all groups > dotnet interop > february 2006 >
You're in the

dotnet interop

group:

How do i create a mixed mode DLL with MFC, ATL, CLR


How do i create a mixed mode DLL with MFC, ATL, CLR n.prabhakar NO[at]SPAM gmail.com
2/10/2006 12:50:03 AM
dotnet interop: Hi,

How do i create a mixed mode DLL which supports all three - MFC, ATL
and CLR.

I have gone through the link <a
href="http://msdn2.microsoft.com/en-us/library/ms235211.aspx">http://msdn2.microsoft.com/en-us/library/ms235211.aspx</a>

I have tried various combinations of the steps described on this page,
but they desribe only either MFC, or ATL, not both together.

I am having some problems with the header files and am not sure what to
put in the STDAFX.h file. Do all the ATL/MFC header declarations go
into this file?

I first got my DLL to compile only with classes that need ATL. Then I
declared the header that uses MFC classes as well. When i did this, i
got the <Windows.h> is already included error.

WINDOWS.H already included. MFC apps must not #include <windows.h>

I tried certain things like creating an MFC DLL, an ATL DLL and copying
the stdafx.h declarations from all of them and also the various options
mentioned in the link above, but without success.

I will be able to proceed even if i am able to include ATL and MFC in
the same project, but did have much with this either.
RE: How do i create a mixed mode DLL with MFC, ATL, CLR dnebeker
2/25/2006 1:52:27 PM
Before you go to far, make sure you're using VC 2005 and .NET 2.0. If you
are using .NET 1.1 there are deadlocks when using mixed-mode DLL (search for
"Mixed DLL Loading Problem" on MSDN, and there are many other articles about
it as well)

[quoted text, click to view]
AddThis Social Bookmark Button