Resource DLL not loading to process
-
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
-
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
It might help if you showed some code and said where the file is located.
-
It might help if you showed some code and said where the file is located.
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.
-
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.
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.
-
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.