Help - CString::LoadString(nID) is using the wrong resource handle!
-
I am building a library that will be linked to dynamically by other applications. In the library I load strings from the resource string table for the DLL using CString::LoadString(nID). The problem is that once the DLL is loaded, CString::LoadString(nID) tries to load the string resource from the applications resource table, rather than the DLLs. I have tried setting the resource handle (using AfxSetResourceHandle(…)) both sides of the call, but it still looks for the string in the applications resource. How can I get it so an calls in the DLL’s code to CString::LoadString(nID) load the string from the DLL’s resource table, and any calls in the application’s code load the string from the app’s resource table. Get it? Any help would be appreciated. I have tried searching my installed MSDN, but nothing came up that I could see to be useful. Cheers, James Millson
-
I am building a library that will be linked to dynamically by other applications. In the library I load strings from the resource string table for the DLL using CString::LoadString(nID). The problem is that once the DLL is loaded, CString::LoadString(nID) tries to load the string resource from the applications resource table, rather than the DLLs. I have tried setting the resource handle (using AfxSetResourceHandle(…)) both sides of the call, but it still looks for the string in the applications resource. How can I get it so an calls in the DLL’s code to CString::LoadString(nID) load the string from the DLL’s resource table, and any calls in the application’s code load the string from the app’s resource table. Get it? Any help would be appreciated. I have tried searching my installed MSDN, but nothing came up that I could see to be useful. Cheers, James Millson
try the ::LoadString API function (instead of CString::LoadString). -c ------------------------------ Smaller Animals Software, Inc. http://www.smalleranimals.com
-
try the ::LoadString API function (instead of CString::LoadString). -c ------------------------------ Smaller Animals Software, Inc. http://www.smalleranimals.com
Thanks, that worked perfectly.