Re: #import and wchar_t
- From: Peter Nimmo <PeterNimmo@xxxxxxxxxxxxxxxxx>
- Date: Mon, 03 Apr 2006 09:12:04 -0700
"Igor Tandetnik" <itandetnik@xxxxxxxx> wrote in
news:#vu9rCAVGHA.5004@xxxxxxxxxxxxxxxxxxxx:
The sample is done in VC6 where wchar_t was always a typedef forHi Igor,
unsigned short. The compiler did not support it as a native type. I
guess nobody noticed the discrepancy back then, and the sample was not
updated since.
The sample is also internally inconsistent - note how
SAXContentHandlerImpl uses wchar_t but SAXErrorHandlerImpl uses
unsigned short.
The easiest thing to do is probably to use unsigned short throughout.
If for some reason you really want to use wchar_t, the following
(admittedly dirty) trick should work:
#import <msxml3.dll> raw_interfaces_only \
inject_statement("#define unsigned") inject_statement("#define
short
wchar_t") #undef unsigned #undef short
Luckily, "short" is never used on its own in this particular TLB, only
in combination with unsigned.
I have another question. The SAX2 JumpStart uses mbstowcs to convert
the url from a null terminated c style string to wide character text.
Whilst this works fine when not using wchar_t as a Built-In type, it
results in a compilation error when using wchar_t as a Built-In type.
If I use wchar_t as a Built-In type, what conversion functions can I use
to convert the c style string to the appropriate format?
Peter
.
- Follow-Ups:
- Re: #import and wchar_t
- From: Igor Tandetnik
- Re: #import and wchar_t
- Prev by Date: Re: c++ export / linkage problem
- Next by Date: Re: #import and wchar_t
- Previous by thread: Re: c++ export / linkage problem
- Next by thread: Re: #import and wchar_t
- Index(es):
Relevant Pages
|