how to use the resource file to store all strings?
-
Hi, I would like to have all the UI strings in the resource file (including the strings for the messageboxes). How can I put them in the resource file and retrieve them? Thanks,
You can either add them manually to the .rc file, or do it through the IDE. Just click the ResourceView tab in the Workspace pane. Double-click the String Table resource type, and press the INS key. To retrieve the values, use
LoadString()
.
A rich person is not the one who has the most, but the one that needs the least.
-
Hi, I would like to have all the UI strings in the resource file (including the strings for the messageboxes). How can I put them in the resource file and retrieve them? Thanks,
Go to the resource view in the work space pane and select "String Table", then add your strings. In your code call LoadString(...) (sdk version or CString version). INTP
-
Hi, I would like to have all the UI strings in the resource file (including the strings for the messageboxes). How can I put them in the resource file and retrieve them? Thanks,
Go to Project->Add Resource menu item. Select "String Table" and Hit "New". The string editor should come up where you can add strings. To retrieve them: Using MFC: CString strText((LPCTSTR)IDS_MY_TEXT); or CString strText; strText.LoadString( IDS_MY_TEXT ); Non-MFC: TCHAR pszText[MAX_TEXT]; ::LoadString( GetModuleHandle(NULL), IDS_MY_TEXT, pszText, MAX_TEXT ) ____________________________________________ Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. (Rich Cook)