Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. C++ project to c#

C++ project to c#

Scheduled Pinned Locked Moved C#
csharpc++tools
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    faheemnadeem
    wrote on last edited by
    #1

    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.

    D N D 3 Replies Last reply
    0
    • F faheemnadeem

      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.

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

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

      F 1 Reply Last reply
      0
      • D dan sh

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

        F Offline
        F Offline
        faheemnadeem
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • F faheemnadeem

          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.

          N Offline
          N Offline
          N a v a n e e t h
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • F faheemnadeem

            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.

            D Offline
            D Offline
            Dave Doknjas
            wrote on last edited by
            #5

            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

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups