RemoveHook
This function will remove the first instance of a global hook.
Syntax
- void RemoveHook(int hookid, void* hook)
Parameters
- hookid: the ID of the hook to remove.
- hook: a pointer to the hook function to remove.
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;
}