Re: messabebox(...) v afxmessanebox
You are likely right that the difference is negligible. I guess it would
depend on how many strings there are, but there would have to be a lot in
order to notice a difference. The beauty of our jobs is that there are so
many creative ways to accomplish our tasks. You say GLS() I say GRS()
(GetLocalizedString vs. GetResourceString) Of course, I can read
IDS_I_LIKE_OREGON much easier than, um, whatever you said in Italian, but I
get your point.
Frankly, I know OP wants to use his own string based vector and that is
certainly his prerogative, but if it were me I'd just use multiple string
tables in one or more RC files and let the IDE do the work for me.
It's an interesting discussion of methods though and I've enjoyed the banter
as usual :o)
Tom
"Giovanni Dicanio" <giovanni.dicanio@invalid.com> wrote in message
news:OZqEj3ueIHA.1168@TK2MSFTNGP02.phx.gbl...
"Tom Serface" <tom.nospam@camaswood.com> ha scritto nel messaggio
news:D2823AAE-C0B0-44A6-A86B-3AAB98EA95D2@microsoft.com...
That's a clever idea. You could use constants for the English values
(keys) as well
[...]
IDS_WELCOME 1
IDS_COUNTRY 2
[...]
Hi Tom,
the fact is that I prefer reading strings into source code (maybe others
prefer to read integer constants, but I prefer reading strings).
It is just my personal preference, and I'm aware that others also more
qualified than me can have different opinions, but I just consider more
readable in source code having:
DoSomething( GLS("I like Oregon" );
(which by GLS() - Get Localized String - function can be translated in the
exe like e.g. italian string L"Mi piace l'Oregon"), instead of:
DoSomething( IDS_I_LIKE_OREGON )
(and exspecially for longer strings...).
Of course, you are right when you write that a string-keyed mapping is
less efficient than just integer values; however, I think that in most
cases the difference is negligible.
G