CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    May 2007
    Posts
    127

    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured