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:
polopt
New Member
*


Posts: 2
Joined: Jul 2006
O.P. dll and script
Hey,

Sorry for my english, i don't speak very well. I have a problem , i want  send a string to a dll, but i just catch the first character in the .dll.

code :
code:
DLLIMPORT int ConectionLog (char * name)
{
   
    MessageBox (0, name, "Hi", MB_ICONINFORMATION);

}

this code juste print the first character of the string name.

the code in script to send a string is :

code:
Interop.Call("msgplus.dll","ConectionLog", "hello"):



wha is rong widht is??

thanks for help


This post was edited on 07-03-2006 at 04:48 PM by polopt.
07-03-2006 04:27 PM
Profile E-Mail PM Find Quote Report
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
polopt
New Member
*


Posts: 2
Joined: Jul 2006
O.P. RE: dll and script
thank's dramado, but i have a error she don't recognize the WCHAR type, i have include the wchar.h library but don't works...
It's work.... ouf...thank's dramato, i convert my string and works


This post was edited on 07-03-2006 at 06:51 PM by polopt.
07-03-2006 06:42 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