SAMPLE: MFCVBX Implements a VBX Control Using MFCLast reviewed: July 18, 1997Article ID: Q123377 |
1.00 1.50
WINDOWS
kbprg kbfile kbinterop kbcode
The information in this article applies to:
SUMMARYNOTE: 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. Download MFCVBX.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:
MORE INFORMATIONThe 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 reference words: kbinf CVBControl CDK 1.00 1.50 2.00 2.50
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |