Solved

PreCreateWindow() not getting hit in a Dialog

Posted on 1998-12-02
4
658 Views
Last Modified: 2013-11-20
I have a dialog created in resource editor as a child, no border, control.  Now I want to modify those styles programmatically with ModifyStyle, but since it isn't working correctly I go to PreCreateWindow and modify the createstruct just to test things out.  I find that PreCreateWindow()isn't being hit at all now.  What could cause this?  I'm creating the dialog like this:  (modeless)

      CUserDialog* UserDlg = new CUserDialog(rect);
      UserDlg->Create(IDD_USER, NULL);
0
Comment
Question by:appleby
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 1

Accepted Solution

by:
Bridge earned 60 total points
ID: 1325630
What styles do you want to change?
If its the border style set it to on in the resource editor, then turn it off in the InitDialog override. After this you will be able to change it correctly at will.

Dialog construction doesnt call PreCreateWindow.
0
 

Author Comment

by:appleby
ID: 1325631
I want to change Child to Popup, No borders to borders, turn off Control.  Basically anything that needs to be done to change a dialog from being a child of another dialog to being able to stand on its own as a separate dialog.

Why doesn't dialog construction call PreCreateWindow?  Or maybe a better question is, how do you find this stuff out, when it isn't documented in the class docs?  I have tried going back to classwizard as a que - if it is listed and able to be inserted automatically, I was hoping it meant it got called, but this is obviously not true since you have to add oninitdialog manually, and you can add precreatewindow automatically.
0
 
LVL 1

Expert Comment

by:Bridge
ID: 1325632
OnInitDialog is added throu class wizard as WM_INITDIALOG
0
 

Author Comment

by:appleby
ID: 1325633
This doesn't explain why what you suggest would work, and it is a hack more than an answer unless you explain why it is the right way to do it.  I'm only grading this rather than rejecting your answer because I would otherwise withdraw the question...I've found an entirely different way to solve my problem and don't think I will ever get a good answer to doing it this way (I've asked several places and searched everywhere.)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

617 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