GetURL method
Retrieves an object's URL.
Syntax
HRESULT retVal = object.GetURL(ppszURL);
Parameters
- ppszURL
-
Type: LPSTR
Address of an LPSTR that will be filled with a pointer to the object's URL. Because this method allocates memory for the string, you must create and instance of an IMalloc interface and free the memory using IMalloc::Free when it is no longer needed.
Examples
The following code fragment provides an example of how to allocate and free memory in order to store a pointer to an object's URL.
// 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
Show: