Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts

    MS types to standard types

    Does anyone know of a web page that holds something like a Microsoft to standard dictionary (like a French to English dictionary but for types)? I don't really like using MS types such as LPWSTR because they are ugly, unreadable and it is hard to remember all of them. Currently, I use find/findstr (as in windows' grep) to find the typedefs on the win32 header files but this is quite time consuming and a bit of a PITA.

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Most of those are pretty readable (though I agree, I don't like using them). LPWSTR is a long pointer to a wide character string. Also if you are using Visual Studio, you can usually just hover over them and it will show you the typedef line for it in a tooltip.
    OracleGuy

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    It's usually best to stick with standard types unless you only ever plan on compiling on M$ windows. I ran into this scenario recently when I developed and shared memory application that at the moment only needs to be compatible with windows but later may need to run on a Sun. I initially used those silly M$ data types because I got tired of having to look them up in that windows header file where they are all defined at. I had to go back later and change everything to standard types. What a pain.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #4
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    I did find a page on the MSDN that lists that data type and you can easily click on other ones in the chapter to see what they are: http://msdn.microsoft.com/en-us/library/cc230355.aspx

    I generally stick to doing my own typedefs instead of using the Microsoft ones since like Spookster said, it can reduce the portability of the code.
    OracleGuy

  • #5
    Senior Coder
    Join Date
    Apr 2003
    Location
    England
    Posts
    1,192
    Thanks
    5
    Thanked 13 Times in 13 Posts
    Thanks, the MSDN link was exactly what I was looking for and both of your reasons for not using the MS types are the same as mine.

    I get annoyed with things like this:
    typedef ULONG_PTR SIZE_T;
    then having to look up ULONG_PTR
    typedef unsigned __int3264 ULONG_PTR;
    and so on.
    Last edited by ghell; 07-06-2008 at 03:16 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •