wndTopMost - getting C2065 error
-
My app needs a window to appear on top of all existing windows on the desktop. I have therefore coded :- CAlarmEndDlg dlgEnd; dlgEnd.SetTime(szTime); dlgEnd.SetWindowPos(&wndTopMost,60,80,0,0,SWP_NOSIZE); dlgEnd.DoModal(); However, on compiling I get :- D:\Programming projects\MyAlarm\MyAlarmDlg.cpp(219) : error C2065: 'wndTopMost' : undeclared identifier I have found wndTopMost in wincore.cpp const AFX_DATADEF CWnd CWnd::wndTopMost(HWND_TOPMOST); which appears to be some sort of data definition (of which I'm not familiar) but why is this not being picked up during compilation ? Any help would be appreciated !
Doug
-
My app needs a window to appear on top of all existing windows on the desktop. I have therefore coded :- CAlarmEndDlg dlgEnd; dlgEnd.SetTime(szTime); dlgEnd.SetWindowPos(&wndTopMost,60,80,0,0,SWP_NOSIZE); dlgEnd.DoModal(); However, on compiling I get :- D:\Programming projects\MyAlarm\MyAlarmDlg.cpp(219) : error C2065: 'wndTopMost' : undeclared identifier I have found wndTopMost in wincore.cpp const AFX_DATADEF CWnd CWnd::wndTopMost(HWND_TOPMOST); which appears to be some sort of data definition (of which I'm not familiar) but why is this not being picked up during compilation ? Any help would be appreciated !
Doug
If this code is outside a CWnd object (which is probably the case), you should try this:
CAlarmEndDlg dlgEnd;
dlgEnd.SetTime(szTime);
dlgEnd.SetWindowPos(&CWnd::wndTopMost,60,80,0,0,SWP_NOSIZE);
dlgEnd.DoModal();Cédric Moonen Software developer
Charting control [v2.0] OpenGL game tutorial in C++ -
My app needs a window to appear on top of all existing windows on the desktop. I have therefore coded :- CAlarmEndDlg dlgEnd; dlgEnd.SetTime(szTime); dlgEnd.SetWindowPos(&wndTopMost,60,80,0,0,SWP_NOSIZE); dlgEnd.DoModal(); However, on compiling I get :- D:\Programming projects\MyAlarm\MyAlarmDlg.cpp(219) : error C2065: 'wndTopMost' : undeclared identifier I have found wndTopMost in wincore.cpp const AFX_DATADEF CWnd CWnd::wndTopMost(HWND_TOPMOST); which appears to be some sort of data definition (of which I'm not familiar) but why is this not being picked up during compilation ? Any help would be appreciated !
Doug
-
DougButtimer wrote:
dlgEnd.SetWindowPos(&wndTopMost,60,80,0,0,SWP_NOSIZE);
Use dlgEnd.SetWindowPos(&CWnd::wndTopMost,60,80,0,0,SWP_NOSIZE); instead.
Thanks for both replies !! Yes, the use was within a global function (Timer callback) and the use of CWnd:: has cured the problem. Just given myself a smacked hand for not trying that before posting the cry for help !! Thanks again !
Doug