This would be so unpleasant head-breaking exercise with so little use so I would advise you to avoid it by all means. The result would be ugly, absolutely non-portable and very hard to maintain.
First, there is not way to insert a MFC windowed control in a WPF host control. Generally, WPF has almost nothing to do with windows. WPF controls are not windows, with rare exclusion.
So, first you need to integrate WPF with
System.Windows.Forms
which can provide controls for hosting some external Windows. So, you need to use WPF to
System.Windows.Forms
interoperation layer. Read
Walkthrough: Hosting a Windows Forms Control in WPF:
http://msdn.microsoft.com/en-us/library/ms751761.aspx[
^]. The solution is to use
System.Windows.Forms.Integration.WindowsFormsHost
, see
http://msdn.microsoft.com/en-us/library/system.windows.forms.integration.windowsformshost.aspx[
^].
Now, you can insert some
System.Windows.Forms
control, such as
Panel
, in WPF window. When you do it, you can PInvoke Windows API
SetParent
using the panel handle and the handle of you MCF window. See
http://msdn.microsoft.com/en-us/library/ms633541%28v=vs.85%29.aspx[
^]. You will need to adjust MFC window styles the way it behaves nicely as a child window of the panel. One problem is that the panel cannot know that it is a parent of some external window, from .NET standpoint.
When you have all that, you have a change to build a monster using WPF,
System.Windows.Forms
and MFC at the same time. Don't think it will help you much. The biggest problem is MFC. How to organize interoperation between native MFC code and .NET? The only way is P/Invoke; and you cannot pass any classes. Basically, you can only P/Invoke static functions with primitive types common between .NET and unmanaged code. On this level, it is extremely difficult to organize complex cooperation between component which is usually required by UI development.
Now, "docking MDI". In a strict sense of MDI, there is no docking support or anything like that. This is some old and discouraged UI design which you don't really know. Also, MDI is not supported by WPF (thanks goodness :-)).
By "MDI" you probably mean something else — modern interface with multiple docking containers (none of them are windows or controls). You can try AvalonDock; see
http://avalondock.codeplex.com/[
^].
Overall, I don't see any sense in this activity. Chances are, you can upgrade your MFC application to your new requirement without using .NET
and write a brand new .NET application doing the same using less effort and development time than you would take for your "integration" project. I'm not sure you will complete such project at all.
Seriously, think if you can avoid it.
—SA