Click to See Complete Forum and Search --> : Manually loading msvcr90.dll


salvinger
04-27-2009, 10:30 PM
I'm attempting to manually map a dll into a target process, and so far everything is going well but with one hitch. The dll has a dependency on msvcr90.dll and whenever my program tries to load that library it returns 0 unless the target process already has it loaded. If I try the absolute path to the dll, then I get an error from the dll saying that the program loaded the dll incorrectly.

I could just statically link my dll to the runtime, but that seems to be avoiding the real problem. Does anyone know what I should do to fix this?

Danny
04-28-2009, 02:04 AM
I would link the dll statically into the program.
However, if you insist on loading the dll dynamically, you can first download msvcr90.dll and then download the one you need.

salvinger
04-28-2009, 10:36 AM
Well I know I already have that dll, it's just that I am unable to load it with loadlibrary. The weird thing is when I call loadlibrary on my dll in the context of the target process, the target process magically loads msvcr90, so I'm wondering why I can indirectly load it with a dll that links against it, and not manually load it with LoadLibrary("msvcr90.dll")

jonnin
04-28-2009, 11:07 AM
any chance you are mixing moded? Some of the ms**** dlls have a debug version and a release version and you can link in the wrong one (blowing up your project in the process). If you are in debug mode, you might need ms***D.dll or, swap to release mode and see if it clears up in the Non-D version?

salvinger
04-28-2009, 11:52 AM
No I'm not mixing the two, but this isn't really a problem with compatibility between the two though. I'm just trying to get a process to load the msvcr90 dll, which for some reason keeps returning 0 on the loadlibrary call :( and I can't figure out how the windows loader does it