下面这段程序向父窗口发送消息时(自定义消息参数),release版本出错,而debug版可正常运行。
不知错在何处,请指教!!!谢谢!!!// CmdLineEdit.h : header file
//
class CMyMsgPara ???????????????????????????????????????
{
public:
char OperCH, OperVal;
CString SelVal;
bool SelCH[512];
};/////////////////////////////////////
// CCmdLineEdit windowclass CCmdLineEdit : public CEdit
{
// Construction
public: CMyMsgPara  *m_MyMsgPara;
.....
}//////////////////////////////////////////
// CmdLineEdit.cpp : implementation fileGetParent()->SendMessage(WM_CMDLINE, (WPARAM)m_MyMsgPara); ?????????????????/////////////////////////////////////////////////////////////////////////////
// CMyViewclass CMyView : public CView
{
......
protected:
//{{AFX_MSG(CMyView)
//}}AFX_MSG afx_msg LRESULT OnCmdLine (CMyMsgPara *MyMsgPara);????????????????????
DECLARE_MESSAGE_MAP()
};/////////////////////////////////////////////////////////////////////////////
// CMyView
IMPLEMENT_DYNCREATE(CMyView, CView)BEGIN_MESSAGE_MAP(CMyView, CView)
//{{AFX_MSG_MAP(CMyView)
//}}AFX_MSG_MAP
ON_MESSAGE(WM_CMDLINE , OnCmdLine )??????????????????????????????????
END_MESSAGE_MAP()

解决方案 »

  1.   

    你的指针CMyMsgPara *MyMsgPara指向谁了?
      

  2.   

    /////////////////////////////////////////////////////////////////////////////
    // CCmdLineEdit
    CCmdLineEdit::CCmdLineEdit()
    {
       m_MyMsgPara = new CMyMsgPara;
       m_MyMsgPara->............初始化
    }
      

  3.   

    afx_msg LRESULT OnCmdLine (CMyMsgPara *MyMsgPara);
    改为
    afx_msg LRESULT OnCmdLine (WPARAM wParam, LPARAM lParam);即可