displaylists and mfc

Hi I hope someone can help or at least have a clue what could be going wrong.
I am using msvc++6 and have an mdi application displaying opengl windows.

This all works fine.

However I wanted to use display lists and whenever I try to generate one using glGenList() It always returns 0 and so doesnt generate it. The function works fine when I am not using mfc so I think it may be this but I dont know why.

Any ideas

Display lists work fine under MFC. Where are you placing your call to glGenLists? Is it before or after OpenGL is initialised?

I am doing it after open gl is initialised Is there any order this should be done in or do I need to request a display list at a certain point in time. (I previously drew the object without display lists and it worked fine)

What I did was glGenLists() in the init function of my model class, so it is called when I do a model->init(); in my InitGL() function.

For me, this is working great. Perhaps you can post a small bit of code, so we can see how you’re doing it?

There is a simple example of MFC and displaylists at:
http://www.mfcogl.com/OpenGL%20-%20draw%20cylinder%20between%202%20pts.htm

It was mostly to illustrate how to draw a cylinder between 2 points but it uses displaylists to draw a bunch of axes.