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. Strange Compiler behavior

Strange Compiler behavior

Scheduled Pinned Locked Moved C / C++ / MFC
data-structureshelp
5 Posts 2 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.
  • F Offline
    F Offline
    ForNow
    wrote on last edited by
    #1

    Hi all of the sudden out of the clear blue sky in any of my CWinApp methods constructor Initinstance, any declaration of CEvent is flaged as an error say the complier doesn't recognize that type whether I declare it on the Stack CEvent myevent or on the heap CEvent *evenptr = new CEvent, If I declare globally or some other class CMainFrame for instance its ok

    L 1 Reply Last reply
    0
    • F ForNow

      Hi all of the sudden out of the clear blue sky in any of my CWinApp methods constructor Initinstance, any declaration of CEvent is flaged as an error say the complier doesn't recognize that type whether I declare it on the Stack CEvent myevent or on the heap CEvent *evenptr = new CEvent, If I declare globally or some other class CMainFrame for instance its ok

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Have you included the correct header file, as shown in https://msdn.microsoft.com/en-us/library/efk30beh.aspx[^]?

      F 1 Reply Last reply
      0
      • L Lost User

        Have you included the correct header file, as shown in https://msdn.microsoft.com/en-us/library/efk30beh.aspx[^]?

        F Offline
        F Offline
        ForNow
        wrote on last edited by
        #3

        I have stdafx.h if that's what you're referring too I going to create a MFC MainFrame type project and cut and paste the code to it thanks

        L 1 Reply Last reply
        0
        • F ForNow

          I have stdafx.h if that's what you're referring too I going to create a MFC MainFrame type project and cut and paste the code to it thanks

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Er, no, that is a project file that should contain the #include statements for all the required headers. Have you checked the link I gave you for the name of the necessary header, and also checked that you have it included in your stdafx.h?

          F 1 Reply Last reply
          0
          • L Lost User

            Er, no, that is a project file that should contain the #include statements for all the required headers. Have you checked the link I gave you for the name of the necessary header, and also checked that you have it included in your stdafx.h?

            F Offline
            F Offline
            ForNow
            wrote on last edited by
            #5

            Thing is it compiled cleanly the day before I made some unrelated coding changes And I started getting those Errors I started the project along time ago when I didn't know anything about MFC it was kind of sloppy this was a good opportunity for me to clean it up I created a project with the same name on a different drive and it looks good those compile errors went away As soon as I finish i going to copy it back to the original spot overlay the code with this Thanks

            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