PRB: PropertySheet Fails When Changing from VC++ 5.0 to VC++ 6.0

ID: Q197631


The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API)
  • Microsoft Visual C++, 32-bit Editions, version 6.0


SYMPTOMS

After installing Visual C++ 6.0 and rebuilding an application, any call to the PropertySheet API will fail on systems that have the original Comctl32.dll file. These systems include Windows 95 and Windows NT 4.0 with no Internet Explorer or Internet Explorer version 3.0x installed.


CAUSE

Visual C++ 6.0 includes an updated Prsht.h file that changes the size of both the PROPSHEETHEADER and PROPSHEETPAGE structures depending on what the _WIN32_IE preprocessor directive is defined as.

If _WIN32_IE is not defined, it is defined as 0x0400 by default. Having _WIN32_IE defined as 0x0400 causes the new members of the PROPSHEETHEADER and PROPSHEETPAGE structures to be included. Because of this, the sizes of these structures change. Each of these structures contains a size member, which the PropertySheet API examines. Unfortunately, the original version of PropertySheet (implemented in Comctl32.dll) will fail if the size of these structures is not exactly what is expected.


RESOLUTION

If you need to call the function PropertySheet for any version of Comctl32.dll, you must add a define in the settings for your project.

NOTE: Do not perform these steps if you are using MFC's CPropertySheet classes. See the More Information section regarding CPropertySheet.

To do this in Visual C++ 6.0

  1. On the Project menu, click settings.


  2. Click the C/C++ tab.


  3. Select All Configurations in the Settings For combo box on the left.


  4. Select the Preprocessor item in the Categories combo box on the right.


  5. Add the following directive in the Preprocessor Definitions edit box:
    _WIN32_IE=0x0200


  6. Rebuild the entire project.


This process targets your application for all Comctl32.dll platforms; it also causes compiler errors if you attempt to use any new common control features that would cause your application to not work correctly with all versions of Comctl32.dll.

You can also set the dwSize members of the PROPSHEETHEADER and PROPSHEETPAGE structures to the PROPSHEETHEADER_V1_SIZE and PROPSHEETPAGE_V1_SIZE values, respectively. These values are defined in the updated Prsht.h file. Using these values, however, prevents your project from building if you do not have the updated Prsht.h file.


STATUS

This behavior is by design.


MORE INFORMATION

The Visual C++ 6.0 MFC CPropertySheet and CPropertyPage classes are not subject to this behavior. To get the new property sheet behavior in MFC, you will need to use the CPropertySheetEx and CPropertySheetEx classes.

Setting the _WIN32_IE value in an MFC project prevents the project from building.

Additional query words:

Keywords : kbNTOS400 kbPropSheet kbSDKPlatform kbVC600 kbWinOS98
Version : winnt:6.0
Platform : winnt
Issue type : kbprb


Last Reviewed: January 10, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.