Forum Discussion
tristaanogre
14 years agoEsteemed Contributor
You need to, then, make sure you do appropriate checks along the line as well... If there is the possibility that, when you get to looking for lblUser, some of the other objects may need to be waited for, you should also use the WaitAliasChild there, too.
Additionally, you might want to verify your mapping criteria to make sure you're properly identifying the objects, that they aren't returning the wrong object.
Also, the WaitAliasChild is only valid from an object that actually has that child. so, if you don't have that frmMainForm and you try calling it in your path, you will inevitably get the error.
Now, if you want to FIND the child anywhere in your hierarchy and return whether or not it is find, use FindChild. so, I'd change your code like so:
This is assuming that the list of properties and their corresponding values are correct.
Additionally, you might want to verify your mapping criteria to make sure you're properly identifying the objects, that they aren't returning the wrong object.
Also, the WaitAliasChild is only valid from an object that actually has that child. so, if you don't have that frmMainForm and you try calling it in your path, you will inevitably get the error.
Now, if you want to FIND the child anywhere in your hierarchy and return whether or not it is find, use FindChild. so, I'd change your code like so:
, 10)
if (obj.Exists)
Log.Message("It exists!")
else
Log.Message("It does not exist!")
This is assuming that the list of properties and their corresponding values are correct.