chiyuw...@gmail.com
unread,Nov 22, 2012, 11:53:41 AM11/22/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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);
}