底层工作程序的实现
(1)新建工程Receiver、仍是单文档。
(2)在CReceiverApp类的InitInstance()函数末尾添加:
m_pMainWnd->SetWindowText("Receiver");
用以指定底层工作程序的窗口标题,以便主控程序能根据标题获取到此窗口的窗口句柄。
(3)在MainFrm.h中添加自定义消息:#define WM_COMM WM_USER+100。
(4)添加自定义消息WM_COMM的消息映射:
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_COMM,OnSendMsg)
END_MESSAGE_MAP()