There are a number of examples out there but yet I can't seem to figure out the solution to my problem. I have
class FooSource{
...
void StartGetFoos(void (*callback)(vector<IFoo*>*, IAsyncResult));
...
}
When StartGetFoos()
is called, a request it done to get Foos, saving the callback. when the request it complete (takes about 30 secs), the saved callback is called with results.
I cannot change the signature of this method.
and somewhere else I have a class
class FooUser {
...
void FooUser::MyCallback(vector<IFoo*>* foos, IAsyncResult result)
{
// marshall to UI thread and update UI
}
void init()
{
fooUser->StartGetFoos(??????);
// how do I pass my callback member function here?
}
}