Re: Schema Query - Top Level Classes Only



"Gerry Hickman" wrote:

Hi Jeffrey,

I am not sure if I have understood you completely. Is your problem
resolved? If not, can you tell me why urkec's reply does not meet your
need? Can you help to explain your problem in more details?

Urkec's reply solves the problem in the context of using a query, but I
want to use the SubClasses() method instead to get only
top-level-classes from a Namespace, see my previous post for code
snippets that demonstrate this.

--
Gerry Hickman (London UK)


Instead of SWbemObject.Subclasses_ you would need to use
SWbemServices.SubclassesOf with wbemQueryFlagShallow flag:

var wbemQueryFlagShallow = 1
var cSubClasses = oSvc.SubclassesOf("", wbemQueryFlagShallow)

but you get the same result using SWbemServices.ExecQuery with the query I
posted:

var cSubClasses1 = oSvc.ExecQuery("Select * From Meta_Class Where
__Superclass Is Null")



--
urkec
.


Loading