Hi, everyone. I'm a newbie in C++. I have a program that create a simple dialog.
Code:
// Filename: test31.CPP
#include <afxwin.h>
#include "Resource.h"
class DialogApp : public CWinApp
{
public:
BOOL InitInstance();
};
class CExoDialog : public CDialog
{
public:
enum { IDD = IDD_DIALOG1 };
CExoDialog();
};
CExoDialog::CExoDialog()
: CDialog(CExoDialog::IDD, NULL) /// May I replace IDD by IDD_DIALOG1?
}
BOOL DialogApp::InitInstance()
{
CExoDialog Dlg;
m_pMainWnd = &Dlg;
Dlg.DoModal();
return TRUE;
};
DialogApp theApp;
//End of test31.CPP
-------------
Code:
//Filename: resource.h
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Script1.rc
//
#define IDD_DIALOG1 101
#define IDC_PROGRESS1 1000
#define IDC_IPADDRESS1 1001
#define IDC_EDIT1 1005
#define IDC_ANIMATE1 1006
#define IDC_SLIDER1 1007
#define IDC_BUTTON1 1008
#define IDC_CHECK1 1009
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1010
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
-------------
When I replace IDD with IDD_DIALOG1, I get some errors:error C2589: 'constant' : illegal token on right side of '::'. Why?