|
-
July 20th, 1999, 08:06 PM
#1
Why my view doesn't work first?
Hello All:
I Use splitter window in SDI application. I wrote code in Mainframe::OnCreateClient like this:
// m_hSplitter is a CSplitterWnd object
if(!m_hSplitter.CreateStatic(this,1,2)) return false;
if(!m_hSplitter.CreateView(0,1,pContext->m_pNewViewClass,CSize(0,0),pContext)) return false;
// m_hMywnd is m_hSplitter's child windows
m_hMywnd.Create(...);
m_hSplitter.SetColumnInfo(0,100,0);
m_hSplitter.SetColumnInfo(1,200,0);
m_hSplitter.RecalcLayout();
My Splitter Window can display successfully.But Menu's Items which I wrote code for View is disabled untill I click the View client area. Is it possible let the items enabled when application start? thanks for any advice.
nvc
-
July 20th, 1999, 10:55 PM
#2
Re: Why my view doesn't work first?
The reason the menu items are only enabled when you click on the view is because the handler's for them are in the view class. To make them available no matter what view is active then move all the handlers into the mainframe class.
-
July 20th, 1999, 11:21 PM
#3
Re: Why my view doesn't work first?
Hi.
Accroding as Visual C++ developers jounal, www.vcdj.com,
Davide Marcato answered this kind of questions, but MDI with splitter
window.
Even though menu command leaves at View class, he added OnCmdMsg fun
to CChildFrame.
I think that this will work on SDI Application.
Try to check this.
HTH.
-Masaaki Onishi-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|