INVOKE the message call back onto the STA thread :-) 

> -----Original Message-----
> From: Moderated discussion of advanced .NET topics. 
> [mailto:[EMAIL PROTECTED] On Behalf Of 
> Dave Foderick
> Sent: Mittwoch, 18. Februar 2004 02:27
> To: [EMAIL PROTECTED]
> Subject: [ADVANCED-DOTNET] Call STA method from MTA process
> 
> I have a main program that I marked for STA with the 
> [STAThread] attribute.
> That process is instantiating a FileSystemWatcher that is 
> notifying it when files are dropped into a directory. I get 
> the notification of the Created event. So far so good.
> 
> Now, inside my event handler I need to instantiate and 
> execute a COM component (SQLXMLBulkLoad). The problem is that 
> the event handler runs in a MTA process and the COM component 
> barfs at it (this is known issue with SQLXMLBulkLoad).
> 
> My question is this: How can I get my event handler in the 
> MTA thread to execute a method on the STA thread? Or is there 
> some way to get the FileSystemWatcher to execute in STA mode?
> 
> Thanks in advance,
> Dave Foderick
> Net Knowledge
> 
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com 
> Some .NET courses you may be interested in:
> 
> NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles 
> http://www.develop.com/courses/gaspdotnetls
> 
> View archives and manage your subscription(s) at 
> http://discuss.develop.com
> 
> 

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
Some .NET courses you may be interested in:

NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles
http://www.develop.com/courses/gaspdotnetls

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to