hwnd question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

hwnd question

Mikael Svane-2
I am wrapping an ActiveX control that needs the hwnd of the window that is
is placed inside. As I recall, I get the hwnd simply by sending #asParameter
to the Shell that the view belongs to, but I am getting strange error
messages from the control. Is #asParameter the correct way of getting the
hwnd? Before I ask the manufacturer of the control I want to make sure that
I haven't made a simple error.

Best regards,
Mikael Svane
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: hwnd question

Blair McGlashan
Mikael

You wrote in message news:a122s4$npk84$[hidden email]...
> I am wrapping an ActiveX control that needs the hwnd of the window that is
> is placed inside. As I recall, I get the hwnd simply by sending
#asParameter
> to the Shell that the view belongs to, but I am getting strange error
> messages from the control. Is #asParameter the correct way of getting the
> hwnd? ...

That would depend on whether you have embedded the control directly in the
shell, which seems unlikely?

You must send #asParameter to relevant View, not the Presenter.

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: hwnd question

Mikael Svane-2
Blair,

>
> You must send #asParameter to relevant View, not the Presenter.
>

What I thought was that since Presenter>>asParameter (which Shell inherits)
is defined as:

Presenter>>asParameter
        ^ self view asParameter

and the control needs the hwnd of it's parent window, which should be the
Shell, self asParameter would be enough? Perhaps I am misunderstanding
something here?

Regards,

Mikael
[hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: hwnd question

Bill Schwab-2
Mikael,

> Presenter>>asParameter
>         ^ self view asParameter
>
> and the control needs the hwnd of it's parent window, which should be the
> Shell, self asParameter would be enough? Perhaps I am misunderstanding
> something here?

I think Blair is suggesting that a sub-presenter of the shell might be a
more appropriate receiver.  If you're trying to get the handle for the
immediate parent view, then you'll need to send #asParameter to that view or
its presenter, not to a parent further up the line (with the shell being the
most removed).

Have a good one,

Bill

--
Wilhelm K. Schwab, Ph.D.
[hidden email]