Visual Studio 11 provides the ability to do Unit Testing Native C++ Applications with a new C++ unit testing framework shipping with VS 11.
So the C++ developers no longer need to use the “/clr” flag or fall back to 3rd party frameworks.
To learn more about native unit testing in Visual Studio 11, please visit MSDN.
This article gives the ability to make MFC dialogs expand or contract. The CExpandContractHelper simplifies the process to expand or contract MFC Dialog.
There are 4 Approaches to accomplish this.
Approach 1. (Explicit) P/Invoke
Approach 2. Dynamic P/Invoke
Approach 3. Implicit P/Invoke (Use a C++/CLI wrapper)
Approach 4. Convert C++ DLL to a COM server, and call it from .NET code through .NET-COM interop
I don’t like to reinvent the wheel so please go through msdn forum answer here
The CWinFormsControl class provides the basic functionality for hosting of a Windows Forms control.
For more information on using Windows Forms, see below MSDN articles
This step-by-step article describes how to call a managed DLL from native C++ code.
Click me to take to the Microsoft KB article.
In Visual Studio 2010, the size of statically-linked MFC applications grew substantially. Pat Brenner, a developer on the Visual C++ Libraries team in his article explains how to reduce the size.
Read more about this here
Use the CWnd::CenterWindow method to center the dialog. Write CenterWindow() method in the OnInitDialog() method.