Results 1 to 4 of 4

Thread: DLL + resources

  1. #1

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471

    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
    Bababooey
    Tatatoothy
    Mamamonkey

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    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)
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    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?
    Bababooey
    Tatatoothy
    Mamamonkey

  4. #4

    Thread Starter
    Hyperactive Member noble's Avatar
    Join Date
    Nov 2000
    Location
    Philly
    Posts
    471
    nm

    AFX_MANAGE_STATE( AfxGetStaticModuleState() );

    solves the problem
    Bababooey
    Tatatoothy
    Mamamonkey

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width