BUG: Control Properties Depersist Incorrectly When They Are Hosted in ATL (280510)
The information in this article applies to:
- The Microsoft Active Template Library (ATL) 3.0, when used with:
- Microsoft Windows Millennium Edition
This article was previously published under Q280510 SYMPTOMS When you create an ATL dialog, or an ATL Composite control,
with other ActiveX Controls embedded in it, the control properties that you set
at design time in the Dialog Editor load correctly on computers running Windows
2000 or Windows NT, but do not load correctly on computers running Windows 95,
Windows 98, or Windows Millennium Edition (Windows Me). CAUSE In AtlAxWindowProc:
if (lpCreate && lpCreate->lpCreateParams)
nCreateSize = *((WORD*)lpCreate->lpCreateParams);
lpCreateParams is the address of a SHORT value that specifies the size, in
bytes, of the window creation data. The value is immediately followed by the
creation data. This value is valid only on computers running Windows 2000 or
Windows NT (for more information, see the CREATESTRUCT documentation). Therefore, the ActiveX Control is initialized
correctly on computers running Windows 2000 or Windows NT. However, on
computers running Windows 95, Windows 98, or Windows Me, the data starts at lpCreateParams because the SHORT value is not valid, and the initialization does
not work. RESOLUTION Download the Atlhostlic.h file (contained in
ATLHostLic.exe). This is a modified version of the Atlhost.h ATL header file.
This modified header permits ATL control hosting to work correctly on computers
running Windows 95, Windows 98, or Windows Me. Copy this file to your project
folder, and then change all of the #include statements that reference the original Atlhost.h file to
reference the Atlhostlic.h file. NOTE: This solution works only for debug and minimum-dependency
builds. All changes from the original Althost.h file are marked with the
comments "BEGIN CHANGE" and "END CHANGE." This solution will not
work when you create ActiveX Controls dynamically by using the Win32 CreateWindow function that has the control properties passed in as the last
parameter. For
additional information, click the article number below to view the article in
the Microsoft Knowledge Base: 218442 HOWTO: Dynamically Add ActiveX Controls to ATL Composite Control
STATUSMicrosoft has confirmed that this is a bug in the Microsoft
products that are listed at the beginning of this article.
REFERENCESFor
additional information, click the article number below to view the article in
the Microsoft Knowledge Base: 228530 BUG Access Violation in Ole32.dll When Creating an ATL Composite Control
Modification Type: | Minor | Last Reviewed: | 12/21/2004 |
---|
Keywords: | kbdownload kbdownload kbbug kbpending KB280510 |
---|
|