SetPixelFormat

I am always getting Run Out of Memory problem
due to the usage of SetPixelFormat while
using OpenGL.If any remedies, welcoming with
appreciation.

Buy more memory
Ok, seriously, now: look for recursive calls. This sounds like the classic situation…

Which display-mode you like to use ?
Remember: GL uses a lot of additionla buffers in the videocard-memory! Check your maximum of available colors, calculate your memory-needings and the compare it with your
videocard´s memory. There is a goodbook from
A&W available - with describing a GET-PFD-Programm: it lists you all available modes, memory-needings and PFD-settings.
I don´t know the title, but i know that it is written by “Ron Fosner”