Did you try in a part document, instead of an assembly?
Long time ago, I have tried OpenGL to draw some virtual lines, and it was successful only in a part document, not in an assembly document.
Simon is right. If you want to use OpenGL in assembly document, you just need to place your OpenGL codes("wgl::create context,wgl::make current" and
so on, such codes are not necessary) in the BufferSwapNotify which is created in DocView.h and DocView.cpp files.
I think you are going about this the wrong way. I have got this to work in the past by using the context that SolidWorks has already created.
You need to use that context by placing your OpenGL drawing code in BufferSwapNotify. Forget about CreateContext and MakeCurrent. SolidWorks handles all of that for you.