不管什么样的途径创建,都有一个资源ID,有了这个ID,不就可以进行消息映射了吗?
所以我认为这不是问题.

解决方案 »

  1.   

    CButton::Create 
    BOOL Create( LPCTSTR lpszCaption, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID );Return ValueNonzero if successful; otherwise 0.ParameterslpszCaptionSpecifies the button control’s text.dwStyleSpecifies the button control’s style. Apply any combination of button styles to the button.rectSpecifies the button control’s size and position. It can be either a CRect object or a RECT structure.pParentWndSpecifies the button control’s parent window, usually a CDialog. It must not be NULL.nIDSpecifies the button control’s ID.nID就是你的控件的ID呀!