G
Guest
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();
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.
For now, I worked around this by seraching for the WINWORD process with the
latest timestamp. This works, but does not feel like great code.
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.
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();
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.
For now, I worked around this by seraching for the WINWORD process with the
latest timestamp. This works, but does not feel like great code.
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.