PRB: PropertySheet Fails When Changing from VC++ 5.0 to VC++ 6.0 (197631)
The information in this article applies to:
- Microsoft Win32 Application Programming Interface (API)
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q197631 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- On the Project menu, click settings.
- Click the C/C++ tab.
- Select All Configurations in the Settings For combo box on the left.
- Select the Preprocessor item in the Categories combo box on the right.
- Add the following directive in the Preprocessor Definitions edit box:
- 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.
| Modification Type: | Major | Last Reviewed: | 4/9/2004 |
|---|
| Keywords: | kbprb kbPropSheet KB197631 |
|---|
|