Link to home
Start Free TrialLog in
Avatar of lapucca
lapucca

asked on

I'm getting NotImplementedException when I tried to get the Count property from the IContianer object.

I'm getting NotImplementedException  when I tried to get the Count property from the IContianer object iconComputers.  What does this error mean?  How can I correct this problem?  Thanks.


//deGlobalComputers is a DirectoryEntry object.
                    IADsContainer iconComputers = (IADsContainer)deGlobalComputers.NativeObject;
                    IADsContainer iconUsers = (IADsContainer)deGlobalComputers.NativeObject;
                    IADsContainer iconGroups = (IADsContainer)deGlobalComputers.NativeObject;
                    iconComputers.Filter = new object[] {"meeting"};
                    int numOfComputers = iconComputers.Count;
--
Thanks.
ASKER CERTIFIED SOLUTION
Avatar of Alexandre Simões
Alexandre Simões
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of paulb1989
paulb1989

If 'Count' not implemented then maybe you could do this:

int numOfComputers = iconComputers.Count;
foreach (object o in iconComputers)
    numOfComputers++;
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of lapucca

ASKER

Thanks Paul.  I already have coded it that way but I want to know why the IContainer code won't work.  As both of you have pointed out that Count property isn't implemented so I'll just split the points between you 2.  Thank you both.