BUG: “Unhandled exception in EXENAME.EXE(OLE32.DLL): 0xC0000005: Access Violation” when you use an ATL Composite control on computers without Visual C++ installed
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 ViolationYou 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.
Resolution
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 0×80040112 (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.”
