Condividi tramite


Metodo IADsPathname::CopyPath (iads.h)

Il metodo IADsPathname::CopyPath crea una copia dell'oggetto Pathname.

Sintassi

HRESULT CopyPath(
  [out] IDispatch **ppAdsPath
);

Parametri

[out] ppAdsPath

Puntatore all'interfaccia IDispatch nell'oggetto IADsPathname restituito.

Valore restituito

Questo metodo supporta i valori restituiti standard, nonché i seguenti:

Per altre informazioni e altri valori restituiti, vedere Codici di errore ADSI.

Commenti

Questo metodo viene utilizzato per modificare il percorso dell'oggetto e mantenere il percorso dell'oggetto originale.

Esempio

Nell'esempio di codice di Visual Basic seguente viene illustrato come creare una copia di un pathname.

Dim x, y As New Pathname
x.Set "LDAP://srv1/dc=dom,dc=company,dc=com",ADS_SETTYPE_FULL
set y = x.CopyPath
MsgBox y.Retrieve(ADS_FORMAT_WINDOWS)

Nell'esempio di codice VBScript/ASP seguente viene illustrato come creare una copia di un pathname.

<%
Dim x, y
Const ADS_SETTYPE_FULL = 1
Const ADS_FORMAT_WINDOWS = 1
Set x = CreateObject("Pathname")
x.Set "LDAP://srv1/dc=dom,dc=company,dc=com",ADS_SETTYPE_FULL
 
set y = x.CopyPath
Response.Write y.Retrieve(ADS_FORMAT_WINDOWS)
%>

Nell'esempio di codice C++ seguente viene creata una copia di un oggetto pathname. Per altre informazioni e un esempio di codice della funzione GetPathnameObject , vedere IADsPathname.

IADsPathname *pPath;
LPWSTR adsPath;
adsPath = L"LDAP://server/cn=jeff smith,dc=Fabrikam,dc=com";
 
IADsPathname *pPath = GetPathnameObject(adsPath)
if (!pPath) exit(0);
 
IDispatch *pDisp;
HRESULT hr;
hr = pPath->CopyPath(&pDisp);
if(FAILED(hr)) exit(hr);
 
IADsPathname *pPathCopy;
hr = pDisp->QueryInterface(IID_IADsPathname,(void**)&pPathCopy);
 
// ...

Requisiti

   
Client minimo supportato Windows Vista
Server minimo supportato Windows Server 2008
Piattaforma di destinazione Windows
Intestazione iads.h
DLL Activeds.dll

Vedi anche

Codici di errore ADSI

IADsPathname