Sharing violation error when loading a DLL
-
When I try to load any DLL with LoadLibraryEx, it gives a NULL-handle and the last error (GetLastError) is ERROR_SHARING_VOILATION. I'm using LoadLibraryEx, because I want to load a DLL that I found using CFileFind (or however it's called). Does someone know how to solve that? Even looping (+::Sleep(50)) until the last error is not ERROR_SHARING_VIOLATION won't help (it will hang the application).
-
When I try to load any DLL with LoadLibraryEx, it gives a NULL-handle and the last error (GetLastError) is ERROR_SHARING_VOILATION. I'm using LoadLibraryEx, because I want to load a DLL that I found using CFileFind (or however it's called). Does someone know how to solve that? Even looping (+::Sleep(50)) until the last error is not ERROR_SHARING_VIOLATION won't help (it will hang the application).
Are you sure that
GetLastError()
is returning the correct code? Before callingLoadLibraryEx()
, do aSetLastError(0);
to make sure. Also, check which other app has loaded the DLL. Bikram -
Are you sure that
GetLastError()
is returning the correct code? Before callingLoadLibraryEx()
, do aSetLastError(0);
to make sure. Also, check which other app has loaded the DLL. Bikram