Re: Activex control containment message reflection
<miikka.laakso@kaannos.com> wrote in message
news:1157447059.283973.41610@h48g2000cwc.googlegroups.com
I might have wrong aproach to this problem. The actual problem is that
I have dialog which has controls and I need to change the control
texts dynamically (translate the dialog controls from one language to
another).
This is currently done by relying on control IDs. ActiveX control
itself doesn't seem to have static control id whereas ActiveX host
has.
You are not supposed to communicate with an ActiveX control using window
messages, but only via exposed COM interfaces. E.g. a control may have a
Text or Caption or similar property.
Suppose you know that all ActiveX controls you use have Text property.
In your code that reassigns captions to all controls on the dialog,
check whether a particular ID hosts an ActiveX control: e.g. call
AtlAxGetControl - if it fails, you have a regular control you can send
WM_SETTEXT to, if it succeeds, you have the COM interface to an ActiveX
control. Query for IDispatch, use late binding to assign to Text
property.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925