When should I consider using a string table resource over a string constant in my Win32 application?
I've written a fair bit of Win32 desktop apps as hobby projects throughout my career but I've never used resources of the type string table in any of them; usually I either hard-code strings or build them through environment variables to determine paths and drive letters etc.
In what situations might I want to use a string table instead of string constants when designing a Windows program?
-
1I can't think of any time that I've used them directly. For internationalization I prefer external dictionary files so that translations and new languages can be added without altering the executable. (your compiler though may be converting your hard coded strings into resources behind the scene)GrandmasterB– GrandmasterB2016年03月31日 19:55:47 +00:00Commented Mar 31, 2016 at 19:55
-
@GrandmasterB: I believe, but am not 100% sure, you can achieve that with ResourceDlls.whatsisname– whatsisname2016年03月31日 21:28:28 +00:00Commented Mar 31, 2016 at 21:28
1 Answer 1
They come in most useful when you are going to ship a multi-lingual version of your software. When doing that, the LoadString()
calls makes dealing with the language abstracted away.
When doing drive paths and letters its less useful, but when you need to write either "Cancel" or "Abbrechen" on your cancel button, that's where it matters.
Explore related questions
See similar questions with these tags.