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. Access a COM dll without registering it?

Access a COM dll without registering it?

Scheduled Pinned Locked Moved C#
csharpcomvisual-studiohelptutorial
7 Posts 4 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.
  • D Offline
    D Offline
    DiscoJimmy
    wrote on last edited by
    #1

    I have a C# application which uses a COM dll that was registered when some third party software was installed. So when I added a reference to it in visual studio, it naturally created an Interop.dll, and that's what I have a reference to. My problem is that I wanted to send the program to a friend and he doesn't have that 3rd party software on his machine. What's the best way to deal with this? I tried adding a reference to the dll file itself instead of using the COM tab, and that seemed to work, but it looks like it involves the path to that file on MY machine, which probably won't work on his side either. Copy Local is set to TRUE, but that seems to just copy in the Interop dll. I've had experience with a setup installer packaging the needed files and registering them for you, but i'd like to avoid an installer. we'll be doing rapid dev-test cycles and it's nice to be able to just 'drop-install' the files on his machine. Anyone able to guide me on this?

    J H 2 Replies Last reply
    0
    • D DiscoJimmy

      I have a C# application which uses a COM dll that was registered when some third party software was installed. So when I added a reference to it in visual studio, it naturally created an Interop.dll, and that's what I have a reference to. My problem is that I wanted to send the program to a friend and he doesn't have that 3rd party software on his machine. What's the best way to deal with this? I tried adding a reference to the dll file itself instead of using the COM tab, and that seemed to work, but it looks like it involves the path to that file on MY machine, which probably won't work on his side either. Copy Local is set to TRUE, but that seems to just copy in the Interop dll. I've had experience with a setup installer packaging the needed files and registering them for you, but i'd like to avoid an installer. we'll be doing rapid dev-test cycles and it's nice to be able to just 'drop-install' the files on his machine. Anyone able to guide me on this?

      J Offline
      J Offline
      J4amieC
      wrote on last edited by
      #2

      If you send him the com dll just get him to open a cmd prompt and run regsvr32 <path_to_com_dll>.

      D M 2 Replies Last reply
      0
      • J J4amieC

        If you send him the com dll just get him to open a cmd prompt and run regsvr32 <path_to_com_dll>.

        D Offline
        D Offline
        DiscoJimmy
        wrote on last edited by
        #3

        Yeah, was hoping to avoid that, but it's my fallback plan. Is that regsrvr32 file part of the visual studio SDK, or the windows SDK? And is it freely available? because i imagine i'll have to get him that as well.

        J 1 Reply Last reply
        0
        • D DiscoJimmy

          Yeah, was hoping to avoid that, but it's my fallback plan. Is that regsrvr32 file part of the visual studio SDK, or the windows SDK? And is it freely available? because i imagine i'll have to get him that as well.

          J Offline
          J Offline
          J4amieC
          wrote on last edited by
          #4

          Neither, its part of Windows.

          1 Reply Last reply
          0
          • J J4amieC

            If you send him the com dll just get him to open a cmd prompt and run regsvr32 <path_to_com_dll>.

            M Offline
            M Offline
            Md Marufuzzaman
            wrote on last edited by
            #5

            Im not confirm that the regsvr32 is perfect for a dll registration which is developed by using C#.net..RegAsm command can be consider...:)

            I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.


            Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you. Thanks Md. Marufuzzaman

            J 1 Reply Last reply
            0
            • M Md Marufuzzaman

              Im not confirm that the regsvr32 is perfect for a dll registration which is developed by using C#.net..RegAsm command can be consider...:)

              I will not say I have failed 1000 times; I will say that I have discovered 1000 ways that can cause failure – Thomas Edison.


              Don't forget to click [Vote] / [Good Answer] on the post(s) that helped you. Thanks Md. Marufuzzaman

              J Offline
              J Offline
              J4amieC
              wrote on last edited by
              #6

              :confused: Its a COM dll, not a .NET assembly. RegAsm allows com clients to call .NET dll's. The OP was asking about accessing a COM dll from .NET

              1 Reply Last reply
              0
              • D DiscoJimmy

                I have a C# application which uses a COM dll that was registered when some third party software was installed. So when I added a reference to it in visual studio, it naturally created an Interop.dll, and that's what I have a reference to. My problem is that I wanted to send the program to a friend and he doesn't have that 3rd party software on his machine. What's the best way to deal with this? I tried adding a reference to the dll file itself instead of using the COM tab, and that seemed to work, but it looks like it involves the path to that file on MY machine, which probably won't work on his side either. Copy Local is set to TRUE, but that seems to just copy in the Interop dll. I've had experience with a setup installer packaging the needed files and registering them for you, but i'd like to avoid an installer. we'll be doing rapid dev-test cycles and it's nice to be able to just 'drop-install' the files on his machine. Anyone able to guide me on this?

                H Offline
                H Offline
                Henry Minute
                wrote on last edited by
                #7

                Apart from all the good advice from others, there is one point that you might want to consider. That is the legality of copying the dll to your friends machine. If it came with software that you have installed, then there might be copyright issues. I'm not saying don't do it, I'm just saying is all. :)

                Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

                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