MFC and OpenGLSL

I am trying to create a shader within an MFC application.I am using Microsoft Visual C++ and WinXP. I have included the glew.h file and everything seems to work fine until I try to execute my application and it gives me a Microsoft Error. When I go into the debug it says that CXX0017:Error: Symbol “this” was not found. I found out that as soon as I try

GLhandleARB v  = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);

Microsoft gives me an error. Strange thing is though that I first tried the whole code in a “normal” OpenGL program (without MFC) and it was working perfectly. And now I am trying to integrate that program into my MFC application where all other OpenGL seems to work fine. But as soon as I create a shader object or refer to it, Microsoft gives me an error.

Any ideas???Is GLSL not supported by MFC???

I’m sorry, but you’re an embarrassment to the Irish nation.

Go to the beginners forum, this is nothing to do with GLSL, it’s to do with you not understanding the OpenGL extension mechanism on win32.

@knackered: very helpful!

@L.B: Did you check to see if glewInit() failed?
You probably need to correct your project setup to make MFC code work with GLEW. It’s not clear if you have a compile, link or runtime error. If it’s a linking error make sure you are linking with the glew library.

…or stay a while and discuss beginners OpenGL compilation issues in the “OpenGL Shading Language” forum.

Hi! Thank you, yes it was a problem with GlewInit().

And to knackered…I was not aware that it was a problem with my setup and that is why I thought that there was maybe something going on with my OpenGLSL. Yes I am a beginner and I did not mean to “upset” anyone by writing to the slightly inappropriate forum…maybe get some sleep?:slight_smile:

You goddam fool :wink:

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