PRB: Component Gallery Unable to Import OLE ControlLast reviewed: June 14, 1996Article ID: Q152392 |
The information in this article applies to:
SYMPTOMSMicrosoft Developer Studio reports the error message:
Unable to import OLE control.Make sure the control contains a valid type library" when attempting to import an ActiveX control (OLE control).
CAUSEBy default, MFC applications use ID binding to call methods in ActiveX controls. Because of this behavior, Developer Studio checks to make sure that the version of the type library is the same as that of the control. If the versions are not the same, Developer Studio reports an error. This error is usually caused by incrementing the version of the ActiveX Control but not the version of the type library. For more information on ID binding, please see the following article in the Microsoft Knowledge Base:
ARTICLE ID: Q138138 TITLE : Three Binding Types (Late, ID, Early) Possible in VB for Apps RESOLUTIONMake sure that the version of the ActiveX control matches the version of its type library. In an MFC control, the version of the control is represented by constants found in the implementation file for the OLE control class:
const WORD _wVerMajor = 1; const WORD _wVerMinor = 0;In the same project, the version for the type library is represented by the version keyword in the .odl file for the OLE control:
[ uuid(AFCDB500-BB23-11CF-A685-00AA00A70FC2), version(1.0), helpstring("VersionTest OLE Control module"), control ] STATUSThis behavior is by design.
MORE INFORMATIONAn updated version of this control would have version identifiers similar to the following:
const WORD _wVerMajor = 2; const WORD _wVerMinor = 4; [ uuid(AFCDB500-BB23-11CF-A685-00AA00A70FC2), version(2.4), helpstring("VersionTest OLE Control module"), control ] |
Additional reference words: 4.00 4.10 import control
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |