Forum Discussion

asdfasdfasdfasd's avatar
asdfasdfasdfasd
Contributor
15 years ago

Cannot call .NET method for object returned by FindChild

I have an interesting scenario where I'm unable to call a .NET method for an object returned by FindChild, but can call the same .NET method if I reference the object fully.



Here's the code that works:



var obj =
NameMapping.Sys.pCatalyst.hwndWave.wWave.wavectrlMain.dpnlWave.WPFObject("Grid",
"", 1).WPFObject("mFrame").WPFObject("DefaultQuickWavePage", "",
1).WPFObject("StackPanel", "",
1).WPFObject("mQuickWaveControl").WPFObject("StackPanel", "",
1).WPFObject("StackPanel", "", 2).WPFObject("StackPanel", "",
1).WPFObject("mLimitPriceControl").WPFObject("StackPanel", "",
1).WPFObject("mComboBoxLimitType");



obj.SelectItemWithValue(obj.Items.Item(0));



Here's the code that does not work:



var obj = NameMapping.Sys.pCatalyst.hwndWave.FindChild("NativeClrObject.Name", "mComboBoxLimitType", 14);



obj.SelectItemWithValue(obj.Items.Item(0));



The .NET method in question is SelectItemWithValue, but I'm sure it affects all .NET methods.

1 Reply

  • Nevermind, I figured it out.  The object returned from FindChild is indeed a different object (comparing the FullName properties).  I didn't realize developers would name two objects the same...