[tao-users] [ace-users] Compilation error using ACE_USES_WCHAR

Mello, César Menin de Mello (Elipse Software) mello at elipse.com.br
Thu May 21 07:41:09 CDT 2015

Hi Phil,

Thank you very much! The usage of macros ACE_TEXT_ALWAYS_CHAR, ACE_TEXT and ACE_TEXT_CHAR_TO_TCHAR solves the issues with IFRService.

To share this through a pull request I still have to figure out how to setup a build from the git repository though.

Thank you very much.

Best regards!

-----Original Message-----
From: tao-users [mailto:tao-users-bounces at list.isis.vanderbilt.edu] On Behalf Of Phil Mesnier
Sent: quarta-feira, 20 de maio de 2015 18:31
To: Cesar Mello
Cc: tao-users at list.isis.vanderbilt.edu
Subject: Re: [tao-users] [ace-users] Compilation error using ACE_USES_WCHAR

Hi Cesar,

I'm shifting this to the TAO users list… (using my registered account this time)

> On May 20, 2015, at 4:02 PM, Cesar Mello <cmello at gmail.com> wrote:
> Hi,
> I can build most of ACE and TAO using ACE_USES_WCHAR under Windows (Visual Studio 2015 RC). Everything I currently need works, congratulations for the great work!

On behalf of the ATCD development community, thanks!

> But in IFRService/AliasDef_i.cpp the local variable ACE_TString "id" is wide (that's ok when reading from the ACE_Configuration::get_string_value because it also returns a wide string):
> ----
> CORBA::TypeCode_ptr
> TAO_AliasDef_i::type_i (void)
> {
>  ACE_TString id;
>  this->repo_->config ()->get_string_value (this->section_key_,
>                                            ACE_TEXT("id"),
>                                            id);
> ----
> But later this wide string is passed to CORBA::TypeFactory::create_alias_tc which expects an ANSI string (const char*):
> ---
>  return this->repo_->tc_factory ()->create_alias_tc (id.c_str (),
>                                                      name.c_str (),
>                                                      tc.in ());
> ---
> Should this string be converted from wide to ANSI before calling create_alias_tc?

Thank you again for reporting this defect. There is a macro we use, ACE_TEXT_ALWAYS_CHAR(). In context the fix is:
 return this->repo_->tc_factory ()->create_alias_tc (id.c_str (),
                                                     name.c_str (),
                                                     ACE_TEXT_ALWAYS_CHAR (tc.in ()));

> Maybe if you give me a hint I can fix it myself.

There are several ACE_TEXT* macros used to handle char/wchar_t conversions. Note that these are not proper translators so use of character sets that extend beyond 0xFF (0x7F?) will yield interesting results. :-)

> Thank you a lot for the attention.
> Best regards!
> Mello


Phil Mesnier
Principal Software Engineer and Partner,   http://www.ociweb.com
Object Computing, Inc.                     +01.314.579.0066 x225

tao-users mailing list
tao-users at list.isis.vanderbilt.edu

More information about the tao-users mailing list