cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot call .NET method for object returned by FindChild

Highlighted
Contributor

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 1
Highlighted
Contributor

RE: Cannot call .NET method for object returned by FindChild

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...
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors