How To Assign the ActiveX Control LPDispatch Property in VB 4ID: Q153881
|
It is often useful for one ActiveX (OLE) Control to hold an LPDispatch
pointer to another control on the same Visual Basic form. The first control
can use this pointer to call methods and/or access properties on the second
control using OLE Automation. This article demonstrates how to create a
property of type LPDispatch on an MFC ActiveX Control, and how to properly
set this property to another control's IDispatch pointer in Visual Basic.
NOTE: Although this article discusses properties of type LPDispatch, this
information also applies to properties of type LPUnknown.
Follow these steps to add a property to a custom ActiveX control that
is to hold another control's IDispatch pointer:
'Set the control's DispatchProp property to the DBCombo OLE control on
'this form.
Set MyOcx1.DispatchProp = DBCombo1
. . .
. . .
'Don't forget to set this property to Nothing when finished
Set MyOcx1.DispatchProp = Nothing
For more information, please see the following article in the Microsoft Knowledge Base:
Q141414 How to Enumerate OLE and VB Controls from an OLE Control Visual C++ Books Online, Programming with MFC Encyclopedia.
Additional query words: 4.00 4.10 4.20 kbinf
Keywords : kbole kbCtrl kbMFC kbVC
Version : 4.00 4.10 4.20
Platform : NT WINDOWS
Issue type :
Last Reviewed: July 28, 1999