What is a wrapper function?

Oct 14, 2008 at 8:43pm
Question answered, thanks.
Last edited on Oct 15, 2008 at 6:44pm
Oct 14, 2008 at 8:49pm
**edit**
Last edited on Oct 15, 2008 at 6:44pm
Oct 14, 2008 at 8:49pm
*edited*
Last edited on Oct 15, 2008 at 6:44pm
Oct 15, 2008 at 11:45am
The general reply is that a wrapper function is a function that is used to simplify the calling of another function.

So in this case the dsp_chat_no_events wraps the Trampoline function.
You call dsp_chat_no_events with parameters of (const char *,int ,bool).

Internaly it casts pEverQuest to a CChatHook*, then calls the Trampoline method of CChatHook.
The outer brackets round ((CChatHook*)pEverQuest) are required because -> has a higher precedence than a typecast, so if they were not there the compiler would try to evaluate pEverQuest->Trampoline(... which would error.
Topic archived. No new replies allowed.