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. Import old DLL to C# .Net

Import old DLL to C# .Net

Scheduled Pinned Locked Moved C#
csharpc++delphi
6 Posts 5 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.
  • R Offline
    R Offline
    Reza Shojaee
    wrote on last edited by
    #1

    Hi everybody I have old dll(s) that implemented with Visual Basic 6.0 and Borland Delphi 6.0 and Visual C++ 6.0 I haven't the source of these dlls, So I want to know how can import these dll to C# .Net as a reference.

    Best Regards, Reza Shojaee

    C P 2 Replies Last reply
    0
    • R Reza Shojaee

      Hi everybody I have old dll(s) that implemented with Visual Basic 6.0 and Borland Delphi 6.0 and Visual C++ 6.0 I haven't the source of these dlls, So I want to know how can import these dll to C# .Net as a reference.

      Best Regards, Reza Shojaee

      C Offline
      C Offline
      Calla
      wrote on last edited by
      #2

      If it's a COM component you can just add it from the COM tab and let VS create the Interop.

      R 1 Reply Last reply
      0
      • C Calla

        If it's a COM component you can just add it from the COM tab and let VS create the Interop.

        R Offline
        R Offline
        Reza Shojaee
        wrote on last edited by
        #3

        I tried with COM tab but VS doesn't accept it

        Best Regards, Reza Shojaee

        V D 2 Replies Last reply
        0
        • R Reza Shojaee

          I tried with COM tab but VS doesn't accept it

          Best Regards, Reza Shojaee

          V Offline
          V Offline
          Vimalsoft Pty Ltd
          wrote on last edited by
          #4

          Do you receive some sort or Error ?

          Vuyiswa Maseko, Spoted in Daniweb-- Sorry to rant. I hate websites. They are just wierd. They don't behave like normal code. C#/VB.NET/ASP.NET/SQL7/2000/2005/2008 http://www.vuyiswamaseko.com vuyiswa@its.co.za http://www.itsabacus.co.za/itsabacus/

          1 Reply Last reply
          0
          • R Reza Shojaee

            I tried with COM tab but VS doesn't accept it

            Best Regards, Reza Shojaee

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            Then it's not a COM-based .DLL. You'll have to use P/Invoke to get at the functions it exposes. I hope you have all the documentation on the functions because, if you don't, you're going to find it nearly impossible to call the functions in the .DLL.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008
            But no longer in 2009...

            1 Reply Last reply
            0
            • R Reza Shojaee

              Hi everybody I have old dll(s) that implemented with Visual Basic 6.0 and Borland Delphi 6.0 and Visual C++ 6.0 I haven't the source of these dlls, So I want to know how can import these dll to C# .Net as a reference.

              Best Regards, Reza Shojaee

              P Offline
              P Offline
              puromtec1
              wrote on last edited by
              #6

              You need to look up interop services. You can use tlbimp.exe to generate your interop if it is COM (which from the post above seems not to be the case). Otherwise, you can use the DLLImport attribute and reference the functions this way. You will find it tricky to figure out the proper types to use in the function signature, so you need to research a little. But, this is your start.

              [DllImport("TheCplusplus.dll")]
              static extern uint BTSeparateItems([In, MarshalAs(UnmanagedType.BStr)] string filePath, out object obj);

              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