|
From: Per W. <pw...@ia...> - 2003-03-21 23:02:43
|
See below /PWM On Fri, 21 Mar 2003, Zodiaq wrote: > Hello Per and all Dev-C++ users, > > Wednesday, March 19, 2003, 1:54:34 PM, Per wrote as follows: > > PW> Among other things yes. Every resource in the resource file - string, > PW> menu, image, ... have a language and sub-language setting, i.e. > PW> English,US-English. > > PW> But the resource is also a way to use graphical design tools to describe > PW> the graphical API of an application. The resource file allows any data > > Graphical API?? IMO there is no such thing... Do you mean GUI - > Graphical User Interface ? Yes, that's what I mean. A resource editor is a bit more graphical than most GUI's :-) > > PW> that the resource editor needs to change to be separated from the manually > PW> edited source code of the application. > > PW> A resource file might contain the same string etc. in multiple languages. > PW> The OS will then try to auto-select the language based on the users > PW> language settings in the OS. > > AFAIK in source code programmer have to load proper local string, > AFAIK system doesn't do that autamatically... am I wrong? You are both right and wrong. The resource file may contain the same resource (string, dialog, image, ...) in multiple language versions. However, the order of the different languages in the file seems to affect the OS success at selecting correct language version. If the language order is correct for a Swedish Win NT, i.e. depending on user language the application always selects correct language of dialogs, a German NT will fail misserably. M$ have a tendancy to implement interesting ideas but then fuck up on the implementation. > > PW> One other reason for resource files is that the same code may support a > PW> simple or advanced API. In the simplified API, some dialogs might be > PW> smaller, and with some 'advanced' fields removed. > > But if some fields are removed source code also have to be changed... > if not program would crush trying to send some infos to not existing > controls - I have experienced this recently... It's a question of type of fields, and how the application is written. It's completely safe to send messages to controls that doesn't exist in the resource file. However, if the application binds the control to a C++ object, things might get a bit more hairy. It's also important for the program to either check for the existence of input fields, or to supply reasonable defaults in case the removed field is a input field. > > PW> A third reason for resource files is that they allow customization, i.e. a > PW> program is delivered to different corporations, and each corporation gets > PW> the application with different look-and-feel, i.e. the colors, logos etc. > PW> are adjusted. > > Hmmm... interesting... got to remember that! > > PW> Basically, a resource compiler takes a - normally text - xx.rc file and > PW> produces a binary xx.res file. That file is then appended to the > > MinGW produces .o files... but extension IS NOT important, only that > it have to be linked into final executable... > > PW> executable file, and the windows API contains functions to look for > PW> resource data at the end of a exe or dll file. > > PW> One way to support multiple languages of an application is to build the > PW> main exe without resources - or with only language-neutral resources. Then > PW> the project contains one dll file for each market. Uppon startup, the > PW> program selects which dll to load and use for resource lookup. > > Good idea! > > PW> /Per W > > Thanks for your comments :-) > -- > regards, Zodiaq > > > > ------------------------------------------------------- > This SF.net email is sponsored by:Crypto Challenge is now open! > Get cracking and register here for some mind boggling fun and > the chance of winning an Apple iPod: > http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |