Hi,
I'm experiencing some unusual behaviour trying to use VB COM through win32ole in Ruby, and I'm hoping someone might
be able to help. I'm using Ruby 1.84-19 (final) here.
I've included the contents of the files I'm using to reproduce these issues below. Note that you need VB6 to build the
COM DLL, but hopefully you'll be able to see what it's doing without this. I've supplied a pre-built version, but it
will need registering on the computer before it works.
If you run the script, you'll find that it calls a VB subroutine that raises an error, and just before this it displays
a dialog window saying "About to raise error...". However, despite the script only containing one call to
this subroutine, when you click OK to dismiss the window it appears again. Is this a bug or is there an explanation
for it?
The script then calls a VB function that returns an empty variant and an uninitialised array in a variant. However,
when Ruby tries to display the contents of the return value it gives different results, namely 'nil' and 'false'. I
was expecting it to display 'nil' in both cases since there is no data available, but perhaps I've misunderstood
something.
Note that until the most recent version, this final call would actually generate a segmentation fault, and although
it seems to work correctly most of the time now, we're still occasionally experiencing this problem (but we can't reproduce
it as example code).
Thanks,
Andrew. |