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. Resource DLL not loading to process

Resource DLL not loading to process

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestionlearning
5 Posts 2 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.
  • T Offline
    T Offline
    tony_Udz
    wrote on last edited by
    #1

    Hi, I m trying to load a resource dll to my application but its failing with error code 126(which says dll not found). I have also checked the path manually as well as using CFileFind (and it shows that dll is there). One more thing i have also checked the same code with normal dll(i.e. which has some code) and it works absolutely fine. Does anyone has any idea or hint about this? Is it related to trusted dll? Thanks in Advance! Tony

    Richard Andrew x64R 1 Reply Last reply
    0
    • T tony_Udz

      Hi, I m trying to load a resource dll to my application but its failing with error code 126(which says dll not found). I have also checked the path manually as well as using CFileFind (and it shows that dll is there). One more thing i have also checked the same code with normal dll(i.e. which has some code) and it works absolutely fine. Does anyone has any idea or hint about this? Is it related to trusted dll? Thanks in Advance! Tony

      Richard Andrew x64R Offline
      Richard Andrew x64R Offline
      Richard Andrew x64
      wrote on last edited by
      #2

      It might help if you showed some code and said where the file is located.

      T 1 Reply Last reply
      0
      • Richard Andrew x64R Richard Andrew x64

        It might help if you showed some code and said where the file is located.

        T Offline
        T Offline
        tony_Udz
        wrote on last edited by
        #3

        CString strPath = "C:\\Test\\SampleResource.dll"; CFileFind Ff; bool bIsFilePresent = Ff.FindFile(strPath); // It returns true HINSTANCE hTest = LoadLibrary(strPath); // It returns NULL DWORD dwError = GetLastError();// It returns 126 I hope this piece of code is understandable. Thanks.

        Richard Andrew x64R 1 Reply Last reply
        0
        • T tony_Udz

          CString strPath = "C:\\Test\\SampleResource.dll"; CFileFind Ff; bool bIsFilePresent = Ff.FindFile(strPath); // It returns true HINSTANCE hTest = LoadLibrary(strPath); // It returns NULL DWORD dwError = GetLastError();// It returns 126 I hope this piece of code is understandable. Thanks.

          Richard Andrew x64R Offline
          Richard Andrew x64R Offline
          Richard Andrew x64
          wrote on last edited by
          #4

          The problem is most likely that the DLLMain() function in the DLL is returning FALSE. When you build the resource DLL, set the "Entry Point" property to None - Resource DLL. That ought to fix it. The "Entry Point" property is on the "Linker" tab.

          T 1 Reply Last reply
          0
          • Richard Andrew x64R Richard Andrew x64

            The problem is most likely that the DLLMain() function in the DLL is returning FALSE. When you build the resource DLL, set the "Entry Point" property to None - Resource DLL. That ought to fix it. The "Entry Point" property is on the "Linker" tab.

            T Offline
            T Offline
            tony_Udz
            wrote on last edited by
            #5

            Entry point has been very correctly set and in fact it is working fine with WinXP and Win Vista. But same code is failing with Windows 7. Any idea about 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