Thanks Richard, you understand my problem exactly !!
My application makes extensive use of WordML, and is a model of exactly the
type of thing MS want people to use WordML for. Unfortunately, when the user
uploads a document, I need to convert it from .doc format to WordML so get
the process started. Microsoft doesn't seem to have thought of this part of
it, so the only option open to me is to automate Word.
"Richard Blewett [DevelopMentor]" <richardb@NOSPAMdevelop.com> wrote in
message news:epOBHc7$EHA.1904@TK2MSFTNGP14.phx.gbl...[color=blue]
> In essence what you are witnessing is one of the reasons why they warn you
> that Office is not suitable for server side use (theres lots of other
> reasons too like threading throughput). IIRC correctly, the WordML schema
> has now been published and generating WordML would be a more scaleable and
> robust solution than trying to automate word on the server
>
> Regards
>
> Richard Blewett - DevelopMentor
>
http://www.dotnetconsult.co.uk/weblog
>
http://www.dotnetconsult.co.uk
>
> The abort does not actually get delivered to the managed thread until it
> returns from the unmanaged call. There is no way to get around that
> behavior.
>
> You could try running the interop call in a separate appdomain, and then
> unload the appdomain instead of using an abort. I've observed that the CLR
> will go to greater lengths to unload frozen threads when unloading an
> appdomain then when you simply call abort.
>
> Another option is to run it in a totally separate process and then unload
> the process. You could use remoting between processes to send data
> back-and-forth between the main process and the helper process.
>
> In short, there is no good way to shutdown a thread frozen in an unmanaged
> call.
>
>
>
> "Andy Fish" <ajfish@blueyonder.co.uk> wrote in message
> news:uIh4wV6$EHA.2552@TK2MSFTNGP09.phx.gbl...[color=green]
> > Hi,
> >
> > I am using COM interop to invoke MS word from my .net app. If word pops
> > up
> > a dialog box, my thread obviously hangs until the dialog is answered.
> >
> > Here's the problem: because the app is running on a server, there is
> > nobody there to answer the dialog, so I have another thread that calls
> > Abort() on the first thread in the event that the operation doesn't
> > complete within a certain amount of time.
> >
> > Unfortunately, whilst the call to Thread.Abort() works, the dialog box
> > stays up and the subsequent Thread.Join() hangs until the dialog is
> > cancelled.
> >
> > Is there any way round this behaviour? This isn't going to happen very
> > often so I don't care how inefficient it is, but it's got to run on an
> > unattended server so I can't afford to have my app get stuck forever.
> >
> > TIA
> >
> > Andy
> >
> >[/color]
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.300 / Virus Database: 265.7.1 - Release Date: 19/01/2005
>
>
>
> [microsoft.public.dotnet.languages.csharp][/color]