HOWTO: Setting the Picture Property of an ActiveX ControlLast reviewed: July 7, 1997Article ID: Q146010 |
The information in this article applies to:
SUMMARYTo set the Picture property of an ActiveX control, you can use the Component Gallery to insert an ActiveX control into an AppWizard-generated application with control container support. If the control has a picture property, the wrapper classes generated by the Component Gallery will contain the SetPicture() and GetPicture() methods. The More Information section below contains details that explain how to use the picture property of an ActiveX control.
MORE INFORMATIONUsing the Microsoft Grid Control as an example, you can implement the SetPicture() and GetPicture() methods in the control classes provided by the Component Gallery by using this code:
void CGridCtrl::SetPicture(LPDISPATCH propVal) { SetProperty(0x15, VT_DISPATCH, propVal); } CPicture CGridCtrl::GetPicture() { LPDISPATCH pDispatch; GetProperty(0x15, VT_DISPATCH, (void*)&pDispatch); return CPicture(pDispatch); }It is not intuitively clear how to use these methods to get or set the picture property. The following steps show how to set the picture property of an ActiveX control successfully in an AppWizard-generated application. The particular control used in this example is the Microsoft Grid Control, and its picture property is being set to the toolbar bitmap provided by AppWizard.
REFERENCESFor Visual C++ 4.xx: OLE Control Containers: Programming OLE Controls in an OLE Control Container - Visual C++ Books Online, MFC Encyclopedia. OLE Controls: Using Pictures in an OLE Control - Visual C++ Books Online, MFC Encyclopedia. For Visual C++ 5.0: ActiveX Control Containers: Programming ActiveX Controls in an ActiveX Control Container - Visual C++ Books Online, Visual C++ Programmer's Guide. ActiveX Controls: Using Pictures in an ActiveX Control - Visual C++ Books Online, Visual C++ Programmer's Guide.
|
Additional query words: ocx
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |