# kind of blackout...how to use a header

This topic is 1255 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi

seems I have a kind of blackout that early in the morning. Well how to use:

http://www.xsquawkbox.net/xpsdk/mediawiki/XPLMHandleMouseWheel_f

XPLMHandleMouseWheel_f (FakeFenster, 1, 1, 1, 1, inRefcon);

is wrong obviously. FakeFenster is the windowid and the 1 stand for parameters I don't need? What about refcon?

Thanks

##### Share on other sites
The documentation clearly states that is not a function you call. You need to write a function which uses the signature and calling conventions shown and then pass a pointer to it to some other SDK function (which is up to you to research). The SDK will then call your function when appropriate with the arguments it chooses as useful.

##### Share on other sites
Just to clarify, when you see

typedef Type(*Something)(Type, Type);
This is not defining a function called Something. That would look like:

Type Something(Type, Type);
The former is declaring a shorthand for a pointer-to-function type. So you can do something like this:

Type myFunction(Type a, Type b)
{
}

Type doSomeStuff(Something s)
{
Type a;
Type b;

Type r = s(a, b); // C++ usage, needs to be (*s)(a, b) in C, I think

return r;
}

void f()
{
Something s = myFunction;
doSomeStuff(s);
}

Hope that clarifies. Function pointer syntax is confusing when you first encounter it. Edited by Aardvajk

1. 1
2. 2
3. 3
Rutin
22
4. 4
frob
17
5. 5

• 9
• 33
• 13
• 13
• 10
• ### Forum Statistics

• Total Topics
632580
• Total Posts
3007189

×