Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello mates,

I'm trying to send a windowsmessage from an app in C# (Compact Frame) to another one in C++ (MFC), both of them in a PDA.

In the receiver app (MFC) I realize that I receive the message but I can't read the string message, it shows a little square.

This is the code of the Sender (C#)
C#
OpenNETCF.Win32.Win32Window.SendMessage(hwndVal, typeMsgVal, intValue, stringMessage);


And this is the code of the receiver (C++)
C++
CString myStr = (CString) lParam;
AfxMessageBox(myStr);


Thanks a lot in advance!
Posted
v2

1 solution

You cannot pass a pointer (the string) across process. Have a look at this CodeProject article: "Use WM_COPYDATA to send data to/from C++ and C# Windows processes"[^].
 
Share this answer
 
Comments
Garth J Lancaster 20-Dec-12 5:06am    
molto bene :-) thats what I would have done

Buon Natale
CPallini 20-Dec-12 12:27pm    
Buon Natale a te Garth e, take care.
:-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900