On Sep 2, 4:23 ¨Âí¬ ÃèõãÒåíå¼ãòåíåó®äåöì®®®Àíáã®ãïí¾ ÷òïôåº > On Sep 2, 2009, at 4:58 PM, Chuck Remes wrote: > > > > > > > On Sep 2, 2009, at 4:43 PM, Daniel Berger wrote: > > >> <snip> > > >>> It can't seem to load a few of its dependencies like "windows/com". > > >>> 1. The gem doesn't have a dependency on the windows-api gem. > > >>> 2. The windows-api gem, after installation, doesn't have a lot of > >>> the > >>> files that pr-win32ole wants to load. > > >> There is no gem for pr-win32ole. All you should need to do is: > > >> gem install windows-pr > > >> That should install win32-api and windows-api automatically. It > >> should > >> then "just work" as long as RUBYOPT is set. If it doesn't, please > >> give > >> me a specific error you're getting. > > > Well, I ran 'gem build pr-winole32.gemspec' so it was easy to install. > > > I now have everything up and going. When I run my program, it > > crashes on a call toWIN32OLE_EVENT.message_loop. > > > starting... > > C:/Ruby/lib/ruby/gems/1.8/gems/pr-win32ole-1.0.0/lib/pr/win32ole.rb: > > 701:in `[]=': index 8 out of string (IndexError) > > ¨Âòïú¯Òõâù¯ìéâ¯òõâù¯çåí󯱮¸¯çåíó¯ðò÷éî³²ïìå±®°®°¯ìéâ¯ðò¯ > > win32ole.rb:701:in `ole_val2variant' > > ¨Âòïú¯Òõâù¯ìéâ¯òõâù¯çåí󯱮¸¯çåíó¯ðò÷éî³²ïìå±®°®°¯ìéâ¯ðò¯ > > win32ole.rb:4481 > > ¨Âòï¨åöá쩺³ºéàãáìì§ > > ¨Âòï¨åöá쩺³ºéàÄéóðáôãèÍåóóáçå> > ¨Âòïú¯Òõâù¯ìéâ¯òõâù¯çåí󯱮¸¯çåíó¯ðò÷éî³²ïìå±®°®°¯ìéâ¯ðò¯ > > win32ole.rb:5034:in `ole_msg_loop' > > ¨Âòïú¯Òõâù¯ìéâ¯òõâù¯çåí󯱮¸¯çåíó¯ðò÷éî³²ïìå±®°®°¯ìéâ¯ðò¯ > > win32ole.rb:5039:in `message_loop' > > ¨Âòﯯ®èïóô¯Óèáòåä Æïìäåòó¯Íù Äïãõíåîôó¯ÎåôÂåáîóÐòïêåãôó> > ChuckKit/lib/main.rb:165 > > > If that trace looks crappy, view it here: ¨Âôô𺯯ðáóôéå®ïò篶°³¶µ> > Okay, dug into the pr-win32ole code and this is what I found. > > Line 701 was trying to access index 8 of a string with only 4 > characters. Backing up the stack I looked at where it was passed in > from and see that the +pvarResult+ variable passed into the lambda had > the value "\n\000". ¨Âèå ìáíâäá éî ñõåóôéïî éó ïî ìéîå ´´°°> > I don't know this code well enough to say where that came from > originally, but that explains the IndexError anyway. It looks like the > code that operates on those strings assumes they are 16 characters > long. That assumption blew it up. It's been fixed in SVN. I'm curious if your code works with the updated version. Regards, Dan