RegisterClass failed: class already exits

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?

5
задан user963241 3 September 2010 в 19:33
поделиться