Just starting to do some non mfc, win32 api programming. Right away the basic problem comes up, what is the best way to get a specific data pointer into a window procedure, i.e. associate data with a specific window? Ive been using lots of globals to hold my data, but this will only allow one instance of the window to work at a time.

How does MFC do it? I see two ways.. make some global mapping object, that will take a specific hwnd, and return a pointer to its data, or store a pointer to data "in" the window using SetWindowLong()... Then at the start of the window procedure, you will access this pointer.

Hope I explained it clearly enough, thanks