开发者

ActiveX and HWND of COleControl [duplicate]

开发者 https://www.devze.com 2023-04-05 10:26 出处:网络
This question already has开发者_如何学运维 an answer here: Closed 11 years ago. Possible Duplicate:
This question already has开发者_如何学运维 an answer here: Closed 11 years ago.

Possible Duplicate:

Why does GetSafeHwnd() return zero in an ActiveX control?

I am building a ActiveX communication component. I have a class which actually does every communication things for me. I have to instantiate this class with a Hwnd handle in order to let the class pass messages to its owner (the owner is derived from COleControl).

But when I use the ActiveX control from an app build with delphi the handle returned by this->GetSafeHwnd(); returns NULL. ( 'this' pointer is an instance of the class which I derrived from COleControl)

Does anybody have a solution for this?


Possibly your control allows windowless activation. Such control can be rendered inside of a parent window without having its own window. Different containers may create this control as window or windowless.

Disable "Allows windowless activation" property of the control. However, this can reduce the control rendering performance. You can create another invisible window for internal communication, and still allow windowless activation.

Details: see COleControl::GetControlFlags and windowlessActivate flag.

0

精彩评论

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