WSAAsyncSelect and virtual functions
Hello!
I'm trying to make an asynchronous socket class with WSAAsyncSelect.
I get an unhandled exception on this events when I call virtual functions like OnAccept from WndProc. I have the pointer for the instance of the class in the window:
Code:
SetWindowLong(hwnd, GWL_USERDATA, (long) ((LPCREATESTRUCT)lParam)->lpCreateParams);
If I try to connect to a socket that is listening I get an error.
If I remove the keyword virtual from the function and try now to connect the Onaccept is called with no problem, but I need those function to be virtual.
What is the problem?
Thanks for reading my post, bye!
Last edited by Chirieac; May 24th, 2008 at 08:03 AM.
I love this forum. Thanks all for your help!