A: 

I don't know WHY that's happening, but have you tried other threading methods? Such as a BackgroundWorker component or ThreadPool.QueueUserWorkItem? Does the error still happen?

Chris Thompson
tried with BackgroundWorker, but same result.
Samir
+1  A: 

Could it be because threads you create execute in the default security context, not in the security context of the main thread?

See the doc on ExecutionContext for a hint. You can set the ExecutionContext on your thread and re-try.

Cheeso
I bet it's a permissions issue. Vista UAC could be getting in the way. Windows 7 does auto-elevation for certain tasks so that could explain why it works on 7 and not Vista.
Chris Thompson
Chesso, the link deals with FileDialogPermission. What permission is needed for this case(the code above). If you can give a code snippet how to do this it will really be helpful.
Samir
A: 

Have you called CoInitialize from your thread?

What error code is it returning?

Ian Boyd
A: 

Shell functions work with STA threads only, and .NET threads are MTA by default. You can set the thread to use single-apartment threading:

th->SetApartmentState(ApartmentState::STA);
th->Start();
wj32