HOWTO: Saving a Blob Property in ActiveX Control PadLast reviewed: July 2, 1997Article ID: Q167827 |
The information in this article applies to:
SUMMARYWriting out a blob property using PX_Blob() may not work when the control is hosted in an HTML page in ActiveX Control Pad. The blob property is not written out when the HTML page is saved. The solution is to throw an exception if PX_Blob returns FALSE as follows:
void CCircCtrl::DoPropExchange(CPropExchange* pPX) { ... if (!PX_Blob(pPX, _T("CircleOffset"), hOffset)) AfxThrowOleException (E_FAIL); ... } MORE INFORMATIONWhen it comes time to save out the control's properties, first ActiveX Control Pad calls the control's IPersistPropertyBag::Save() function which in turn calls DoPropExchange(). If PX_Blob() returns FALSE in DoPropExchange(), it throws an exception. The exception is caught by COleControl::XPersistPropertyBag::Save() and E_FAIL is returned. This prompts ActiveX Control Pad to call the control's IPersistStream::Save() function which can write out the blob property. The binary or blob property is saved in the <OBJECT> tag under the DATA attribute:
<OBJECT ID="Circ1" CLASSID="CLSID:2ACAA944-C431-11CF-8E0E-00AA00B91033" DATA="DATA:application/x-oleobject;BASE64,..."> </OBJECT> REFERENCESFor a sample control that writes out a blob property, please see the following article(s) in the Microsoft Knowledge Base:
ARTICLE-ID: Q137333 TITLE : DOC: How To Use the PX_Blob Function |
Keywords : AXSDKControls kbprg MfcOLE
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |