What does it matter? C++? what's up Constant? Show? About what? Morning? MFC? what's up Use? enum? {? International direct dial telephone? =? IDD_DIALOG 1? };
Coming? Show? Constant? Namely. const? (-ant),? Do you use it at this time? const? International direct dial telephone? =? IDD_DIALOG 1? There will be problems.
This is the structure of the writing dialog box. Because different dialogs can use the same class. Different dialogue resources.
And different resources should be the same code.
enum? {? International direct dial telephone? =? IDD_DIALOG 1? } this will do.
As long as you use IDD in the base class code, you can get the ID number of the dialog resource without writing other code to set it.
If you delete this sentence, you can see why you use IDD.
If you want to define it as a variable, you need to modify the code yourself.
:? CDialog(CTestDlg::IDD,? PParent)// Need to modify the call to the base class constructor.
If IDD is a variable, you need to assign a value before calling this base class construct. And modify it to don't CTestDlg::?
Something like this:
CTestDlg::CTestDlg(CWnd*? It's obvious? /*=NULL*/)
:IDD(IDD_TEST_DIALOG)? //variable initialization
,? CDialog (international direct dial telephone, pParent)? //Constructor personally feels that using constants will be efficient? Point, because Changshu is included in the instruction, the variable needs to access the memory to get the value.