KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q163454: PRB: Problem Using Visual C++ v4.2b OLE Controls in VB v4.0

Article: Q163454
Product(s): Microsoft C Compiler
Version(s): winnt:4.2,5.0
Operating System(s): 
Keyword(s): kbole kbCtrl kbMFC kbVC420 kbVC500 kbGrpDSMFCATL
Last Modified: 31-JUL-2001

-------------------------------------------------------------------------------
The information in this article applies to:

- Microsoft Visual C++, 32-bit Enterprise Edition, versions 4.2, 5.0 
- Microsoft Visual C++, 32-bit Professional Edition, versions 4.2, 5.0 
-------------------------------------------------------------------------------

SYMPTOMS
========

If you create an Appwizard-generated control using Visual C++ version 4.2b or
5.0, you may not be able to use that control on some Windows 95 or Windows NT
3.51 machines. Two problems may occur: problems registering the control with the
system registry, or problems loading the control for use in the Visual Basic 4.0
development environment. If you try to load the control using the Custom
Controls dialog box in Visual Basic 4.0, you may see the error message "Error in
loading DLL."

CAUSE
=====

ActiveX controls built with the Visual C++ 4.2b technology update or Visual C++
5.0, have dependencies to the newer version of Oleaut32.dll. If that DLL is
missing, you may have problems registering and using the control. With Visual
Basic, the type information generated for an ocx control implicitly imports type
information that is contained in a file called Stdole2.tlb. If that type
information is not on the target machine, Visual Basic reports an error loading
the DLL into the Visual Basic development environment.

RESOLUTION
==========

The Help topic called "OLE Controls, Distributing OLE Controls" lists the
following files that you should redistribute with an MFC ActiveX control:

  Mfcx0.dll      MFC DLL (ANSI)
  Mfcx0u.dll     MFC DLL (Unicode)
  Msvcrtx0.dll   C run-time libraries
  Olepro32.dll   OLE property frame and standard types support
  Regsvr32.exe   Control registration utility

In addition to these files, you should also redistribute Stdole2.tlb and
Oleaut32.dll. Both of these files are version 2.20.4054 and were installed by
the Visual C++ 4.2b technology update. You should install these files in the
target machine's system directory. This allows the control to function correctly
on Windows 95 and Windows NT 3.51.


Note that the Oleaut32.dll and Stdole2.tlb can be distributed per the Visual C++
5.0 redistribution license agreement.


(c)Microsoft Corporation 1996, All Rights Reserved. Contributions by Michael
Dice, Microsoft Corporation
(c) Microsoft Corporation 1996, All Rights Reserved.
Contributions by Michael Dice, Microsoft Corporation


Additional query words:

======================================================================
Keywords          : kbole kbCtrl kbMFC kbVC420 kbVC500 kbGrpDSMFCATL 
Technology        : kbVCsearch kbAudDeveloper kbVC420 kbVC500 kbVC32bitSearch kbVC500Search
Version           : winnt:4.2,5.0
Issue type        : kbprb

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.