|
There are different way's to to that.
The first one is to store every (yes, i mean every) label in a database.
Before showing the label you must get it first from the database.
It's very easy now to add a language. You only need to add a field for that language in the database. And a translater can fill in the new field.
Your sourcecode remains the same. (no recompilations)
The other way is to add every label to the stringtable of the resource. You need to recompile when you added a language. But you don't need a database.
And the thirth way is the way I'll prefer for your project. Use a XML file with the labels for every language. It's not that hard to parse the XML-file.
None of the techniques above are quick and easy to implement.
You have to remove every label and get the label in the correct language
succes !
W.
|
|
|
|
|
whofmans wrote:
Is there a way to do this fast
Nope. AFAIK, a lot has already been discussed about this thema. There is several articles about that in CP, try to make a search.
~RaGE();
|
|
|
|
|
Another idea is to use a texte file of the following format:
01 "String1"
02 "String2"
03 "String3"
.... and so on for every string you need to be translated.
You create then a class that loads such a text file (you just have to specify the filename of the file to be loaded) and with a function that returns a string given an index (something like char* LanguageClass->GetString(int StringIndex) ).
So, for every string in your project, (for example MessageBox("String1") ), you specify instead: MessageBox(LanguageClass->GetString(1) ). For the controls (for the static textes, you must change the Id to a specific value), you use the SetWindowText function to change the text.
So, when you want to use another language you just have to specify another text file to be loaded. For example if you want to specify the language with the command line parameters, you construct your LanguageClass there and you specify wich language file has to be loaded.
Hope this helps !
|
|
|
|
|
Thank you all!
I think i use the cmoonen's way. Only not with a Index integer but with the original string.
The textfile looks then like this:
"Hello" "Hallo"
"Error" "Fout"
If the string is not found in the textfile then i return the given string, otherwise the translated string will be returned.
|
|
|
|
|
sometimes a word may have two (or more) translations ("Commercial" in french may be a "sales Person" or "Commercial" in english).
In this case you will have some problem with your method (you can only have one translation for one word).
have a nice day
|
|
|
|
|
The main problem with this method, is the user can modify the text file, if someone changes a text string such as:- "Press Yes to delete all file" to Press Yes to leave all files" you tend to get some very irate phone calls! Although the good point is that a user can do their own translarions.
If I have seen further it is by standing on the shoulders of Giants. - Isaac Newton 1676
|
|
|
|
|
The best solution is using Satellite DLL!
A. Riazi
|
|
|
|
|
The best solution is using Satellite DLL.
A. Riazi
|
|
|
|
|
Focus on Buttons missing in XP
Program written in MFC VC++ 6.0 - SP5, has been in use on everything from Window 95 up to XP Pro.
I have noticed that buttons and checkboxes on dynamically created dialogs (and maybe others) running on XP Pro do not show the dotted frame to indicate the control has the focus. I have observed this on PCs set up to use the Classic Windows style in XP. I do not know if the standard XP style also behaves in this way as I cannot change the setting. The same program displays these normally when run on NT4.
Does anyone know how to restore this desirable behaviour as it does not show which control has the focus.
Sara
|
|
|
|
|
It's a user setting, the user can choose to hide focus indicators and keyboard shortcuts (like underlined letters in menus).
--Mike--
THERE IS NO THERE IS NO BUT THERE IS
MAGIC PIXIE DUST BUSINESS GENIE CODE PROJECT
BUY MY SOFTWARE!! (please?) RightClick-Encrypt | 1ClickPicGrabber
My IntarWeb Homepgae!!!11
|
|
|
|
|
Thank you. That fixed it once I found the place to change the entry.
A change with that effect is a bit subtle as it refers to underline of menu items but no reference to button focus.
Sara
|
|
|
|
|
Hi,
Is there control or class for visual html editing? Like the editing area of FronPage for example?
Thanks in regards!
Yasen
|
|
|
|
|
Yes, It's the CHtmlEditView class. It is new in MFC 7. You just create a SDI application and specify the base class to be derived from CHtmlEditView and build it and you are done. You type into the view window, insert and move pictures etc and HTML is created for you. You can view it by right clicking on the view and selecting View Source.
Hope this helps.
Art
|
|
|
|
|
Hi,All
In My application i am using CPropertySheet class for tabed dialog.
I have to change the Tab Cotrol Back color and TabColor.
For this i tried with
CMyDislplay::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
if( nCtlColor == CTLCOLOR_DLG)
{
pDC->SetBkColor(RGB(181,195,222));
pDC->SetTextColor(RGB(255,255,255));
return (HBRUSH)(m_pDlgBKBrush->GetSafeHandle());
}
HBRUSH hbr = CPropertySheet::OnCtlColor(pDC, pWnd, nCtlColor);
}
//CMyDislplay is derived from CPropertySheet.
In above trial the dialog color is changed,but Tab Color not changing
----
Can any one help me...
how can i change the Tab Color as wel as dialog color
thank in
advance..
anju
|
|
|
|
|
I have been developing some application that requires the use of the windows com port. The windows driver seems to be behaving rather erratically when used with a non intel motherboard.
Symptoms:
Win XP/2K, intel motherboard, intel cpu
Windows serial driver works without error when receiving data from physical serial com port.
Win XP/2k, ALi/VIA motherboard with intel/AMD cpu,
Windows serial driver seems to be dropping data or had buffer overflow problems when receiving a few hundred kilobytes of data. Therefore the data i received when using the readfile(); would be invalid.
This is a very consistent problem and very repeatable.
Below is my configuration:
dcb.BaudRate= 57600;
dcb.fParity = FALSE;
dcb.Parity = FALSE;
dcb.StopBits= FALSE;
dcb.ByteSize= 8;
dcb.fOutxCtsFlow = TRUE;
dcb.fOutxDsrFlow = FALSE;
dcb.fDtrControl = DTR_CONTROL_DISABLE;
dcb.fDsrSensitivity = FALSE;
dcb.fRtsControl = TRUE;
dcb.fOutX = FALSE;
dcb.fInX = FALSE;
dcb.fBinary = TRUE;
dcb.fNull = FALSE;
dcb.fAbortOnError = FALSE;
I tried searching around for configuration advises to the windows com port for the ALI and VIA chipsets but couldn't find any writeouts on them.
Please do advise on this issue...
Best Regards
spc
|
|
|
|
|
Hi, everyone!
I want to develop a remote desktop share/remote control
program, like terminal service in XP.
The reason why I want to develop a program like this has
two reasons:
1. I want to control the authentication method more flexibly,
for example, replace windows authentication method with
LADP method. But XP can only use windows authentication.
2. XP terminal service can not let more than two users to
share the same desktop.
My quetions are:
1. Does Microsoft have SDK to develop applications like this?
2. Are there some source codes that I can refer?
Thanks in advance,
George
|
|
|
|
|
VNC[^] is an open source cross-platform remote desktop application, so you should be able to modify that to include your own custom authentication.
I believe it allows multiple users to remote view the same desktop (and you can have a choice of just remote displaying the desktop, or actually allowing the remote user to control it)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
Thanks, benjymous buddie!
It is a very nice open source software!
George
|
|
|
|
|
I used most of time dynamic memory allocation. But I am asking my self how much could be a static allocated array in a Visual C++ application.
Is something related to Operatong System like : for 16 bit win mak is 64kbytes.
For the Visual C++ 6, I didn't found some specification related to this problem.
IS for sure the I tryed with a bigger buffer, but how sure could be ?
Thanks
Cutty
|
|
|
|
|
the maximum size of a statically allocated array in a function is limited by the size of the program's stack. the maximum size of an array allocated outside of a function is probably limited at run-time by the system (ie. how much memory is available).
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
Hi, all!
Here's a plain old C++ program that you have to modify such that it prints "Hello, world!" before it prints "Bye, world!" :
<br />
<br />
#include <iostream.h><br />
<br />
int main()<br />
{<br />
cout<<"Bye, world!";<br />
return 0;<br />
}<br />
<br />
But here's the catch: You should NOT modify main() - in fact, you should'nt do anything to main() at all, but apart from that, you can do anything.
In fact, I already know of TWO ways to do this (of which one works everywhere and one works on Turbo C++ but not on VC++), and I just want to find out if there are any more.
Right now, it's 11 AM IST (5:30 AM GMT). I'll be back around 4:00 PM IST (10:30 AM GMT) for the answers.
Happy brain-racking!
Vikram.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
This is not a standard C++ program, it uses iostream.h instead of iostream.
Surely if you create a class which prints hello world in it's constructor and create a global instance of it you'll get the desired result ?
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Christian Graus wrote:
This is not a standard C++ program, it uses iostream.h instead of iostream.
Yeah, you've got a point. But that's not the point.
Christian Graus wrote:
Surely if you create a class which prints hello world in it's constructor and create a global instance of it you'll get the desired result ?
That's right. That's one way of doing it- the portable way.
The "other" way is doing it in Turbo C++ , like this:
<br />
<br />
#include <iostream.h><br />
<br />
void Hello()<br />
{<br />
cout<<"Hello, world!";<br />
}<br />
#pragma startup Hello<br />
<br />
int main()<br />
{<br />
cout<<"Bye, world!";<br />
return 0;<br />
}<br />
<br />
It does'nt work with the Win32 compiler (the pragma is implementation-dependant).
BTW, what happened to poor Vinod's article? Did it get chucked out? Poor guy!
I woulda loved to see his next article on RAM or something- his articles make funny reading. The humor content is way high.
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|
|
Vikram Punathambekar wrote:
Yeah, you've got a point. But that's not the point.
I know, but I'm pedantic.
Vikram Punathambekar wrote:
BTW, what happened to poor Vinod's article?
It was removed and he was advised to modify and resubmit if he wanted to. I don't think he did.
I like the operator << solution better. iostreams rock. I dunno why I didn't think of it, because I play with them quite a bit. And when I said 'doesn't this work', it's because I didn't try it, and I too wasn't sure if iostreams were up and running prior to main(). I guess they are, but if the standard says they must be is another thing.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
Christian Graus wrote:
I know, but I'm pedantic.
So am I. I've got an eye for detail.
The << overload is definitely more "elegant", but you're indirectly modifying what is inside main() . So is the guy who used a #define on cout (see replies to this thread). That's something a purist (and pedants like you and me) would frown upon. The cleanest solution (IMHO) is the global constructor. Anyway, I like the << overload best (though I'm a purist).
Poor Vinod. All he wanted was to make us laugh.
Any other solutions for the original question, do let me know at binarybandit@operamail.com .
"Do not give redundant error messages again and again." - A classmate of mine, while giving a class talk on error detection in compiler design.
|
|
|
|