C++/CLI wrapper generator

G

Guest

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.
 
J

Jochen Kalmbach [MVP]

Hi zolof!
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.

I dont't understand your question...

If you want to use C# DLLs (assemblies) than you do not need to generade
C++/CLI wrappers... just use the assemblies...

Or maybe I missed the point...

Just compiler your EXE with /clr and use the C# DLLs....

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
B

Ben Voigt [C++ MVP]

zolof said:
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?
 
G

Guest

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).
 
P

Pixel.to.life

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).

:






- 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 ]
 
G

Guest

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.
 
B

Ben Voigt [C++ MVP]

zolof said:
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).

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.
 

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