Re: Something Cool About Vista
"Tom Serface" <tom.nospam@camaswood.com> wrote in message
news:4A8D396F-2067-4D92-B591-C1937D3A431C@microsoft.com...
I would normally avoid doing it this way. It makes it very difficult to
edit the resources using the IDE. I only did this one application this way
because I needed a totally stand alone program that would run in the
correct language depending on where it is installed. It's a program for
restoring files from a CD, DVD, or Blu-ray disc. It gets added to the disc
at create time. It needed to be very small (it's around 300K including 6
languages) and if someone creates a disc in English, then tries to restore
it on a German system I wanted the restore program to run in German (for
example). That all worked OK, I just didn't have a good way to test it
since I didn't have all the languages loaded on my PC.
Yes, I'm faced with a similar project now. We have our own proprietary way
of translating the strings, though. The translations are stored in XML
resources and applied dynamically by subclassing each window at runtime.
BTW, under pre-Vista OS's there were 2 API's to determine the user's
language:
GetSystemDefaultLangID()
GetUserDefaultLangID()
Both are set in the Regional Control Panel, I forget which tabs. The first
requires a reboot, the second does not. I am using the second one to
determine the default language.
I also statically linked MFC so this is as stand alone as it can get
(doesn't rely on any DLLs that I can find). There were a few technical
difficulties with this program, like it can't really run from the disc so
I had to make it clone itself onto the harddrive before running, but ...
oh well... you get the idea. One 300K program caused me a lot of grief,
but was really a lot of fun to create.
Just curious, what is the program doing that precludes running from
read-only disc?
One thing that is interesting. MFC added less than 150K to the EXE size
(statically linked). I wonder why people call that "code bloat". You
could never do that with .NET (considering no runtime modules). That
doesn't even fill out the sector on the disc :o)
I think MFC got the reputation of code bloat back when anything more than 20
KB was too much for an ActiveX control... dial-up modem days and all. It
sure doesn't apply nowdays. Even redistributing the MFC DLL's is low weight
compared to .NET.
Cheers,
David