IMoniker * pMoniker = nullptr; CreateURLMoniker(nullptr, L"http://www.example.com", &pMoniker); IStream * pStream = nullptr; HRESULT hr = pMoniker->BindToStorage(nullptr, nullptr, IID_IStream, (void**)&pStream);
IMoniker* pURLMoniker = nullptr; CreateURLMoniker(nullptr, L"http://www.example.com", &pURLMoniker); IBindCtx* pBindCtx = nullptr; CreateBindCtx(0, &pBindCtx); IStorage* pStorage = nullptr; HRESULT hr = pURLMoniker->BindToStorage(pBindCtx, nullptr, IID_IStorage, (void**)&pStorage);This example is similar to the first one, but instead of binding to an IStream interface, we bind to an IStorage interface. This allows us to access the file located at the web address "http://www.example.com" as if it were a file stored locally on the computer. Package Library: This interface is a part of the Windows API and is implemented in the Ole32.dll library.