Re: Getting a handle of the ATL composite Control Dialog

From: Igor Tandetnik (itandetnik_at_mvps.org)
Date: 12/07/04


Date: Tue, 7 Dec 2004 09:54:21 -0500


"dramesh" <rdeekonda@hotmail.com> wrote in message
news:1102412805.857681.74990@f14g2000cwb.googlegroups.com
> For a composite control object there is no CAxDialogImpl based class
> selected.

I don't know what you are talking about. Here are the relevant parts of
atlctl.h:

template <class T>
class CComCompositeControl : public CComControl< T, CAxDialogImpl< T > >
{...}

template <class T, class WinBase = CWindowImpl< T > >
class ATL_NO_VTABLE CComControl : public CComControlBase, public
WinBase
{...}

So, if you have

CMyControl : public CComCompositeControl<CMyControl>

your class is derived from CComCompositeControl<CMyControl> which is
derived from CComControl<CMyControl, CAxDialogImpl<CMyControl> > which
is derived from CComControlBase and CAxDialogImpl<CMyControl>. I don't
know how to make it any clearer.

> At the moment with the composite control object
> I am not able to access the control which is another activex control,
> a Formview Label control. I would like to set the caption on this
> label control and so I need to get the object representing this
> control. Using GetDlgItem() I only get a handle to the control
> window.

CWindow::GetDlgControl. Before you ask, your class _is_ indeed derived
from CWindow.

-- 
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