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. how do i load a dll made in C#?

how do i load a dll made in C#?

Scheduled Pinned Locked Moved C / C++ / MFC
c++questioncsharptutorial
6 Posts 6 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
    FASTian
    wrote on last edited by
    #1

    Any article on how to load a dll made in C# to be used in visual c++ 6. Also if this dll is capable of throwing events how do we handle these events? Thanks

    A A K J 4 Replies Last reply
    0
    • F FASTian

      Any article on how to load a dll made in C# to be used in visual c++ 6. Also if this dll is capable of throwing events how do we handle these events? Thanks

      A Offline
      A Offline
      Alexander M
      wrote on last edited by
      #2

      as every other dll!? LoadLibrary!? GetProcAddress!? Don't try it, just do it! ;-)

      P 1 Reply Last reply
      0
      • A Alexander M

        as every other dll!? LoadLibrary!? GetProcAddress!? Don't try it, just do it! ;-)

        P Offline
        P Offline
        palbano
        wrote on last edited by
        #3

        I don't believe that is going to work.

        1 Reply Last reply
        0
        • F FASTian

          Any article on how to load a dll made in C# to be used in visual c++ 6. Also if this dll is capable of throwing events how do we handle these events? Thanks

          A Offline
          A Offline
          Andy Brummer
          wrote on last edited by
          #4

          Probably the easiest way do do it is to expose the C# code as a com object.


          The architect has placed his bets, but the odds are long -Poster Children

          1 Reply Last reply
          0
          • F FASTian

            Any article on how to load a dll made in C# to be used in visual c++ 6. Also if this dll is capable of throwing events how do we handle these events? Thanks

            K Offline
            K Offline
            krisko
            wrote on last edited by
            #5

            I dont think you can create a DLL in C#. You can only build an assembly in C#. There is a difference between DLL and Managed assembly, although they share the same extension. To use the assembly from C++, as another reader pointed out convert the C# class to a COM object and use the COM object in VC++. Else you can host the CLR runtime in your VC++ app and then load your assembly there in.

            1 Reply Last reply
            0
            • F FASTian

              Any article on how to load a dll made in C# to be used in visual c++ 6. Also if this dll is capable of throwing events how do we handle these events? Thanks

              J Offline
              J Offline
              Joel Lucsy
              wrote on last edited by
              #6

              Do a search for "hosting the CLR". As for catching exceptions, it's probably pretty similar to managed c++. -- Joel Lucsy

              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