Re: VC2005 - GetDlgItem & windowless ActiveX controls

On Apr 10, 1:07 pm, Stodge <sto...@xxxxxxxxx> wrote:
On Apr 10, 12:22 pm, Stodge <sto...@xxxxxxxxx> wrote:

On Apr 10, 12:03 pm, Stodge <sto...@xxxxxxxxx> wrote:

On Apr 10, 10:52 am, Ajay Kalra <ajayka...@xxxxxxxxx> wrote:

On Apr 10, 10:34 am, Stodge <sto...@xxxxxxxxx> wrote:

I'm porting an app developed under VC6 to VC2005 and I'm having
trouble resolving some runtime assertions/crashes. My first question
is, is it possible to call GetDlgItem on a windowless control? It
looks like the answer is NO, because obviously it returns a window
handle, which in my case is NULL.

It wouldnt make any sense as you said because there is no window so
its mute to request a control on a non-existant window. Why dd this
even come up? Perhaps there is a hidden window or may be its in the
contex of a container window.


Thanks Ajay. As you point out it's rather odd, but I need access to
the underlying class, which is derived from CDialog. It contains
numerous methods I need to call - no MVC here unfortunately.

I found this:

COleControlContainer *cont;
cont = dialog->GetControlContainer();

But I don't think it really helps.

Thanks again.

I meant CWnd, not CDialog. I'm having a hard time getting my head
around this.

What I don't understand is why this worked when built in VC6 but not
in VC2005.

I dont understand how it worked if its not a window.
COleControlContainer is derived from a CCmdtarger and not a CWnd, so
it cant have this method. Can you post the code which worked in VC6
and not now. In your code above, you do have access to dialog though.