I have this struct
in C++:
struct TEXTMSGSTR
{
HWND Sender;
wchar_t Text[255];
//wchar_t *Text;
};
and in C#:
public struct TEXTMSGSTR
{
public IntPtr Sender;
public ? Text;
}
which I am sending as part of a COPYDATASTRUCT
message from unmanaged to managed code. What would be the correct construction of the struct
on the C# side as C# does not have wchar_t
? I have tried string etc. but of course errors appear!
Can anybody give me some ideas about how to marshal this as well as I am new to this stuff?:
TEXTMSGSTR tx = (TEXTMSGSTR)Marshal.PtrToStructure(cds.lpData, typeof(TEXTMSGSTR));