Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I create a CWnd_based class CSubWnd, and create it in the OnCreate function of a dialog!To me surprise the controls on the dialog will not be drawed, Is there someone who can tell me why!
Posted

When the OnCreate handler is called, the controls are not created and positioned. OnInitDialog is called after the controls are created and positioned, but just before the dialog is shown.
 
Share this answer
 
As far as I know, CDialog does not include an OnCreate() function. All initialisation is done in OnInitDialog().

I stand corrected; Superman has it right.
 
Share this answer
 
v2

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