When you need to call exported functions in a DLL, but cannot link with any library that resolves all these calls, you normally need to call the LoadLibrary function on the DLL and then obtain a pointer to each procedure you want to use with a call to the GetProcAddress function.
But the GetProcAddress can do more than provide you with a pointer to exported functions. It can also retrieve exported global variables. The xceedzip.dll file possesses a specially exported variable, which is a structure made of a pointer to each exported function. This structure's data is set when the DLL is loaded, and is of type XceedZipFunctions. Its exported variable name is g_xzFunctions.
To use the xceedzip.dll API interface without linking with xceedzip.lib, all you need is the following code:
VC++ | Copy Code |
---|---|
|