In order to properly load a DLL compiled using Visual Studio or Visual C++ on a machine that does not have the program, two conditions must be met during the deployment process:
(1) The end user must install the version of the Microsoft Visual C++ Redistributable Package that matches the version of Visual Studio from which the DLL was installed.
(2) The DLL must be built in Release configuration in Visual Studio/C++, not in Debug configuration. The Release configuration embeds manifests into the binary file that describe the DLL's dependencies on the Visual C++ runtime libraries. These manifests are required to properly link the DLL to the runtime libraries.
If the DLL fails to load on a machine that already has the matching version of the Microsoft Visual C++ Redistributable Package installed, recompile the DLL in Visual Studio using the Release configuration.
For more information, consult the following Microsoft Help page:
Best Answer