Changing Process Priority of an embedded OCX

delphi package - easy access to kernel objects etc.
Post Reply
kenijo
Posts: 1
Joined: Tue Jan 09, 2007 5:00 pm

Changing Process Priority of an embedded OCX

Post by kenijo »

Hello every one,

I developed a C# software which embed an external OCX to manage 3D stuffs. When I start my software the CPU is pegging because of that OCX so I would like to know if I can lower the priority of this OCX without lowering the priority of tha main software using madKernel?

Thank you for your help
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

If that OCX is drawing 100% CPU then there's nothing you can do to stop it. However, you could eventually lower the priority of the OCX initialization, so that when other threads need CPU time, they get the CPU first and OCX initialization has to wait. In order to do that create you could probably create a secondary thread (see TThread) and inside load the OCX. Don't know whether the OCX likes such a multi threaded approach, though.
Post Reply