Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I didn't understand constructor(Auto generated)in Dialog class,why cWnd pointer is passing and what's the role of CDialog(cApp::IDD,pParent). I am new to vc++,can any one please tell me elaborately(why this line is included CDialog(cApp::IDD,pParent))

What I have tried:

I created one Dialog in vc++ 6.0,it's constructor like as follows
cApp::cApp(cWnd *pParent)
:CDialog(cApp::IDD,pParent)
{
//some initializations are there
}
Posted
Updated 3-Aug-16 17:56pm
v2

1 solution

See CDialog::CDialog[^]. The cApp::IDD value is generated by the framework and identifies the Dialog resource that is used to build the Dialog's window. The pParent value is a pointer to the window that owns the Dialog, and lets Windows know which Window to deactivate when the Dialog is visible.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900