仅供参考,没有用过。
考虑到设计时licensing和运行时licensing的不同,当设计时licensing时,包容器会以一个空值bstrKey传给IClassFactory2::CreateInstanceLic
(
IUnknown* pUnkOuter, //Pointer to controlling unknown of
// aggregated object
IUnknown* pUnkReserved, //Unused. Must be NULL.
REFIID riid, //Reference to the identifier of the
// interface
BSTR bstrKey, //License key provided by
// IClassFactory2::RequestLicKey
void** ppvObject //Address of output variable that receives
// the interface pointer requested in riid
);
如果重载这个方法,并判断bstrKey的值来设一个flag,通过判断flag在OnDraw里写不同的代码来实现你的要求。