Switching Vsync state

Finally i learnt to disable vsync.But when i disabled once in program i couldn’t enable
it.Where is the problem?Here is my code to switch vsync state:

void Svsync(bool v)
{
if(!v)
{
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = 0;
PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = 0;

wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)
wglGetProcAddress(“wglSwapIntervalEXT”);
wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)
wglGetProcAddress(“wglGetSwapIntervalEXT”);
tint=wglGetSwapIntervalEXT();
wglSwapIntervalEXT(0);

}

else
{
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = 0;
PFNWGLGETSWAPINTERVALEXTPROC wglGetSwapIntervalEXT = 0;

wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)
wglGetProcAddress(“wglSwapIntervalEXT”);
wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)
wglGetProcAddress(“wglGetSwapIntervalEXT”);
wglSwapIntervalEXT(1);

}
}

  1. Post the code where you are using Svsync…
  2. Are you sure you have disabled it?
  3. Check if wglGetProcAddress retunrs NULL…
  4. BTW why are you calling

tint=wglGetSwapIntervalEXT();

???
PM