|
Hi Friends,
I have a strange problem. I have a dialog based program and I Create a modeless CPropertySheet with 5 CPropertypage in it. and in the main Dialog box i have some buttons. when selecting a menu option i change size of the PropertySheet.
Now Issues are
I align the buttons in the dialog box with the property page. It looks ok on some Windows XP versions, but the Page looks more expanded in some other versions (like Chinese, Korean or japanese) and the Buttons aligned along it goes outside the main dialog.
The other issue is
when i compile the program in Multi Byte it looks OK. but If I compile the same program in UNICODE the color of the CPropertyPage turns white and looks different.
For the First issue, I kind of found the cause. That is the size of the CPropertypage is calculated according to the font set on it and as that font differs in some version of OS the size calculated become wrong and the display is screwed up. But I am clue less about how to resolve it.
Can some one help me with these?
P.Somasundaram
|
|
|
|
|
Hi,
I have the same problem with the size of the property pages. For Japanese the pages became longer than the dialog, so I resized the dialog to 1.2 times the original size and it looked okay. But for chinese, the property pages were made smaller, so the graphics were cut off. I dont know yet how to resolve it.
Did you ever find out a better solution that works for all OS?
Thanks,
Kalyan
|
|
|
|
|
Hi,
I am trying out the following code .
setlocale(LC_ALL ,"");
std::string ab = "名前を入力してください: " ;
cout.imbue(std::locale("Japanese_Japan.932"));
cout<<ab<<endl;
printf("%s" ,ab.c_str());
Both system and user locale are set to japanese.
Cout statement doesnt print the message in screen.
I am able to print message using printf .
how can i use cout to print japanese meesages ?
Thanks in advance
|
|
|
|
|
shouldn't you use std::wstring ?
|
|
|
|
|
Maximilien wrote: shouldn't you use std::wstring
No. His encoding is Shift_JIS (CP 932) and that's multibyte, not wide char.
|
|
|
|
|
Nemanja Trifunovic wrote: No. His encoding is Shift_JIS (CP 932) an
No. Her* encoding is...
*Deepa = female
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
I should know you're only interested in female's questions.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Wait... Weren't you the same guy who accused me of having a general hatred towards women?
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Yes.
Your memory is too strong, pal.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: Your memory is too strong, pal.
Mr. Nic Rowan shares his opinion[^] with you.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
Uh?!... What opinion?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Are you sure the locale was successfully set?
Try
cout << cout.rdbuf()->getloc().name();
after the imbue and see what it prints out.
|
|
|
|
|
As you said i tried printing the stream locale is shows "Japanese_Japan.932".
One thing observed is that if setlocale(LC_ALL ,"") call is commented then the message is printed correctly.
Any idea why ?
|
|
|
|
|
Deepa Bellary wrote: setlocale(LC_ALL ,"")
What is the User default ANSI code page of your operating system? If that is the same as the code page of what you're trying to print, I don't see why it should fail.
From the docs ^:
setlocale( LC_ALL, "" );
Sets the locale to the default, which is the user-default ANSI code page obtained from the operating system.
It is a crappy thing, but it's life -^ Carlo Pallini
|
|
|
|
|
If you are using std::wstring's, you need std::wcout.
std::cout works *only* with std::strings.
Since there is no _tcout, I like to use _tprintf (and _T macro) when printing Unicode stuff in console.
Take this code for example:
std::wstring test1 = _T("test1");
std::cout << test1.c_str() << endl; // prints junk "0012DE10"
std::wcout << test1.c_str() << endl; // prints "test1"
But to do it "properly", something like this is needed:
std::basic_string<TCHAR> test1 = _T("test1");
_tprintf(_T("Testing string is: %s"), test1.c_str());
I hope that helps.
Best regards,
loreia
modified on Saturday, January 17, 2009 12:55 PM
|
|
|
|
|
|
use wprintf() instead of printf(). likely use wide char version of cout(wcout) instead of cout
|
|
|
|
|
hi
how to simple crypt and encrypt string in Visual C++ ?
|
|
|
|
|
Depends on what kind of encryption you want. Have a look at Cryptography and Security[^] section of codeproject.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
http://en.wikipedia.org/wiki/Tiny_Encryption_Algorithm#Reference_code[^]
this is a very simple algorithm and just a few lines of code, but don't expect it to be very secure. if you're looking for an uncrackable algorithm then don't use this one
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Ok How can i use this code for a String?
|
|
|
|
|
What you do is to read both of your replies.
The wikipedia link described a nice algorithm called TEA.
The other person pointed you to http://www.codeproject.com/KB/security/[^]
Reading that list of articles, I came across http://www.codeproject.com/KB/security/TEA.aspx[^]
That has a picture of a demo project, and that has a "encrypt cstring" button, and a "decrypt cstring".
Then you think: "Hmm, maybe I'll read the code and find out how this person has done"...
Not having done any real encryption, I'll wish you luck.
But I'd also repeat the warning that TEA is encryption-lite. I have no idea if this is true though. It depends on the strength you need.
Again, good luck, and good learning,
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
|
|
Dear all,
I don't know if this the best place for posting my message, but I'll try...
I am trying to figure out which the best approach for the implementation of a class of a (VERY LARGE, LARGE = 1e6 - 1e7) arrays of 2-by-2 matrices. My contraints are the following:
- I have to perform a number of mathematical operations on this matrices, like C = A * B * D avoiding the creation of temporaries (due to size of these objects). Overoloading operators is not a problem, but I DO need a good starting point
- the execution speed of this operations must be as high as possible, since I have to perform a large number of operations.
I've been googling for the last 3-4 days and I've found a number of different approaches for the soultion of this problem (downloadable libraires, expression templates, block-copy techinques), but I haven't found a well performing solution for my problem yet.
Can anybody help me, please?
|
|
|
|