as2003
asked on
basic mfc mdi q
I have a basic child window in an mdi prog. I want to resize the contents (a CView based class) when the child window frame is resized. So far i've just been trying to catch the WM_SIZE message without success. I tried overriding with:
void CChildFrame::OnSize(UINT nType, int cx, int cy)
{
AfxMessageBox("hello2");
}
in childwindow.cpp
and
protected:
void OnSize(unsigned int nType, int cx, int cy);
in childwindow.h
but nothing happens
void CChildFrame::OnSize(UINT nType, int cx, int cy)
{
AfxMessageBox("hello2");
}
in childwindow.cpp
and
protected:
void OnSize(unsigned int nType, int cx, int cy);
in childwindow.h
but nothing happens
ASKER
I added the code via 'class view' -> 'CChildFrame' -> 'Add Function...' and copying the parameters from what i found out about OnSize in the help files
This is not the right way, erase all this and start again.
You can use the Classview's "Add Message Handler..." option, or use the ClassWizard (press Ctrl-W), this will generate the proper mapping macros and the function declaration.
You can use the Classview's "Add Message Handler..." option, or use the ClassWizard (press Ctrl-W), this will generate the proper mapping macros and the function declaration.
ASKER
Cool, that's working a bit better now! I'm tring to make the grid control that's in the child window resize as the frame does but the only thing that look right is .SetWindowRgn(HRGN hRgn, BOOL bRedraw);
I tried using this but didn't really get anything to happen.
Thanks for your help so far.
I tried using this but didn't really get anything to happen.
Thanks for your help so far.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
If first, maybe you haven't put the proper mapping macro.