For the moment my MFC source code is compiled using VC++ 6.
Thanks to Microsoft, I cannot compile it using /clr.
I don't want to migrate because it cost a lot of efforts and because VS2005
does not generates the same exe. The exe will be bigger, slower to execute,
and not compatible with default libraies installed with Win98 and Win2000 (I
will need a new crt, mfc8.1 and atl8.1).
Also VS2005 is much slower to use and to compile than VC++6.
VS2005 is good only for .NET and specific C++ dev (like smart phone dev).
> >I have a lost of C# classes from many DLLs to use from my legacy C++ EXE
> > application.
> > Is there a generator that would use reflexion (for example) to generate a
> > C++/CLI wrapper.
>
> Can you not just compile with /clr and use the classes directly?
Pixel.to.life - 03 Aug 2007 01:04 GMT
> For the moment my MFC source code is compiled using VC++ 6.
> Thanks to Microsoft, I cannot compile it using /clr.
[quoted text clipped - 14 lines]
>
> - Show quoted text -
"I have a lost of C# classes from many DLLs to use from my legacy C++
EXE application."
I dont understand this statement. Your legacy C++ EXE aplication has a
lots of C# code???
Regardless, I faced a situation where I wanted to wrote GUI in a
managed forms application; and my core libraries were unmanaged C++.
I wrote simple managed wrappers around exposed classes from the
unmanaged libraries; so now I can keep legacy C++ code, and develop UI
in a managed way.
If that what you need, let me know, I will share how I did that.
[ http://groups.google.com/group/medicalimagingscience ]
zolof - 03 Aug 2007 08:22 GMT
I have many .NET assemblies to be used by one legacy exe.
For the exe (VC++6) to be able to use the assemblies (C# 2.0), I need to
develop some wrapper DLLs (C++/CLI) since I don't want to use COM interop.
I am looking for a software that would use reflection to analyze my .NET
assemblies and generated the wrapper DLLs automatically.
I am sure this is possible and I will make ity myself if there is no way to
buy such a tool.
Ben Voigt [C++ MVP] - 03 Aug 2007 17:57 GMT
> For the moment my MFC source code is compiled using VC++ 6.
> Thanks to Microsoft, I cannot compile it using /clr.
[quoted text clipped - 6 lines]
> (I
> will need a new crt, mfc8.1 and atl8.1).
Creating managed wrappers and calling C# from C++ will introduce all the
issues mentioned here tenfold. You'll need not only the updated CRT, but
also the entire .NET Framework installed.
Actually, VC2005 generates better code than VC6, your executable will be
smaller or faster (depending on what optimization settings you choose) just
by recompiling your standard C++ source code. You can also statically link
the new CRT so you don't need to install it separately, but not if you want
to run managed code in the same application.
You really need to decide between avoiding the new CRT dependency and using
C#. You can't have both.