CDialogBar problems with VC2.2
Gillian - WEIL IT Swin -- GMARSH@weil.co.uk Thursday, January 11, 1996 Hello everyone, My application has many child windows, all using my own frame window class derived from MDIChildWnd, which has an override of PreCreateWindow. Several of these child windows have a CDialogBar (different in each case), and my PreCreateWindow has a switch which sets the appropriate dialog resource based on the RUNTIME_CLASS prior to creating the dialog bar. This has been working fine for many months using VC++1.52. I have now tried building the project with VC++2.2 and my dialog bars fail to create. Stepping through the code in debug in both versions, I find that initially my PreCreateWindow correctly assigns the dialog resource in both cases. The difference occurs in the MFC file winmdi.cpp on the line (line 495 in 1.52, 503 in 2.2): HWND hWnd = (HWND)::SendMessage(pParentWnd->m_hWndMDIClient, WM_MDICREATE, 0, (LONG)(LPSTR)&mcs); In 1.52, it passes over this line and completes correctly, whereas in 2.2 it jumps back into my PreCreateWindow and reassigns the dialog resource to 0 - the default value for all child windows of RUNTIME_CLASS's that do not have dialog bars. Does anyone out there know what's going on? Thanks in advance. Gill gmarsh@weil.co.uk
David Elliott -- dce@netcom.com Friday, January 12, 1996 I got this from Gill, so I won't be sending out any responses to this issue: In actual fact the problem was due to winmdi in VC2.2 calling PreCreateWindow twice, whereas in VC1.52 it calls it only once. I have modified my PreCreateWindow override so that it always calls the base class, but performs my specific code once only. I still don't understand why my specific code should behave differently second time around (a test of the RUNTIME_CLASS) but no matter. David Elliott - dce@netcom.com - http://www.btw.com/dce
| Вернуться в корень Архива |