View Full Version : MS types to standard types

07-05-2008, 03:28 PM
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.

07-05-2008, 06:45 PM
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.

07-05-2008, 09:26 PM
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.

07-05-2008, 10:27 PM
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.

07-06-2008, 03:13 AM
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:
then having to look up ULONG_PTR
typedef unsigned __int3264 ULONG_PTR;
and so on.