Jump to content
  • Advertisement
Sign in to follow this  
jimywang

how can I use AfxLoadLibrary?

This topic is 4887 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 am trying to call a win32 dll from a MFC dll.In my program,I included stdafx.h which is created by visual studio,and I still get compiler error AfxLoadLibrary is not defined.Can somebody give me some advise pls?thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
Hello,

For a reason I don't fully understand, it seems that AfxLoadLibrary() is only used when AFXDLL is declared - ie you are using the DLL version of the MFC. I suggest you to create a blank project (MFC app with shared MFC dll) and to test wether you can call it or not.

Another solution may be to use the ::LoadLibrary() API (the first parameter can be either NULL or ::GetModuleInstance(NULL)).

HTH,

Share this post


Link to post
Share on other sites
I actually tried LoadLibrary() function.but for some reason,it doesnt work.I used ShowLastError,it says "The operating system cannot run".Does it mean I have some problem in my dll?

Share this post


Link to post
Share on other sites
Hi again,

< kidding >
Of course, If the OS cannot run, then there should be something wrong.
< /kidding >

Where does this ShowLastError() come from? Do you mean GetLastError()? What is the numeric return of GetLastError()?

Regards,

Share this post


Link to post
Share on other sites
thanks for helping.yeah I meant GetLastError.and I format them into string.and it says "the operating system cannot run"

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!