-
DLL + resources
What would be the implications, if any, that would occur as a
result of creating a DLL solely for the purpose of storing a very
large string table (200+ entries) that a program would link
to in order to retrieve these strings. I understand that the
static nature of the string table would increase the size of the
DLL's working set but would this have a significant impact on
the performance of the application if you were not constantly
reading these values?
thx for any help
-
That's called localization dlls and is done all the time.
No negative impact, except that you must use LoadLibrary to obtain a module handle that you can later use to load resources.
pro: every instance of your app can use the same string storage, you can create international versions simply by replacing the dll (no compiling/linking of the main app required)
-
I'm trying to get this to work and something is not right.
What am i doing wrong?
in my DLL...
Code:
CString MYLIB_DLLAPI CTestDLL::Message()
{
CString strTemp;
strTemp.LoadString(IDS_STRING1);
return strTemp;
}
and in my test prog...
Code:
CTestDLL test;
CString strTemp = test.Message();
AfxMessageBox(strTemp);
should i be doing something else?
-
nm
AFX_MANAGE_STATE( AfxGetStaticModuleState() );
solves the problem