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 / C++ / MFC
  4. call C# function from C++ dll

call C# function from C++ dll

Scheduled Pinned Locked Moved C / C++ / MFC
questioncsharpc++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.
  • P Offline
    P Offline
    Paulraj G
    wrote on last edited by
    #1

    Hi All, I have a function in C++ dll like

    FunctionCPP(int s)
    {
    }

    I have a function in C# application(exe) like

    int FunctionCSharp(int s)
    {
    return s;
    }

    what is the procedure to call FunctionCSharp from FunctionCPP? Any help will be appriciated. Thanks

    G.Paulraj

    C 1 Reply Last reply
    0
    • P Paulraj G

      Hi All, I have a function in C++ dll like

      FunctionCPP(int s)
      {
      }

      I have a function in C# application(exe) like

      int FunctionCSharp(int s)
      {
      return s;
      }

      what is the procedure to call FunctionCSharp from FunctionCPP? Any help will be appriciated. Thanks

      G.Paulraj

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      Not sure how this would work with a C++ DLL loaded into a C# application, but read what MSDN[^] says here, maybe it can get you going. Registering/Using somekind of inbetween COM interface sounds like a good idea.

      > The problem with computers is that they do what you tell them to do and not what you want them to do. < > If it doesn't matter, it's antimatter.<

      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