On Sep 2, 4:23=A0pm, Chuck Remes <cremes.devl... / mac.com> wrote:
> 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 =A0
> >>> 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 =A0
> >> should
> >> then "just work" as long as RUBYOPT is set. If it doesn't, please =A0
> >> 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 =A0
> > 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 `[]=3D': index 8 out of string (IndexError)
> > =A0 =A0 =A0 =A0from C:/Ruby/lib/ruby/gems/1.8/gems/pr-win32ole-1.0.0/li=
b/pr/
> > win32ole.rb:701:in `ole_val2variant'
> > =A0 =A0 =A0 =A0from C:/Ruby/lib/ruby/gems/1.8/gems/pr-win32ole-1.0.0/li=
b/pr/
> > win32ole.rb:4481
> > =A0 =A0 =A0 =A0from (eval):3:in `call'
> > =A0 =A0 =A0 =A0from (eval):3:in `DispatchMessage'
> > =A0 =A0 =A0 =A0from C:/Ruby/lib/ruby/gems/1.8/gems/pr-win32ole-1.0.0/li=
b/pr/
> > win32ole.rb:5034:in `ole_msg_loop'
> > =A0 =A0 =A0 =A0from C:/Ruby/lib/ruby/gems/1.8/gems/pr-win32ole-1.0.0/li=
b/pr/
> > win32ole.rb:5039:in `message_loop'
> > =A0 =A0 =A0 =A0from //.host/Shared Folders/My Documents/NetBeansProject=
s/
> > ChuckKit/lib/main.rb:165
>
> > If that trace looks crappy, view it here: =A0http://pastie.org/603650
>
> 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 =A0
> characters. Backing up the stack I looked at where it was passed in =A0
> from and see that the +pvarResult+ variable passed into the lambda had =
=A0
> the value "\n\000". =A0The lambda in question is on line 4400.
>
> I don't know this code well enough to say where that came from =A0
> originally, but that explains the IndexError anyway. It looks like the =
=A0
> code that operates on those strings assumes they are 16 characters =A0
> 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