TheObserver
Programmer
I'm working in C++, C, and XWindows.
I am having a problem where I need to call a class, set an object pointer to point at an object I passed in with the constructor's argument list, and then when I do a callback in response to a GUI item being clicked (XWindows stuff), I pass the pointer back to a C function so it can act on the object and have everything be groovy.
My problem lies in that for some reason the method I call from my callback has to be a static void. As such, I can't pass in the pointer to the object that I need to pass along to the C function. I have tried not using static void, but the compiler chokes and says I don't have a method defined as void(*)(parameter list) - it's defined as void (parameter list).
So, either I can have a method that works, but doesn't do anything useful (it cores), or I have a method that would seemingly do what I need it to (gets the pointer and passes it along to the C function) except that it won't compile.
Any info/ideas/leads?
Thanks for your time.
I am having a problem where I need to call a class, set an object pointer to point at an object I passed in with the constructor's argument list, and then when I do a callback in response to a GUI item being clicked (XWindows stuff), I pass the pointer back to a C function so it can act on the object and have everything be groovy.
My problem lies in that for some reason the method I call from my callback has to be a static void. As such, I can't pass in the pointer to the object that I need to pass along to the C function. I have tried not using static void, but the compiler chokes and says I don't have a method defined as void(*)(parameter list) - it's defined as void (parameter list).
So, either I can have a method that works, but doesn't do anything useful (it cores), or I have a method that would seemingly do what I need it to (gets the pointer and passes it along to the C function) except that it won't compile.
Any info/ideas/leads?
Thanks for your time.