Application not loading on 64 bit Win R2

I need to fix an application which runs fine on all 32 bit windows systems. When I run the same application on Windows 2008 R2, it hangs. When I debugged, I found that it stops during the construction of an object, and this happens after the exit of the constructor and before the return of the object pointer by the new() statement. Within the constructor, I am loading a DLL file using loadlibrary method and retrieving the pointers to its functions using getprocadd. The application is in C++. Can experts suggest me how to go about identifying the cause? Any ideas on the possible causes will be appreciated.
Who is Participating?
sukhoi35Connect With a Mentor Author Commented:
I could solve this issue by loading the library in the constructor of the Containing class instead of in the constructor of the new object being defined. Technically, I am not really sure how this made a difference.
Kyle AbrahamsSenior .Net DeveloperCommented:
Is the dll 64 bit compatible?  Can you update to a 64 bit compatible version of the dll?
Eduardo GoicovichIT ConsultantCommented:
You can use Process Monitor ( to monitor and test the program
Is there any error code from the loadlibrary call?
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

sukhoi35Author Commented:
There actually is no error code returned by the loadlibrary call. I tried modifying the load flags from 0 to LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE. This worked, but I could observe that the application was dysfunctional in few other areas.
sukhoi35Author Commented:
I mean, the application became dysfunctional in few other areas after introducing this flag. Otherwise, with a flag value of 0, the application works normally except when the piece of code to load this DLL is invoked. The DLL I am loading is a 64-bit DLL.
sukhoi35Author Commented:
Practically, this worked
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.