WinAPI newbie

So I took the advice of the replies in my first thread on where to start with Windows API so I got my hands on Programming Windows by Charles Petzold. I really thought I got my hands on the good stuff when I started to read but then I got the chapter two: Wide Characters and C followed by the even more intimadating Wide Characters and Windows when I realized what I'm getting myself into. I love it so far thought. Anyway, instead of bugging you guys about every little road block I run into, I figured the best thing is to learn how to learn. So if someone can please explaing to me or point me in the right direction. The most difficult part I'm having trouble with is when the book explains a function and which .h it's declared in. It gives me the format. For example...
"The wide-character version of the strlen function is called wcslen ("wide-character string length"), and it's declared both in STRING.H (where the declaration for strlen resides) and WCHAR.H. The strlen function is declared like this:


size_t __cdecl strlen (const char *) ; "

I REALLY don't understand how to read that syntax. What is size_t and wth is __cdec1...and the parameters after str are (const char *)??? did they forget to type something after the *? The big problem is that from here on out there are a LOT of concepts and functions that they describe in this similar manner and they build other concepts based on the fact that the reader can read this and the Author never explains how to read this format.

The absolute right direction is to not use the Windows API. It binds you to that platform and there exist many more cross-platform libraries that far surpass the Windows API. However, if you wish to continue... size_t is a type in the C++ Standard Library that is essentially an unsigned integral type.

_cdecl is this:
http://msdn.microsoft.com/en-us/library/zkwh89ks(VS.71).aspx

And they forgot nothing. The prototype need not contain the name of the variable inside the function.

-Albatross
Ok, that helps a lot. And DOH, I forgot about the prototype not needing the name of the variable in a function. Thanks.
Quick note: when you run into a data type that ends with a "_t" suffix, it means that it's a typedef, rather than a true built-in type.

For example, "size_t" could resolve either to a 4-byte unsigned integer (for 32-bit), or an 8-byte (for 64-bit) unsigned integer, depending on how a particular implementation defines it.
Topic archived. No new replies allowed.