Solved

PreCreateWindow overriding in CDialog

Posted on 1998-12-02
2
852 Views
Last Modified: 2013-11-20
Why my overrided PreCreateWindow function, in a CDialog derived class, is never called?
I need to change the lpszClass field of the CREATESTRUCT;
Thanx.
0
Comment
Question by:wau
  • 2
2 Comments
 
LVL 2

Accepted Solution

by:
wyy_cq earned 50 total points
ID: 1325666
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
0
 
LVL 2

Expert Comment

by:wyy_cq
ID: 1325667
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.

0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Expand macro to include alternate header placement and naming 5 72
countEvens challenge 2 103
java ^ examples 8 67
post4 challenge 28 101
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question