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

dll and script
Author: Message:
dramado
New Member
*


Posts: 11
Joined: Jun 2006
RE: dll and script
the 'string' passed from the script to the dll is widechars

code:
void DLL_EXPORT ConectionLog(WCHAR* sometext)
{
MessageBoxW(0, sometext, sometext, 0);
}


code:
to convert from unicode to ansi
void DLL_EXPORT SomeFunction(WCHAR* sometext)
{
int a = SysStringLen(sometext)+1;
char *ansistr = (char*)malloc(a);
WideCharToMultiByte(CP_ACP,
                        0,
                        sometext,
                        -1,
                        ansistr,
                        a,
                        NULL,
                        NULL);
//...use the strings, then free their memory:
//delete[] ansistr;
MessageBox(0, ansistr, "hello", 0);
free(ansistr);
}


07-03-2006 06:10 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
dll and script - by polopt on 07-03-2006 at 04:27 PM
RE: dll and script - by dramado on 07-03-2006 at 06:10 PM
RE: dll and script - by polopt on 07-03-2006 at 06:42 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