Best method for storing this pointer for use in WndProc
I'm interested to know the best / common way of storing a this pointer for use in the WndProc . I know of several approaches, but each as I understand it have their own drawbacks. My questions are: What different ways are there of producing this kind of code: CWindow::WndProc(UINT msg, WPARAM wParam, LPARAM) { this->DoSomething(); } I can think of Thunks, HashMaps, Thread Local Storage and the Window User Data struct. What are the pros / cons of each of these approaches? Points awarded for code examples and recommendations. This is purely for curiosities sake. After using MFC I've just been