CComSingleThreadModel
(1)
GetUIObjectOf
(1)
EnumFormatEtc
(1)
IDataObject
(1)
ShellFolder
(1)
Window
(1)
Laggy
(1)
COM
(1)

Implementing IDataObject for IAsycnhOperation...

Asked By Caesar
10-Nov-09 01:58 AM
Hi all,

Would like to know what are the interfaces that I need to implement to
support asynchronous file operation for my NSE...(my NSE as source and
explorer as destination).

so far I have implemented IDataObject with IAsynchoperation and
singlethreadedapartment. Is it correct? When I copy file from nse to
explorer, while the file transfer is going on, I can browse both destination
and source, although source window(NSE) is so laggy.

Is there anything that I need to consider in implementing asynchronous
operation?

Thanks

I suspect that the NSE is laggy when file transfer is going on is

Caesar replied to Caesar
11-Nov-09 08:55 PM
I suspect that the NSE is laggy when file transfer is going on is because
IDataObject resides in the same STA as the NSE UI.

I tried to change IDataObject from CComSingleThreadModel to
CComMultiThreadModel. It did not work though.

Then in ShellFolder::GetUIObjectOf (IID_IDataObject), I tried to run a
separate thread to create IDataObject then marshall it back to main thread.
However, whenever IDataobject::EnumFormatEtc is called, it failed. Other
methods that does NOT require IDataObject to deal with COM object work fine
though. Only the methods that deal with COM object failed in this marshalled
IDataObject.
Post Question To EggHeadCafe