Moving MFC ext DLLs to .NET

R

Ramanujam R

I'm trying to move a portion of our application to .NET from VC6 - the
idea was to let most of the older DLLs still be compiled with VC6. As
a
first step just opened the project with VC7, and leaving everything
unmanaged, just tried to get a build.

After fixing some compile problems, we ran into problems linking with
DLLs
that were MFC dependent. (something to do with CString-s that are
templates
in VC7). Is the only way to recompile these dependencies with VC7? I
attempted this, but there were some compiler errors which I'm still
trying
to figure out. Also, will these recompiled versions be backward
compatible with VC6 compiled apps?

I couldn't find anything on MSDN. Searched on these newgroups found
that I wasn't the only one having problems - there were some replies
that mention
something about linking MFC statically, etc.

Any experiences/pointers would be greatly appreciated...

Thanks,
 
R

Ramanujam R

Thanks...

Carl Daniel said:
No. VC6 MFC and VC7 MFC don't mix.


If you need to mix VC6 and VC7-compiled DLLs in a single process, you need
to be very careful about your DLL interfaces. Generally, any interface
which includes MFC, ATL or STL classes will not be compatible. An interface
that uses your own classes exclusively will probably be compatible, but you
also need to be sensitive about runtime library differences: There's no way
to get a VC6 DLL and a VC7 DLL to share a single runtime heap, so it's
essential that your DLLs expose "complete" resource management interfaces,
with both allocation and deallocation for all objects that cross the DLL
boundary.

-cd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top