You could use a custom windows message. The thread pool callback function could post the message to your MFC application's hwnd. The WPARAM could contain the number of characters in the string and the LPARAM could be a pointer to the string. Of course the way that the message handler processes the custom message depends on what the LPARAM points to. A raw pointer to memory allocated by new or malloc? A pointer to a CString object? A pointer to a std::string object? And so forth.
Best way to retrieve very long strings from thread pool
Flaviu_
1,031
Reputation points
I have a MFC SDI app. I have a thread pool in the document class. The threads retrieve very long strings. My question: how can I get those strings from the threads?
I want to avoid save them to HDD files, or inside a database. Any ideas?
Developer technologies | C++
3,977 questions