RE: Clipping the MainFrame View with another View
Thanks for pointing me in the right direction in your last post, and bearing
with me so far. The problem was establising the parent-child relationship,
and having raised teen agers I can testify to its inherent difficulty and
obscurity ;-/. At long last, using a pointer to the mainframe class as the
parent window argument to LoadWindow(), instead of NULL, made it work. It
seems obvious NOW, which seems to be the norm for things like this that drive
one crazy.
This finally made it work:
pMainFrm->m_pNewFrm->LoadFrame(
NEW_FRAME_MENU_ID,
WS_OVERLAPPEDWINDOW | FWS_ADDTOTITLE ,
pMainFrm,
&wcontext);
Once again, thanks much for your help!
"Mark Salsbery" wrote:
BOOL CNewFrm::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style |= WS_EX_TOPMOST;
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
MFC is overwriting your style. Plus, It's an extended style so it needs to
be added to the dwExStyle member of cs...
Try
BOOL CNewFrm::PreCreateWindow(CREATESTRUCT& cs)
{
BOOL fRet = CFrameWnd::PreCreateWindow(cs) ;
if (fRet)
{
//cs.style |= ;
cs.dwExStyle |= WS_EX_TOPMOST;
}
return fRet;
}
Mark