CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11
  1. #1
    Join Date
    Nov 2009
    Posts
    128

    Question dialog id undeclared identified

    i have created win32 application with MFC in a shared Dll.

    i have include a dialog with ID = IDD_DIALOG.i have created class for dialog which is CSettingsDlg derived from CDialog.
    and included header

    Code:
           class CSettingsDlg : public CDialog
    {
    	DECLARE_DYNAMIC(CSettingsDlg)
    
    public:
    	CSettingsDlg(CWnd* pParent = NULL);   // standard constructor
    	virtual ~CSettingsDlg();
    
    // Dialog Data
    	enum { IDD = IDD_DIALOG1 };// error C2065: 'IDD_DIALOG1' : undeclared identifier
    
    protected:
    	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
    
    	DECLARE_MESSAGE_MAP()
    };
    i am getting an error :
    error C2065: 'IDD_DIALOG1' : undeclared identifier

    what should i do ?
    Last edited by dskp; March 2nd, 2010 at 07:44 AM.

  2. #2
    Join Date
    Feb 2010
    Posts
    30

    Re: dialog id undeclared identified

    error C2065: 'IDD_DIALOG1' : undeclared identifier

    a variable’s type must be specified in a declaration before it can be used. The parameters that a function uses must be specified in a declaration, or prototype, before the function can be used.

  3. #3
    Join Date
    Nov 2009
    Posts
    128

    Re: dialog id undeclared identified

    what should i do.i dint understand.

  4. #4
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: dialog id undeclared identified

    What kind of dll did you make ? To have dialogs in a MFC dll it needs to be a MFC extension dll instead of a regular dll.

  5. #5
    Join Date
    Apr 1999
    Posts
    3,585

    Re: dialog id undeclared identified

    Are you sure you are including "resource.h" where it is needed?
    Gort...Klaatu, Barada Nikto!

  6. #6
    Join Date
    Nov 2009
    Posts
    128

    Re: dialog id undeclared identified

    i didn't use any dll.

    what i meant i took a "win32 application" and in project setting i took "MFC in a shared Dll" option since i am using MFC support thats all.

  7. #7
    Join Date
    Nov 2009
    Posts
    128

    Re: dialog id undeclared identified

    yes @Mike Harnad

  8. #8
    Join Date
    Feb 2010
    Posts
    30

    Re: dialog id undeclared identified

    did you include the resource.h file

  9. #9
    Join Date
    Apr 1999
    Posts
    3,585

    Re: dialog id undeclared identified

    Use the resource editor and make sure you actually have a resource with that ID.
    Gort...Klaatu, Barada Nikto!

  10. #10
    Join Date
    Nov 2009
    Posts
    128

    Re: dialog id undeclared identified

    i observed this :-

    Code:
    resource.h
                     #define IDD_DIALOG1                     104
    
    .cpp
    // Dialog Data
    	enum { IDD = 104 }; //when i include this its is working
    	//enum { IDD = IDD_DIALOG1 };//when in include its not working

  11. #11
    Join Date
    Apr 1999
    Posts
    3,585

    Re: dialog id undeclared identified

    Take a look here.
    Gort...Klaatu, Barada Nikto!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured