Retrieving a User SDO

The following code retrieves a Server Data Object (SDO) for the Administrator.

   HRESULT  hr;
   _bstr_t bstrUserName = L"Administrator";
   CComPtr<IUnknown> pUserUnknown;

   hr = pSdoMachine->GetUserSDO(
      DATA_STORE_LOCAL,
      bstrUserName,
      (IUnknown**) &pUserUnknown
   );
   if (FAILED(hr))
   {
      return hr;
   }

   CComPtr<ISdo> pUserSDO;
   hr = pUserUnknown->QueryInterface(
      __uuidof(ISdo),
      (void**) &pUserSDO
   );
   if (FAILED(hr))
   {
      return hr;
   }

See Also

Attaching to an SDO-Enabled Computer
ISdo
ISdoMachine
ISdoMachine::GetUserSDO
SysAllocString
SysFreeString

Send comments about this topic to Microsoft

Build date: 10/15/2007