Hi!Jason F.,
Thanks for you instruction!
And here are some more detailed infomation:
My code in cvi:
//***---------------------------------------------------------------------------------------***//
//*** the global window message that will be received by vc++ *** //
#define RESULT_MSG "{FE4EE340-6192-11d5-9B48-9BA90ACC8C0F}"
char TestMsg[100];
int PassFlag;
//*** I've already got frmHandle----handle of MainFrame in VC *** //
Fmt(TestMsg,"There is an error occurs!\r\n");
PassFlag =1;
idResultMsg= RegisterWindowMessage(RESULT_MSG);
SendMessage(frmHandle,idResultMsg,PassFlag,(LPARAM)(LPCTSTR)TestMsg);
//** I set a breakpoint here.The Variables window shows:
//** TestMsg 00D572C0 "There is an error occurs!\r\n" char *
//** At this time,in VC,wParam/*PassFlag*/ is 1,that's right.And
//** lParam/*TestMsg*/ is
//** 00D572C0,does this mean I've received the correct array address?(But when I
//** see with VC Memory tool,this address has no character)If so,how to get the
//** contents?
//** I've tried with
//** LPCTSTR str = (LPCTSTR)lParam;
//** but error occurs "CXX0030:Error:expression cannot be evaluated..".
//---------------------------------------------------------------------------------------------------//
//** Whst's more..
//** If I use
//** SendMessage(frmHandle,WM_SETTEXT,0,(LPARAM)(LPCTSTR)TestMsg),
//** then in VC,
//** CString MsgString;
//** GetWindowText(MsgString);
//** can get the correct TestMsg.That is MsgString is "There is an error occurs!\r\n".
//** Then what shall I do to get a char array from cvi?
Thanks & Regards,
Lily