My sample application gets a COM IStream instance from a IPortableDeviceResources::GetStream() function. I want to read the device object contents asynchronously using this IStream object. How can I do that using an asynchronous moniker?

没有正确的解决方案

其他提示

IStream is synchronous by design. I would first ask what your scenario is for needing this to be asynchronous.

For example, if the reason for wanting an asynchronous data stream is so that you won't block the UI thread, you can perform the IStream operations in a worker thread.

If the reason is so that you can issue multiple parallel reads, MTP 1.0 devices don't support this because at the driver level, the requests will still be processed sequentially in a single, global, MTP session. MTP 2.0 supports multi-session which allows for multiple parallel connections to the same device, but so far not many devices have adopted this. Most, if not all, MTP devices in the market are MTP 1.0.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top