What is a wrapper function?

Question answered, thanks.
Last edited on
**edit**
Last edited on
*edited*
Last edited on
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.