CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2001
    Posts
    49

    How to load a string from string table

    LoadString() function is used to load the string from a executable file, but this function is not working if I try to load a string from Library file( working fine with dll file).

    For example I have executable named

    1.exe which is linked with a library file 1.lib.

    if i try to load a string from 1.lib using loadlibrary it is failing. Is their any way to load a string inside a library.

    Please help







  2. #2
    Join Date
    Mar 2000
    Location
    Virginia USA
    Posts
    1

    Re: How to load a string from string table

    Use this line as the first line of your dll function that loads the String.
    AFX_MANAGE_STATE(AfxGetStaticModuleState( ));

    e.g.

    void LoadString()
    {
    AFX_MANAGE_STATE(AfxGetStaticModuleState( ));
    CString str;
    str.LoadString(IDS_MYSTR);
    }
    This should work


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

Featured