Help with modeless dialog error
-
Using Visual C++ 6.0 MFC in SDI application I created a dialog box class called CTestDialog and assocatied files TestDialog.cpp and TestDialog.h. The dialog box ID is IDD_TESTDIALOGBOX. I want to have it run as a modeless dialog, and I have a routine in MainFrm.cpp where I want to control the display of this dialog box. When I put the header file for test dialog into MainFrm.cpp I get a compilation error. #include "TestDialog.h" error C2065: 'IDD_TESTDIALOGBOX' : undeclared identifier I don't get this error when the header file is placed in any other .cpp file. I don't understand what the problem is. Thanks
-
Using Visual C++ 6.0 MFC in SDI application I created a dialog box class called CTestDialog and assocatied files TestDialog.cpp and TestDialog.h. The dialog box ID is IDD_TESTDIALOGBOX. I want to have it run as a modeless dialog, and I have a routine in MainFrm.cpp where I want to control the display of this dialog box. When I put the header file for test dialog into MainFrm.cpp I get a compilation error. #include "TestDialog.h" error C2065: 'IDD_TESTDIALOGBOX' : undeclared identifier I don't get this error when the header file is placed in any other .cpp file. I don't understand what the problem is. Thanks
The dialog IDs are defined in
resource.h
So add#include "resource.h"
in your corresponding cpp file which shows the error. Regards, Jijo._____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.
-
The dialog IDs are defined in
resource.h
So add#include "resource.h"
in your corresponding cpp file which shows the error. Regards, Jijo._____________________________________________________ http://weseetips.com[^] Visual C++ tips and tricks. Updated daily.
thanks!
-
Using Visual C++ 6.0 MFC in SDI application I created a dialog box class called CTestDialog and assocatied files TestDialog.cpp and TestDialog.h. The dialog box ID is IDD_TESTDIALOGBOX. I want to have it run as a modeless dialog, and I have a routine in MainFrm.cpp where I want to control the display of this dialog box. When I put the header file for test dialog into MainFrm.cpp I get a compilation error. #include "TestDialog.h" error C2065: 'IDD_TESTDIALOGBOX' : undeclared identifier I don't get this error when the header file is placed in any other .cpp file. I don't understand what the problem is. Thanks
You can also edit TestDialog.h and put
#include "resource.h"
at the top, before your
CTestDialog
declaration.Software Zen:
delete this;
Fold With Us![^]