Strange Compiler behavior
-
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
-
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
-
Have you included the correct header file, as shown in https://msdn.microsoft.com/en-us/library/efk30beh.aspx[^]?
-
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
-
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?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