[tao-users] [ace-users] Compilation error using ACE_USES_WCHAR
Phil Mesnier
mesnier_p at ociweb.com
Wed May 20 16:31:00 CDT 2015
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
--
Phil Mesnier
Principal Software Engineer and Partner, http://www.ociweb.com
Object Computing, Inc. +01.314.579.0066 x225
More information about the tao-users
mailing list