Hello all, I'm working on a program using MFC and VS6, and when I split my program into files (aka: move certain portions to a new file for easier reading and such), I get this error:

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

Here's the portion of my dialog class that's causing the errors:

#if !defined(AFX_DLG_H__94E25BA3_F903_4611_BB23_D1C559C46EBC__INCLUDED_)
#define AFX_DLG_H__94E25BA3_F903_4611_BB23_D1C559C46EBC__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// CDlg dialog
class CDlg : public CDialog
// Construction
	CDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_DIALOG };

// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_DLG_H__94E25BA3_F903_4611_BB23_D1C559C46EBC__INCLUDED_)

And the file which calls CDlg.h:

#if !defined(AFX_P_H_INCLUDED_)

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "StdAfx.h"
#include "Dlg.h"

class CP : public CDlg{
// various functions and such


Does anyone know how to fix this? (I've been trying for a while, but the error itself is confusing to me [as to why it's even occuring]).

11 Years
Discussion Span
Last Post by raevin

Sorry for this post, but I couldn't figure out how to edit the post.

I fixed this error by adding:

#include "Resource.h"

at the top of the header that was causing the problem.

This article has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.