您上面的这个应该是做类似DDX_Control()的操作,简单的可以参考对话框工程中的DoDataExchange()函数中的相关代码。可以参考下面CDataExchange类的定义
class CDataExchange
{
// Attributes
public:
BOOL m_bSaveAndValidate; // TRUE => save and validate data
CWnd* m_pDlgWnd; // container usually a dialog
// Operations (for implementors of DDX and DDV procs)
HWND PrepareCtrl(int nIDC); // return HWND of control
HWND PrepareEditCtrl(int nIDC); // return HWND of control
void Fail(); // will throw exception
#ifndef _AFX_NO_OCC_SUPPORT
CWnd* PrepareOleCtrl(int nIDC); // for OLE controls in dialog
#endif
// Implementation
CDataExchange(CWnd* pDlgWnd, BOOL bSaveAndValidate);
HWND m_hWndLastControl; // last control used (for validation)
BOOL m_bEditLastControl; // last control was an edit item
};
关于您上面的SendMessage()的发送消息的部分您可以针对具体的消息,参考MSDN文档,理解各个消息的含义。
Visual C++ enthusiast, like network programming and driver development. At present is being engaged in the WinCE/Windows Mobile platform embedded development.