glCreateProgram - Access violation

Hello again all,

I’ve made a shader class that will handle all my compiling and error handling, but to my horror, the easiest part decided to stop me from finishing.

I decided to make a struct called ShaderProgram that would contain my two shaders so I can just enable and disable each program to get a desired effect, though I feel this is a good idea, the problem is the glCreateProgram() method, throwing me a memory access violation.
Glew reports My OpenGL version as 4.2.

GLuint Prog = glCreateProgram();
Will, in any class or function, throw the memory violation error.

// This may actually be ignored, if not, feel free to scorn me about any bad code.
My code as follows:

// My include block (Way at the top) (all headers are working and linked)
#pragma once
#include <gl\glew.h>
#include <glm\glm.hpp>
#include <stdio.h>
#include <FlakPath.h> // Simple file-path class
#include <map>

using namespace std;

struct ShaderProgram
	GLuint mProgram;
	SHADER mVertex,mFragment;

	void Shader_DualDebug()
		cout << "
		cout << "
         // **************************************
         // Error Occurs Here, inside the method 
         // **************************************
	ShaderProgram(){mProgram = glCreateProgram();}

	void Activate(string Vertex,string Fragment,bool _Compile = false, bool _Use = false)

		if (_Compile)

		if (_Use)


        // Error Occurs Here also, on the CreateProgram line (again, a memory error)
	ShaderProgram(string Vertex,string Fragment,bool _Compile = false, bool _Use = false)

		mProgram = glCreateProgram();

Any help would be much appreciated.

Did you initialize OpenGL and load the function pointers?


GLint GlewInitResult = glewInit();
	if (GLEW_OK != GlewInitResult) 
		printf("ERROR: %s

I realized that I had put my glCreateProgram() before the above block, which finished the GL instillation.
Thanks, was a simple placement error, as many things are.