|
Do you really need to create them at runtime? Unless you don't know until runtime how many labels you'll need, you can create them as not visible. Then at runtime, you can alter their text and position and show them as needed.
You can also add controls at runtime, of course, but more often than not it's not actually needed.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
I've been trying to get the edit control in my dialogbox to accept UNICODE characters (WinXP):
1) Compiled application for UNICODE, the richedit control accepts UNICODE but the standard edit control does not.
2) Tried setting font of control to use a TT unicode font (WM_INITDIALOG); that didn't work.
3) Tried editing the .rc directly to use UNICODE font; that didn't work.
4) Searched MSDN for solution; that didn't work, but maybe one of the samples applications show how to do it.
5) Currently searching CP, then it is off to the rest of the www.
Note: I know the edit control will accept MBCS, since it has been able to do that since Win3.1.
Q. Does anyone know why the above solutions don't work?
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Did you define both UNICODE and _UNICODE ? That should be enough to make your application use UNICODE versions of Win32 APIs and MFC libraries.
John R. Shaw wrote:
the richedit control accepts UNICODE but the standard edit control does not.
How exactly is it failing?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hello Jose,
Yes I have define both UINCODE and _UNICODE. I've used UNICODE, MBCS and SBCS in console programs without a problem.
Jose Lamas Rios wrote:
That should be enough...
That's what I thought, but it's not working.
Jose Lamas Rios wrote:
How exactly is it failing?
1) If I paste a character from the Character Map application, even if same font selected, then the edit control displays '?' (does not translate).
2) If paste it to the richedit control, it diplays correctly.
P.S. What's the time difference between the east coast of US and Uruguay? It is just after midnight here.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
John R. Shaw wrote:
Hello Jose,
Hi, John
John R. Shaw wrote:
1) If I paste a character from the Character Map application, even if same font selected, then the edit control displays '?' (does not translate).
Weird. Is it a plain vanilla dialog generated with Class Wizard? Are you processing any message or notification for this edit? Any character in particular (what unicode code)?
I can't try it right now, but I might tomorrow...
John R. Shaw wrote:
P.S. What's the time difference between the east coast of US and Uruguay? It is just after midnight here.
We are at (GMT-3:00), so that will be one hour of difference. It's 1:47 AM right now.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Ahhh! Another night owl.
Jose Lamas Rios wrote:
Weird. Is it a plain vanilla dialog generated with Class Wizard? Are you processing any message or notification for this edit? Any character in particular (what unicode code)?
1) Plain vanilla dialog generated with Class Wizard.
2) Nope. I am not processing any message for this edit; I should not have to.
3) Well I don't think that it matters but I was pasting character U+0428, using "Corier New" and "Times New Roman".
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Are you using VS2003 or VS6?
I first tried with VS2003. In the project settings (Configuration Properties / General) I changed "Character Set" to "Use Unicode character set". This takes care of removing _MBCS and defining both UNICODE and _UNICODE. Rebuilt and everything worked fine.
Then tried with VS6. In project settings (C/C++ tab, Category General, Preprocessor definitions) removed _MBCS, and added UNICODE, _UNICODE. In the Link tab, Category Output, I set Entry-point symbol as wWinMainCRTStartup. Rebuilt and everything worked fine too.
In both cases I started with an AppWizard-generated dialog-based application and just added an edit control to the dialog template.
Try getting the text from the edit and inspect its content so as to determine if you are having problems with the text itself or if it's just a problem in how the edit displays it.
I also suggest testing by creating a project from scratch as I did.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
:-DVery good! I should have checked in yesterday.
What I did was to check the size returned by sizeof(TCHAR) and found that it was still 1. So I checked the settings and found that _MBCS was defined before UNICODE,_UNICODE. So I removed it from my UNICODE builds.
Naturaly, this caused some other problems, which I am working on now.
P.S. I'm using VC6.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
John R. Shaw wrote:
Naturaly, this caused some other problems, which I am working on now
Well, that's what we do for a living, isn't it?
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Hi
You can set the font(some unicode font) from the resource editor itself this is working for me.
--Antony
|
|
|
|
|
John R. Shaw wrote:
...but the standard edit control does not.
Does it work in Notepad?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
DavidCrow wrote:
Does it work in Notepad?
Yes!
In my settings: _MBCS,UNICODE,_UNICODE
Solution: remove _MBSC from settings.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
when i study the codepage.
i can't understand... that mean?
how to used codepage 80 00 under character?
|
|
|
|
|
|
|
JWood wrote:
Joel's a bit preachy
A bit preachy, may be. But I do find it funny and enlightening at the same time
JWood wrote:
there is also http://www.flipcode.com/articles/article_advstrings01.shtml[^]
I didn't know that; it's a good one too.
I think both articles complement each other well. Joel's is more conceptual. It does a very good job at explaining the character sets evolution, and the concepts behind each of the names in the dance: what's ASCII, what's ANSI, what's a code page, etc., and Unicode, of course. In particular, it explains the distinction in Unicode between the character set, that is, the mapping between characters and numeric values (and no, it isn't limited to 65536 characters), and the possible encodings to use when you need to represent Unicode code points in memory or disk (and no, it isn't always stored as 16 bit per char).
The article you linked, on the other hand, is more implementation oriented, and as such it covers details that aren't present in the one from Joel. Although is somewhat conceptually wrong when it talks about Unicode and Unicode-encoded-as-utf-16 as if they were exactly one and the same, that doesn't actually hurts much, because of its focus on Visual C++ and Win32, where that equivalence is almost always true, and even MS documentation treat them as the same thing.
So, to any beginner, I'd recommend starting with Joel's article so as to better understand the concepts, and then reading this other article by Fredrick Andersson to see how these concepts are implemented and used with Visual C++ and Win32 APIs.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
Yeah certainly Joel has all the interesting theoretical points. I'm a practical type programmer so the Andersson article appeals a little more to me.
This is an issue that kind of struck me when I realized it - "Whoh, when did this happen and why wasn't I told?"
I am actually working on a piece of code to update to MBCS / Unicode all the functions in fairly large program so that it is ready for the European / Asian market.
|
|
|
|
|
I'm a source code control ART (anal retentive type). It's saved my butt on a number of occasions. However, over the past 18 months, my work is more mobile. Most of the code resides on my laptop, and 2-3 days each week I am in "the lab" - with access to servers, etc. As a result, application of VSS is not really practical.
So, I'm looking for some kind of source control tool that will allow me to have a database on my laptop but also allow me to synchronize with the "main" repository when I have the connection.
Any ideas?
C. Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
|
|
|
|
|
CharlieG wrote:
So, I'm looking for some kind of source control tool that will allow me to have a database on my laptop but also allow me to synchronize with the "main" repository when I have the connection.
This topic shows up in the lounge every once and a while. Here is a link for more information (I suggest reading all of the threads to get a good idea). Hope this helps.
Source Versions? ^]
-------------------------------
|
|
|
|
|
Yeah, I'll re-read the thread. Maybe something will popup to me..
thanks
C. Gilley
Will program for food...
Whoever said children were cheaper by the dozen... lied.
|
|
|
|
|
Hello guys and gals. I am currently a student doing my final year project in MC-CDMA with Turbo encoding and decoding. I am searching for any related source codes on MC-CDMA for me to work on. Your kind assistance will be greatly appreciated.
Cheers
Han
P.S. If there are any useful websites on mc-cdma and turbo codes, please tell me. Thanks a million.
|
|
|
|
|
kwangster wrote:
P.S. If there are any useful websites on mc-cdma and turbo codes, please tell me.
How about this one?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Thanks DavidCrow!! I will go take a look at it.
Guys and gals, if you find more information on MC-CDMA or any related source codes on MC-CDMA, please let me know. Thanks a milion.
|
|
|
|
|
Does anyone know if there are unicode versions of standard libraries stecifically the iostream ones? Is the templatized version designed to take care of this, is there a switch define like in the microsoft libraries for #define _UNICODE?
|
|
|
|
|
iostreams does a poor job at handling UNICODE. Even though you can use wide character versions of the routines, they still output in MBCS.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|