在傳遞自定義消息的過程中,需要轉換CString 變量。
在發送消息端使用如下方法:
SendMessage(WM_MESSAG_MINE,0,(LPARAM)strVal.AllocSysString());
----------------------------------------
在接收消息端使用:
BSTR b = (BSTR)lParam;
CString s(b);
SysFreeString(b);
AfxMessageBox(s);
在發送消息端使用如下方法:
SendMessage(WM_MESSAG_MINE,0,(LPARAM)strVal.AllocSysString());
----------------------------------------
在接收消息端使用:
BSTR b = (BSTR)lParam;
CString s(b);
SysFreeString(b);
AfxMessageBox(s);