--------------------Configuration: gps - Win32 Debug--------------------
Compiling...
gpsView.cpp
C:\Documents and Settings\Fantasy\My Documents\作业\comm\gps\gpsView.cpp(23) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CGpsView::*)(unsigned int,class CPoint)' to 'void (__thiscall CCmdTarget::*)(struct tagNMHDR *,long *)'
Pointers to members have different representations; cannot cast between them
Error executing cl.exe.
Creating browse info file...gps.exe - 1 error(s), 0 warning(s)错误指向的代码是ON_NOTIFY(NM_RCLICK, IDC_LIST_GPS, OnRclickListGps)
这是我右键单击一formview中listctrl控件的事件.
我是按正确步骤加如消息的,为什么会出现这种错误?不懂,望大家指点!!1谢谢!~!!
Compiling...
gpsView.cpp
C:\Documents and Settings\Fantasy\My Documents\作业\comm\gps\gpsView.cpp(23) : error C2440: 'type cast' : cannot convert from 'void (__thiscall CGpsView::*)(unsigned int,class CPoint)' to 'void (__thiscall CCmdTarget::*)(struct tagNMHDR *,long *)'
Pointers to members have different representations; cannot cast between them
Error executing cl.exe.
Creating browse info file...gps.exe - 1 error(s), 0 warning(s)错误指向的代码是ON_NOTIFY(NM_RCLICK, IDC_LIST_GPS, OnRclickListGps)
这是我右键单击一formview中listctrl控件的事件.
我是按正确步骤加如消息的,为什么会出现这种错误?不懂,望大家指点!!1谢谢!~!!
由于不兼容的调用约定而产生的 C2440
//{{AFX_MSG(CGpsView)
afx_msg void OnRclickListGps(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
DECLARE_DYNAMIC_MAP()
IMPLEMENT_DYNCREATE(CGpsView, cdxCDynamicFormView)BEGIN_MESSAGE_MAP(CGpsView, cdxCDynamicFormView)
//{{AFX_MSG_MAP(CGpsView)
// ON_NOTIFY(NM_RCLICK, IDC_LIST_GPS, OnRclickListGps)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()BEGIN_DYNAMIC_MAP(CGpsView, cdxCDynamicFormView)
DYNAMIC_MAP_ENTRY(IDC_LIST_GPS,mdResize,mdResize)
// DYNAMIC_MAP_ENTRY(IDC_TREE_COMBO,mdResize,mdNone)
END_DYNAMIC_MAP()void CGpsView::OnRclickListGps(UINT nFlags, CPoint point)
{
GetCursorPos(&point);
CMenu*pPopMenu=new CMenu;
pPopMenu->LoadMenu(IDR_RIGHTBUTTON_MENU);
CMenu*pFileMenu=pPopMenu->GetSubMenu(0); CGpsDoc *pDoc=GetDocument();
if( pDoc->m_bAuoMenuEnable)
{
pFileMenu->EnableMenuItem(ID_FILE_DOWNLOAD, MF_GRAYED);
pFileMenu->EnableMenuItem(ID_FLASH_DELETE, MF_GRAYED);
pFileMenu->EnableMenuItem(ID_FILE_DOWNLOAD_ZHD, MF_GRAYED);
pFileMenu->EnableMenuItem(ID_FLASH_ERASE, MF_GRAYED);
pFileMenu->EnableMenuItem(ID_FLASH_RECOVER, MF_GRAYED);
pFileMenu->EnableMenuItem(ID_FLASH_REFRESH, MF_GRAYED);
}
pFileMenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_RIGHTBUTTON,point.x,point.y,this);
delete pPopMenu;}