Solved

PreCreateWindow() not getting hit in a Dialog

Posted on 1998-12-02
4
632 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
  • 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
repeateFront java challenge 31 92
windows 10 how make picture as desktop background 2 62
modThree challenge 4 88
Fibonacci challenge 11 120
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

815 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now