Link to home
Start Free TrialLog in
Avatar of wau
wau

asked on

PreCreateWindow overriding in CDialog

Why my overrided PreCreateWindow function, in a CDialog derived class, is never called?
I need to change the lpszClass field of the CREATESTRUCT;
Thanx.
ASKER CERTIFIED SOLUTION
Avatar of wyy_cq
wyy_cq

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of wyy_cq
wyy_cq

preCreateWindow is the function which let you change the window style before it created .
but the dialog 's style is defined in resource .

in the VC Online help ,it not refer to  changing the style of dialog by preCreateWindow .

if you want to change the style of dialog ,you can call ModifyStyle or ModifyStyleEx in OnInitDialog

you can't do "change the lpszClass field of the CREATESTRUCT"
if you change it ,it will not be a dialog.

i guess you want to create a new window with the looking defined in the resource.

so you can derive the class from CFormView ,CDialogBar, they can be the child window.