Platform SDK: Active Directory, ADSI, and Directory Services

IADsServiceOperations::Continue

The IADsServiceOperations::Continue method resumes a service operation that has been halted by the IADsServiceOperations::Pause method.

HRESULT IADsServiceOperations::Continue(void);

Return Values

This method supports the standard return values, including S_OK. For other return values, see ADSI Error Codes.

Example Code [Visual Basic]

The following Visual Basic code snippet shows how to restart a paused Microsoft® Fax Service on a Windows® 2000 Professional.

Dim cp As IADsComputer
Dim so As IADsServiceOperations
Set cp = GetObject("WinNT://myMachine,computer")
Set so = cp.GetObject("Service", "Fax")
If (so.Status = ADS_SERVICE_PAUSED) then ' The operation has paused.
so.Continue
End If

Example Code [C++]

The following C++ code snippet restarts the Microsoft Fax Service running on a Windows 2000 Professional.

IADsContainer *pCont;
IADsServiceOperations *pSrvOp;
LPWSTR adsPath = L"WinNT://myMachine,computer";

HRESULT hr = ADsGetObject(adsPath,
IID_IADsContainer,
(void**)&pCont);
if(FAILED(hr)) exit(hr);
IDispatch *pDisp;
hr = pCont->GetObject(L"Service",L"Fax",&pDisp);
pCont->Release();
if(FAILED(hr)) exit(hr);

hr = pDisp->QueryInterface(IID_IADsServiceOperations,(void**)&pSrvOp);
pDisp->Release();
if(FAILED(hr)) exit(hr);

long status;
hr = pSrvOp->get_Status(&status);
if(status == ADS_SERVICE_PAUSED) pSrvop->Continue();

pSrvOp->Release();

Requirements

  Windows NT/2000: Requires Windows 2000 (or Windows NT 4.0 with DSClient).
  Windows 95/98: Requires Windows 95 or later (with DSClient).
  Header: Declared in Iads.h.

See Also

IADsService, IADsServiceOperations, IADsServiceOperations::Pause