When I create a child window a 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 removed when the child window was destroyed:
WM_DESTROY:
{
delete this; //destroy child class
}
It works if I comment on the outcome error. Does this mean that I no longer need to register the class?
source
share