G
Guest
Hi,
I need to send a string from my DLL( in eVC 4.0)
to a C# application.
I have declared the string as "char *someString".
for example,
********code in my DLL*******
char *someString;
someString = (GetString)(...); // GetString is a pointer to a function in a
// third party DLL. This
function returns a char *.
SendMessage(,, (LPARAM)someString);
***********code in my DLL ends****************
######## code in my C# application########
unsafe
{
string str = new string((char *)m.LParam.ToPointer());
}
MessageBox.Show(str);
######## code in my C# application ends here ########
in my C# application, MessageBox is
showing some symbols rather than the actual string. I presume that
the string which is sent by the DLL might be in UNICODE.
I want to display the actual string, How can I do this.
Kindly let me know.
Cheers,
Naveen.
I need to send a string from my DLL( in eVC 4.0)
to a C# application.
I have declared the string as "char *someString".
for example,
********code in my DLL*******
char *someString;
someString = (GetString)(...); // GetString is a pointer to a function in a
// third party DLL. This
function returns a char *.
SendMessage(,, (LPARAM)someString);
***********code in my DLL ends****************
######## code in my C# application########
unsafe
{
string str = new string((char *)m.LParam.ToPointer());
}
MessageBox.Show(str);
######## code in my C# application ends here ########
in my C# application, MessageBox is
showing some symbols rather than the actual string. I presume that
the string which is sent by the DLL might be in UNICODE.
I want to display the actual string, How can I do this.
Kindly let me know.
Cheers,
Naveen.