Object Paths to Classes

[This is preliminary documentation and subject to change.]

The object path to a class consists of three parts:

<server><namespace>:<classname>

The <server> portion of the syntax is a double leading backslash followed by the network name of the machine. The <namespace> portion is the object path to the appropriate namespace on that server. The <classname> portion is the relative object path to the instance within the namespace.

For example, to reach MyClass residing in the Root\Default namespace on the server MyServer, use the following object path:

\\MyServer\Root\Default:MyClass
 

To specify the current server, use the pseudonym "\\.":

\\.\Root\Default:MyClass
 

If the namespace is deeply nested, use the entire path of namespaces, employing a backslash as a separator:

"\\\\MyServer\\Ns1\\Ns2\\Ns3\\MyClass"
 

If the class resides in the current namespace on the current server, the object path can contain only the class name:

"MyClass"

The following code fragment illustrates how to use the relative object path to retrieve the class definition for MyClass:

BSTR Path = SysAllocString(L"MyClass");
    IWbemClassObject *pMyClass = 0;
    pHmmSvcs->GetObject(Path, 0, 0, &pMyClass, 0);
 

Object paths to classes are used in calls to: