Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Download a internet image Asynchronously using URL moniker

14 views
Skip to first unread message

chiyuw...@gmail.com

unread,
Nov 22, 2012, 11:53:41 AM11/22/12
to
I using implementing a feature in our software to download a internet image asynchronously to system memory and display it afterward using url moniker.
The problem is that when BindToStorage() always blocks even when I set BINDF_ASYNCHRONOUS | BINDF_ASYNCSTORAGE inside GetBindInfo()
Any suggestion? Thanks.
On of my function looks like this
void RemoteImageProvider::
openURLImage(const df::PlatfString& url)
{
HRESULT hr = S_OK;
// Create WIC factory
if (!mIWICFactory) {
hr = CoCreateInstance(
CLSID_WICImagingFactory,
NULL,
CLSCTX_INPROC_SERVER,
IID_PPV_ARGS(&mIWICFactory)
);
}
// Crate url moniker and bind.
LPMONIKER moniker = NULL;
int result = CreateURLMonikerEx(0, url.GetChars(), &moniker, URL_MK_LEGACY);
CComPtr<IBindCtx> bindCtx;
CreateAsyncBindCtx(0, this, 0, &bindCtx);
if (SUCCEEDED(hr))
hr = RegisterBindStatusCallback(bindCtx, this, NULL, 0);
if (SUCCEEDED(hr))
hr = moniker->BindToStorage(bindCtx, 0, IID_IStream, (void**)&mStream);

}
0 new messages