BUG: GetDlgItem() Returns NULL Under Win32s

Article translations Article translations
Article ID: 149982 - View products that this article applies to.
This article was previously published under Q149982
This article has been archived. It is offered "as is" and will no longer be updated.
Expand all | Collapse all

Symptoms

Calling GetDlgItem() to get the CWnd pointer of a control in a dialog can fail and return NULL under Win32s. DoDataExchange(), which calls DDX functions, also ends up calling GetDlgItem(). This can result in an assert in Dlgdata.cpp, line 43.

Cause

This is caused by having extended styles in any of the controls in the dialog. Any extended style converts the dialog resource to a DIALOGEX resource. Win32s does not support DIALOGEX resources. None of the controls in the dialog are be created and the dialog does not display correctly. For details on how to replace the DIALOGEX style, please see the "More Information" section of this article.

Resolution

Remove all extended styles in all the controls in the dialog resource.

Status

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching the problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Visual C++ versions 4.2 and later do not support building Win32s applications.

More information

For additional information, please see the following article in the Microsoft Knowledge Base:
138971 BUG: Default Dialog-Based Application Doesn't Work in Win32s

Properties

Article ID: 149982 - Last Review: October 25, 2013 - Revision: 3.0
Applies to
  • Microsoft Foundation Class Library 4.2, when used with:
    • Microsoft Visual C++ 4.0 Standard Edition
Keywords: 
kbnosurvey kbarchive kbbug kbdlg kbprogramming kbuidesign KB149982

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com