What is this and does it work

Hi chaps been playing with the XPLANE API and windows API and what is this?

PLUGIN_API??? its not static, public what is it and how does it work can anyone point me to any begginer tutorials regarding this?

I seem it a low when trying to program windows and don't understand it?

1
2
3
4
5
6

PLUGIN_API int XPluginStart(
						char *		outName,
						char *		outSig,
						char *		outDesc)
{
you need to be little more specific.
Sorry to be vague the code ->PLUGIN_API<- what is that doing is it defining a type?

I see it often in the windows API but do not understand how it works or what it is doing?

1
2
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
    LPSTR lpCmdLine, int nCmdShow)


Here we are defining the method WinMain with a return type of int but what does WINAPI do?
closed account (NyhkoG1T)
It is a defined macro. You could effectively replace PLUGIN_API with

extern "C" __declspec(dllexport)

and it would still function properly.

PLUGIN_API, however, is easier on the eyes
There's a convention in C and C++ programming that, when you see a name that's all in upper-case characters, it's usually a macro or a #defined symbol. So if you see something like PLUGIN_API, you can guess that it's a macro, and use your IDE to find the definition of it.

Edit: I often see const values also given all-upper-case names in C++, as well. This makes sense, as they're often doing the job that a #defined symbol would have done in C.
Last edited on
Thanks guys that has pointed me in the right direction I now know what I need to learn.

Thank you!
Topic archived. No new replies allowed.