Writing a DLL that loads msvcr80.dll and exposes the free()-function-Collection of common programming errors

I have a third-party DLL that depends on MSVCR80 and allocates resources that I need to cleanup. The library does not expose a free-function for doing this. Instead, I need to load the same runtime library and manually call the free function.

As a workaround I’m trying to write a “wrapper” DLL that loads the correct runtime and exposes the free function. This DLL is created using Visual Studio 2010 and is dependent on a separate runtime library. Doing LoadLibrary("msvcr80.dll") fails with error R6034 which I guess is because of manifest issues.

Is it even possible to load msvcr80.dll using LoadLibrary? Do I need to create a manifest, embed it into the DLL and store msvcr80.dll in the same directory as my wrapper DLL?

I realize that this is a flaw in the third-party library, but I’m pretty much stuck with this version. Getting the vendor to fix this is most likely not an option.