Calling C/C++ function from C#
-
Can someone please tell me how to call a C/C++ function that is in a .c or .cpp file from C#?
Hello If the function is written on C, you can create a DLL exporting this function. Than you can interop it in C# using
DllImport
. With best regards, Andrew -
Hello If the function is written on C, you can create a DLL exporting this function. Than you can interop it in C# using
DllImport
. With best regards, Andrew -
Thanks Andrew, And the same if it's written in C++? Can you please guide me to an article or so,so I can follow it step by step?I have never tried creating a C++ dll before? Thanks and Best Regards, E.A.
You can browse this[^] site for question about interoping API or other functions. It's not simple to use C++ dll from C#. More of it, there is no approaches for it known to me. If you have a C++ class you can try to use it with MC++ (Managed C++) using IJW (it just works) technology. With best regards, Andrew -- modified at 7:44 Tuesday 13th September, 2005
-
You can browse this[^] site for question about interoping API or other functions. It's not simple to use C++ dll from C#. More of it, there is no approaches for it known to me. If you have a C++ class you can try to use it with MC++ (Managed C++) using IJW (it just works) technology. With best regards, Andrew -- modified at 7:44 Tuesday 13th September, 2005
-
Thanks for trying to help out. I have heard about MC++ but I havent' heard about IJT. Does this mean that after using my class with MC++ that I can call it directly from .NET or what? Best Regards, E.A.
-