[Webinar] Streamline your web hosting managementRegister Today


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

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

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Question has a verified solution.

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

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month11 days, 9 hours left to enroll

640 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