>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