C++ project to c#
-
Hi, I have a sdk written in c++ to control an IP module from .net. I wish to port all these libraries to C#. As i have never written interops, wrappers, or even worked in c++, what are my options. I need to know what i need to know to accomplish making dll's which are compatible to c# or if there are any third party tools that can convert all dll's from C++ to C#. Thank you.
-
Hi, I have a sdk written in c++ to control an IP module from .net. I wish to port all these libraries to C#. As i have never written interops, wrappers, or even worked in c++, what are my options. I need to know what i need to know to accomplish making dll's which are compatible to c# or if there are any third party tools that can convert all dll's from C++ to C#. Thank you.
If you just need to use the methods that the dll exposes in your C# code, you need to check if the dll is managed or unmanaged. If it is a managed one, add reference to it, create object and call methods. If it is an unmanaged dll, you can use DllImport attribute. Here[^] a link that might help you.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
-
If you just need to use the methods that the dll exposes in your C# code, you need to check if the dll is managed or unmanaged. If it is a managed one, add reference to it, create object and call methods. If it is an unmanaged dll, you can use DllImport attribute. Here[^] a link that might help you.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
I have got a sample application build around the sdk, its written in VC2003.net. I can add a reference to some of the dll's and ocx files but not all. I am sending you an email to download the sdk and a sample application within can u please get some time and see into it and tell me what i am up against, it would be really helpful. I would be really thankfull. Just tell me what i need to do to start. Thankyou
-
Hi, I have a sdk written in c++ to control an IP module from .net. I wish to port all these libraries to C#. As i have never written interops, wrappers, or even worked in c++, what are my options. I need to know what i need to know to accomplish making dll's which are compatible to c# or if there are any third party tools that can convert all dll's from C++ to C#. Thank you.
faheemnadeem wrote:
I have a sdk written in c++ to control an IP module from .net.
How that SDK exposes its functionality? Do they provide static libraries or DLLs? If they provide static libraries, better option is to create a managed DLL using C++/CLI which has the static libraries linked. If they provide DLLs, then you can use P/Invoke to communicate with it from C#.
Best wishes, Navaneeth
-
Hi, I have a sdk written in c++ to control an IP module from .net. I wish to port all these libraries to C#. As i have never written interops, wrappers, or even worked in c++, what are my options. I need to know what i need to know to accomplish making dll's which are compatible to c# or if there are any third party tools that can convert all dll's from C++ to C#. Thank you.
There are converters for this, but you need to have a very good knowledge of both C++ and C# to be capable of making the adjustments to get it working. If the C++ code makes heavy usage of pointer arithmetic, then you are better off leaving the code in C++.
David Anton Convert between VB, C#, C++, & Java www.tangiblesoftwaresolutions.com