Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Intellisense for GetObject and Collections?
Message
De
13/06/2002 15:53:27
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00668160
Message ID:
00668199
Vues:
22
>I can get the below code to enumerate my services OK, but I am getting no IntelliSense in my .prg if I type "? oService.".
>
>Is there a trick to getting IntelliSense to work with GetObject and collections, or is it just that WMI is a biotch?
>
>
>cHost = "."
>oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" + cHost + "\root\cimv2")
>colServiceList = oWMI.ExecQuery("Select * from Win32_Service")
>For Each oService in colServiceList
>	? oService.Name
>Next
>
You need to declare oService AS the appropriate type. Before you can do that, you need to add that type to IntelliSense.

In the IntelliSense Manager, go to the Types page, click on Type Libraries, and choose the appropriate library. Once you do that, the available types will show up when you type:

LOCAL oService AS

Once the definition is in place, you'll have IntelliSense for the variable.

Tamar
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform