PDA

Click to See Complete Forum and Search --> : DLL + resources


noble
Mar 4th, 2002, 10:10 AM
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

CornedBee
Mar 5th, 2002, 05:45 AM
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)

noble
Mar 5th, 2002, 11:55 AM
I'm trying to get this to work and something is not right.

What am i doing wrong?

in my DLL...

CString MYLIB_DLLAPI CTestDLL::Message()
{
CString strTemp;

strTemp.LoadString(IDS_STRING1);

return strTemp;
}



and in my test prog...

CTestDLL test;

CString strTemp = test.Message();
AfxMessageBox(strTemp);


should i be doing something else?

noble
Mar 5th, 2002, 01:18 PM
nm

AFX_MANAGE_STATE( AfxGetStaticModuleState() );

solves the problem