Dave Burt
1/17/2006 1:32:00 PM
splitDiff wrote:
> Hi all-
Hi!
> A vendor that I work with provides an OLE inteface for scripting its
> client application. I wanted to write some test scripts in Ruby, and I
> figured that olegen.rb might get me a jump start.
Have you got a script working with normal dynamic Win32OLE? It's usually
more straightforward; use olegen if you need to speed things up.
> Unfortunately, I am hitting the following error:
>
> uninitialized constant OLEOperation_1::VT_HRESULT (NameError)
>
> I think that this is the offending line:
>
> ret = _setproperty(-536739838, [arg0], [VT_BSTR, VT_HRESULT])
>
> The VT_HRESULT constant appears several places in the code generated by
> olegen, so I can't avoid the call.
>
> I tried a brute force:
>
> VT_HRESULT=25
>
> which got me further along in the code, but led to undefined method
> errors coming from OLEProperty the next time I called that object.
>
> Any ideas or assistance would be appreciated. Thanks
OK, is VT_HRESULT meant to be defined in the vendor library? Try
Constants::VT_HRESULT, see if that works. If that works, but it's too
long-winded for you, you can add "include Constants" in your script. If not,
search the file olegen generated for the constant you want -- is it there,
and if so, what module? Or, if you've dropped back to Win32OLE as I
suggested, you can use WIN32OLE.const_load(ole_server, Kernel) to load the
constants directly into the top-level namespace.
Write back if I'm not making sense; it's late :)
Cheers,
Dave