HELP !!! Managed C++, WinForms and ATL !!!

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Dmitry (dmitry.pekerman_at_himmingbird.com)
Date: 11/01/04


Date: Mon, 1 Nov 2004 14:27:33 -0500

Hi,

I have a simple ATL based windows class:

class CApplicationBarHost : public CWindowImpl<CApplicationBarHost>
{
public:
    // construct host window
    CApplicationBarHost(CExchExt* pExchExt);
    virtual ~CApplicationBarHost();
    CExchExt* GetExchExt()const { return m_pExchExt; }
    HRESULT FinalConstruct();
    BOOL CreateApplicationHostWindows();
    DECLARE_WND_CLASS(APPLICATION_BAR_HOST_CLASS_NAME)

public:

    BEGIN_MSG_MAP(CApplicationBarHost)
        MESSAGE_HANDLER(WM_SIZE, OnSize)
        MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
    END_MSG_MAP()

protected:

    LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
    LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled);

private:
    CExchExt* m_pExchExt; // pointer to exchange extension
    gcroot<SearchBarCtrl __gc*> m_pSearchBarCtrl;
};

As you can see, there is SearchBarCtrl member in this class which is
WinForms user control.

The CApplicationBarHost should create the search bar control and manage it
via Managed C++ (resize, repositioning, close, show), so this class will be
ATL based host for WinForm control.

Here is my problem! In order to create Search bar control I have to say that
this control will be child of the host window. I don't know how to set
Inform parent via managed C++ code :(((

Could you help me here? This should be a common scenario for some
application that still have ATL based UI (in my case this is Outlook
exchange extension) and would like to embed some modern .NET WinForms
controls.

Thanks a lot for your help !



Relevant Pages

  • HELP !!! Managed C++, WinForms and ATL !!!
    ... LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& ... WinForms user control. ... ATL based host for WinForm control. ...
    (microsoft.public.dotnet.framework.interop)
  • HELP !!! Managed C++, WinForms and ATL !!!
    ... LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& ... WinForms user control. ... ATL based host for WinForm control. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • HELP !!! Managed C++, WinForms and ATL !!!
    ... LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& ... WinForms user control. ... ATL based host for WinForm control. ...
    (microsoft.public.dotnet.general)
  • HELP !!! Managed C++, WinForms and ATL !!!
    ... LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& ... WinForms user control. ... ATL based host for WinForm control. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • HELP !!! Managed C++, WinForms and ATL !!!
    ... LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& ... WinForms user control. ... ATL based host for WinForm control. ...
    (microsoft.public.dotnet.faqs)