Rotation Problem

Hi,

I have simple cube-rotating program( from DevX openGL tutorial). Mouse works fine when
i have this piece of code

CPaintDC dc(this);
CBitirmeDoc* pDoc = GetDocument();
pDoc->RenderScene();
SwapBuffers(dc.m_ps.hdc);

in OnPaint method.

But i want to the cube to be drawn after i press a certain button. So i deleted the OnPaint function and used the same code on my OnButton function. Cube is drawn again, but i can’t rotate it anymore. Can you figure out what causes this problem?

Any help is appreciated, thanks.