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 << "
*Vertex*
";
		mVertex.Print_Textual_State();
		cout << "
*Fragment*
";
		mFragment.Print_Textual_State();
	}
         // **************************************
         // Error Occurs Here, inside the method 
         // **************************************
	ShaderProgram(){mProgram = glCreateProgram();}

	void Activate(string Vertex,string Fragment,bool _Compile = false, bool _Use = false)
	{
		mVertex.Set_Data(GL_VERTEX_SHADER,Vertex);
		mFragment.Set_Data(GL_FRAGMENT_SHADER,Fragment);

		if (_Compile)
		{
			mVertex.Compile();
			mFragment.Compile();
		}

		if (_Use)
		{
			mVertex.Attach(mProgram);
			mFragment.Attach(mProgram);
		}

	}

        // 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();
		Activate(Vertex,Fragment,_Compile,_Use);
	}
};

Any help would be much appreciated.

Did you initialize OpenGL and load the function pointers?

SOLVED


GLint GlewInitResult = glewInit();
	if (GLEW_OK != GlewInitResult) 
	{
		printf("ERROR: %s
",glewGetErrorString(GlewInitResult));
		exit(EXIT_FAILURE);
	}

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.