Picking

I’ve got a problem with the openGl picking.
In the drawing function, I put my glPushName or glLoadName (not between glBegin or glEnd).
When I treat number of hits, I always obtain 0 !!

And if I do a glGetError(), this function returns
GL_INVALID_OPERATION is generated if glLoadName
is called between a call to glBegin and the corresponding call to glEnd.
And glLoadName ISN’T between glBegin and glEnd.

What could be the problem ??

Thanx a lot

Are you rendering in selection mode when making these calls? glRenderMode(GL_SELECT);