IShellFolder marshaling

IShellFolder marshaling

Post by Roman Vareni » Tue, 10 Jun 2003 22:39:40



Hello,

I'm trying to create another thread and marshal IShellFolder to it. Like
this:

IShellFolder* pISHF;
SHGetDesktopFolder(&pISHF);
HRESULT hr = ::CoMarshalInterThreadInterfaceInStream( IID_IShellFolder,
pISHF, &m_streamUnk );

It works well under WinXP but fails under Win98 with hr == 0x80040155L
(Interface not registered).
Indeed, it's not registered. It looks like I shouldn't ise IShellFolder from
multiple threads.

Is there any workaround? How can I call IShellFolder from more then one
thread?

Best regards

 
 
 

IShellFolder marshaling

Post by Jim Barr » Wed, 11 Jun 2003 01:53:11



> I'm trying to create another thread and marshal IShellFolder to it.
[...]
> It works well under WinXP but fails under Win98 with hr == 0x80040155L
> (Interface not registered).
> Indeed, it's not registered. It looks like I shouldn't ise IShellFolder from
> multiple threads.

Prior to Windows 2000, the shell used a kind of "fake COM", and there was no support for marshalling.

Quote:> Is there any workaround? How can I call IShellFolder from more then one
> thread?

You can pass the IShellFolder pointer directly to another thread, just don't try to access it simultaneously from more than one thread.

--
Jim Barry, MVP for Windows SDK
"For bureaucratic reasons, we settled on one issue, weapons of mass
destruction, because it was the one reason everyone could agree on."
Paul Wolfowitz, US Deputy Defence Secretary

 
 
 

1. Caching IShellFolders for IShellFolder::BindToObject

Hi,
I have implemented a cache for storing IShellFolders that are created by
explorer calling IShellFolder::BindToObject() in my multi level foldering
NSE. Basically I have a hashtable that is keyed on a string representation
of the pidl of the IShellFolder. Each time BingToObject is called I try to
obtain an IShellFolder from the cache by the string representation of the
absolute pidl constructed from the pidl passed into BindToObject. If the
cache does not hold the requested IShellFolder then I create a new one, add
it to the cache and pass it back out of the function. Debugging this things
seem to work fine and IShellFolders are being taken from the cache and given
to explorer however when I try to go into a subfolder in the NSE explorer
does the work to bind to the new IShellFolder but never calls the
IShellFolder::CreateViewObject method, this means the namespace is still
sitting in the same folder view as before.

Anyone got any ideas?

Andy

2. Buying 250 3.12 licensing

3. strange corba marshal error org.omg.CORBA.MARSHAL

4. Phonostenography, anancient system of speedwrittind, is unique. It gives one the ability to classify,analyze, and synthesize information in any landuage. Phonostenography consist of nine movement symbols. After the thirty lesson course, you will be wel

5. IShellFolder::ParseDisplayName unknown

6. Network Node Manager for Solaris

7. XP IShellFolder::EnumObjects bug

8. fs:4 gig wide/diff quantum 34300wd drives

9. How to register a object(DLL) implemented the IShellFolder interface?

10. IShellFolder

11. IShellFolder::ParseDisplayName called with strange arguments

12. Win98 and IShellFolder

13. IShellFolder and NT4