Masaki Suketa
3/3/2007 1:34:00 AM
Hello,
In message "Re: Win32OLE trouble (custom ocx)"
on 07/03/03, Barry Walker <barryjr@gmail.com> writes:
> require 'win32ole'
> include WIN32OLE::VARIANT
> qp = WIN32OLE.new("QPTNT.QPTntCtrl.1")
> s= qp.Version
>
> gives
> qptest.rb:4:in `method_missing': Version (WIN32OLERuntimeError)
> OLE error code:0 in <Unknown>
> <No Description>
> HRESULT error code:0x8000ffff
> Catastrophic failure from qptest.rb:4
>
> I tried another method, Activate2 with the same results.
Sorry, I'm not sure, but this might be Win32OLE's limit.
> I only get one number on one line.
>
> 36
Thank you.
I guess olegen worked fine, and created the expected script code.
Perphaps the olegen created the script code like as the following.
Is that right?
require 'win32ole'
obj = WIN32OLE.new("QPTNT.QPTntCtrl.1")
include WIN32OLE::VARIANT
obj._invoke(36, [], []) # this invokes Version.
But unfortunately, I think you would get the same result
even if you try above script.
> When I run it for the Activate2 (which requires one arguement) method I
> get:
>
> 55
> -----
> "I4"
> ["I4"]
> false
Perphaps, I guess olegen created as the following code.
obj._invoke(55, [arg], [VT_I4])
And [IN, OUT, OPTION] tags are not needed in this case.
> It was a year ago I ran the OCX with VBSript and I can't find the code.
> I just remember that it worked and that it was very cumbersome so I
> abandon it. As I recall I invoked QPTnt.ocx not QPTNT.QPTntCtrl.1.
BTW, Does the following VBScript work?
Set obj = CreateObject("QPTnt.ocx")
obj.Version
or
Set obj = CreateObject("QPTNT.QPTntCtrl.1")
obj.Version
If it would not work, Win32OLE script does not work.
Regards,
Masaki Suketa