开发者

Is it possible to figure out when the switching between design mode and run mode takes place in ActiveX?

I have programmed an ActiveX in MFC. When placed inside a co开发者_开发知识库ntainer, I can use COleControl::AmbientUserMode() to determine if it's now in design mode or run mode. What I want is to find the specific point when the switching between design and run modes takes place. Is there any virtual method or message handler when that happens?

Thanks in advance.


Well, I have figured that out. The following interface member is called when an ambient property is changed.

HRESULT IOleControl::OnAmbientPropertyChange([in] DISPID dispiD)

If you switch between design and run modes, OnAmbientPropertyChange is called with dispid value of DISPID_AMBIENT_USERMODE. So you can override it to implement your own code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜