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. Visual Basic
  4. Help on vb6 and .dll

Help on vb6 and .dll

Scheduled Pinned Locked Moved Visual Basic
questiontestingbeta-testinghelp
7 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.
  • B Offline
    B Offline
    blurboy
    wrote on last edited by
    #1

    windows XP, vb6 My vb6 project requires to reference A.dll in order to run properly. In my PC, the compiled .exe program runs normally. BUT when i deployed it to another computer, it does not run normally. UNTIL I realised i have to register the dll on that computer. I did not realize it had to do with registering the dll because I did not register the dll on my PC before. It seems that when I compile my project, vb6 automatically registers A.dll. Therefore it ran nomally on my PC. Therefore, I have coded my program to auto-register the A.dll itself. And I tested on my PC, it was ok. But again when I deployed to another PC, it doesn't work. QUESTION: Even after I unregistered the A.dll on my PC, I still can run my program normally! For some reason, vb6 keeps locking on to my dll. and I cant seem to unregister it. Therefore I am unable to test my auto-registering code! How can I unregister the A.dll on my PC, so that I can test out the auto-registering of the A.dll itself?? I would prefer to perform the testing on my PC than to deploy it over and over again to find out if my code works.

    _ D S B 4 Replies Last reply
    0
    • B blurboy

      windows XP, vb6 My vb6 project requires to reference A.dll in order to run properly. In my PC, the compiled .exe program runs normally. BUT when i deployed it to another computer, it does not run normally. UNTIL I realised i have to register the dll on that computer. I did not realize it had to do with registering the dll because I did not register the dll on my PC before. It seems that when I compile my project, vb6 automatically registers A.dll. Therefore it ran nomally on my PC. Therefore, I have coded my program to auto-register the A.dll itself. And I tested on my PC, it was ok. But again when I deployed to another PC, it doesn't work. QUESTION: Even after I unregistered the A.dll on my PC, I still can run my program normally! For some reason, vb6 keeps locking on to my dll. and I cant seem to unregister it. Therefore I am unable to test my auto-registering code! How can I unregister the A.dll on my PC, so that I can test out the auto-registering of the A.dll itself?? I would prefer to perform the testing on my PC than to deploy it over and over again to find out if my code works.

      _ Offline
      _ Offline
      _Erik_
      wrote on last edited by
      #2

      It's been long from the last time I used VB6, so maybe I am wrong but, have you tried to deploy the dll file in the same location as your exe file? As far as I can remember, this way you can forget about registering the library.

      1 Reply Last reply
      0
      • B blurboy

        windows XP, vb6 My vb6 project requires to reference A.dll in order to run properly. In my PC, the compiled .exe program runs normally. BUT when i deployed it to another computer, it does not run normally. UNTIL I realised i have to register the dll on that computer. I did not realize it had to do with registering the dll because I did not register the dll on my PC before. It seems that when I compile my project, vb6 automatically registers A.dll. Therefore it ran nomally on my PC. Therefore, I have coded my program to auto-register the A.dll itself. And I tested on my PC, it was ok. But again when I deployed to another PC, it doesn't work. QUESTION: Even after I unregistered the A.dll on my PC, I still can run my program normally! For some reason, vb6 keeps locking on to my dll. and I cant seem to unregister it. Therefore I am unable to test my auto-registering code! How can I unregister the A.dll on my PC, so that I can test out the auto-registering of the A.dll itself?? I would prefer to perform the testing on my PC than to deploy it over and over again to find out if my code works.

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

        blurboy wrote:

        I did not realize it had to do with registering the dll because I did not register the dll on my PC before. It seems that when I compile my project, vb6 automatically registers A.dll.

        True. When you compile a .DLL project under VB6, it automatically does the registration for you. Which makes sense because VB6 is only capable of tareting COM-based .DLL's. It can't generate a normal function .DLL.

        blurboy wrote:

        Therefore, I have coded my program to auto-register the A.dll itself.

        This is normally handled by the installer for your app, not the app itself. But, it's still possible to do so long as you realize that not everyone who uses your app may be able to register a COM .DLL.

        blurboy wrote:

        Even after I unregistered the A.dll on my PC, I still can run my program normally! For some reason, vb6 keeps locking on to my dll. and I cant seem to unregister it. Therefore I am unable to test my auto-registering code!

        REGSVR32 /u mydllname.dll will unregister that .DLL files GUIDs. Once the registrations are gone, the bindings shouldn't work any more. But, there may be old GUID data from older versions of your .DLL that are still registered. There's no way to automatically remove all of those references out of the Registry. You'll have to hunt them down and remove them by hand.

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

        B 1 Reply Last reply
        0
        • D Dave Kreskowiak

          blurboy wrote:

          I did not realize it had to do with registering the dll because I did not register the dll on my PC before. It seems that when I compile my project, vb6 automatically registers A.dll.

          True. When you compile a .DLL project under VB6, it automatically does the registration for you. Which makes sense because VB6 is only capable of tareting COM-based .DLL's. It can't generate a normal function .DLL.

          blurboy wrote:

          Therefore, I have coded my program to auto-register the A.dll itself.

          This is normally handled by the installer for your app, not the app itself. But, it's still possible to do so long as you realize that not everyone who uses your app may be able to register a COM .DLL.

          blurboy wrote:

          Even after I unregistered the A.dll on my PC, I still can run my program normally! For some reason, vb6 keeps locking on to my dll. and I cant seem to unregister it. Therefore I am unable to test my auto-registering code!

          REGSVR32 /u mydllname.dll will unregister that .DLL files GUIDs. Once the registrations are gone, the bindings shouldn't work any more. But, there may be old GUID data from older versions of your .DLL that are still registered. There's no way to automatically remove all of those references out of the Registry. You'll have to hunt them down and remove them by hand.

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

          B Offline
          B Offline
          blurboy
          wrote on last edited by
          #4

          REGSVR32 /u mydllname.dll will unregister that .DLL files GUIDs. Once the registrations are gone, the bindings shouldn't work any more. But, there may be old GUID data from older versions of your .DLL that are still registered. There's no way to automatically remove all of those references out of the Registry. You'll have to hunt them down and remove them by hand. Already tried so. REGSVR32 /u mydllname.dll. But when i double click on my exe to run. it still run normally!

          J 1 Reply Last reply
          0
          • B blurboy

            REGSVR32 /u mydllname.dll will unregister that .DLL files GUIDs. Once the registrations are gone, the bindings shouldn't work any more. But, there may be old GUID data from older versions of your .DLL that are still registered. There's no way to automatically remove all of those references out of the Registry. You'll have to hunt them down and remove them by hand. Already tried so. REGSVR32 /u mydllname.dll. But when i double click on my exe to run. it still run normally!

            J Offline
            J Offline
            James H
            wrote on last edited by
            #5

            Your best bet is a "clean build" PC to test on - I use VMWare Workstation for this - it allows you to rollback the state of the Virtual Machine so you can go back to "clean" for testing the installers. As for the mystery of it still working on your PC - it depends a bit on the way the DLL is called from VB - if you are using CreateObject as in e.g. wordObj = CreateObject("Word.Application") then the registry is searched first for Word.Application class then it picks up a GUID in that to get actual reg info point to the OLE DLL. This is known as "Late Binding". Early binding is what you get when you add the DLL to the references in your VB project. Can't remember for sure but there is a good chance that when you open the VB project if it is early bound and it doesn't find the registry info that it automatically re-registers the DLL - and it is likely it does this even if you don't run the project (because it needs the reference to be working to even allow a compile). I recommend ProcMon (old Sysinternals tool - now Microsoft) to spy on what is going on and ow the registry info for your DLL is being found.

            1 Reply Last reply
            0
            • B blurboy

              windows XP, vb6 My vb6 project requires to reference A.dll in order to run properly. In my PC, the compiled .exe program runs normally. BUT when i deployed it to another computer, it does not run normally. UNTIL I realised i have to register the dll on that computer. I did not realize it had to do with registering the dll because I did not register the dll on my PC before. It seems that when I compile my project, vb6 automatically registers A.dll. Therefore it ran nomally on my PC. Therefore, I have coded my program to auto-register the A.dll itself. And I tested on my PC, it was ok. But again when I deployed to another PC, it doesn't work. QUESTION: Even after I unregistered the A.dll on my PC, I still can run my program normally! For some reason, vb6 keeps locking on to my dll. and I cant seem to unregister it. Therefore I am unable to test my auto-registering code! How can I unregister the A.dll on my PC, so that I can test out the auto-registering of the A.dll itself?? I would prefer to perform the testing on my PC than to deploy it over and over again to find out if my code works.

              S Offline
              S Offline
              S Houghtelin
              wrote on last edited by
              #6

              VB 6 will look in the WIN\system or system32 folders even if a dll is unregistered. To test your auto register you would need to either relocate the dll or rename it with a different suffix. Additionally, assure that the installer is adding the dll file to the new system. The Software Packager (To build the installation package) will have a step for you to indicate what files you want to add, especially if you are using a custom dll or ocx. The packager does not automatically assure that all the necessary dll’s are added. Simply dragging or copying an executable to a new machine does not add the needed dlls. The installer will add and register the dlls. Good luck

              It was broke, so I fixed it.

              1 Reply Last reply
              0
              • B blurboy

                windows XP, vb6 My vb6 project requires to reference A.dll in order to run properly. In my PC, the compiled .exe program runs normally. BUT when i deployed it to another computer, it does not run normally. UNTIL I realised i have to register the dll on that computer. I did not realize it had to do with registering the dll because I did not register the dll on my PC before. It seems that when I compile my project, vb6 automatically registers A.dll. Therefore it ran nomally on my PC. Therefore, I have coded my program to auto-register the A.dll itself. And I tested on my PC, it was ok. But again when I deployed to another PC, it doesn't work. QUESTION: Even after I unregistered the A.dll on my PC, I still can run my program normally! For some reason, vb6 keeps locking on to my dll. and I cant seem to unregister it. Therefore I am unable to test my auto-registering code! How can I unregister the A.dll on my PC, so that I can test out the auto-registering of the A.dll itself?? I would prefer to perform the testing on my PC than to deploy it over and over again to find out if my code works.

                B Offline
                B Offline
                blurboy
                wrote on last edited by
                #7

                Thanks everyone for the help! appreciate it :)

                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