Problem in creating objects using ActiveDs Type Library

Problem in creating objects using ActiveDs Type Library

Post by Minha » Sat, 05 Jul 2003 16:14:52



Hi All

Can any one help me in the problem i am having while using
ActiveDs Typelib in C# using COM Interop Assemblies.
Actually i am unable to create object of any interface in
the Typelib can anyone tell me the correct syntax to
create and object of the interface.

 
 
 

Problem in creating objects using ActiveDs Type Library

Post by MVP - ADS » Sun, 06 Jul 2003 02:49:20


For the creatable interfaces, you should be able to create them with new
such as:

LargeInteger x = new LargeInteger();

or

LargeInteger x = new LargeIntegerClass();

Not all of the types are creatable though.  For many of the interfaces, you
may have to cast a value you receive as an Object to the appropriate
interface.

If that doesn't fix it, can you post some code illustrating what's going
wrong?

Joe K.


Quote:> Hi All

> Can any one help me in the problem i am having while using
> ActiveDs Typelib in C# using COM Interop Assemblies.
> Actually i am unable to create object of any interface in
> the Typelib can anyone tell me the correct syntax to
> create and object of the interface.


 
 
 

1. Using ActiveDs.IADsUser in VB.NET (Not all properties are available on Native Object)

I have problem that is causing me heaps of problems when I am trying to use
the ActiveDs.IADsUser object in Visual Basic .NET.

Basically I want to be able to read the following properties of my users
from our Active Directory.
I return a DirectoryEntry (ent2) from a DirectorySearcher function and then
cast that as an ActiveDs.IADsUser object in the following line of code.

Dim NativeObj As ActiveDs.IADsUser = CType(ent2.NativeObject,
ActiveDs.IADsUser)

This appears to work and I can see properties like Name, Parentr,
BadLoginCount with their values.

If I place a breakpoint on the line of code above and look in the Locals
window, I see a few of the properties are populated while many of the ones I
need show the following message "<error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred>"

.BadLoginCount                (Displays 2)
.PasswordLastChanged     (Displays #5/26/2003 3:04pm#)

but then
.PasswordExpirationDate     (Displays "<error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred")
.LastLogin     (Displays "<error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred")
.PasswordMinimumLength     (Displays "<error: an exception of type:
{System.Runtime.InteropServices.COMException} occurred")

Can anyone tell me why some properties are correctly shown while others are
unavailable?

TIA
Anthony

2. Alternative to VueScan?

3. Urgent: Please help "Dynamic Link Library ACTIVEDS.dll Could Not Be Found"

4. Newbie: ISDN and Webserver

5. creating / using document library templates ?

6. FS Ebay TOPO ADROBOT Robot 1983

7. Nested doc libraries ins STS Office 2003?

8. FA: Less than a day to go: Dual Single-Ended UW SCSI PCI - 375-0005

9. Creating Application Specific Objects using LDAP

10. Using ASP to create user objects in Active Directory

11. No .ins files created

12. Add different File Type to Document Library

13. Document library - Column - Type Choice - Link to Database