Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

wxUSE_UNICODE is always set to 1 in setup.h!?

4 views
Skip to first unread message

Thomas Zehbe

unread,
May 24, 2006, 8:25:03 AM5/24/06
to
Hi All,
I'm actually using Version 2.6.2. I build the wxwidgets libs with VC6 on an
W2K machine using the wx.dsw workspace file in build/msw directory. I
compiled versions for release and debug, both for unicode and ansi mode.

Perhaps I misunderstood something, but I assumed that the preprocessor
directive "_UNICODE" which is only defined in the unicode configurations
makes the wrapper file "setup.h" in the "msvc/wx" directory including the
setup.h from the corresponding "lib/vc_lib/msw<xx>" directory.
And I further assumed that wxUSE_UNICODE is only set to 1 in unicode versions
of setup.

But struggeling with MS simple mapi api I found that wxUSE_UNICODE is defined
as 1 in all setups because the _T("x") macro didn't expand to "x" in ansi
mode.
My Question is wether I misunderstood something or is this a bug or did I mix
up my environment by accident?
Any hint would be appreciated!
Regards

Thomas

--
Dipl.-Ing. Thomas Zehbe
INGENION GmbH
Kuhweide 6
31552 Apelern
Fon: 05043 / 40 57 90 4
Fax: 05043 / 40 57 90 7

---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
For additional commands, e-mail: wx-use...@lists.wxwidgets.org

Vadim Zeitlin

unread,
May 24, 2006, 9:13:12 AM5/24/06
to
On Wed, 24 May 2006 14:25:03 +0200 Thomas Zehbe <t...@ingenion.de> wrote:

TZ> Perhaps I misunderstood something, but I assumed that the preprocessor
TZ> directive "_UNICODE" which is only defined in the unicode configurations
TZ> makes the wrapper file "setup.h" in the "msvc/wx" directory including the
TZ> setup.h from the corresponding "lib/vc_lib/msw<xx>" directory.

I don't quite understand the sentence above but what happens with _UNICODE
is that it overrides wxUSE_UNICODE definition in setup.h. This allows you
to use the same setup.h for both ANSI and Unicode builds: even though
wxUSE_UNICODE is 0 in setup.h, if _UNICODE is defined it is overridden and
redefined as 1.

TZ> But struggeling with MS simple mapi api I found that wxUSE_UNICODE is
TZ> defined as 1 in all setups because the _T("x") macro didn't expand to
TZ> "x" in ansi mode.

If you changed wxUSE_UNICODE to 1 this would be the case but you shouldn't
need to do it.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Thomas Zehbe

unread,
May 24, 2006, 10:16:55 AM5/24/06
to
Am Mittwoch, 24. Mai 2006 15:13 schrieb Vadim Zeitlin:
> On Wed, 24 May 2006 14:25:03 +0200 Thomas Zehbe <t...@ingenion.de> wrote:
>
> TZ> Perhaps I misunderstood something, but I assumed that the preprocessor
> TZ> directive "_UNICODE" which is only defined in the unicode
> configurations TZ> makes the wrapper file "setup.h" in the "msvc/wx"
> directory including the TZ> setup.h from the corresponding
> "lib/vc_lib/msw<xx>" directory.
>
> I don't quite understand the sentence above but what happens with _UNICODE
Vadim, thanks for your hint!
What I meant is the following:
->I found wxUSE_UNICODE defined as "1" in lib/vc_lib/mswd/wx/setup.h
->I assumed that there would be a special setup.h for every configuration.

But now I just reread the documentation and found that during the build
process "include/wx/msw/setup.h" is copied to the target include dir.

I must have modified the original setup.h but I can't remember that. Sorry!
Regards
Thomas

> is that it overrides wxUSE_UNICODE definition in setup.h. This allows you
> to use the same setup.h for both ANSI and Unicode builds: even though
> wxUSE_UNICODE is 0 in setup.h, if _UNICODE is defined it is overridden and
> redefined as 1.
> TZ> But struggeling with MS simple mapi api I found that wxUSE_UNICODE is
> TZ> defined as 1 in all setups because the _T("x") macro didn't expand to
> TZ> "x" in ansi mode.
>
> If you changed wxUSE_UNICODE to 1 this would be the case but you shouldn't
> need to do it.
>
> Regards,
> VZ

--

Dipl.-Ing. Thomas Zehbe
INGENION GmbH
Kuhweide 6
31552 Apelern
Fon: 05043 / 40 57 90 4
Fax: 05043 / 40 57 90 7

---------------------------------------------------------------------

Iulian-Nicu Serbanoiu

unread,
May 24, 2006, 10:18:55 AM5/24/06
to
On 5/24/06, Thomas Zehbe <t...@ingenion.de> wrote:
But now I just reread the documentation and found that during the build
process  "include/wx/msw/setup.h" is copied to the target include dir.

I must have modified the original setup.h but I can't remember that.  Sorry!
Regards
Thomas

You can control this. And if you don't remember you can always extract
the source again and test to be certain. I don't think the 10 minutes (?) of
compilation of the wx library are a real trouble.

Regards,

Iulian

Vadim Zeitlin

unread,
May 24, 2006, 10:42:31 AM5/24/06
to
On Wed, 24 May 2006 16:16:55 +0200 Thomas Zehbe <t...@ingenion.de> wrote:

TZ> What I meant is the following:
TZ> ->I found wxUSE_UNICODE defined as "1" in lib/vc_lib/mswd/wx/setup.h

You must have modified this file (or wx/msw/setup.h from which it is
created by default) then. By default the file in "mswd" (notice no 'u')
shouldn't have wxUSE_UNICODE == 1.

TZ> ->I assumed that there would be a special setup.h for every configuration.

This is true. It allows you to have different settings for different
configurations which is very useful sometimes. But you don't have to edit
anything for wxUSE_UNICODE because _UNICODE overrides it and so everything
just works by default.

TZ> But now I just reread the documentation and found that during the build
TZ> process "include/wx/msw/setup.h" is copied to the target include dir.

If it's newer than the file which is already there.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Thomas Zehbe

unread,
May 24, 2006, 11:09:43 AM5/24/06
to
I have checked it so I did find I must have messed it up:-)
Now my box is recompiling ...
Next time I'll have a look first.
Regards,
Thomas
>
> Regards,
>
> Iulian
0 new messages