Article ID: 193272 - View products that this article applies to.
This article was previously published under Q193272
This article has been archived. It is offered "as is" and will no longer be updated.
The OnInitDialog() function (which is called in response to a WM_INITDIALOG message) for a CPrintDialog-derived class, was called in MFC prior to Visual C++ 6.0. However, this is no longer true for MFC DLLs of Visual C++ 6.0. Therefore, programs that rely on OnInitDialog() to be called will not work as expected.
Previously, MFC set up a message hook for CPrintDialog. This hook was the only way to catch a WM_INITDIALOG message. MFC for Visual C++ 6.0 purposely removed this hook so MFC applications would automatically get the new Print dialog by default on Windows 2000; however, this causes applications that rely on CPringDialog::OnInitDialog() to fail to work.
Set up the message hook function, _AfxCommDlgProc(), in the constructor of your CPrintDialog-derived class as shown below:
Then, make your project statically linked to MFC.
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, visit the following MIcrosoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/vstudio/Aa718362.aspxFor more information about Visual Studio 6.0 Service Pack 1, click the following article numbers to view the articles in the Microsoft Knowledge Base:
(https://support.microsoft.com/kb/193009/ )Visual Studio 6.0 Service Pack 1 readme
(https://support.microsoft.com/kb/194022/ )Visual Studio 6.0 service packs, what, where, why
(https://support.microsoft.com/kb/194295/ )How to tell that a Visual Studio service pack is installed
Steps to reproduce the behavior
Article ID: 193272 - Last Review: February 23, 2014 - Revision: 4.2