Select the product you need help with
FIX: The CDialog::Create() function returns an incorrect value when a dialog box is created in Visual C++Article ID: 193099 - View products that this article applies to. This article was previously published under Q193099 On This PageSYMPTOMS If a dialog box is created via the CDialog::Create() call,
and the dialog box's OnInitDialog() (in response to WM_INITDIALOG message) ends
the dialog box via EndDialog(), the CDialog::Create() function returns a
non-zero value. The CDialog::Create() in this case should return zero.
Because the dialog box was destroyed due to an EndDialog() call in the dialog's OnInitDialog(), CDialog::m_hWnd is NULL in this case. CAUSE An additional test was made in the WM_INITDIALOG code (at
line 365 of Dlgcore.cpp), which leads to Create() succeeding even if the window
handle is NULL. MFC code for Visual C++ 5.0: RESOLUTION When calling CDialog::Create check both the return value of
CDialog::Create(), and the value of CDialog::m_hWnd. If CDialog::m_hWnd is
NULL, then the dialog-box creation is unsuccessful. STATUS Microsoft has confirmed this to be a bug in the Microsoft
products listed at the beginning of this article. This bug has been fixed in
the Visual Studio 6.0 Service Pack 1. To obtain this service pack, please see: http://msdn2.microsoft.com/en-us/vstudio/Aa718362.aspx For more information on the Visual Studio 6.0 Service Pack 1,
please see the following articles in the Microsoft Knowledge Base:
(http://msdn2.microsoft.com/en-us/vstudio/Aa718362.aspx)
193009 INFO: Visual Studio 6.0 Service Pack 1 Readme
(http://support.microsoft.com/kb/193009/EN-US/
)
194022 Visual Studio 6.0 service packs, what, where, why
(http://support.microsoft.com/kb/194022/EN-US/
)
194295 How To Tell That a Visual Studio Service Pack Is Installed
(http://support.microsoft.com/kb/194295/EN-US/
)
MORE INFORMATION Modify the code for displaying the dialog box so it also
checks against the CDialog::m_hWnd variable. For instance: Steps to Reproduce Behavior
PropertiesArticle ID: 193099 - Last Review: August 7, 2007 - Revision: 6.2 APPLIES TO
|


Back to the top








