Hi everyone,
I'm developing a C# app to add and remove users from a GW 8 server. I have problems getting it to work properly.
In my code, to get it working, I have to cast objects (like the System object) to their IAD-interface counterparts to get them working, otherwise I get

the 0x80004002: No such interface error. I'm not really at home with the COM stuff, so can someone explain why I have to cast all these objects?
Also, I've encountered a situation where this approach doesn't work. A code snippet follows:

AdminTypeLibrary.System tmpSys = new AdminTypeLibrary.System();
IADSystem gwSys = (IADSystem)tmpSys;
IADDomain dom = (IADDomain)gwSys.ConnectedDomain;
IADUsers users = (IADUsers)dom.Users;
IADUsersIterator usrItr = (IADUsersIterator)users.CreateIterator();
// Trying the 3 first users just for testing.
for (int ii = 0;ii < 3;ii++)
IADUser usr = (IADUser)usrItr.Next();
if (usr!=null)
// The next line throws the "No such interface" exception.

Am I doing something wrong in the code? Why doesn't the IADUser object work?
I've seen that others have had the same problem, but without no really good solution, so I think it will be good if it can be solved once and for all.
Thanks in advance.