Passing OnEvent pointer to a function


2003-10-25 01:52:27 AM
cppbuilder87
I want to have a general function that take a TMenuItem object and a OnClick event function and create child objects from a list and use the OnClick event to do stuff. I have different OnClick events that perform different tasks on the listed objects.
How do I declare the function pointer to make this work? I only get stupid error messages like "missing ')'" (which it isn't) or incompatible conversion (between __fastcall and __closure).
All functions are part of my TMain class which I have only one instance off. Ofcourse I could do it the dirty way and use indexes to identify the wanted function but I don't like that idea.
/Anders