RemoveHook

This function will remove the first instance of a global hook.

Syntax

Parameters

Example

#include "Leadwerks.h"

using namespace Leadwerks;

void MyHook(char* error)
{
std::string s = std::string(error);
System::Print(s);
// -- set a breakpoint here and view the printed output
}

int main(int argc, const char *argv[])
{
//Add a hook
System::AddHook(System::DebugErrorHook,MyHook);

//Now remove the hook. Expect an error when you run this!
System::RemoveHook(System::DebugErrorHook,MyHook);

//Induce an error
Debug::Error("Something went wrong!");

return 0;
}