Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Supported interfaces in live object
Message
 
 
To
13/07/2000 16:26:41
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00391907
Message ID:
00392073
Views:
10
>Where the heck is this thing documented?

Here.

>But what I really need it for is checking for supported interfaces in
>ADSI objects. The ADSI IADsComputer object supports an optional
>IADsComputerOperations interface that when implemented allows shutdown of a \
>remote machine through its ADSI representation. The problem is, I can't figure
>out how to tell if the interface is implemented before I make the call, and
>ClassInfoFromObject pukes when you pass it any ADSI object.

Perhaps something along these lines?

*-- Code begins here
? IsSupported("IADsComputerOperations")

Function IsSupported
Lparameters lcInterface
Local ox
ox=CreateObject("tli.tliapplication")

*-- Assuming that it chokes on an ADSI object, we'll just go
*-- after it via the GUID in the registry.
x=ox.TypeLibInfoFromRegistry('{97D25DB0-0363-11CF-ABC4-02608C9E7553}',1,0,0)
oInt = x.Interfaces
For i = 1 To oInt.Count
If oInt.Item(i).Name = lcInterface
Return .t.
Endif
EndFor
Return .f.
*-- Code ends here
Mike Stewart
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform