Shoutbox

Dlls for Interop.Call - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: Dlls for Interop.Call (/showthread.php?tid=69472)

Dlls for Interop.Call by Deco on 12-13-2006 at 10:16 PM

Hi guys,

What kind of dll do I have to make so I can use it in the scripts?

I understand from the documentation that the only thing I have to watch is that the functions are __stdcall ..

Anything else?

Anyone ever create a Dll to use with scripts and wouldn't mind sending me an example to learn from?

Thanks


RE: Dlls for Interop.Call by matty on 12-13-2006 at 10:46 PM

If you are using Visual Basic you need to use a tool called VBAdvance so that it will export functions other then that a standard Windows DLL with Functions Exported would be fine.


RE: Dlls for Interop.Call by Deco on 12-13-2006 at 11:46 PM

Ok so I just make public functions...use Interop.Call(pathtodll+"mydll.dll","myfunc",input)?

And if I'm making this dll in vb.net use that tool.. :)

Ok got it will try!


RE: Dlls for Interop.Call by matty on 12-13-2006 at 11:56 PM

quote:
Originally posted by Deco
Ok so I just make public functions...use Interop.Call(pathtodll+"mydll.dll","myfunc",input)?

And if I'm making this dll in vb.net use that tool.. :)

Ok got it will try!
No vbAdvance doesn't support VB.Net it supports Visual Basic 6. I am not too sure about using VB.Net never programmed in it.
RE: Dlls for Interop.Call by RaceProUK on 12-14-2006 at 05:31 PM

quote:
Originally posted by Matty
I am not too sure about using VB.Net never programmed in it.
.NET has a COM Interop thing that may be of use.
RE: Dlls for Interop.Call by felipEx on 12-14-2006 at 07:44 PM

you should create the DLL as W32 DLL, not activeX. or trying create activeX dll?


RE: Dlls for Interop.Call by Deco on 12-14-2006 at 09:21 PM

The problem was solved in another thread. The one about ActiveXObjects. Someone send a working example of a dll in c# and I just went on frmo that.

THanks though


RE: Dlls for Interop.Call by ShawnZ on 12-14-2006 at 09:32 PM

quote:
Originally posted by Matty
quote:
Originally posted by Deco
Ok so I just make public functions...use Interop.Call(pathtodll+"mydll.dll","myfunc",input)?

And if I'm making this dll in vb.net use that tool.. :)

Ok got it will try!
No vbAdvance doesn't support VB.Net it supports Visual Basic 6. I am not too sure about using VB.Net never programmed in it.


IL can't export stdcallable functions. It isn't the same format as a windows binary.

quote:
Originally posted by RaceProUK
quote:
Originally posted by Matty
I am not too sure about using VB.Net never programmed in it.
.NET has a COM Interop thing that may be of use.

exporting to COM is different than exporting a function normally. you can't call a com function in a dll.
RE: Dlls for Interop.Call by RaceProUK on 12-15-2006 at 04:31 PM

quote:
Originally posted by ShawnZ
IL can't export stdcallable functions. It isn't the same format as a windows binary.
But a .NET DLL can have native exports.
quote:
Originally posted by ShawnZ
exporting to COM is different than exporting a function normally. you can't call a com function in a dll.
You can: you just need to create the DLL's COM object first.
RE: Dlls for Interop.Call by CookieRevised on 12-27-2006 at 10:53 AM

I'm not sure if the thread title is the explicit request (using Interop.Call) or if it is because he didn't know you can make and use ActiveXs yourself too. So to answer people who read this thread and would otherwise be misinformed:

quote:
Originally posted by Matty
If you are using Visual Basic you need to use a tool called VBAdvance so that it will export functions other then that a standard Windows DLL with Functions Exported would be fine.
You don't need that (not free, and not available anymore) tool since in VB you can make an ActiveX OCX or DLL nativly and since it is ActiveX it can work in scripts too.

Anyways, the tool vbAdvance can indeed make standard DLLs, but there are a lot of caveats and requirements and limitations. And if one isn't an extremely advanced VB programmer and if one doesn't have expert notion of APIs aand other advanced programming techniques it is even suggested in that tool itself to not even attempt it.

quote:
Originally posted by afelipE_scripts
you should create the DLL as W32 DLL, not activeX. or trying create activeX dll?
No, an ActiveX can work in scripts too. Heck, extremely many scripts use ActiveX objects, if it weren't for ActiveX half the existing scripts wouldn't work.