Jump to content
  • Advertisement
Sign in to follow this  
derek7

Do I need AfxSetResourceHandle?

This topic is 4417 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 make resource to a dll . and I use loadLibrary to map/link dll to exe.so I can use resource like loadMenu(hinst, id); but I see no need for AfxSetResourceHandle. another question: if resource in dll conflict with exe resource, what happen? for example // resource in dll #define IDI_my 200 // resource in exe #define IDM_my 200

Share this post


Link to post
Share on other sites
Advertisement
AfxSetResourceHandle is for use with MFC. If you're not using MFC, then you don't need it.

There is no conflict between dll/exe resources because you have to pass the HINSTANCE when obtaining the resource. So, if you pass the instance of your dll, you'll get the dll resource. If you pass the instance of your exe, you'll get the exe resource.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dave Hunt
AfxSetResourceHandle is for use with MFC. If you're not using MFC, then you don't need it.

There is no conflict between dll/exe resources because you have to pass the HINSTANCE when obtaining the resource. So, if you pass the instance of your dll, you'll get the dll resource. If you pass the instance of your exe, you'll get the exe resource.


thanks.

#ifndef _DEBUG
CMutex Mutex(FALSE,TEXT("KLGamePlace"),NULL);
if (Mutex.Lock(0)==FALSE) return FALSE;
#endif

another question:
I see the code in my mfc project. I found Mutex not used in elsewhere in that project. so where does the code come to play?

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!