Microsoft KB Archive/123377

{|
 * width="100%"|

MFCVBX Implements a VBX Control Using MFC

 * }

Q123377

-

The information in this article applies to:


 * The Microsoft Foundation Classes (MFC), used with:
 * Microsoft Visual C++, versions 1.0, 1.5

-

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 files are available for download from the Microsoft Download Center:

Mfcvbx.exe

For additional information about how to download Microsoft Support files, click the article number below to view the article in the Microsoft Knowledge Base:

"Q119591 How to Obtain Microsoft Support Files from Online Services" Microsoft used the most current virus detection software available on the date of posting to scan this file for viruses. Once posted, the file is housed on secure servers that prevent any unauthorized changes to the file.

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 : kbfile kbsample kb16bitonly kbMFC kbVBX kbVC kbVC100 kbVC150

Issue type :

Technology : kbAudDeveloper kbMFC