Do I need AfxSetResourceHandle?

Started by
1 comment, last by derek7 17 years, 10 months ago
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
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.
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?

This topic is closed to new replies.

Advertisement