Solved

1500 points! MDI application with docking window

Posted on 2001-06-14
13
404 Views
Last Modified: 2013-11-20
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
Comment
Question by:Wakizashi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
13 Comments
 
LVL 42

Expert Comment

by:sedgwick
ID: 6190705
why CreateQindowEx and not just Create()?
0
 
LVL 1

Author Comment

by:Wakizashi
ID: 6190730
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
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6190816
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!

 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6190917
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
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6194583
can we help more?
0
 
LVL 1

Author Comment

by:Wakizashi
ID: 6194601
Please wait. I need a few days to find out that everything is okay or not.
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6195247
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
 
LVL 1

Author Comment

by:Wakizashi
ID: 6201279
That's what I'm looking for but it looks like I need your code. Please post it.
0
 
LVL 9

Accepted Solution

by:
ShaunWilde earned 300 total points
ID: 6201595
> That's what I'm looking for but it looks like I need your code. Please post it.

your email please :)
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6201600
however everything you need is on this page
0
 
LVL 9

Expert Comment

by:ShaunWilde
ID: 6201615
except that I fogot to mention that you need to add AfxEnableControlContainer(); to InitInstance of you CWinApp derived class
0
 
LVL 1

Author Comment

by:Wakizashi
ID: 6201624
My E-Mail address is psycho@ag-e.hu.

Thank You in advice.
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9484696
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 47
Need to retreive data from .TFS file exported by DVR 8 244
Thin secure Windows 10 5 107
Not needed 13 129
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question