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

Call2 function
Author: Message:
smeuuh
New Member
*


Posts: 4
Joined: Apr 2006
O.P. Call2 function
Hello.
I'm currently trying to make a neat plugin which will get the song played from winamp, and change the avatar with the cover winamp is playing (using the folder.jpg files in each album's folder)
So the method i'm trying is the following :
- make a C++ DLL which, when called, will return the string containing the currently played song's filename
- call it by Interop.Call2, do some stuff and change the avatar

Looking in the plus scripting help, i found that the string returned must be a "bstr". I have a C-style string (char*) containing the file name (although it's not unicode, i wonder if it will prevent it from working ... well, will see later), I want to return it as a bstring.
I tried the following :

OLECHAR title2[1024];
   for(int i = 0;i<1024;i++) title2[i] = title[i];
   return SysAllocString(title2);
, as advised in the help, but it fails to compile ("  [Linker error] undefined reference to `SysAllocString@4' ")
I also tried return title2; It compiles, but i don't know if it works :/

Another thing that bothers me is : how to make my function "call2-visible" ?
My code is :
__declspec(dllexport) __stdcall BSTR GetTitle();
__stdcall BSTR GetTitle()
{
//do stuff, return the BSTR
}
BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
{
        return TRUE;
}


My script is :
function OnEvent_ChatWndSendMessage(ChatWnd,Message )
{
    return Interop.Call2("GetFileName.dll","GetTitle");
}
and it doesn't work :/

I have really little experience in writing C++ DLL, so excuse me if my questions seem stupid :$
Thanks in advance
Smeuuh

This post was edited on 11-03-2006 at 04:43 PM by smeuuh.
11-03-2006 03:38 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Call2 function - by smeuuh on 11-03-2006 at 03:38 PM
RE: Call2 function - by Delphi Thunderbolt on 11-04-2006 at 05:13 AM
RE: Call2 function - by phalanxii on 11-04-2006 at 08:35 AM
RE: Call2 function - by smeuuh on 11-04-2006 at 02:13 PM


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