Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/168831

From BetaArchive Wiki
Knowledge Base

PRB: Older MFC OCX Controls Incompatible with Visual Basic 4.0

Article ID: 168831

Article Last Modified on 7/16/2004


  • Microsoft Visual Basic 4.0 Standard Edition
  • Microsoft Visual Basic 4.0 Professional Edition
  • Microsoft Visual Basic 4.0 Professional Edition
  • Microsoft Visual Basic 4.0 16-bit Enterprise Edition
  • Microsoft Visual Basic 4.0 32-Bit Enterprise Edition

This article was previously published under Q168831


Upon placing an OCX control on a Visual Basic form, the control will ASSERT or cause a General Protection Fault. The most common asserts are as follows:

  • Assertion Failure in CTLPROP.CPP Line 768
  • Assertion Failure in CTLMODUL.CPP Line 128

The control will continue to run in most cases, but will not function properly.


OLE Custom Controls (OCX Controls) created using the Microsoft Foundation Classes (MFC) that ship with Microsoft Visual C++ version 2.0 or earlier for 32-bit development and Microsoft Visual C++ 1.51 or earlier for 16-bit development will not work properly in Visual Basic 4.0.

The OCX standards and implementations have changed such that some minor incompatibilities have been created. The following MFC code raises the assertion when Visual Basic passes NULL as parameters:

       DISPID dispid,
       ASSERT_POINTER(lpcaCookiesOut, CADWORD);


Upgrade to Visual C++ 2.1 or higher for 32-bit development and Visual C++ 1.52 or higher for 16-bit development.


Microsoft has confirmed this to be a problem with Visual C++ version 2.0 and earlier for 32-bit development and Visual C++ 1.51 and earlier for 16-bit development.

(c) Microsoft Corporation 1997, All Rights Reserved. Contributions by Troy Cambra, Microsoft Corporation

Additional query words: kbMFC kbVBp400 kbdse kbDSupport kbVBp kbVC

Keywords: kbprb KB168831