消息框不可见

时间:2014-04-11 07:49:44

标签: c++ visual-c++ mfc

我有modHolder类对象

class modHolder : public CWinThread
{
    DECLARE_DYNCREATE(modHolder)

protected:
    modHolder();          
    virtual ~modHolder();

public:
    CMainWindow * v1;
    virtual BOOL InitInstance();
    virtual int ExitInstance();

protected:
    DECLARE_MESSAGE_MAP()
};

创建如下:

AfxBeginThread(RUNTIME_CLASS(modHolder));

我的框架内有按钮:

class CMainWindow : public CFrameWnd
{
public:

    CMainWindow ();
        CButton m_wndPushButton;

protected:
    afx_msg LRESULT OnMyMessage1(WPARAM wParam, LPARAM lParam);
    afx_msg  int OnCreate (LPCREATESTRUCT lpcs)   ;
    afx_msg void OnPaint ();
    afx_msg void OnPushButtonClicked ();
    DECLARE_MESSAGE_MAP ()

};

当我按下按钮时,不显示任何可见消息:

void CMainWindow::OnPushButtonClicked ()   
{   
    MessageBox (_T ("bbb"),_T ("Error"), B_ICONINFORMATION | MB_OK);
    //AfxMessageBox("aaaa");
} 

但是消息函数不会返回。为什么消息不可见?

0 个答案:

没有答案