IDataObject and Threading
-
Hi, I am creating a shell extension and having some problems in Dropping a file on the extension. My extension actually communicates with an FTP server and whenever a file is dropped in it, I have to copy the file onto the FTP server. This process is working fine in a single threaded component. But I would like to show a progress dialog for the same and I am doing the file copy in a background thread and showing a modal dialog in the main thread. The problem is IDataObject is created in the main thread and I am passing a reference of the same to the background thread. When I invoke the GetData(..) method of IDataObject, its returning failure. But when the same in inoked from the main thread, I am getting the results. The extension runs in an Aprtment threading model. Any help would be appreciated... Thanks and Best Regards Jugs "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
-
Hi, I am creating a shell extension and having some problems in Dropping a file on the extension. My extension actually communicates with an FTP server and whenever a file is dropped in it, I have to copy the file onto the FTP server. This process is working fine in a single threaded component. But I would like to show a progress dialog for the same and I am doing the file copy in a background thread and showing a modal dialog in the main thread. The problem is IDataObject is created in the main thread and I am passing a reference of the same to the background thread. When I invoke the GetData(..) method of IDataObject, its returning failure. But when the same in inoked from the main thread, I am getting the results. The extension runs in an Aprtment threading model. Any help would be appreciated... Thanks and Best Regards Jugs "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
-
Hi Jon, You were right. I was not marshalling the interface across apartment boundaries. I used CoMarshalInterThreadInterfaceInStream and CoGetInterfaceAndReleaseStream methods and was successfull. Thanks for the support. Best Regards Jugs "A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."