Opengl and MFC

I don’t know much about MFC programming.
But I create a single document MFC application using appwizard.
I made following changes
void CLineView::OnDraw(CDC* pDC)
{
CLineDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
drawline();

}

void CLineView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);

// TODO: Add your message handler code here
glViewport ( 0, 0, cx, cy ) ;

}

void CLineView::drawline( )
{
glClearColor ( 0.0f, 0.0f, 0.0f, 0.0f ) ;
glClear ( GL_COLOR_BUFFER_BIT ) ;

glBegin ( GL_LINES ) ;

	glColor3f ( 0.0f, 1.0f, 0.0f ) ; 
    glVertex2f ( 0.25f, 0.25f ) ;
    glVertex2f ( 0.75f, 0.25f ) ;

glEnd( ) ;

glFlush( );

}

And I have declared the drawline function as public in class CLineView : public CView
This code is simple ,but still i don’t see any thing.
I have included gl.h and in links (setting)opengl32.lib .
What can be the problem ?

Thanks
aus

I can’t tell where you are calling swapbuffers(), see examples at www.mfcogl.com

Thanks for the website.
I hadn’t written setpixel function.

Now it works

Thanks,
aus