Exe dynamic invocation a. d. LL
A. d. LL also dynamic invocation B.D LL
A. d. LL and B.D LL path in the same layer, exe in a. d. a layer of LL
Exe calls a. d. LL methods:
M_hHandle=: : LoadLibraryEx (_T (a. d. "LL absolute path"), NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
A. d. LL call B.D LL method
M_hHandle=: : LoadLibraryEx (_T (" B.D LL absolute path "), NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
Exe layer calls LoadLibraryEx error GetLastError=0
If the a. d. LL in static load B.D LL, is good at exe layer calls
Have any good solution?
CodePudding user response:
Can have a try of the module itself at GetModuleFileName, file path name, and then constructs the B.D LL the absolute path
TCHAR szPath [MAX_PATH + 1)={0};
If (GetModuleFileName (AfxGetInstanceHandle (), szPath, MAX_PATT))
{
PathRemoveFileSpec (szPath);//remove the current module file name
PathAppend (szPath, _T (" B.D LL));//append B.D LL
HMODULE hDLLB=LoadLibrary (szPath);
If (hDLLB)
{
.
FreeLibrary (hDLLB);
}
}
CodePudding user response:
B what dependence lead to the failure load
CodePudding user response: