Jump to content
  • Advertisement
Sign in to follow this  
fathom88

Strange LoadLibrary Bug??

This topic is 4019 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm using the LoadLibrary call in a VC++ app. The app works fine on a XP machine. However, the minute I run on a XP Pro machine, the dll is not loaded and I exit out. I did the obvious check and made sure my dll was present. It is in the same folder as my .exe. According to the documentation, the dll is searched for in this directory 1st. I've run the app on a fresh, newly installed XP system just fine. It simply won't load the dll in XP Pro. I checked and I'm logged in as System admin on the XP Pro machine. Do I need to do something special when in XP Pro? Thanks for any help.

Share this post


Link to post
Share on other sites
Advertisement
I doubt it has anything to do with XP vs XP Pro. More than likely it's just a difference between your two machines.

Does your dll have dependencies on other dlls (e.g. the MSVC dlls) that might not be present on the XP Pro machine? If so, it won't load.

Share this post


Link to post
Share on other sites
Using Sysinternals Filemon, you could check where exactly the application tries to locate the dll.
Maybe, the working directory of your application is set to a different folder on the XP Pro machine.

Share this post


Link to post
Share on other sites
Yes, I thought that might be a problem. I've run the app on several, non-developer XP machines and the app works fine. If it is another dependency, it is not related to the development studio. Thanks for the input.

Share this post


Link to post
Share on other sites
I've tried explicitly naming the path (and made sure both systems were copied to same paths) and got the same results, OK on XP, not OK for XP Pro. The tool looks cool though. I'll give it a try.

Share this post


Link to post
Share on other sites
Phil_T, you were absolutely right! I found another XP Pro machine and it worked. The XP Pro machine that I 1st tested on was a fresh system (only the OS was loaded). I've done all the Windows Updates and it still does not work. It must be some obsecure dependency that I just can't see. Thanks Wack for the tool. I'll give it try now. Hope it works!

Share this post


Link to post
Share on other sites
Solved! Using the dll dependency tools, I went down the list and found the missing dll. It was mfc71.dll! I thought this dll was standard !?! I searched on several non-developer PC's and found the the dll just fine. I'm glad I it worked after copying the missing dll. However, I'm curious why it was missing in the 1st place. I went as far as re-intalling the OS for the machine. However, I was forced to use the recovery CD that came w/ the machine. Can anyone help me w/ this part of the mystery?

Share this post


Link to post
Share on other sites
mfc71.dll is only included with MSVC, not with Windows.

Go into your project properties and set "Use of MFC" to "Use MFC in a Static Library" (that's what it's called in MSVC2003 anyway) and the problem should go away...

Share this post


Link to post
Share on other sites
You are right. Why was I able to find it on numerous non-developer PC's (PC's w/out Visual Studio or anything of the sort)? I got a fresh laptop from the IT deparatment that was going to be used by the accounting staff? Could some other software package be loading the dll? I took a quick look at the accounting staff's laptop and could only see MS Office & Outlook. You were right about the static setting. The dll was built w/ the shared flag set ON.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!