Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. wndTopMost - getting C2065 error

wndTopMost - getting C2065 error

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Still learning how to code
    wrote on last edited by
    #1

    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

    C T 2 Replies Last reply
    0
    • S Still learning how to code

      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

      C Offline
      C Offline
      Cedric Moonen
      wrote on last edited by
      #2

      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++

      1 Reply Last reply
      0
      • S Still learning how to code

        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

        T Offline
        T Offline
        Taran9
        wrote on last edited by
        #3

        DougButtimer wrote:

        dlgEnd.SetWindowPos(&wndTopMost,60,80,0,0,SWP_NOSIZE);

        Use dlgEnd.SetWindowPos(&CWnd::wndTopMost,60,80,0,0,SWP_NOSIZE); instead.

        S 1 Reply Last reply
        0
        • T Taran9

          DougButtimer wrote:

          dlgEnd.SetWindowPos(&wndTopMost,60,80,0,0,SWP_NOSIZE);

          Use dlgEnd.SetWindowPos(&CWnd::wndTopMost,60,80,0,0,SWP_NOSIZE); instead.

          S Offline
          S Offline
          Still learning how to code
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups