Getting the CView to respond to the SplitterWindow,Cview messageHandlers in SDI app
Posted on 2003-11-02
I have made a splitter window in a SDI app, it works great except that it doesnt acknowledge the CView handlers (the button is disabled..grayed out) UNLESS you have picked in the CVIEW window, then the button lights up.
The reason for this is in the CMainFrame to create a SDI splitter I have to return TRUE and not let the function OnCreateClient() do the default action of CFrameWnd::OnCreateClient(lpcs, pContext);(see below)
BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
//deteled the splitter creation code (its standard stuff)
//by uncommenting this out then you create a view that allows active buttons
//but you will destroy your splitters
// return CFrameWnd::OnCreateClient(lpcs, pContext);
return TRUE;//do this so the splitter shows up in the SDI app, but button handlers to
//CView are inactive unless you select the actual view
Is there a way to set this up so that even though you are in a sdi app with splitters, if I want to add handlers to the cview class they are enabled aoutomatically , similar to if you did call:
return CFrameWnd::OnCreateClient(lpcs, pContext);
this will enable all buttons for a CView window, even if you didnt select in the window.