Export (0) Print
Expand All

IADsDeleteOps::DeleteObject method

The IADsDeleteOps::DeleteObject method deletes an ADSI object.

Syntax


HRESULT DeleteObject(
  Long lnFlags
);

Parameters

lnFlags

Reserved.

Return value

This method supports standard return values, including S_OK for a successful operation. For more information about error codes, see ADSI Error Codes.

Examples

The following code example shows how to delete an object and its child objects.


Dim cont As IADsContainer
Dim ops As IADsDeleteOps
 
Set cont = GetObject("LDAP://OU=sales,DC=Fabrikam,DC=com")
Set ops = cont
 
ops.DeleteObject (0)

The following code example shows how to delete an object and its child objects.


IADsContainer *pCont;
LPWSTR adsPath = L"LDAP://OU=Sales,DC=Fabrikam,DC=com";
HRESULT hr = ADsGetObject(adsPath,
                          IID_IADsContainer,
                          (void**)&pCont);
if (FAILED(hr)) exit(hr);
 
IADsDeleteOps *pOps;
hr = pCont->QueryInterface(IID_IADsDeleteOps,(void**)&pOps);
pCont->Release();
if(FAILED(hr) exit(hr);
 
pOps->DeleteObject(0);
pOps-Release();

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2003

Header

Iads.h

DLL

Activeds.dll

IID

IID_IADsDeleteOps is defined as B2BD0902-8878-11D1-8C21-00C04FD8D503

See also

Access Control and Object Deletion
ADSI Error Codes
IADsContainer::Delete
IADsDeleteOps
IADsDeleteOps Interface
IDirectoryObject::DeleteDSObject

 

 

Show:
© 2014 Microsoft