error C2057: expected constant expression

Posted on 2004-10-23
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

    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

    >>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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Suggested Solutions

    Title # Comments Views Activity
    Show shut-down message as Windows 8 shuts down. 9 62
    Replacement selected text 2 43
    dog bark java program 15 57
    changeXy challenge 13 23
    This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
    Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
    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 sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…

    913 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

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now