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. Using a C DLL in a C# Application...

Using a C DLL in a C# Application...

Scheduled Pinned Locked Moved C#
csharpquestion
4 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.
  • S Offline
    S Offline
    signbit
    wrote on last edited by
    #1

    Is there a way to use a C DLL to use in a C# Application? :) - A programmer's national anthem; "AAAAAHHHHH!!!!"

    J 1 Reply Last reply
    0
    • S signbit

      Is there a way to use a C DLL to use in a C# Application? :) - A programmer's national anthem; "AAAAAHHHHH!!!!"

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      Yep, that's what Platform Invoke[^] is for. What's more, you can write a C++/CLI dll that uses native code and .NET code as well. Such a dll could then be callable from C# with ease.

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: How 'bout a little guitar now? The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      M 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        Yep, that's what Platform Invoke[^] is for. What's more, you can write a C++/CLI dll that uses native code and .NET code as well. Such a dll could then be callable from C# with ease.

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: How 'bout a little guitar now? The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

        M Offline
        M Offline
        Mridang Agarwalla
        wrote on last edited by
        #3

        Does PInvoke work if a create a DLL in any other language too e.g. Delphi?

        J 1 Reply Last reply
        0
        • M Mridang Agarwalla

          Does PInvoke work if a create a DLL in any other language too e.g. Delphi?

          J Offline
          J Offline
          Judah Gabriel Himango
          wrote on last edited by
          #4

          Good question, I've never tried before. My guess is, as long as one can export the native methods so that they're visible to C, then yes.

          Tech, life, family, faith: Give me a visit. I'm currently blogging about: How 'bout a little guitar now? The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

          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