"W" version does not work but "A" version does

  • Thread starter Thread starter **Developer**
  • Start date Start date
D

**Developer**

I have a couple of instances where using "Auto" did not work so I tried the
"A" version of the DLL and it works.
Tried the "W" version and it doesn't.


Anyone have any idea why that might happen?


It is true that with XP Auto uses the "W" version is it not?


Thanks
 
**Developer** said:
I have a couple of instances where using "Auto" did not work so I tried the
"A" version of the DLL and it works.
Tried the "W" version and it doesn't.


Anyone have any idea why that might happen?


It is true that with XP Auto uses the "W" version is it not?


Thanks

Please be more specific, what exactly doesn't work?
Which API are you calling, how does it's signature looks like, how did you
declare it and how was it compiled?

Willy.
 
OK. It'll take a while. Maybe I can put one into an example.

Looking through my files I not find these, which suggest to me I found these
did not work until I changed to "A"

SHGetFileInfoA

OpenPrinterA

GetPrinterA

DocumentPropertiesA

SetPrinterA



As I remember it, the SetPrinter just didn't change the values with Auto.

The SHGetFileInfoA I just found out did not return the vales of Type and
Name with Auto



So do you know of any situation at all where it is necessary to was the "A"
version?



Thanks
 
I see these are all Win32 API's, what OS are you running this on?
NT4 and higher all have both ANSI and UNICODE versions of these API's, so it
should work with Auto.

Willy.
 
Inline
Willy.

**Developer** said:
OK. It'll take a while. Maybe I can put one into an example.
The SHGetFileInfoA I just found out did not return the vales of Type and
Name with Auto
Please post your code or a repro case, guess your structure definitions are
wrong, normaly you should never explicitely call a W or A version.
 
I see now why the "A" version worked:
The default enumeration member for C# and Visual Basic is CharSet.Ansi

I needed to change the structure to CharSet.Auto
Then I believe both the structure and function expects/generates Unicode for
XP


Thanks, this is something that's been bothering me for a long while.
 
Back
Top