WIN32OLE taking 100% CPU utilisation

Hi there,

just having a quick play with WIN32OLE and it looks like the
message_loop is taking 100% CPU utilisation. What have I done wrong?
This is running on ruby 1.9.2p136 in WinXP and using Office 2007.

http://pastie.org/3004860

Thanks.

···

--
Posted via http://www.ruby-forum.com/.

The Perl version works with no such issues so I'm using that for now.

···

--
Posted via http://www.ruby-forum.com/.

do all versions of ruby do the same thing?

···

--
Posted via http://www.ruby-forum.com/.

This is how #message_loop is supposed to work. It polls the Win32 event sink and processes all of the events that are in queue. Try putting a short sleep in your "loop do" like "sleep(0.1) # 100 ms".

Your code won't run much slower but the CPU utilization will be lower.

cr

···

On Dec 12, 2011, at 6:24 AM, Shareef J. wrote:

Hi there,

just having a quick play with WIN32OLE and it looks like the
message_loop is taking 100% CPU utilisation. What have I done wrong?
This is running on ruby 1.9.2p136 in WinXP and using Office 2007.

http://pastie.org/3004860

Roger Pack wrote in post #1036348:

do all versions of ruby do the same thing?

Sorry, missed these replies. Not tried any more versions I'm affraid -
if I ever try again I will post here but I have it working in Perl for
now.

···

--
Posted via http://www.ruby-forum.com/\.