在设计模式中与运行模式中,属性却无法保存,导致辛苦设计的参数无法使用
起始只要设置属性页,持久化属性就行
首先
void CBlack_control_chooseCtrl::DoPropExchange(CPropExchange* pPX)
{
//默认代码
ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
COleControl::DoPropExchange(pPX);
//增加的代码,将属性持久化
PX_Color(prop,_T("tranColor"),tranColor,RGB(255,0,0));
}
//注意,在属性更改后要通知属性表
void setColor(COLORREF color)
{
tranColor=color;
BoundPropertyChanged(0x1);
}
参考:http://bbs.pfan.cn/post-242827.html
http://blog.csdn.net/liufei_learning/article/details/5082373