I need to pass a object of a class from one c# application to another (Same machine different folders).
Tried following....
public static void SendMessageWithData( IntPtr destHandle, IntPtr srcHandle )
{
COPYDATASTRUCT cds = new COPYDATASTRUCT();
cds.dwData = srcHandle;
IntPtr iPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf(cds));
Marshal.StructureToPtr(cds, iPtr, true);
SendMessage(destHandle, WM_COPYDATA, IntPtr.Zero, iPtr);
Marshal.FreeCoTaskMem(cds.lpData);
Marshal.FreeCoTaskMem(iPtr);
}