Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Why OnInitDialog not called?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Why OnInitDialog not called?

 Post Reply Post Reply
Author
Message
XTMFC View Drop Down
Newbie
Newbie


Joined: 02 October 2005
Location: United States
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote XTMFC Quote  Post ReplyReply Direct Link To This Post Topic: Why OnInitDialog not called?
    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,
                  CRect(0, 0,120, 120),
                  xtpPaneDockTop,
                  m_paneManager.GetC lientPane() );

    m_dlgContractSelector = new CXTResizeDialog();
    m_dlgContractSelector->Create(IDD _CONTRACT_SELECTOR,this);

    m_pwndContractSelector->Attach( m_dlgContractSelector );

    m_pwndContractSelector->SetOption s(xtpPaneNoCloseable);

 //   m_pwndContractSelector->GetChil d()->SendMessage(WM_INITDIALOG);

Back to Top
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2005 at 7:15am
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
Back to Top
XTMFC View Drop Down
Newbie
Newbie


Joined: 02 October 2005
Location: United States
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote XTMFC Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2005 at 7:54pm

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.

Back to Top
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Posted: 04 October 2005 at 9:06pm
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
Back to Top
Warren View Drop Down
Groupie
Groupie
Avatar

Joined: 23 February 2005
Status: Offline
Points: 64
Post Options Post Options   Thanks (0) Thanks(0)   Quote Warren Quote  Post ReplyReply Direct Link To This Post Posted: 16 December 2005 at 11:29am
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
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.