写了一个ActiveX控件, 有
BackImage、VirtualWidth、VirtualHeight
等属性,引用如下:<OBJECT ID="MainPane" CLASSID="CLSID:ECEA59B0-6D4C-478A-BAB1-A7BF33B30272"codebase = "sdxl.dll"WIDTH = "400" HEIGHT = "300"><PARAM NAME="BackImage" VALUE="http://young/bkImg2.jpg">
<PARAM NAME="VirtualWidth" VALUE="8000">
<PARAM NAME="VirtualHeight" VALUE="8000"></OBJECT>但ActiveX控件中BackImage、VirtualWidth、VirtualHeight等属性并没有变化!!!
请问怎样才能在控件显示之前初试化控件属性?<PARAM NAME= VALUE= >在什么时候起作用?
BackImage、VirtualWidth、VirtualHeight
等属性,引用如下:<OBJECT ID="MainPane" CLASSID="CLSID:ECEA59B0-6D4C-478A-BAB1-A7BF33B30272"codebase = "sdxl.dll"WIDTH = "400" HEIGHT = "300"><PARAM NAME="BackImage" VALUE="http://young/bkImg2.jpg">
<PARAM NAME="VirtualWidth" VALUE="8000">
<PARAM NAME="VirtualHeight" VALUE="8000"></OBJECT>但ActiveX控件中BackImage、VirtualWidth、VirtualHeight等属性并没有变化!!!
请问怎样才能在控件显示之前初试化控件属性?<PARAM NAME= VALUE= >在什么时候起作用?
基类中添加一个
-----------------
class YourObject :
......
IPersistPropertyBagImp<CYourObject> // add this
-----------------
BEGIN_PROP_MAP( YourObject )
PROP_ENTRY( "PropertyName", 1, CLSID_NULL )
END_PROP_MAP( )
但是我没用 ATL 怎么办,
我用的是 MFC ActiveX ControlWizard,
我要想 实现 IPersistPropertyBagImp 该怎么办
{
ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
COleControl::DoPropExchange(pPX);
// TODO: Call PX_ functions for each persistent custom property.
PX_String(pPX, _T("strDraw"), m_strMyProp, "default prop value"); // add this
}
随便说一句, ATL 中实现IPersistPropertyBag还要加一句 COM_INTERFACE_ENTRY(IPersistPropertyBag), 鲁班面前耍榔头, 呵呵呵