What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Solved] Call a DLL with javascript without Interop.Call

[Solved] Call a DLL with javascript without Interop.Call
Author: Message:
Huhu_Manix
Full Member
***

Avatar
Upload me again... *salivate*

Posts: 106
– / Male / –
Joined: Jul 2006
O.P. [Solved] Call a DLL with javascript without Interop.Call
Hi all !

I've programmed a little application in C# to use script like msg plus does.
I thank that was easy but there's a little problem. ^^

The application compil perfectly the JScript file, all work perfectly, I can call JS's function by the application, but I can't call application's function by the JS, i tried lot of thing as "Interop.Call" to send message with user32 but i understood after that's a msg plus function. :^)

Does someone know how i can call user32 without Interop.Call from the javascript's file ?

Maybe with an ActiveX object... *-)

I'm sure it's possible because Patchou did it.

Thanks ^^

This post was edited on 12-30-2006 at 03:32 AM by Huhu_Manix.
12-29-2006 08:05 PM
Profile E-Mail PM Web Find Quote Report
Baggins
Full Member
***

Avatar
B000ALFAZO

Posts: 387
Reputation: 13
29 / Male / Flag
Joined: Oct 2006
RE: Call a DLL with javascript without Interop.Call
found this little snippet:

http://www.adp-gmbh.ch/csharp/call_dll.html
12-29-2006 08:12 PM
Profile E-Mail PM Web Find Quote Report
Huhu_Manix
Full Member
***

Avatar
Upload me again... *salivate*

Posts: 106
– / Male / –
Joined: Jul 2006
O.P. RE: Call a DLL with javascript without Interop.Call
Thanks but i meaned call a DLL from the JavaScript.
12-29-2006 08:16 PM
Profile E-Mail PM Web Find Quote Report
Baggins
Full Member
***

Avatar
B000ALFAZO

Posts: 387
Reputation: 13
29 / Male / Flag
Joined: Oct 2006
RE: Call a DLL with javascript without Interop.Call
Oh, i belive this is not possible because all variables in JScript are variants and it would not work with the arguments being of different, however, you can get a dynamic wrapper (ActiveX) .dll which takes the variants and passes them onto the requested function in the correct type.

i will update this when i find it

dnwrap.dll + readme.txt

.zip File Attachment: dynawrapNt.zip (14.44 KB)
This file has been downloaded 1944 time(s).

This post was edited on 12-29-2006 at 08:33 PM by Baggins.
12-29-2006 08:22 PM
Profile E-Mail PM Web Find Quote Report
Huhu_Manix
Full Member
***

Avatar
Upload me again... *salivate*

Posts: 106
– / Male / –
Joined: Jul 2006
O.P. RE: Call a DLL with javascript without Interop.Call
Thanks, i don't try it yet but it should be perfect ! ;)
12-30-2006 03:00 AM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Call a DLL with javascript without Interop.Call
What Patchou did is adding his own methods, functions, interface, etc to the scripting engine. This should be well explained how in the MSDN library.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-30-2006 03:15 AM
Profile PM Find Quote Report
Huhu_Manix
Full Member
***

Avatar
Upload me again... *salivate*

Posts: 106
– / Male / –
Joined: Jul 2006
O.P. RE: Call a DLL with javascript without Interop.Call
Thanks but i tried what baggins gave me, it's exactly what i needed.
12-30-2006 03:31 AM
Profile E-Mail PM Web Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Solved] Call a DLL with javascript without Interop.Call
quote:
Originally posted by Huhu_Manix
Thanks but i tried what baggins gave me, it's exactly what i needed.
it works, but it is not what you need.

If you already included the Windows scripting engine so your applications acts as the host* , it is only a few steps away (relativly spoken) to make your own function and methods. You don't need to depend on a dodgy ActiveX wrapper for that.

*(and I hope you did and you do not do some dodgy thing as in pushing a text file to the scripting runtime with a call like Shell or whatever. As that would also mean your application has no scripting capabilities at all and isn't a host at all, you just take some script file and run it outside your application)


quote:
Originally posted by Baggins
Oh, i belive this is not possible because all variables in JScript are variants and it would not work with the arguments being of different,
That isn't the reason. If it was, then it would also be impossible for Plus! to add this to the scripting engine... The reason is simply because such an instruction is not included nativly (unfortunatly, but understandable).

quote:
Originally posted by Baggins
however, you can get a dynamic wrapper (ActiveX) .dll which takes the variants and passes them onto the requested function in the correct type.

i will update this when i find it

dnwrap.dll + readme.txt
Please, never attach files and other programs like that to posts. Always link to the original download pages for obvious reasons:
- updates
- important info
- untampered with packages
- original code
- etc...

The original Dynawrap.dll... is available from here:
http://cwashington.netreach.net/main/tools/default.asp?topic=a-m

This post was edited on 12-30-2006 at 09:35 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
12-30-2006 09:10 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On