Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize


Call this function within your control's DoPropExchange member function to initialize a font property by converting a VBX control's font-related properties.

BOOL PX_VBXFontConvert( 
   CPropExchange* pPX, 
   CFontHolder& font  


Pointer to the CPropExchange object (typically passed as a parameter to DoPropExchange).


The font property of the OLE control that will contain the converted VBX font-related properties.

Nonzero if the exchange was successful; 0 if unsuccessful.

This function should be used only by an OLE control that is designed as a direct replacement for a VBX control. When the Visual Basic development environment converts a form containing a VBX control to use the corresponding replacement OLE control, it will call the control's IDataObject::SetData function, passing in a property set that contains the VBX control's property data. This operation, in turn, causes the control's DoPropExchange function to be invoked. DoPropExchange can call PX_VBXFontConvert to convert the VBX control's font-related properties (for example, "FontName," "FontSize," and so on) into the corresponding components of the OLE control's font property.

PX_VBXFontConvert should only be called when the control is actually being converted from a VBX form application. For example:

void CMFCActiveXControlCtrl::DoPropExchange(CPropExchange* pPX)
   ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));

   if (IsConvertingVBX())
      PX_VBXFontConvert(pPX, InternalGetFont());



Header: afxctl.h

Community Additions

© 2015 Microsoft