Group:  Microsoft Word ยป microsoft.public.word.oleinterop
Thread: How to set the processor affinity for the Word application?

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

How to set the processor affinity for the Word application?
theTone 24.07.2006 14:16:02
Hi all,

We have noticed that using the Word OLE is much slower on dual processor
machines.
Limiting the processor affinity to one processor helps.
So, I want to set the affinity in my C# code.

I succeeded with the following code:
oWord = new Word.Application();
oWord.Visible = false;
Process[] wordProcesses = Process.GetProcessesByName("WINWORD");
if (wordProcesses.Length == 1) {
(wordProcesses[0]).ProcessorAffinity = new IntPtr(1);
}

However, I only want to effect the WINWORD process I just created.
And not any others that might be running.

Is there any way to get from an Word.Application object to its associated
process?
Can I get the ProcessID in some way?

Any help is appreciated,
Thanks,
Tony.

RE: How to set the processor affinity for the Word application?
theTone 08.08.2006 12:46:14
Isn't there anybody who knows if it is possible
to go from a WordApplication instance to its associated process?

I now simply search for the latest started WINWORD process,
but that really is not the way I like to solve this...

All help is appreciated,
Thanks,
Tony.

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net