Basically, when our software runs under Windows 7, it works: the call to LoadLibrary() succeeds, and life is good.
But when the same software is run on an XP box (latest patches), the call to LoadLibrary fails, returning NULL, with an error code that specifies module not found.
I have tried forcing it to use the UNICODE version LoadLibraryW instead of the LoadLibraryA version for our app.
I have tried making sure that the install folders are mapped through a local drive letter.
And I've verified the pathname is in fact accessible from the executing machine (i.e. the error produced indicates what path it is trying to load, and I use that string to actually find the file).
The weird thing is that this code runs correctly when compiled on VS 2008 SP2.
It also works fine when the client machine is Windows 7.
It only fails if it is compiled + linked by VS 2010 and if it run on an XP client.
I'm at a total loss as to what in the world could be going wrong.
To add weirdness to the stew:
If I fire up my XP VM on my development box and run this code in debug build in VS2010 under XP, it works correctly!
In fact, under my XP VM, the standard (release) build also runs correctly!!!
It's just when run from a true XP box that it fails (I've tried a couple of XP machines so far, both fully patched).
Any thoughts?!
I'm beginning to run out of credible ideas. :(
I would examine differences between your toolset and platform combinations.
For example the VS2008 vs VS2010 distinction is less important than what SDK you're using. Different SDKs could be targeting different msvc runtime libraries.
Is it possible you have the VS2010 runtime library installed on your XP VM and not the other XP platform?
You might also try the 'depends' utility on the non-working platform to determine missing dependencies.