Sign in to follow this  

Do I need AfxSetResourceHandle?

This topic is 4207 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
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

This topic is 4207 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this