Microsoft KB Archive/160921

= PRB: Error Using OLE Controls =

Article ID: 160921

Article Last Modified on 10/15/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition

-



This article was previously published under Q160921



SYMPTOMS
When you try to use one of the ActiveX controls included with Visual FoxPro 5.0, an OLE error occurs.

The following example is typical of the error message (but not the only wording that may be displayed):

OLE Idispatch exception code ) from TreeView Control: Imagelist must be initialized before it can be used.



CAUSE
The Visual Basic Control Creation Edition 5.0 beta was installed on your system after Visual FoxPro 5.0 was installed.

There is an incompatibility between Visual FoxPro 5.0 and the version of the ComCtl32.ocx that comes with Visual Basic Control Creation Edition (VBCCE) 5.0 beta.



RESOLUTION
Follow these rules when you install the Visual Basic Control Creation Edition 5.0 beta:

 Copy the existing Visual FoxPro 5.0 Comctl32.ocx (should be dated 8/21/96) to a file called Comctl32.vfp. Install Visual Basic Control Creation Edition 5.0 beta (or any Visual Basic 5.0 beta). Copy the newly installed Comctl32.ocx to Comctl32.vb. Copy the Visual FoxPro Comctl32.vfp to Comctl32.ocx. Re-register the Visual FoxPro Comctl32.ocx control by executing the following in a MS-DOS window:

regsvr32 comctl32.ocx



If you have already installed the Visual Basic Control Creation Edition 5.0 beta, you should rename the Visual Basic version of the .ocx file, and then re-install the Visual FoxPro version of ComCtl32.ocx. The steps to re-install the ActiveX control are as follows:


 * 1) Run the Setup.exe program in the root directory of Visual FoxPro 5.0.
 * 2) Choose "Add/Remove Components."
 * 3) Select "Professional Applications" and choose "Change Option."
 * 4) Select "ActiveX Controls" and clear the check box to remove the ActiveX controls.
 * 5) Click "OK" to complete the removal (setup).
 * 6) Once the setup is completed, repeat the above steps, but mark the check box for "ActiveX Controls" to re-install ComCtl32.ocx and the other controls.
 * 7) From the Visual FoxPro menu, choose "Tools/Options." Choose the "Controls" tab and the "ActiveX Controls" option button, and ensure that the check boxes for the controls in ComCtl32 are selected. These controls are shown in the "ActiveX Controls Overview" Help topic.

Additional query words: kbdsd vfoxwin

Keywords: kbenv KB160921

-

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

© Microsoft Corporation. All rights reserved.