Cstring 与 wParam 类型转换

来源:互联网 发布:科比2010年总决赛数据 编辑:程序博客网 时间:2024/05/22 02:00

在传递自定义消息的过程中,需要转换CString 变量。

在发送消息端使用如下方法:

SendMessage(WM_MESSAG_MINE,0,(LPARAM)strVal.AllocSysString());

----------------------------------------

在接收消息端使用:

BSTR b = (BSTR)lParam;
CString s(b);
SysFreeString(b);
AfxMessageBox(s);

 

即可。


参考:http://forums.devx.com/showthread.php?156023.html


0 0
原创粉丝点击