When I create a child window for the second time,
if (!::RegisterClass(&hwClass))
{
throw std::runtime_error("RegisterClass failed!");
}
It throws an exception that the class already exists. but the child window class was deleted when the child window was destroyed at:
WM_DESTROY:
{
delete this; //destroy child class
}
It works if I comment the expection error. does that mean I don't need to register a class again?