?
Solved

'undeclared identifier' Error due to a dialog resource ID

Posted on 2006-05-22
8
Medium Priority
?
412 Views
Last Modified: 2008-01-09
I have a class derived from CPropertySheet, called CMyPropertySheet.  In the header file for this class, I have an include statement for each property page that will reside in my property sheet;  That code looks like this:

#include "Page1.h"
#include "Page2.h"
#include "Page3.h"

I have created a dialog for each property page.  I have assigned the resource IDs of 'IDD_PAGE1_DIALOG', 'IDD_PAGE2_DIALOG', and 'IDD_PAGE3_DIALOG'.  I have created a class for each of these property pages.  I did this with the class wizard.  All this went fine.  However, when I build (f7) my project, I get the following 2 error messages in the header file FOR EACH of my property page classes:

page1.h(24) : error C2065: 'IDD_PAGE1_DIALOG' : undeclared identifier
page1.h(24) : error C2057: expected constant expression

So, in total, I get 6 error messages (2 for each property page resource ID).

Thus, it seems as though the resource IDs for each of my property page dialogs are not being found.  I can look in the resource.h file and find each property page's resource ID.  Each page DOES INDEED have a valid resource ID.

Any thoughts?
0
Comment
Question by:clintMon
  • 4
  • 3
8 Comments
 
LVL 30

Accepted Solution

by:
Axter earned 2000 total points
ID: 16736880
Hi clintMon,
> page1.h(24) : error C2065: 'IDD_PAGE1_DIALOG' : undeclared identifier

Do you have an include for resource.h in your page?.h file?
Does your resource.h file have a define for 'IDD_PAGE1_DIALOG'?

David Maisonave (Axter)
Cheers!
0
 
LVL 30

Expert Comment

by:Axter
ID: 16736883
Your resource.h file needs to have the define for the IDD macros you use.
0
 
LVL 86

Expert Comment

by:jkr
ID: 16736929
I assume that the 'resource.h' file has the #define statements for these constants - but, are you using

#include "resource.h"

in '"PageXY.h"?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:clintMon
ID: 16736977
Thanks Axter.  Putting the include statement for the resource header in each of my property page header files did the trick.  Specifically, the line:

#include "resource.h"
0
 
LVL 86

Expert Comment

by:jkr
ID: 16737061
Hmmm, didn't I suggest that? ;o)
0
 
LVL 30

Expert Comment

by:Axter
ID: 16737135
>>Hmmm, didn't I suggest that? ;o)

That's the first sentance in my comment.
0
 
LVL 86

Expert Comment

by:jkr
ID: 16737275
Sorry, missed that completely - otherwise I wouldn't have added mine anyway.
0
 
LVL 30

Expert Comment

by:Axter
ID: 16737317
>>Sorry, missed that completely - otherwise I wouldn't have added mine anyway.

No problem.  I thought you might have added it for extra clarity.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question