LinkBack Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 02-Nov-2009, 06:51 AM
Junior Member
 
Join Date: Mar 2008
Posts: 6
tekniker 0 reputation points
Default Error 0x80004002: No such interface.

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;
gwSys.Connect(gwDomain);
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.
Console.WriteLine(usr.Name);
}
}

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.
Reply With Quote
 

Tags
casting, csharp, error

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -6. The time now is 04:42 AM.


© 2007 Novell, Inc. All Rights Reserved.

Search Engine Friendly URLs by vBSEO 3.3.0 RC2