Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I created a dialog box in MFC using ID = IDD_DIALOG1

Then i created a simple C++ class named myClassX.

in the constructor myClassX()

when i am trying to use the name of IDD_DIALOG1, its not displaying in intellisense.

in constructor, i used the code as:-

Other IDD_.... names are there.

might be an intellisense error..

But its even not compiling..

C++
myClassX::myClassX()
{
    Create(IDD_DIALOG1, GetDesktopWindow());
}


Its showing error "Identifier 'IDD_DIALOG1' is undefined.."

Where's could be the problem?
Posted
Updated 26-May-12 9:42am
v2
Comments
Sean Niizuma 26-May-12 8:50am    
Is myClassX() a dialog class of IDD_DIALOG1? If not, have you created a class for the IDD_DIALOG1?
Harmanjeet Singh 26-May-12 9:13am    
yes. i already created the class and added that dialog header file into my C++ class..

1 solution

You must include the header file (say 'Dialog1.h' probably in 'Resource.h', as pointed out by Chuck O'Toole) containing the IDD_DIALOG1 definition into the myClassX class implementation source file (say 'myClassX.cpp').

BTW Giving to your types (and variables) meaningful names would help your job.
 
Share this answer
 
v5
Comments
Harmanjeet Singh 26-May-12 9:13am    
yes. i already created the class and added that dialog header file into my C++ class..
Chuck O'Toole 26-May-12 9:22am    
Did you include "Resource.h" too?
Chuck O'Toole 26-May-12 9:14am    
Most likely place for "IDD_DIALOG1" is "Resource.h". You'd be surprised how many people don't include "Resource.h" in the code module.
CPallini 26-May-12 9:46am    
Yes, you are right.
Harmanjeet Singh 26-May-12 10:48am    
Sir! You are right. i skipped Resource.h file. Thanx! it worked... :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900