SAMPLE: MFCVBX Implements a VBX Control Using MFC

ID: Q123377


The information in this article applies to:


SUMMARY

NOTE: You need VBX Control Development Kit to create a VBX control. The VBX Control Development Kit comes with the Professional Edition of Visual Basic and with the Visual Control Pack. But it does not come with Visual C++.

The MFCVBX sample demonstrates how to write a VBX control using MFC.


MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

~ MFCVBX.EXE

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

Q119591 How to Obtain Microsoft Support Files from Online Services
The sample implements a VBX control as a _USRDLL. This enables the sample to be used by MFC and Visual Basic applications. Creating a VBX control as an extension DLL (_AFXDLL) would restrict the VBX making it usable only by MFC applications.

It is important that the MODEL, Property, and Event structures be declared NEAR in order for this control to work correctly. It is also important that you create an object of a class derived from CWinApp.

Depressing the right button inside the control when your application is executing will display a message box indicating the point of your mouse click.

You can use AppStudio to set the properties of this control. You can use ClassWizard to manipulate the CVBCtlWnd class if needed.

For more information on _USRDLLs refer to MFC TechNote #11 and the MFC sample DLLTRACE.

The VBAPI.H and VBAPI.LIB Include files are not included with this sample. In order to build the sample, you will need these files, which are included with the VBX Control Development Kit (see the NOTE above).

Additional query words: kbinf CVBControl CDK kbfile


Keywords          : kbsample kb16bitonly kbMFC kbVBX kbVC kbVC100 kbVC150 
Version           : 1.00 1.50
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: July 27, 1999