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 / C++ / MFC
  4. Dll load problem

Dll load problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
8 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.
  • S Offline
    S Offline
    swatgodjr
    wrote on last edited by
    #1

    hi, i have made a program that will load other programs from dll files. i have it working just fine on my own pc but when i go to have someone else test it, it fails to load anything at all. am i doing soemthign wrong with how i have my program loading the dll files?

    L 1 Reply Last reply
    0
    • S swatgodjr

      hi, i have made a program that will load other programs from dll files. i have it working just fine on my own pc but when i go to have someone else test it, it fails to load anything at all. am i doing soemthign wrong with how i have my program loading the dll files?

      L Offline
      L Offline
      Laxman Auti
      wrote on last edited by
      #2

      swatgodjr wrote:

      am i doing soemthign wrong with how i have my program loading the dll files?

      When you are using the DLL on your M/C no problem because that DLL is already registered on your M/C When you use it on other M/C the Application is not able to find the Registered DLL. So try to register your DLL on Other M/C where you execute your Application. use Regsvr32 - for registration use Regsvr32 /u - for unregistration. Knock out 't' from can't, You can if you think you can :cool:

      S B 2 Replies Last reply
      0
      • L Laxman Auti

        swatgodjr wrote:

        am i doing soemthign wrong with how i have my program loading the dll files?

        When you are using the DLL on your M/C no problem because that DLL is already registered on your M/C When you use it on other M/C the Application is not able to find the Registered DLL. So try to register your DLL on Other M/C where you execute your Application. use Regsvr32 - for registration use Regsvr32 /u - for unregistration. Knock out 't' from can't, You can if you think you can :cool:

        S Offline
        S Offline
        swatgodjr
        wrote on last edited by
        #3

        i tried to use that on another pc but it came back sayign it could not be found on the pc.

        L 1 Reply Last reply
        0
        • L Laxman Auti

          swatgodjr wrote:

          am i doing soemthign wrong with how i have my program loading the dll files?

          When you are using the DLL on your M/C no problem because that DLL is already registered on your M/C When you use it on other M/C the Application is not able to find the Registered DLL. So try to register your DLL on Other M/C where you execute your Application. use Regsvr32 - for registration use Regsvr32 /u - for unregistration. Knock out 't' from can't, You can if you think you can :cool:

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

          Are we sure the DLL is COM based? You may be dealing with a traditional dll here that uses LoadLibrary(). The thread initiator did not specify this unfortunately.

          1 Reply Last reply
          0
          • S swatgodjr

            i tried to use that on another pc but it came back sayign it could not be found on the pc.

            L Offline
            L Offline
            Laxman Auti
            wrote on last edited by
            #5

            swatgodjr wrote:

            i tried to use that on another pc but it came back sayign it could not be found on the pc.

            Is it your DLL ( created by you for your application) ? if no then What is the name of the DLL ,that you trying to load ? Knock out 't' from can't, You can if you think you can :cool:

            S 1 Reply Last reply
            0
            • L Laxman Auti

              swatgodjr wrote:

              i tried to use that on another pc but it came back sayign it could not be found on the pc.

              Is it your DLL ( created by you for your application) ? if no then What is the name of the DLL ,that you trying to load ? Knock out 't' from can't, You can if you think you can :cool:

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

              i made the dll myself, i am using LoadLibrary to load it in my program. originally my application was console based and it ran perfectly, loaded on any pc i put it on. but since turnign it into a dialog based gui application, using the exact same loading code, it fails to load now on any pc but mine.

              B 1 Reply Last reply
              0
              • S swatgodjr

                i made the dll myself, i am using LoadLibrary to load it in my program. originally my application was console based and it ran perfectly, loaded on any pc i put it on. but since turnign it into a dialog based gui application, using the exact same loading code, it fails to load now on any pc but mine.

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

                Pay special attention to the search order in the LoadLibrary documentation. Where your dll is in relation to the "Paths" searched is important. A_Laxman mentioned the COM based way of how the dll path is "registered" in the registry so an app can search the ProgId or CLSID of the component to obtain the info such as what it's path is. You are basically trying to achieve the same end via whatever means you have at your disposal. If you don't ensure your dll is located in one of the paths mentioned in the LoadLibrary documentation (Try not to rely on the PATH environment variable as this is a user configurable item and subject to change when users jack around with their settings), you might want to have your app installation msi place the path in your registry space for your installation. I do this and then retrieve the settings (including the path to the apps "bin" directory which is where I place my dll's). If your using VC++ 6.0, you will probably need the Visual Studio Enterprise Installer 1.1 to quickly build your MSI's. You really shouldn't be deploying apps that have dll's and other components without an MSI (at least in native C++ deployment) here's the link.. Visual Studio Installer[^] This also make COM component registration/unregistration an automated process and simplifies things since it puts your app in the add/remove programs applet window. -- modified at 11:23 Tuesday 23rd May, 2006

                S 1 Reply Last reply
                0
                • B bob16972

                  Pay special attention to the search order in the LoadLibrary documentation. Where your dll is in relation to the "Paths" searched is important. A_Laxman mentioned the COM based way of how the dll path is "registered" in the registry so an app can search the ProgId or CLSID of the component to obtain the info such as what it's path is. You are basically trying to achieve the same end via whatever means you have at your disposal. If you don't ensure your dll is located in one of the paths mentioned in the LoadLibrary documentation (Try not to rely on the PATH environment variable as this is a user configurable item and subject to change when users jack around with their settings), you might want to have your app installation msi place the path in your registry space for your installation. I do this and then retrieve the settings (including the path to the apps "bin" directory which is where I place my dll's). If your using VC++ 6.0, you will probably need the Visual Studio Enterprise Installer 1.1 to quickly build your MSI's. You really shouldn't be deploying apps that have dll's and other components without an MSI (at least in native C++ deployment) here's the link.. Visual Studio Installer[^] This also make COM component registration/unregistration an automated process and simplifies things since it puts your app in the add/remove programs applet window. -- modified at 11:23 Tuesday 23rd May, 2006

                  S Offline
                  S Offline
                  swatgodjr
                  wrote on last edited by
                  #8

                  the way my app works is nothign really big and complicated, its just a simple program i made to mess aroudn with. i do not "install" it on a pc in any way, i just send it to friends to test if it works. basically you open the exe, go into a screen where you type in the dll to load and the program loads it. its not complicated at least not in my eyes. i did notice that on my pc loadlibrary call is all i need to load the dll file, i do not have to get any addresses to the functions. but when i tell it to do that it crashes after i close the dll. my consoel based version works perfectly on any pc yet migrating the whole thing over to gui based seems to have changed how it does the loading of my dll files.

                  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