Why OnInitDialog not called? |
Post Reply |
Author | |
XTMFC
Newbie Joined: 02 October 2005 Location: United States Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 02 October 2005 at 11:20pm |
I have a CXTPDockingPane in my ChildFrame. The docking pane is attached to a CXTResizeDialog. I wanted to do a few initializations in the OnInitDialog and controls resizing, but the function CXTResizeDialog::OnInitDialog was not called at all. What did I do wrong? I am using v9.601 pro. Thanks in advance for any helps! ///////////////////////// Code /////////////////////////// m_pwndContractSelector = m_paneManager.CreatePane ( IDR_PANE_CONTRACT_SELECTER, m_dlgContractSelector = new CXTResizeDialog(); m_pwndContractSelector->Attach( m_dlgContractSelector ); m_pwndContractSelector->SetOption s(xtpPaneNoCloseable); // m_pwndContractSelector->GetChil d()->SendMessage(WM_INITDIALOG); |
|
Warren
Groupie Joined: 23 February 2005 Status: Offline Points: 64 |
Post Options
Thanks(0)
|
Based on the function not getting called, my guess would be:
1) Make sure ALL of your "CDialog" entries in your dialog are replaced by "CXTResizeDialog" (i.e. make sure the derivation is 100% correct) ...and don't forget the message map macros too!!! For example: BEGIN_MESSAGE_MAP(DerivedDialogClass, BaseDialogClass) Incorrect message maps are typically where the problem is when function calls go missing for me. 2) Make sure the window you get back from: m_pwndContractSelector->GetChild() is REALLY your dialog. Maybe it's something else, or a bad pointer ?!? 3) could be a creation-order issue (maybe the dialog already got the WM_INITDIALOG message), but this is just a wild guess. Best of luck - tracking down bugs like this are never very fun. Warren |
|
XTMFC
Newbie Joined: 02 October 2005 Location: United States Status: Offline Points: 2 |
Post Options
Thanks(0)
|
Hi Warren: Thanks for your help. I tried every poosible way of putting a dialog (CDialog or CXRResizeDialog) into a docking pane and got stuck at the very same point - OnInitDialog() call. Not sure why this happens and I don't want to get into creating the controls using code in stead of using resource editor. In the mean time, I just went back to a regular popup dialog to but I will always be interested in knowing if some one has the same issue and figured out the answer. Thanks. |
|
Warren
Groupie Joined: 23 February 2005 Status: Offline Points: 64 |
Post Options
Thanks(0)
|
I was thinking of doing something similar (although I'm not in a big
hurry - it could be a month or two). I'll try to let you know if I
figure something out...
Warren |
|
Warren
Groupie Joined: 23 February 2005 Status: Offline Points: 64 |
Post Options
Thanks(0)
|
XTMFC,
I got this working (i.e. a pane with re-sizeable controls in it, layout being done in the resource editor). I'm using Xtreme Toolkit Pro 9.80 (if the version matters). Basically what I did was copy/paste from the "grep" example. It did almost exactly what we were both looking for. Note: the "one time" initialization code is done in OnInitialUpdate and not OnInitDialog. And also note, that this function gets called twice (so you'll need a m_bInitialized flag, like in the example) Maybe that was your issue ?!? Warren |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |