Hi all--
I some programming in college using mostly C++ (and some Java) and we learned stuff like quick sorts, hash tables, red-black trees etc. The extent of input/output was cout << "Hello, World!"
I wanted to learn how to program windows and I searched the internet and everyone said "GET PETZOLD!" So I bought "programming windows 5th addition" (I think it's going out of print...should I be worried ??)
Anyways Petzold said I needed to be familiar with C programming...since I knew printf() and malloc() existed but had no idea how to use them, I got the K&R book and went through it.
NOW, I'm into chapter one of petzold (finally) and the hello world function begins with...
Code:
int WINAPI WinMain(HINSTANCE hInstance...){...}
which seemed very odd because nowhere in my c++ or c from k&r did functions ever have more than a return type followed by the function name and parameters in their declaration/definition.
Petzold just says it's a "calling convention" and determines how a function is to be placed on the stack. Expanding WINAPI to __stdcall. Okay...but then LATER in Chapter 2 he defines the true message box with the following:
Code:
WINUSERAPI int WINAPI MessageBoxA(HWND hWnd...){...}
Now this function has 2 calling conventions (WINAPI and WINUSERAPI)? How many can a function have? what are these exactly? does anyone know of a place somewhere that has a beginner's tutorial for these calling conventions? perusing the index...I cannot find any more information on either of these.
Any help would be appreciated!
Thanks!