Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PreCreateWindow() not getting hit in a Dialog

Posted on 1998-12-02
4
Medium Priority
?
669 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

704 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