Method Syntax Question

Aug 9, 2013 at 8:35am
Hello,

I have been learning C++ over the last few months and all the tutorials i go through declare methods like this:

1
2
  returnType MethodName(paramType1 param1, paramType2 param2);
  int MyMethod(int x, int y);


However recently i have seen some differences, i've been looking at some Direct X stuff and now i see them declare like

1
2
 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nShow);
LRESULT WINAPI WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)


I get that int is return type but i dont understand what the WINAPI (not just WINAPI but what ever is between the return type and the method name) is for?

Thanks in advance;

S
Last edited on Aug 9, 2013 at 9:02am
Aug 9, 2013 at 9:09am
It's just a Windows macro for __stdcall.

http://msdn.microsoft.com/en-us/library/zxk0tw93.aspx
Aug 9, 2013 at 9:11am
Thank you, answered my question.
Topic archived. No new replies allowed.