What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Use DLL

Use DLL
Author: Message:
Mindstorms
New Member
*


Posts: 9
– / Male / Flag
Joined: May 2008
O.P. Use DLL
Hello,

I'm a VB.NET developer normally, so I created a DLL with the functions I need. Now I have to load the DLL into an Messenger Plus! Script, and after hours of searching, I can't find an example.
Is there anyone that could help me out with this?

Kind regards,
Thomas
05-26-2008 04:40 PM
Profile PM Web Find Quote Report
Spunky
Former Super Mod
*****

Avatar

Posts: 3658
Reputation: 61
35 / Male / Flag
Joined: Aug 2006
RE: Use DLL
I'm fairly certain it's the same as calling DLLs for APIs so you want to look for Interop.Call(dll_name, function_name, param1, param2 etc)
<Eljay> "Problems encountered: shit blew up" :zippy:
05-26-2008 06:41 PM
Profile PM Find Quote Report
ShawnZ
Veteran Member
*****

Avatar

Posts: 3146
Reputation: 43
32 / Male / Flag
Joined: Jan 2003
RE: Use DLL
quote:
Originally posted by SpunkyLoveMuff
I'm fairly certain it's the same as calling DLLs for APIs so you want to look for Interop.Call(dll_name, function_name, param1, param2 etc)

nope, not for .NET dlls. there isn't an easy way to do it.
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.
05-27-2008 12:32 AM
Profile PM Web Find Quote Report
Mindstorms
New Member
*


Posts: 9
– / Male / Flag
Joined: May 2008
O.P. RE: Use DLL
Well, in that case, I have another question:
I have a string "* - Microsoft Visual Basic 2008 Express Edition", and the only thing I want to be left over is everything before " - Microsoft Visual Basic 2008 Express Edition".

So, "Start Page - Microsoft Visual Basic 2008 Express Edition" » "Start Page".

How can I do this with JScript RegExp?
05-27-2008 03:34 PM
Profile PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Use DLL
You could do it the dirty way, by using string functions such as String.indexOf and String.substr:
code:
//This is a sample string, you'll probably want to get this string through some code...
var strTitle = "Start Page - Microsoft Visual Basic 2008 Express Edition";
//Try to find the last occurrence of the title suffix
var pos = strTitle.lastIndexOf(" - Microsoft Visual Basic 2008 Express Edition");
if(pos !== -1) {
   //Found it, now cut the wanted part from the string
   var strTitleName = str.substr(0, pos);
} else {
   //Not found, some error handling here?
}
A bit more advanced method, but much shorter and cleaner, is to use regular expressions:
code:
var strTitle = "Start Page - Microsoft Visual Basic 2008 Express Edition";
//Make a RegExp object - check out the link for an explanation of the used special characters.
var reSuffix = new RegExp("^(.+) \\- Microsoft Visual Basic 2008 Express Edition$", "i");
//Test the string with the RegExp
if(reSuffix.test(strTitle)) {
   //Got a match, the name is now in $1
   var strTitleName = RegExp.$1;
} else {
   //No match, some error handling here?
}
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
05-27-2008 04:05 PM
Profile E-Mail PM Web Find Quote Report
Mindstorms
New Member
*


Posts: 9
– / Male / Flag
Joined: May 2008
O.P. RE: Use DLL
It doesn't seem to work, when I use it in my program nothing happens.
When I use this website
http://www.regular-expressions.info/javascriptexample.html and use "^(.+) \\- Microsoft Visual Basic 2008 Express Edition$" as regexp and "Start Page - Microsoft Visual Basic 2008 Express Edition" as subject string, the message is "No match".
Ah, after some messing with RegExp, I see that you had a slash to much, it has to be "^(.+)\ - Microsoft Visual Basic 2008 Express Edition$" Thankyou!
05-27-2008 04:55 PM
Profile PM Web Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: Use DLL
Ah yes, my mistake. Hyphens should only be escaped when in a character class (between [ and ]).

Good you figured it out yourself! :P
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
05-27-2008 07:11 PM
Profile E-Mail PM Web 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