Callback, specified in QueueUserAPC , does not get called
问题 In my code, I use QueueUserAPC to interrupt the main thread from his current work in order to invoke some callback first before going back to his previous work. std::string buffer; std::tr1::shared_ptr<void> hMainThread; VOID CALLBACK myCallback (ULONG_PTR dwParam) { FILE * f = fopen("somefile", "a"); fprintf(f, "CALLBACK WAS INVOKED!\n"); fclose(f); } void AdditionalThread () { // download some file using synchronous wininet and store the // HTTP response in buffer QueueUserAPC(myCallback,