Trouble with glDrawPiexls

I learn to use glDrawPiexls to draw a bitmap on a top main window, and it works well.
But when I use the same code on a ChildView of a main window, It doesn’t work, so I wonder why? Can “glDrawPiexls” be used on a child window?

The calling is simple as below:
glRasterPos2i(0, 0);
glPixelZoom(1.0f, -1.0f);
glDrawPixels(640, 480, GL_RGBA, GL_UNSIGNED_BYTE, m_pImageData);

And the pixel format as:
PIXELFORMATDESCRIPTOR pfd =
{
sizeof(PIXELFORMATDESCRIPTOR),
1,
PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER,
PFD_TYPE_RGBA,
16,
0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,
16,
0,
0,
PFD_MAIN_PLANE,
0,
0, 0, 0,
};

My env is Windows2000, Vs.net7.1,opengl1.0

And if anyboady have a sample code which show the usage of glDrawPixels on a child window, please let me know.
Thanks advanced.

Hi !

make sure you have switched the OpenGl context to the child window (wglMakeCurrent…)

Mikael

Of course I do.
I am sure to create the opengl context on the childview, And other opengl render functions work well on this childview except the DAMN glDrawPixels.
You can try it yourself, The test is simple,just show me a working glDrawPixels on a child window.