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 Code in a DLL

Using Code in a DLL

Scheduled Pinned Locked Moved C#
csharp
5 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.
  • B Offline
    B Offline
    Bram van Kampen
    wrote on last edited by
    #1

    Hi, Is it possible to call a function from an external DLL from C#.NET code. If needed I would use LoadLibrary and GetProcAddress. It would be better if it could be linked at Program Loading. Regards :) :)

    Bram van Kampen

    E 1 Reply Last reply
    0
    • B Bram van Kampen

      Hi, Is it possible to call a function from an external DLL from C#.NET code. If needed I would use LoadLibrary and GetProcAddress. It would be better if it could be linked at Program Loading. Regards :) :)

      Bram van Kampen

      E Offline
      E Offline
      Eric Haddan
      wrote on last edited by
      #2

      You would want to P/Invoke http://msdn.microsoft.com/en-us/magazine/cc164123.aspx[^]

      B 1 Reply Last reply
      0
      • E Eric Haddan

        You would want to P/Invoke http://msdn.microsoft.com/en-us/magazine/cc164123.aspx[^]

        B Offline
        B Offline
        Bram van Kampen
        wrote on last edited by
        #3

        Thanks, that is much help. What is not entirely clear is, Where does the C# app look for the DLL. On the Server, or on the Remote Machine. I would require it to look for it on the server. The DLL I have in mind produces a Datablock in a buffer provided by the C# code. The C# Code will not have an understanding of the contents, All it will have to do with it is to store it in an SQL Database held on the server. Regards, :) :)

        Bram van Kampen

        E L 2 Replies Last reply
        0
        • B Bram van Kampen

          Thanks, that is much help. What is not entirely clear is, Where does the C# app look for the DLL. On the Server, or on the Remote Machine. I would require it to look for it on the server. The DLL I have in mind produces a Datablock in a buffer provided by the C# code. The C# Code will not have an understanding of the contents, All it will have to do with it is to store it in an SQL Database held on the server. Regards, :) :)

          Bram van Kampen

          E Offline
          E Offline
          Eric Haddan
          wrote on last edited by
          #4

          You can try adding the path of the dll. I'm not totally sure if that works.

          1 Reply Last reply
          0
          • B Bram van Kampen

            Thanks, that is much help. What is not entirely clear is, Where does the C# app look for the DLL. On the Server, or on the Remote Machine. I would require it to look for it on the server. The DLL I have in mind produces a Datablock in a buffer provided by the C# code. The C# Code will not have an understanding of the contents, All it will have to do with it is to store it in an SQL Database held on the server. Regards, :) :)

            Bram van Kampen

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            The sytem loader looks in the library paths of the machine where the C# code is running for the DLL. So if your code is running on the server the dll must also be on the server.

            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