Re: Questions about porting C++ dll to C#



I have some codes in C to do some complex calculation. In order to use it in
C#, I wrap the C codes using C++ and create a unmanged dll, then my program
will call the dll from the C#.

Is it actually necessary for the C++ wrapper? I had thought that you could create Win32 dlls straight in C. I know this isn't an answer to your question. It just seems that this might be one less layer for you to maintain and debug in to.

--
Andrew Faust
andrew[at]andrewfaust.com
http://www.andrewfaust.com


"chrisben" <chrisben@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:AF5EE7C6-A746-4A69-B7AF-A0B2485A7BE9@xxxxxxxxxxxxxxxx
Hi,

I have some codes in C to do some complex calculation. In order to use it in
C#, I wrap the C codes using C++ and create a unmanged dll, then my program
will call the dll from the C#.

The application has been working ok. However, it is not convenient for me to
debug the codes since after I start the solution, copy the debug dll to the
current foder, my break point cannot step into the codes of that C++ library
even after I include it in the same solution. Later, I found by simply go to
the property of the dll project, change the Use Managed Extensions as Yes,
then I can add the libary to the reference of the C# project, I can recompile
and step into the C++ codes from C# breakpoint.

I changed nothing in C++ library except for that property. It is now easy
for me to debug. However, I start wondering whether this simple change will
impact the performance of my application. Will the app run faster if I change
this property back to No in production? What happened behind the scene after
this change? BTW, I am using VS2003 with framework 1.1.

Thanks

Chrisben

.



Relevant Pages