Windows 7 - 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
CComSingleThreadModel
(1)
GetUIObjectOf
(1)
EnumFormatEtc
(1)
IDataObject
(1)
ShellFolder
(1)
Window
(1)
Laggy
(1)
COM
(1)
  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.
help
keystrokes (without a keyboard hook prefereably). Jim - - www.mustangpeak.net Platform SDK Shell Discussions IShellFolder.GetUIObjectOf (1) GetUIObjectOf (1) IDataObject (1) DataObject (1) Wayne (1) Does the DataObject you pass the shell implement IAsyncOperation? -Wayne I get the DataObject from IShellFolder.GetUIObjectOf so if the Shell is implementing it then yes. . . . Well actually I don't do to the DataObject (seemed you can't add more data to the IDataObject received from GetUIObjectOf ) then I proxy the DataObject the shell gave me for formats that my DataObject can
GetUIObjectOf fails and causes an exception Windows 7 Having a problem with this simple tast. Crashes SHGDN_NORMAL, &sr); StrRetToBuf(&sr, pidlChild, buf, MAX_PATH); if (0 = = _tcsicmp(buf, _T("Display"))) { hr = ParentFolder-> GetUIObjectOf( NULL, 1, (LPCITEMIDLIST*)πdlChild, IID_IContextMenu, NULL, (void* *)cm); / / < = Complains here that cm is uninitialized ZeroMemory pidlChild = NULL; } ILFree(pCFidl); CoUninitialize(); OleUninitialize(); _getch(); return 0; } Platform SDK Shell Discussions SHGetDesktopFolder (1) GetUIObjectOf (1) IEnumIDList (1) GetDisplayNameOf (1) StrRetToBuf (1) IShellFolder (1) IContextMenu (1) BindToObject (1) bluenozer schrieb QI_ARGS_NULL(IContextMenu, pp) expands to IID_IContextMenu, NULL, = reinterpret_cast<void* *> (static_cast<IContextMenu* *> (pp)) and so your GetUIObjectOf call would look like this: hr = 3D ParentFolder-> GetUIObjectOf( NULL, 1, (LPCITEMIDLIST*)πdlChild, QI_ARGS_NULL(IContextMenu, &cm)); - - = 20 Jim Barry, MVP (Windows SDK) keywords: GetUIObjectOf, fails, and, causes, an, exception description: Having a problem with this simple tast. Crashes with
on XP target I am using the CDefView I have used CDefFolderMenu_Create2 during my IShellFolder::GetUIObjectOf (riid = = IContextMenu) to help construct the menus when the user r-clicks on a item TortisesSVN, but nothing for winzip. Any Ideas? - - Gak - Finecats Platform SDK Shell Discussions Outlook (1) GetUIObjectOf (1) XP (1) GetMenuItemInfo (1) CDefFolderMenu (1) TortieseSVN (1) TortisesSVN (1) QueryContextMenu (1) Hello Finecats, Please call GetUIObjectOf for IContextMenu3 or, at least, IContextMenu2. As far as I know, owner drawn menus were on XP target I am using the CDefView I have used CDefFolderMenu_Create2 during my IShellFolder::GetUIObjectOf (riid = = IContextMenu) to h