Hi guys - been several years since I first (and last) used C++ and am basically starting over with fundamentals. I'm a c# developer and my job requires a lot of pinvoke/interop which I am comfortable doing but find would be easier to do in C++.
I'm writing some simple code to get my feet wet with winapi calls in C++, just a simple call to the Beep function (VS2008 from my IDE):
1 2 3 4 5 6 7
|
#include "windows.h"
int _tmain(int argc, _TCHAR* argv[])
{
Beep(0x32, 1000);
return 0;
}
|
The code above works. However, I like to rely on Intellisense so I originally had it written as "WINAPI::Beep(0x32, 1000)" which threw up a compile error "syntax error: missing ';' before '__stdcall'."
So what does this error mean? What is "WINAPI" in this instance, an abstract class, namespace, ...?
Secondly, I'm a bit confused about MSDN's "Syntax" section. For the Beep function, it is shown as:
C++
BOOL WINAPI MessageBeep(
__in UINT uType
);
So.. is this how the function is actually defined in the header? Is this C++ or C? I understand BOOL is the function's return value, what is WINAPI, the class?
Is the "__in" indicator there simply for documentation or is it actual code?
Thanks in advance guys, great site.