• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

1500 points! MDI application with docking window

I wrote an MFC MDI application wichone can load (CreateWindowEx) controls (ActiveX) by they ProgID and shows them.
My problem is I need to dock/undock these controls (user can do this by mouse).

I need a complete code for that, not just tips and tricks. A full code from the beginning: CreateWindowEx, etc, etc in MFC.
I can't accepts codes that are not works well.

I will give 1500 points for the perfect answer. I can only give it in 5 questions (300*5).

Wakizashi
0
Wakizashi
Asked:
Wakizashi
1 Solution
 
Meir RivkinFull stack Software EngineerCommented:
why CreateQindowEx and not just Create()?
0
 
WakizashiAuthor Commented:
Because I create child windows from control on the harddrive. I create instances by ProgID's. The second part of my answer is: because I want to use CreateWindowEx.

Waiting for an answer...
0
 
ShaunWildeCommented:
have a look at http://www.codetools.com/docking/sizecbar.asp - this shows how to create a docking window - then you can just host your controls inside it
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ShaunWildeCommented:
I then modifiy

int CMyBar::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
     if (baseCMyBar::OnCreate(lpCreateStruct) == -1)
          return -1;

     SetSCBStyle(GetSCBStyle() | SCBS_SHOWEDGES | SCBS_SIZECHILD);

     // older versions of Windows* (NT 3.51 for instance)
     // fail with DEFAULT_GUI_FONT
     if (!m_font.CreateStockObject(DEFAULT_GUI_FONT))
          if (!m_font.CreatePointFont(80, "MS Sans Serif"))
               return -1;

     m_wndBrowser.CreateControl(CLSID_WebBrowser,"",WS_CHILD|WS_VISIBLE,CRect(0,0,50,50),this,100);
     LPUNKNOWN lpUnk = m_wndBrowser.GetControlUnknown();
     IWebBrowser2* pBrowserApp;
     HRESULT hr = lpUnk->QueryInterface(IID_IWebBrowser2, (void**) &pBrowserApp);

     BSTR url=CString("www.experts-exchange.com").AllocSysString();
     pBrowserApp->Navigate(url,NULL,NULL,NULL,NULL);
     ::SysFreeString(url);
     pBrowserApp->Release();

     return 0;
}

and add CWnd m_wndBrowser; to the class header
0
 
ShaunWildeCommented:
can we help more?
0
 
WakizashiAuthor Commented:
Please wait. I need a few days to find out that everything is okay or not.
0
 
ShaunWildeCommented:
that's okay - just post if you have problems - I can send you my code - I just modded the sample they had - but I dunno if that is what you were looking for
0
 
WakizashiAuthor Commented:
That's what I'm looking for but it looks like I need your code. Please post it.
0
 
ShaunWildeCommented:
> That's what I'm looking for but it looks like I need your code. Please post it.

your email please :)
0
 
ShaunWildeCommented:
however everything you need is on this page
0
 
ShaunWildeCommented:
except that I fogot to mention that you need to add AfxEnableControlContainer(); to InitInstance of you CWinApp derived class
0
 
WakizashiAuthor Commented:
My E-Mail address is psycho@ag-e.hu.

Thank You in advice.
0
 
Roshan DavisCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by : ShaunWilde

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Roshan Davis
EE Cleanup Volunteer
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now