sorry if this is the wrong forum....it could be placed in either the game programming forum or the windows programming forum...but i decided to put it here...anyway, i have a dialog box, and when one of its buttons are pressed i wan't it to call a function that contains code for rendering 3D geometry (ie a cube).

my code:
Code:
BOOL CALLBACK InsertBrushDlgProc(HWND hWnd, UINT Message, WPARAM wparam, LPARAM lparam)
{
    switch(Message)
    {
        case WM_INITDIALOG:

        return TRUE;
        case WM_COMMAND:
            switch(LOWORD(wparam))
            {
            case IDSCUBE:					
				glPushMatrix();
				SolidCube(1.0, 1.0, 1.0, 0.0, 0.0, 0.0,
					FALSE,
					0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
					0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0,
					0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0);				
				SwapBuffers( hDC );
				
				EndDialog(hWnd, IDCANCEL);
				break;

			case IDHCUBE:
				break;
				
			case IDCANCEL:
				EndDialog(hWnd, IDCANCEL);
                break;
            }
        break;
        default:
            return FALSE;
    }
    return TRUE;
}
anyway on the button press it will not create the geometry....but i think somthing is happening, because when i press the button, my 3D grid which is rendered by default, changes color?

any help will be much appreciated!

-psychopath