Discussion:
Unicode string in VB6 controls
(too old to reply)
S N
2010-03-03 10:42:05 UTC
Permalink
I have a VB6 project using standard VB6 textbox controls. They are not
taking in Unicode characters in Hindi Language.
How do I modify the code so as to enable data entry in Unicode in Hindi
Language without changing the control itself (by using RichText Box Control
or Forms 2.0 controls as indicated on MSDN site).

S N
ralph
2010-03-03 15:22:48 UTC
Permalink
Post by S N
I have a VB6 project using standard VB6 textbox controls. They are not
taking in Unicode characters in Hindi Language.
How do I modify the code so as to enable data entry in Unicode in Hindi
Language without changing the control itself (by using RichText Box Control
or Forms 2.0 controls as indicated on MSDN site).
S N
You can't. Inherent VB6 textboxes don't speak Unicode.
You will have to find a Unicode replacement, adopt one of MS's
suggestions, or go find another alternate on the web. Some free, some
pricey.
S N
2010-03-03 15:30:34 UTC
Permalink
Is there somthing related to Fonts.charset which can help me in solving my
problem?
Post by ralph
Post by S N
I have a VB6 project using standard VB6 textbox controls. They are not
taking in Unicode characters in Hindi Language.
How do I modify the code so as to enable data entry in Unicode in Hindi
Language without changing the control itself (by using RichText Box Control
or Forms 2.0 controls as indicated on MSDN site).
S N
You can't. Inherent VB6 textboxes don't speak Unicode.
You will have to find a Unicode replacement, adopt one of MS's
suggestions, or go find another alternate on the web. Some free, some
pricey.
S N
2010-03-03 15:31:55 UTC
Permalink
Can someone advise me on one of the free solutions for the problem indicated
earlier.
Post by ralph
Post by S N
I have a VB6 project using standard VB6 textbox controls. They are not
taking in Unicode characters in Hindi Language.
How do I modify the code so as to enable data entry in Unicode in Hindi
Language without changing the control itself (by using RichText Box Control
or Forms 2.0 controls as indicated on MSDN site).
S N
You can't. Inherent VB6 textboxes don't speak Unicode.
You will have to find a Unicode replacement, adopt one of MS's
suggestions, or go find another alternate on the web. Some free, some
pricey.
Timo Kunze
2010-03-03 18:42:59 UTC
Permalink
Post by S N
Can someone advise me on one of the free solutions for the problem indicated
earlier.
On my website I provide free Unicode controls that can replace most of
the VB6 controls.

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
S N
2010-03-04 15:02:09 UTC
Permalink
Thanks for the very valuable advise. I shall consider the same.
However, can someone guide me if there is there somthing related to
Fonts.charset values related to this issue.
Post by Timo Kunze
Post by S N
Can someone advise me on one of the free solutions for the problem indicated
earlier.
On my website I provide free Unicode controls that can replace most of
the VB6 controls.
Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich - auf
demokratischem Wege - durchsetzen."
S N
2010-03-04 15:10:52 UTC
Permalink
I hope the free controls on your website support indic languages like Hindi.
Post by Timo Kunze
Post by S N
Can someone advise me on one of the free solutions for the problem indicated
earlier.
On my website I provide free Unicode controls that can replace most of
the VB6 controls.
Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich - auf
demokratischem Wege - durchsetzen."
Timo Kunze
2010-03-04 18:22:13 UTC
Permalink
Post by S N
I hope the free controls on your website support indic languages like Hindi.
Should be no problem as long as you use an adequate font. The controls
are thin COM wrappers around the Windows native controls, so if there're
problems with Hindi, it's likely that the native controls have the same
problems.

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
S N
2010-03-05 16:20:55 UTC
Permalink
Actually the native controls dont support Hindi. When we type in the native
controls in Hindi language, it just shows ???? characters.
That is why i want to use a unicode enabled control.
Post by Timo Kunze
Post by S N
I hope the free controls on your website support indic languages like Hindi.
Should be no problem as long as you use an adequate font. The controls
are thin COM wrappers around the Windows native controls, so if there're
problems with Hindi, it's likely that the native controls have the same
problems.
Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich - auf
demokratischem Wege - durchsetzen."
Timo Kunze
2010-03-05 18:23:13 UTC
Permalink
Post by S N
Actually the native controls dont support Hindi. When we type in the native
controls in Hindi language, it just shows ???? characters.
That is why i want to use a unicode enabled control.
With native controls, you seem to mean the VB6 controls. That's not what
I mean. I mean the native Windows controls - those that are used by the
Windows shell itself. The native Windows controls support Unicode.

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
MikeD
2010-03-06 00:22:52 UTC
Permalink
Post by Timo Kunze
Post by S N
Actually the native controls dont support Hindi. When we type in the native
controls in Hindi language, it just shows ???? characters.
That is why i want to use a unicode enabled control.
With native controls, you seem to mean the VB6 controls. That's not what
I mean. I mean the native Windows controls - those that are used by the
Windows shell itself. The native Windows controls support Unicode.
For clarity's sake, let's use the term "intrinsic" for VB controls and
"native" for Windows controls.

I've always believed (never had a need yet to have to use unicode in VB, so
I have practical experience and am more/less just guessing at all of this)
that the problem with using unicode in VB's intrinsic controls wasn't with
the control itself. After all, VB creates them from Windows' native
controls (VB's TextBox is actually Windows' Edit control). That's why you
can change styles and send EM_ messages and respond to messages via
subclassing. The "problem" is VB itself: it converts unicode to ANSI (or
vice-versa as the case may be). So, when you assign a unicode string to a
Textbox's Text property, VB converts that string to ANSI. I would guess that
if you *solely* use the API with VB's intrinsic controls, you might be able
to utilize unicode.
--
Mike
Timo Kunze
2010-03-06 00:44:39 UTC
Permalink
Post by MikeD
For clarity's sake, let's use the term "intrinsic" for VB controls and
"native" for Windows controls.
"Intrinsic" was the word I was looking for, thank you (English isn't my
native language).
Post by MikeD
I've always believed (never had a need yet to have to use unicode in VB,
so I have practical experience and am more/less just guessing at all of
this) that the problem with using unicode in VB's intrinsic controls
wasn't with the control itself. After all, VB creates them from
Windows' native controls (VB's TextBox is actually Windows' Edit
control). That's why you can change styles and send EM_ messages and
respond to messages via subclassing. The "problem" is VB itself: it
converts unicode to ANSI (or vice-versa as the case may be). So, when
you assign a unicode string to a Textbox's Text property, VB converts
that string to ANSI. I would guess that if you *solely* use the API with
VB's intrinsic controls, you might be able to utilize unicode.
You're on the right track. Under the hood, the intrinsic controls indeed
are native controls. BUT: As you probably know, you can create ANSI
windows and Unicode windows. ANSI windows are created through
CreateWindowExA and have an ANSI message handling routine (e. g.
DefWindowProcA). Unicode windows are created through CreateWindowExW and
have a Unicode message handling routine (DefWindowProcW).
VB6 creates ANSI windows, that's the main reason why it doesn't support
Unicode and why it won't work to make an intrinsic control support
Unicode. My controls create Unicode windows.

To make this topic more complicated: Internally, Windows creates all
windows as Unicode windows. But it does string conversion for the ANSI
versions of the API functions. So while each window actually is a
Unicode window, those that have been created through the ANSI versions
of the API functions, are presented as ANSI windows.

Timo
--
www.TimoSoft-Software.de - Unicode controls for VB6
"Those who sacrifice freedom for safety deserve neither."
"Demokratie ist per Definition unsicher. Ihr Schutz entsteht aus der
Überzeugung, dass die demokratischen Kräfte überwiegen und sich – auf
demokratischem Wege – durchsetzen."
Continue reading on narkive:
Loading...