RE: Threaded Word File Conversion



Using the single threaded with one application object takes
seconds per file. To slow but at least it works.

Hello Chuck, honestly, I am a little surprised to see it takes seconds per
file. I conducted a test on my side, and it turned out to be only 0.355
seconds on average.

I created a folder which 1000 doc files whose size ranges from 120KB to
240KB, then I new a C# Console project from Visual Studio 2005 and
copy&paste the code I demonstrated in the last reply to it. In order to get
the total run time , I wrote the main function as:

static void Main(string[] args)
{
DateTime start = DateTime.Now;
ConvertFiles();
DateTime end = DateTime.Now;
TimeSpan span = end - start;
Console.WriteLine(span.Minutes.ToString() + "mins " +
span.Seconds.ToString());
}

The result is "5mins 55", namely, 0355 seconds per file. I repeated the
test for several times, and the result is almost the same.
My CPU is Intel? Core(TM)2 6300@xxxxxxx, with 2GB RAM

Therefore, I start to suspect if the low performance on your side results
from other factors? Is it because the files to be converted are too large
(e.g. 10MB)? Or is it due to the network bandwidth constraints if the files
are not on local machine?

And regarding the Threaded issue, this problem is most likely caused that
your COM objects are called on different threads. By default Office use STA
apartment model so if you are using COM objects in different threads, this
may cause issues like interop exceptions "object disconnected from its RCW".

Regards,
Jialiang Ge (jialge@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@xxxxxxxxxxxxxx

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================

.



Relevant Pages

  • RE: Threaded Word File Conversion
    ... Hello Chuck, honestly, I am a little surprised to see it takes seconds per ... DateTime start = DateTime.Now; ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ...
    (microsoft.public.office.developer.automation)
  • Re: SysLink Control Problem
    ... I reproduce this issue on my machine, and I can see in the Process Explorer that the two versions of the ComCtl32 loaded by Word. ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ... reproduce the problem in an Outlook COM addin based on KB 230689. ...
    (microsoft.public.win32.programmer.ui)
  • Re: SysLink Control Problem
    ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ... reproduce the problem in an Outlook COM addin based on KB 230689. ... it is the Exchange client extension ...
    (microsoft.public.win32.programmer.ui)
  • Re: Interop.MSProject FileSaveAs
    ... The error this time is caused by the possibility that the MSProject instance ... is working offline. ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Interop.MSProject FileSaveAs
    ... The error this time is caused by the possibility that the MSProject instance ... is working offline. ... Microsoft Online Community Support ... You can send feedback directly to my manager at: ...
    (microsoft.public.dotnet.languages.vb)