Seting up an opengl window in c++.net

Hello,
I have been working on a level editor,I used win32 libraries and cplusplus, however using native win32 library is making development very hard. So i decided to move to c++.net

I spend about 2 days on research and I found out C#.net has a library named CSGL
it is working fine and I can use it for my project. But I prefer using c++.net in my project. Than I found an article about creating opengl view in windows form and it was realy useful.Here its link

http://www.codeproject.com/KB/miscctrl/OpenGLViewWinForms.aspx

but when I make a project and run it,

m_hglrc = wglCreateContext(hdc);
this line return a null
2)
public ref class COpenGL: public System::Windows::Forms::NativeWindow
instead of NativeWindow, Can I use Form
I used form but same error occurred(wglCreateContext return null)

I checked the last error
ERROR_INVALID_PIXEL_FORMAT
2000

here is my format(actually it was working without problem)

PIXELFORMATDESCRIPTOR pfd = {
sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd
1, // version number
PFD_DRAW_TO_WINDOW | // support window
PFD_SUPPORT_OPENGL | // support OpenGL
PFD_DOUBLEBUFFER, // double buffered
PFD_TYPE_RGBA, // RGBA type
24, // 24-bit color depth
0, 0, 0, 0, 0, 0, // color bits ignored
0, // no alpha buffer
0, // shift bit ignored
0, // no accumulation buffer
0, 0, 0, 0, // accum bits ignored
32, // 32-bit z-buffer
0, // no stencil buffer
0, // no auxiliary buffer
PFD_MAIN_PLANE, // main layer
0, // reserved
0, 0, 0 // layer masks ignored
};

moreover Im using ChoosePixelFormat to set the pixel format.

any idea ?

soryy for my English, I hope that I can explain myself properly

I overcome this problem

In the project properties
I changed
general->common Language Support->/clr:pure to /clr

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.