Home > Software engineering >  MFC using LoadLibrary dynamic loading DLL limited number?
MFC using LoadLibrary dynamic loading DLL limited number?

Time:10-04

In MFC, I use LoadLibrary dynamic load the DLL, the DLL has been using no unloading, when loaded into more than 80 calls LoadLibrary has been returned empty, is there a number of the load the DLL?

CodePudding user response:

The memory/resources? See the error code GetLastError

CodePudding user response:

The error code
Meaning
0
System out of memory, executable file was damaged or call illegal
2
The file has not been found
3
The path was not found
5
Attempting to dynamic linking a task mistake or have a Shared or network protection error
6
Libraries need to create a separate data segment for each task
8
There is not enough memory to start the application
10
Windows version is not correct
11.
Executable file illegal or is not a Windows application, or in the. EXE image there is an error in the
12
Applications designed for a different operating system (e.g., OS/2)
13
The application for MS DOS 4. 0 design
14
Executable file types do not know
15
Trying to load a real mode applications (design) for early Windows
16
Trying to load contains can write multiple data segments of the second instance of the executable file
19
Attempting to load a compressed executables (file must be decompressed before they can be loaded)
20
DLL file illegal
21
Applications need to 32 bit extensions

CodePudding user response:

GetLastError returns the error code of 1114
After testing is like this:
In continuous circulation call LoadLibrary () is unable to load the DLL anymore after more than 80 times,
But each LoadLibrary () before calling FreeLibrary release can infinite loading, but doing so is against original intention, could you tell me how to break this problem?

CodePudding user response:

WinError. H: # define ERROR_DLL_INIT_FAILED 1114 l

CodePudding user response:

Load the same DLL, the DLL initialization stem what

CodePudding user response:

reference 5 floor Dobzhansky reply:
load the same DLL, the DLL initialization dry what

Is not the same DLL loading, loading of different DLL has different use, should be no call FreeLibrary release, but the DLL is useless over can't release,

CodePudding user response:

A problem is always a DLL? Or random

CodePudding user response:

refer to 7th floor Dobzhansky response:
problem is always a DLL? Or random

Is to load the DLL number problem, if not call FreeLibrary release DLL loaded, loaded number is limited

CodePudding user response:

reference 1st floor zgl7903 response:
whether memory/resources? GetLastError see error code

When I call FreeLibrary release DLL loaded, you can load an infinite number of DLL,
Is the insufficient memory resources? But this place can not release, the problem how to break?

CodePudding user response:

In the real world, in addition to the time and space could be infinite, any other things are limited,
  • Related