Bada exceptions on RemoveAllControls call

93 views Asked by At

What's the deal with this, it's driving me crazy?

I run this piece of code;

if(GetControlCount() > 0)
{
  RemoveAllControls();
}

And as soon as I step over the RemoveAllControls(); line I get the following exceptions;

12557.709,EXCEPTION,P44,T00,A174,Osp::Ui::Container::GetControlAt (392) > [E_OBJ_NOT_FOUND] Unable to find the specified control.
12557.709,EXCEPTION,P44,T00,A174,Osp::Ui::Container::RemoveControl (247) > [E_OBJ_NOT_FOUND] Propagated.

If the problem is that there are no controls, surely my check should be solving this? So what's the deal?

I have also tried naming the controls individually, null checking them an then removing them if they are not null, but again, I get these exceptions.

1

There are 1 answers

0
John On

12557.709,EXCEPTION,P44,T00,A174,Osp::Ui::Container::GetControlAt (392) > [E_OBJ_NOT_FOUND] Unable to find the specified control. 12557.709,EXCEPTION,P44,T00,A174,Osp::Ui::Container::RemoveControl (247) > [E_OBJ_NOT_FOUND] Propagated.

Is it possible that these are being flagged from a different place in your code? You should try and catch the result to make doubly sure it is coming from where you think. There are several variations of Control::Remove and the AppLog doesn't exactly match the ones you call so perhaps you call other, similarly named ones elsewhere and you are seeing their internal implementation(s) throwing exceptions.