Results 1 to 6 of 6

Thread: IDD_DIALOG1 error C2065 stating undeclared identifier

  1. #1
    Join Date
    May 2011
    Posts
    129

    IDD_DIALOG1 error C2065 stating undeclared identifier

    I was doing few programming in visual c++ programming where I come up with few errors when I’m trying to add dialog1.h file in two file separately. Compilation break and show error at class CDialog1 : public CDialog. My class program is <*class CDialog1: public CDialog {*public: CDialog1 (CWnd* pParent = NULL);// this is an standard constructor. *enum { IDD = IDD_ CDIALOG1 }; // in this line I’m getting an error stating undeclared identifier }; >. Can anyone help me hot to remove this error? Remove * and run the program.

  2. #2
    Join Date
    May 2009
    Posts
    527

    Re: IDD_DIALOG1 error C2065 stating undeclared identifier

    It’s very simple you just need to create a controller with an id. The id which is used is IDD_CDIALOG1. In your code the AFX is different as the class and you had inserted the id which is not present. You must use this program < Class CDialog1 : public CDialog { public:CDialog1 (CWnd* pParent = NULL); //this is an standard constructor. enum { IDD = IDD_ CDIALOG1 };// avoid space in between. Replace your code with this it will surely help you.

  3. #3
    Join Date
    Apr 2009
    Posts
    488

    Re: IDD_DIALOG1 error C2065 stating undeclared identifier

    If you still persist with the same problem you must change the id what you have used in the code. As the id which you had used is not supportable and for this you need to little bit search for your particular id. You can replace the id enum { IDD = IDD_ CDIALOG1 }; which is showing an error because the id is not supportable you should use this id enum { IDD = IDD_DIALOG1} this will surely work for our code. Id you still get a break time error then search for different id.

  4. #4
    Join Date
    May 2009
    Posts
    529

    Re: IDD_DIALOG1 error C2065 stating undeclared identifier

    Even I’m having the same issue in my program. I’m developing my project in c++ and the program return to the break time. I had even checked my resources in the IDD which has being defined in it but still it shows error C2065 unidentified identifier. Does anyone having the same issue like me? Is there any solution to how to neglect this error? I will be very much thankful to the person for helping me regarding this issue.

  5. #5
    Join Date
    May 2009
    Posts
    543

    Re: IDD_DIALOG1 error C2065 stating undeclared identifier

    You are facing the problem as you had created the two dialog class in two different file let us assume that it is MyDialog.h and MyDialog.cpp. In the .cpp you should only include the following code. < #include stdafx.h //line break here #include MyDialog.h> and even include your id in MyDialog.h file and even include the header for you derived class which is a source file. The header mywinapp.h includes the resources in your file.

  6. #6
    Join Date
    May 2009
    Posts
    637

    Re: IDD_DIALOG1 error C2065 stating undeclared identifier

    You can even try this code with your class whose name is <class CMainwndDlg : which is defined as public CDialog> then you need to add the particular id in the progrema that is c_mainwndDlg then declare public and then write an standard constructor with the virtual id which is used for dialog data and the error which your had shown that I had checked in my resources and it don’t have any problem. hope this will going to help you.

Similar Threads

  1. Getting a VBA Error stating not able to load object
    By Corey Dunnett in forum MS Office Support
    Replies: 2
    Last Post: 10-02-2012, 05:28 PM
  2. <identifier> expected error
    By mbueling in forum Software Development
    Replies: 2
    Last Post: 18-10-2011, 06:04 AM
  3. Identifier Expected Error in JAVA
    By Brake Fail in forum Software Development
    Replies: 7
    Last Post: 25-10-2008, 02:35 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,649,131.80068 seconds with 17 queries