首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

第三个!VS2005下编译通不过?VS2003可以通过,该怎么解决

2012-03-04 
第三个!!!---VS2005下编译通不过???--VS2003可以通过BEGIN_MESSAGE_MAP(CFloatPane,CDialog)ON_WM_NCHITTE

第三个!!!---VS2005下编译通不过???--VS2003可以通过
BEGIN_MESSAGE_MAP(CFloatPane,   CDialog)
ON_WM_NCHITTEST()//yk?????   for   2005
ON_WM_PAINT()
ON_WM_TIMER()
//   record   notification
ON_MESSAGE(WM_START_RECORD,   OnRecordStart)
ON_MESSAGE(WM_RECORD_PROGRESS,   OnRecordProgress)
ON_MESSAGE(WM_END_RECORD,   OnRecordEnd)
END_MESSAGE_MAP()


d:\work\newclass.2007.9.4-vs2005\mainui\floatpane.cpp(38)   :   error   C2440:   'static_cast '   :   cannot   convert   from   'UINT   (__thiscall   CFloatPane::*   )(CPoint) '   to   'LRESULT   (__thiscall   CWnd::*   )(CPoint) '


//   CFloatPane   的定义如下,h文件!!!!!
class   CFloatPane   :   public   CDialog
{
DECLARE_DYNAMIC(CFloatPane)

public:
CFloatPane(CWnd*   pParent   =   NULL);       //   standard   constructor
virtual   ~CFloatPane();

//   Dialog   Data
enum   {   IDD   =   IDD_FLOAT_PANE   };

protected:
virtual   void   DoDataExchange(CDataExchange*   pDX);         //   DDX/DDV   support

DECLARE_MESSAGE_MAP()
public:
virtual   BOOL   OnInitDialog();
afx_msg   UINT   OnNcHitTest(CPoint   point);
afx_msg   void   OnPaint();

BOOL   StartRecord();
void   StopRecord();

//   Note:   for   screen   record   notification
afx_msg   LRESULT   OnRecordStart(WPARAM   wParam,   LPARAM   lParam);
afx_msg   LRESULT   OnRecordProgress(WPARAM   wParam,   LPARAM   lParam);
afx_msg   LRESULT   OnRecordEnd(WPARAM   wParam,   LPARAM   lParam);
afx_msg   void   OnTimer(UINT   nIDEvent);

protected:
virtual   void   OnCancel();
virtual   BOOL   OnCommand(WPARAM   wParam,   LPARAM   lParam);

protected:
CSRProgressDlg   *m_pProgressDlg;
CButtonST   m_btnRecord;
CButtonST   m_btnPause;
CButtonST   m_btnStop;
BOOL   m_bRecord;
CEdgeHiddenCtrl   m_EdgeHiddenCtrl;
BOOL   m_bPause;
};



[解决办法]
自己该一下函数的返回类型 OnNcHitTest
[解决办法]
OnNcHitTest在VC2005中要定义返回类型为LRESULT,而2003和VC6中UINT
[解决办法]
error C2440: 'static_cast ' : cannot convert from 'UINT (__thiscall CFloatPane::* )(CPoint) ' to 'LRESULT (__thiscall CWnd::* )(CPoint) '
这个就说明了楼上的问题是UINT和LRESULT的。

热点排行