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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Converting and Calling C++ DLL in C#

Converting and Calling C++ DLL in C#

Scheduled Pinned Locked Moved C#
csharpc++help
2 Posts 2 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.
  • V Offline
    V Offline
    Vini Deep
    wrote on last edited by
    #1

    Hi, I am new to C# programming. I want to refer a DLL written in C++ (win32 DLL) in an application in C#. The Dll is in unmanaged code and my tester application is a C# application. I have read somewhere about using tlbimp to generate the metadata file. Can anyone tell me the process or any link which gives me information on this. Kindly help. Thanks Vini

    H 1 Reply Last reply
    0
    • V Vini Deep

      Hi, I am new to C# programming. I want to refer a DLL written in C++ (win32 DLL) in an application in C#. The Dll is in unmanaged code and my tester application is a C# application. I have read somewhere about using tlbimp to generate the metadata file. Can anyone tell me the process or any link which gives me information on this. Kindly help. Thanks Vini

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      tlbimp.exe only works on COM servers with type libraries (typelibs). If you need to call native APIs that are exported from your DLL, you need to use P/Invoke. See Interoperating with Unmanaged Code[^] in the .NET Framework SDK for the differences between CCWs, RCWs, and P/Invoke, as well as click "Search comments" above. It's been discussed in this forum more times than you can imagine and there are also MANY articles about both types of interop here on CodeProject and across the 'net.

      Microsoft MVP, Visual C# My Articles

      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