Class CAsyncSocket::
SetHandlers()
Base ClassesData ItemsConstructorsDestructorsFunctionsCustom CodeGo to hierarchy chart    Prev page: SetAsyncNext page: SetInstance    Show member index
Private Function Declared in:
AsyncSocket.h

'Declaration' icon -- Shortcut to top of page. Declaration

static BOOL SetHandlers();

'Description' icon -- Shortcut to top of page. Description

Create our handlers

'Function Body' icon -- Shortcut to top of page. Function Body

try
{
    //First create the window class
    if (!m_Window)
        if (!RegisterWindow())
        {
            //Error
            ReportStaticError(CAsyncSocket_Class,"SetHandlers","Error registering the window, please check API error!");
            return FALSE;
        }
        else
            //Check if we need to register a local window, or a thread manager ?
            if (CSpoofBase::IsMultiThreaded())
                //Initialize as multithreaded
                m_pThreadManager=new CSocketThreadManager(CSpoofBase::GetNumberOfThreads(),m_Instance);
            else
            {
                //Run on main thread
                m_WindowHandle=CreateWindowEx(0,CAsyncSocket_Class,SOCKET_WINDOW_NAME,
                                              WS_OVERLAPPED,0,0,0,0,0,NULL,GetInstance(),NULL);
                //Check the value of the window
                if (!m_WindowHandle)
                {
                    //Error
                    ReportStaticError(CAsyncSocket_Class,"SetHandlers","Error creating the window, please check API error!");
                    return FALSE;
                }
                else
                    //We have a window
                    m_Window=TRUE;
            }

    //Created !!
    //Success
    return TRUE;
}
ERROR_HANDLER_STATIC_RETURN(CAsyncSocket_Class,"CAsyncSocket",FALSE)

'See Also' icon -- Shortcut to top of page. See Also

Class Overview Class Overview  |  Protected base class CSpoofBase  |  Hierarchy Chart Hierarchy Chart


Get Surveyor!This web site was generated using Surveyor V4.50.811.1.  Click here for more information. Site content copyright © 2001 Barak Weichselbaum. See the About page for additional notices. This page last updated: 27 Jun 2001.