View Single Post
  #5 (permalink)  
Old 10-23-2007, 09:35 PM
dargueta dargueta is offline
Guru
 
Join Date: Oct 2007
Age: 18
Posts: 790
Last Blog:
Programs Under the Hoo...
Rep Power: 13
dargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the roughdargueta is a jewel in the rough
Default

I want the user to be able to specify their own functions for the handlers, so __declspec(__stdcall) __cdecl pointers would be ideal. The problem is that classes derived from ConsoleObject use the __thiscall calling convention. I'm guessing I'd use a template for the argument types...? Perhaps something like this is what you meant?

Code:
template <typename funcPtrType>
void onMouseOver(funcPtrType (*p)(void))
{
    if(p != NULL)
        (*p)();
    else
         //default handler goes here
}
Reply With Quote

Sponsored Links