I am playing around with Event handling and I am trying to make my own menu in a Win32 console. I have an event pump
but I am getting a little confused when it comes to event model vs callback model and how I would implement them.
I have a basic skeleton program that I am using to write test programs. Perhaps my design is flawed.
void EventPump(bool(*ProgramMain)(HANDLE &,INPUT_RECORD &,DWORD &) )
extern void (*FunctionCallback)(void);
bool EventHandler(HANDLE hStdout,INPUT_RECORD input_record)
bool ProgramMain(HANDLE &hStdout,INPUT_RECORD &input_record,DWORD &EventsInBuffer)
//Functions to be executed each cycle go here
I believe this is the event model. What I am trying to figure out is how I would implement callback functions in a callback model? Would I have to change my design or would i just build on this?
void (*FunctionCallback)(void);//?? not sure if this is write?