HexEdit/GridCtrl_src/GridCtrl.cpp
BOOL CGridCtrl::RegisterWindowClass()
{
    WNDCLASS wndcls;
    HINSTANCE hInst = AfxGetInstanceHandle();
    //HINSTANCE hInst = AfxGetResourceHandle();

    if (!(::GetClassInfo(hInst, GRIDCTRL_CLASSNAME, &wndcls)))
    {
        // otherwise we need to register a new class
        wndcls.style            = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
        wndcls.lpfnWndProc      = ::DefWindowProc;
        wndcls.cbClsExtra       = wndcls.cbWndExtra = 0;
        wndcls.hInstance        = hInst;
        wndcls.hIcon            = NULL;
#ifndef _WIN32_WCE_NO_CURSOR
        wndcls.hCursor          = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
#else
        wndcls.hCursor          = 0;
#endif
        wndcls.hbrBackground    = (HBRUSH) (COLOR_3DFACE + 1);
        wndcls.lpszMenuName     = NULL;
        wndcls.lpszClassName    = GRIDCTRL_CLASSNAME;

        if (!AfxRegisterClass(&wndcls))
        {
            AfxThrowResourceException();
            return FALSE;
        }
    }

    return TRUE;
}
// Register the window class if it has not already been registered.

Register the window class if it has not already been registered.
Register the window class if it has not already been registered .
BOOL CGridCtrl::RegisterWindowClass()
{
    WNDCLASS wndcls;
    HINSTANCE hInst = AfxGetInstanceHandle();
    if (!(::GetClassInfo(hInst, GRIDCTRL_CLASSNAME, &wndcls)))
    {
        wndcls.style            = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;
        wndcls.lpfnWndProc      = ::DefWindowProc;
        wndcls.cbClsExtra       = wndcls.cbWndExtra = 0;
        wndcls.hInstance        = hInst;
        wndcls.hIcon            = NULL;
#ifndef _WIN32_WCE_NO_CURSOR
        wndcls.hCursor          = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
#else
        wndcls.hCursor          = 0;
#endif
        wndcls.hbrBackground    = (HBRUSH) (COLOR_3DFACE + 1);
        wndcls.lpszMenuName     = NULL;
        wndcls.lpszClassName    = GRIDCTRL_CLASSNAME;
        if (!AfxRegisterClass(&wndcls))
        {
            AfxThrowResourceException();
            return FALSE;
        }
    }
    return TRUE;
}
BOOL CGridCtrl :: RegisterWindowClass ( ) { WNDCLASS wndcls ; HINSTANCE hInst = AfxGetInstanceHandle ( ) ; if ( ! ( :: GetClassInfo ( hInst , GRIDCTRL_CLASSNAME , & wndcls ) ) ) { wndcls . style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW ; wndcls . lpfnWndProc = :: DefWindowProc ; wndcls . cbClsExtra = wndcls . cbWndExtra = 0 ; wndcls . hInstance = hInst ; wndcls . hIcon = NULL ; #ifndef _WIN32_WCE_NO_CURSOR wndcls . hCursor = AfxGetApp ( ) -> LoadStandardCursor ( IDC_ARROW ) ; #else wndcls . hCursor = 0 ; #endif wndcls . hbrBackground = ( HBRUSH ) ( COLOR_3DFACE + 1 ) ; wndcls . lpszMenuName = NULL ; wndcls . lpszClassName = GRIDCTRL_CLASSNAME ; if ( ! AfxRegisterClass ( & wndcls ) ) { AfxThrowResourceException ( ) ; return FALSE ; } } return TRUE ; }
Register the window class if it has not already been registered.
Register the window class if it has not already been registered .
//HINSTANCE hInst = AfxGetResourceHandle();
 // otherwise we need to register a new class
