1 reply
by scottvs
Here are other techniques which are also helpful (it looked like maybe your note at the end of the article may have been alluding to this):
Use AfxSetResourceHandle to specify the location of your resources when necessary. Usually it is good to save the current value and restore it when you are done. (AfxGetResourceHandle, etc.)
Also, export a function from your DLL to allow for anyone to get the resource handle easily from anywhere. Something like GetMyResourceHandle which returns the handle to be used in the call to AfxSetResourceHandle or the "raw" Win32 LoadString or something like that. I have found it helpful to create a separate DLL with all of my strings with a COM and API way to talk to it, especially if the strings need to be translated into multiple languages.
One other thing to be aware of is that the MFC AfxFindResourceHandle will search for the FIRST match in the DLL chain with the requested ID/resource type. There is no way to modify the order of the chain, itis according to the DLL file name. If you don't use a global include file for resource IDs strange things can happen.
This discussion is closed to new replies.
Trending Web Development posts
Sort by Trending