What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [question] Calling an external DLL

Pages: (2): « First « 1 [ 2 ] Last »
[question] Calling an external DLL
Author: Message:
BlackSun1102
New Member
*

Avatar

Posts: 9
33 / Male / –
Joined: Jun 2006
RE: [question] Calling an external DLL
Hi,

quote:
Originally posted by BlackSun1102
You must use COM Interop attribtes, to "brand" your functions as COM compactible.

ComVisible is one of this arributes, here you can find a list of all attributes, with decriptions and examples.

Regards Chris
I´m sorry for my bad english. When you find a mistake in my spelling I would be very pleased, if you could tell me.
06-27-2006 04:58 PM
Profile E-Mail PM Find Quote Report
Griffo
Junior Member
**


Posts: 27
Joined: Apr 2006
RE: [question] Calling an external DLL
I'm having trouble with a DLL call in my script too, however mine was made in VB6.

I made a test DLL with this function:
code:
Public Function Test() As String
Test = "hello"
End Function

...and my script code is:
code:
function OnEvent_Initialize(MessengerStart)
{
Debug.Trace(Interop.Call(MsgPlus.ScriptFilesPath + "\\Project1.dll", "Test"));
}

However, I keep getting this error:
code:
Script is now loaded and ready
Function called: OnEvent_Initialize
Interop.Call failed to locate function "Test"
Error: unknown.
       Line: 4. Code: -2147467259.
Function OnEvent_Initialize returned an error. Code: -2147352567

Any ideas what I am doing wrong? Thanks :)

EDIT: I've tried Interop.Call2 as well, but no luck!

This post was edited on 06-27-2006 at 07:38 PM by Griffo.
06-27-2006 07:10 PM
Profile E-Mail PM Web Find Quote Report
mathieumg
Full Member
***


Posts: 181
Reputation: 2
34 / Male / Flag
Joined: May 2004
RE: [question] Calling an external DLL
Was your dll registered with winsvr32?
Official MessengerPlus! Live French Translator
Official StuffPlug 3 French Translator

:)
06-27-2006 09:22 PM
Profile E-Mail PM Web Find Quote Report
cloudhunter
Senior Member
****


Posts: 536
Reputation: 18
37 / – / –
Joined: Dec 2005
RE: [question] Calling an external DLL
Maybe try this?

code:
function OnEvent_Initialize(MessengerStart)
{
Debug.Trace(Interop.Call(MsgPlus.ScriptFilesPath + "\\Project1.dll", "Test()"));
}

As far as I know, doesnt it need the ()?

Cloudy
[Image: cloudy.jpg]
Sig by pirateok/marisaok/marisa ;)
quote:
Originally posted by Moulin Rouge
The greatest thing you'll ever learn, is just to love and be loved in return

6710 days, 23 hours, 19 minutes, 47 seconds ago
06-28-2006 01:18 AM
Profile E-Mail PM Find Quote Report
Griffo
Junior Member
**


Posts: 27
Joined: Apr 2006
RE: [question] Calling an external DLL
cloudhunter: I have tried adding the "()" at th end, still no luck! :(

mathieumg: Tried registering the DLL, but it doesn't make any difference.
06-28-2006 07:50 AM
Profile E-Mail PM Web Find Quote Report
Griffo
Junior Member
**


Posts: 27
Joined: Apr 2006
RE: [question] Calling an external DLL
Anyone had any luck with DLL's yet? Still no joy with mine!
06-28-2006 10:52 PM
Profile E-Mail PM Web Find Quote Report
Themuzz
New Member
*


Posts: 14
Joined: Jun 2006
RE: [question] Calling an external DLL
try:

Interop.Call(MsgPlus.ScriptFilesPath + "\\Project1.dll", "Test", "");

That works fine with me, else the dll is not working....


Greetz Themuzz

06-29-2006 07:52 AM
Profile E-Mail PM Find Quote Report
Griffo
Junior Member
**


Posts: 27
Joined: Apr 2006
RE: [question] Calling an external DLL
Thanks for the reply!

Still no luck I am affraid, not sure what is going on now.

My DLL code is as follows; anything look suspicious?

CODE:
code:
Public Function Test() As String
Test = "hello"
End Function
06-29-2006 08:55 AM
Profile E-Mail PM Web Find Quote Report
craigosaurous
New Member
*


Posts: 3
Joined: Aug 2006
RE: [question] Calling an external DLL
Had the same problem with a dll I was using, but managed to get it working by looking the the function names inside the DLL.

It seems as some C++ DLLs have mangled function names, I used dependancy walker to find the correct function names that worked.  You can also see it in wordpad once you know what to look for.

i.e. the Function name
     IdleTrackerInit
Turned into
     ?IdleTrackerInit@@YAHXZ

See if that works for you
08-23-2006 07:42 AM
Profile E-Mail PM Find Quote Report
Pages: (2): « First « 1 [ 2 ] Last »
« 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