What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » can't call my dll's function

can't call my dll's function
Author: Message:
graphicsxp
New Member
*


Posts: 6
Joined: Sep 2006
O.P. can't call my dll's function
Hi,
I'm using the script editor in Messenger Plus to load a dll I created using
Visual Studio (class library project in vb.net).

The code of the dll looks like this:
code:
Public Class Msg
    Public Sub New()

    End Sub

    Public Function Display() As Boolean
        MsgBox("hello world")
        Return True
    End Function
End Class

and here is the call from the script:
code:
function OnEvent_ChatWndCreated(ChatWnd)
{
var externLib = MsgPlus.ScriptFilesPath + "\\msn.dll";
MsgPlus.DisplayToast("", externLib);
Interop.Call(externLib, "Display");

}

the error returned is :
Interop.Call could not locate the function "Display"


So I assume the dll was found but not the function withing the dll
Does anyone knows what could be wrong there ?
thanks
09-03-2006 09:51 PM
Profile E-Mail PM Find Quote Report
Mnjul
forum super mod
******

Avatar
plz wub me

Posts: 5396
Reputation: 58
– / Other / Flag
Joined: Nov 2002
Status: Away
RE: can't call my dll's function
Since you're using VB.net, you'll need to use regasm to register your DLL and use the following code to call your Display function:

var vbDotNetObject=new ActiveXObject("Namespace.Msg");
vbDotNetObject.Display();

where Namespace is the name of the namespace which your Msg class is in.
09-07-2006 12:21 PM
Profile PM Web Find Quote Report
graphicsxp
New Member
*


Posts: 6
Joined: Sep 2006
O.P. RE: can't call my dll's function
Hi,
Thanks for helping!

I've registered the dll using regasm. Now my code looks like this:
code:
Namespace myMSN
    Public Class Msg
        Public Sub New()

        End Sub

        Public Function Display() As Boolean
            MsgBox("hello world")
            Return True
        End Function
    End Class
End Namespace

my jscript is :

code:
function OnEvent_ChatWndCreated(ChatWnd)
{
var vbDotNetObject = new ActiveXObject("myMSN.Msg");
vbDotNetObject.Display();
MsgPlus.DisplayToast("", vbDotNetObject.Display());
}
and yet it doesn't do anything :(

Do you have an idea why ?

I can't even see the debug window, it's gone for some reason and I can't reactivate it even if I tick the checkbox in the options...


09-08-2006 10:04 PM
Profile E-Mail PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: can't call my dll's function
quote:
Originally posted by graphicsxp
I can't reactivate it even if I tick the checkbox in the options...

there's no checkbox to open the debug window, there's a menu item under Plus!. the checkbox just enables that menu item :p
Spoiler:
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
the game.
09-08-2006 10:06 PM
Profile PM Web Find Quote Report
graphicsxp
New Member
*


Posts: 6
Joined: Sep 2006
O.P. RE: can't call my dll's function
arf... you are right, I got it now.../ thanks

What about my dll issue, can someone help ?

The error I get is:
An ActiveX component cannot create an object

This post was edited on 09-08-2006 at 10:12 PM by graphicsxp.
09-08-2006 10:09 PM
Profile E-Mail 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