Microsoft KB Archive/228530

= BUG: "Unhandled exception in EXENAME.EXE(OLE32.DLL): 0xC0000005: Access Violation" when you use an ATL Composite control on computers without Visual C++ installed =

Article ID: 228530

Article Last Modified on 5/3/2005

-

APPLIES TO

 Microsoft ActiveX Template Library 3.0, when used with:  Microsoft Visual C++ 6.0 Enterprise Edition

 Microsoft Visual C++ 6.0 Professional Edition

 Microsoft Visual C++ 6.0 Standard Edition 

-

<div class="notice_section">

This article was previously published under Q228530

<div class="symptoms_section">

SYMPTOMS
When you create an ATL Composite control with other ActiveX controls embedded in it, you may get an access violation in Ole32.dll. Usually, a message box is displayed with the following error message:

Unhandled exception in EXENAME.EXE(OLE32.DLL): 0xC0000005: Access Violation

You may also see a Web Browser control displayed with the following message, instead of the child ActiveX control:

This page cannot be displayed.

Usually, these controls work correctly on computers with Visual C++ installed, but they do not work on computers without Visual C++ installed.

<div class="cause_section">

CAUSE
The ActiveX controls embedded in the Composite control may be licensed controls. Composite controls and ATL containment do not directly support creation of licensed controls.

When the Composite control attempts to create a licensed control on a computer without providing a run-time license, the Composite control fails with an HRESULT of 0x80040112 (CLASS_E_NOTLICENSED - Class is not licensed for use). The default handling of this failure creates a Web Browser control; the default handling also tries to initialize the Web Browser control with persisted properties of the licensed control. This mismatch of properties may result in an access violation in the Ole32.dll file.

If there is no access violation, the Web Browser control attempts to navigate to a URL that is the string representation of the licensed control's CLSID. This action results in the error message "The page cannot be displayed."

<div class="resolution_section">

RESOLUTION
Download the Atlhostlic.h file (contained in ATLHostLic.exe and a modified version of the Atlhost.h file), which allows licensed controls inserted on Composite controls to work correctly. Copy this file to your project directory and change all #include statements that reference the original Atlhost.h file to reference the Atlhostlic.h file.

Note that 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 may not work when creating ActiveX controls dynamically by using the Win32 CreateWindow function with 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

<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

<div class="moreinformation_section">

MORE INFORMATION
The following file is available for download from the Microsoft Download Center:

ATLHostLic.exe

Release Date: Apr. 13, 2000

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to Obtain Microsoft Support Files from Online Services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.

Steps to Reproduce Behavior

 * 1) Create an ATL DLL project and insert a Composite control object in the project.
 * 2) In the Composite control dialog box, insert the Microsoft TreeView Control.
 * 3) Build and test the control on any container.
 * 4) Test the control on a computer without Visual C++ installed and you should see the error described in the "Symptoms" section.

Additional query words: C0000005 ATLHostLic proxy error 11004 80040112 "no data record is available" kbATL 0x80040112 0xC0000005 license host atlhost.h hosting

Keywords: kberrmsg kbhowto kbdownload kbtshoot kbbug kbnoupdate kbinprocsvr kbqfe kbpatch kbcontainer kbfile kbctrlcreate kblicensing kbpending atdownload KB228530

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.