Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


error C2057: expected constant expression

Posted on 2004-10-23
Medium Priority
Last Modified: 2013-11-20
After making a dialog using and using the Wizard to make a class The code compiles OK.

When I include the header file for this new class  #include "mydialog.h"  in CMainFrame the coimpiler complains.

error C2065: 'IDD_DIALOG_1' : undeclared identifier
error C2057: expected constant expression

Question by:hansw77041
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Author Comment

ID: 12391036
Answering my own question.
I have no idea why including the  #include "resource.h" in the Cmydialog get rid of the error but it does.

LVL 86

Accepted Solution

jkr earned 1500 total points
ID: 12391069
>>I have no idea why including the  #include "resource.h" in the Cmydialog get rid of the error

Becuase that file is maintained by the resource editor and this one put the definition of IDD_DIALOG_1 right in there. All resources need to have an uniqe identifier, and whenever you create a resource with Visual Studio, it will #define this one in 'resource.h' by default.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

597 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