BUG: Default Dialog-Based Application Doesn't Work in Win32s
This article was previously published under Q138971
This article has been archived. It is offered "as is" and will no longer be updated.
A dialog-based application generated using AppWizard will not run properlyunder Win32s.
When AppWizard generates a dialog-based application, it uses a DIALOGEXresource for the main dialog. Win32s, however, does not support DIALOGEXresources. As a result, the dialog box looks incorrect on Win32s. Thisproblem is documented in the Vcread.wri file that ships with Visual C++version 4.0 and 4.1.
To get your dialog-based application working in Win32s, you must changethe DIALOGEX resource to a DIALOG resource, and remove the WS_EX_APPWINDOWstyle. This can be done as follows:
- Open the .rc file as a text file
- Search for the DIALOGEX statement and change DIALOGEX to DIALOG.
- Remove the line containing the extended style WS_EX_APPWINDOW for this dialog box.
- In OnInitDialog() for the main dialog, add the extended style by adding the following line:
Microsoft has confirmed this to be a bug in the Microsoft products listedat the beginning of this article. We are researching this problem and willpost new information here in the Microsoft Knowledge Base as soon as itbecomes available.
Visual C++ versions 4.2 and later do not support building Win32sapplications.
The following is from the .rc file for a dialog-based application:
After the changes, these lines should look like this:
... IDD_DIALOGBASED_DIALOG DIALOGEX 0, 0, 185, 92 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW ...
... IDD_DIALOGBASED_DIALOG DIALOG 0, 0, 185, 92 STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU ...
Visual C++ version 4.0 Vcread.wri file.
Article ID: 138971 - Last Review: 01/06/2015 01:18:34 - Revision: 2.0
- kbnosurvey kbarchive kbbug kbprogramming kbui kbwizard KB138971