IUniformResourceLocator::GetURLIUniformResourceLocator::GetURL*
*



Contents  *



Index  *Topic Contents
*Previous Topic: IUniformResourceLocator Interface
*Next Topic: IUniformResourceLocator::InvokeCommand

IUniformResourceLocator::GetURL

HRESULT GetURL(
    LPSTR *ppszURL
);

Retrieves an object's uniform resource locator (URL).

ppszURL
Address of an LPSTR that will be filled in with a pointer to the object's URL. Because this method allocates memory for the string, you must instantiate an IMalloc interface and free the memory using IMalloc::Free when it is no longer needed. The following code fragment provides an example of how this can be done.
//  START CODE FRAGMENT
{
    // In this example, pURL is a global IUniformResourceLocator pointer.
    LPSTR lpTemp;

    hres = pURL->GetURL(&lpTemp); 
    if (SUCCEEDED(hres)){
        IMalloc* pMalloc;
        hres = SHGetMalloc(&pMalloc); 
        if (SUCCEEDED(hres)){
            pMalloc->Free(lpTemp);
            pMalloc->Release();
        }
    }
}
//  END CODE FRAGMENT

Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.