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. Calling .dll from a C# application (problem when outside VS2010)

Calling .dll from a C# application (problem when outside VS2010)

Scheduled Pinned Locked Moved C#
csharpvisual-studiohelp
11 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.
  • K Offline
    K Offline
    Kaare Tragethon
    wrote on last edited by
    #1

    Hi all, I have a C# application that uses vpc.dll. The application works without problems when running in VS. I have added a reference to the vpc.dll which reisdes in the project location (the same path as the .exe). However, when I install the application on a client machine (using SetupProject in VS where I have included the vpc.dll to the application folder) the call to vpc.dll fails. Basically it will not run at all. I'm fairly new to computer programming, but I find it strange that it works inside VS, but not when installed on client machine. Thanks for any pointers!

    A P 2 Replies Last reply
    0
    • K Kaare Tragethon

      Hi all, I have a C# application that uses vpc.dll. The application works without problems when running in VS. I have added a reference to the vpc.dll which reisdes in the project location (the same path as the .exe). However, when I install the application on a client machine (using SetupProject in VS where I have included the vpc.dll to the application folder) the call to vpc.dll fails. Basically it will not run at all. I'm fairly new to computer programming, but I find it strange that it works inside VS, but not when installed on client machine. Thanks for any pointers!

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      If this is a COM dll, you will need to register it on the client machine. Include the registration process in the setup install program.

      K 1 Reply Last reply
      0
      • A Abhinav S

        If this is a COM dll, you will need to register it on the client machine. Include the registration process in the setup install program.

        K Offline
        K Offline
        Kaare Tragethon
        wrote on last edited by
        #3

        Hi, I have tried to register the .dll but I get an error message like "DllRegister" was not found, not a valid DLL or OCX file.... Not sure what this means but I've tried this both on the development machine and on the client machine.

        D 1 Reply Last reply
        0
        • K Kaare Tragethon

          Hi, I have tried to register the .dll but I get an error message like "DllRegister" was not found, not a valid DLL or OCX file.... Not sure what this means but I've tried this both on the development machine and on the client machine.

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

          You said you set a reference to this .DLL?? That means it's COM-based. But now you're saying that if you execute "REGSVR32 vpc.dll" it complains that it can't find DllRegister. That means it's NOT COM-based. I get the feeling you didn't set a reference to it because what you're saying is contradictory to itself.

          A guide to posting questions on CodeProject[^]
          Dave Kreskowiak

          P 1 Reply Last reply
          0
          • K Kaare Tragethon

            Hi all, I have a C# application that uses vpc.dll. The application works without problems when running in VS. I have added a reference to the vpc.dll which reisdes in the project location (the same path as the .exe). However, when I install the application on a client machine (using SetupProject in VS where I have included the vpc.dll to the application folder) the call to vpc.dll fails. Basically it will not run at all. I'm fairly new to computer programming, but I find it strange that it works inside VS, but not when installed on client machine. Thanks for any pointers!

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            Kaare Tragethon wrote:

            the call to vpc.dll fails. Basically it will not run at all.

            My suspicion is that you are missing something that vpc.dll is dependent on. Is this Virtual PC that you are trying to run?

            *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

            "Mind bleach! Send me mind bleach!" - Nagy Vilmos

            My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

            K 1 Reply Last reply
            0
            • D Dave Kreskowiak

              You said you set a reference to this .DLL?? That means it's COM-based. But now you're saying that if you execute "REGSVR32 vpc.dll" it complains that it can't find DllRegister. That means it's NOT COM-based. I get the feeling you didn't set a reference to it because what you're saying is contradictory to itself.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              I get the feeling (having tried to find out what vpc.dll was) that he's followed these[^] steps, so it's the wrapper for the COM client.

              *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

              "Mind bleach! Send me mind bleach!" - Nagy Vilmos

              My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

              D 1 Reply Last reply
              0
              • P Pete OHanlon

                Kaare Tragethon wrote:

                the call to vpc.dll fails. Basically it will not run at all.

                My suspicion is that you are missing something that vpc.dll is dependent on. Is this Virtual PC that you are trying to run?

                *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                K Offline
                K Offline
                Kaare Tragethon
                wrote on last edited by
                #7

                You are correct, it is VirtualPC. I've "extracted" a .dll from the vpc.exe file (using tlbimp vpc.exe /out vpc.dll). I've tried searching google A LOT, but there's very little (or no) documentation on this that I can find.... The only thing I could find was the above "extract" method.... Thanks!

                P 1 Reply Last reply
                0
                • K Kaare Tragethon

                  You are correct, it is VirtualPC. I've "extracted" a .dll from the vpc.exe file (using tlbimp vpc.exe /out vpc.dll). I've tried searching google A LOT, but there's very little (or no) documentation on this that I can find.... The only thing I could find was the above "extract" method.... Thanks!

                  P Offline
                  P Offline
                  Pete OHanlon
                  wrote on last edited by
                  #8

                  Right - chances are then that the actual Virtual PC client isn't installed on the end users machine. Basically, your DLL is a wrapper for the COM calls - it's not a COM component so you don't need to register it, but it does need the actual COM object registered; in this case Virtual PC.

                  *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                  "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                  My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                  K 1 Reply Last reply
                  0
                  • P Pete OHanlon

                    I get the feeling (having tried to find out what vpc.dll was) that he's followed these[^] steps, so it's the wrapper for the COM client.

                    *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                    "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                    My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

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

                    Ahh, now it makes sense.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak

                    1 Reply Last reply
                    0
                    • P Pete OHanlon

                      Right - chances are then that the actual Virtual PC client isn't installed on the end users machine. Basically, your DLL is a wrapper for the COM calls - it's not a COM component so you don't need to register it, but it does need the actual COM object registered; in this case Virtual PC.

                      *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                      "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                      My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                      K Offline
                      K Offline
                      Kaare Tragethon
                      wrote on last edited by
                      #10

                      I see, thanks for the help!! :-)

                      P 1 Reply Last reply
                      0
                      • K Kaare Tragethon

                        I see, thanks for the help!! :-)

                        P Offline
                        P Offline
                        Pete OHanlon
                        wrote on last edited by
                        #11

                        No problem. I'm glad I could be of assistance.

                        *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

                        "Mind bleach! Send me mind bleach!" - Nagy Vilmos

                        My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

                        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