Thread: wsprintf and format specifiers

  1. #1
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427

    wsprintf and format specifiers

    I am trying to find all the format specifiers of wsprintf and can't find them, but since it looks a lot like our familiar printf function I am inclined to think that these two functions share the same format specifiers. Is that correct? I have all the specifiers for printf on a book.

    by format specifiers I mean thinks likes %c, %f.......
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  2. #2
    left crog... back when? incognito's Avatar
    Join Date
    Oct 2001
    Posts
    1,427
    never mind got it

    Code:
    
    Sequence	Insert
    c	A single character. The wsprintf function ignores character arguments with a numeric value of zero. This sequence is interpreted as type WCHAR when the calling application uses the #define UNICODE compile flag and as type CHAR otherwise.
    C	A single character. This sequence is interpreted as type CHAR when the calling application uses the #define UNICODE compile flag and as type WCHAR otherwise.
    d	A signed decimal integer argument. This sequence is equivalent to the i sequence.
    hc, hC	A single character. The wsprintf function ignores character arguments with a numeric value of zero. This sequence is always interpreted as type CHAR, even when the calling application uses the #define UNICODE compile flag.
    hs, hS	A string. This sequence is always interpreted as type LPSTR, even when the calling application uses the #define UNICODE compile flag.
    i	A signed decimal integer. This sequence is equivalent to the d sequence.
    lc, lC	A single character. The wsprintf function ignores character arguments with a numeric value of zero. This sequence is always interpreted as type WCHAR, even when the calling application does not use the #define UNICODE compile flag.
    ld	A long signed decimal integer. This sequence is equivalent to the li sequence.
    li	A long signed decimal integer. This sequence is equivalent to the ld sequence.
    ls, lS	A string. This sequence is always interpreted as type LPWSTR, even when the calling application does not use the #define UNICODE compile flag. This sequence is equivalent to the ws sequence.
    lu	A long unsigned integer.
    lx, lX	A long unsigned hexadecimal integer in lowercase or uppercase.
    s	A string. This sequence is interpreted as type LPWSTR when the calling application uses the #define UNICODE compile flag and as type LPSTR otherwise.
    S	A string. This sequence is interpreted as type LPSTR when the calling application uses the #define UNICODE compile flag and as type LPWSTR otherwise.
    u	An unsigned integer argument.
    x, X	An unsigned hexadecimal integer in lowercase or uppercase.
    There are some real morons in this world please do not become one of them, do not become a victim of moronitis. PROGRAMMING IS THE FUTURE...THE FUTURE IS NOW!!!!!!!!!

    "...The only real game I thank in the world is baseball..." --Babe Ruth

    "Life is beautiful"-Don Corleone right before he died.

    "The expert on anything was once a beginner" -Baseball poster I own.


    Left cprog on 1-3-2005. Don't know when I am coming back. Thanks to those who helped me over the years.

  3. #3
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    Don't confuse wsprintf() with swprintf().
    The first one is a special version in USER32.DLL for printf() style formatting of TCHAR strings.
    The second one is the ANSI standarnd one.

    gg

Popular pages Recent additions subscribe to a feed