string passing between netcf and unmanaged c++

  • Thread starter Thread starter leibnizster
  • Start date Start date
I'm looking to pass a string between the apps. I tried using
WM_COPYDATA, with lParam being the address of a COPYDATASTRUCT
structure, but I didn't manage to pas strings in my app. This is my
structure in c#:

public struct COPYDATASTRUCT
{
public int dwData;
public int cbData;
public IntPtr lpData;
}

If I try pass an IntPtr which references a string, the app in c++ does
not read the correct characters (when I convert to TCHAR*). It works
fine for ints. Any ideas?

Thanks
 
Back
Top