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. Managed C++/CLI
  4. writing a wrapper for c++ unmanged dll

writing a wrapper for c++ unmanged dll

Scheduled Pinned Locked Moved Managed C++/CLI
questioncsharpc++
3 Posts 3 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.
  • A Offline
    A Offline
    A55imilate
    wrote on last edited by
    #1

    Hi, I have an unmanged c++ dll and need to write a c# wrapper for it so I can add it to my c# application I have this in c++ extern "C" BOOL WINAPI GetDeviceID(DWORD dwDevice, DWORD* pdwID); and in my wrapper I have [DllImport("MDBEngine.dll")] unsafe public static extern bool GetDeviceID(uint dwDevice, uint* pdwID); my question is what is the * for in c++ and do I need it in my reference in c#?

    J E 2 Replies Last reply
    0
    • A A55imilate

      Hi, I have an unmanged c++ dll and need to write a c# wrapper for it so I can add it to my c# application I have this in c++ extern "C" BOOL WINAPI GetDeviceID(DWORD dwDevice, DWORD* pdwID); and in my wrapper I have [DllImport("MDBEngine.dll")] unsafe public static extern bool GetDeviceID(uint dwDevice, uint* pdwID); my question is what is the * for in c++ and do I need it in my reference in c#?

      J Offline
      J Offline
      Jun Du
      wrote on last edited by
      #2

      That is a unmanaged pointer. You must marshal your corrsponding C++/CLI varaible to an appropriate native pointer before using this platform invoke. Best, Jun

      1 Reply Last reply
      0
      • A A55imilate

        Hi, I have an unmanged c++ dll and need to write a c# wrapper for it so I can add it to my c# application I have this in c++ extern "C" BOOL WINAPI GetDeviceID(DWORD dwDevice, DWORD* pdwID); and in my wrapper I have [DllImport("MDBEngine.dll")] unsafe public static extern bool GetDeviceID(uint dwDevice, uint* pdwID); my question is what is the * for in c++ and do I need it in my reference in c#?

        E Offline
        E Offline
        Emad Rangchi
        wrote on last edited by
        #3

        Hi You can use from SWIG (Simplified Wrapper and Interface Generator).SWIG is an interface compiler that connects programs written in C and C++ with scripting languages such as Perl, Python, Ruby,C# and Tcl. It works by taking the declarations found in C/C++ header files and using them to generate the wrapper code that scripting languages need to access the underlying C/C++ code. In addition, SWIG provides a variety of customization features that let you tailor the wrapping process to suit your application. http://www.swig.org/ -- modified at 5:55 Monday 10th July, 2006

        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