What is the best way to write a callback? I only need to call 1 function that has the sig of void (string, int); and this would need to invoke a class since i have member objs that i need to process. Whats the best way to write this? in C i would do pass a func pointer and an void*obj. i dislike that and i suspect there is a better way to do this in C#?
Share
The standard way of handling (or replacing the need for) callbacks in C# is to use delegates or events. See this tutorial for details.
This provides a very powerful, clean way of handling callbacks.