Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

windows sdk - naming convention

  • 08-11-2003 01:27AM
    #1
    Closed Accounts Posts: 358 ✭✭


    anyone know why some methods in the windows sdk end with a capital "A".

    thanks.


Comments

  • Registered Users, Registered Users 2 Posts: 2,157 ✭✭✭dazberry


    Relates to parameters:

    A signifies a call that supports 8 bit ANSI characters.
    W signifies a call that supports wide strings (unicode) or 16 bit characters.

    Depending on what you're using there may be a third call, but that normally just maps to the A call.

    D.


  • Closed Accounts Posts: 437 ✭✭casper-


    Yes, and to save yourself some time, you can just add UNICODE to your project preprocessor definitions list and auto-switch to the 'W' versions. Pretty much every method has three names,

    GetWindowText
    GetWindowTextA
    GetWIndowTextW

    The first one is just a #define that maps to either the Ansi or Wide version. Normally you don't think about this, but when you do turn on Unicode and have to support Win98 you'll find yourself sometimes having to call the 'A' methods explicitly since unicows is not a complete layer.


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    Originally posted by jedidjab79
    Normally you don't think about this, but when you do turn on Unicode and have to support Win98 you'll find yourself sometimes having to call the 'A' methods explicitly since unicows is not a complete layer.

    Another possibility is to do two builds, one with Unicode and _Unicode defined, and one without, and then put both versions into the installer and let the installer decide which version to install.

    NT/2000/XP will support the 'A' versions, 95/98/ME will support some of the 'W' versions. To make matters worse which functions 9x will support the W versions for depend on the version of IE installed.

    To make matters even more confusing whether "Unicode" means UCS-2 or UTF-16 is rather ill-defined as well, granted it doesn't really matter for a lot of functions or for a lot of calling code, but it can be a right nuisance when it does matter.


Advertisement