Compiling an MFC executable file or a rule DLL using/clr
1, open the Project Properties dialog box by right-clicking the project in Solution Explorer and choosing Properties.
2, expand the node next to Configuration properties and select General. In the right-hand pane, under Project defaults, set common language runtime support to common language runtime support (/clr).
3. In the same pane, make sure that MFC is set to use MFC in shared DLLs.
4. Under Configuration Properties, expand the node next to "C + +" and select "General". Make sure that debug Information format is set to program database/ZI (instead of "/zi").
5. Under Configuration Properties, select "C + +" and select "code Generation". Make sure that the Run-time library is set to one of the multithreaded debug DLLs (/MDD) or multithreaded DLLs (/MD).
Second, in the code to reference the required DLL
#using <mscorlib.dll>
#using "DownloaFiles.dll"//Replace with required DLL file
using namespace System;
Using namespace admessage_test;//to the namespace used by classes in the DLL
Add #pragma managed before the DLL function calls the code
This is a manage and unmanage hybrid programming under MFC is a way to achieve.