Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > WIN32OLE - failed to create WIN32OLE

Reply
Thread Tools

WIN32OLE - failed to create WIN32OLE

 
 
zxem
Guest
Posts: n/a
 
      12-19-2007
I am trying to create a ruby class base on a Win32 COM typelib info.
The class I tried to create is as followed.

COM Type info: (There is no registry entry for this class)

[
uuid(0058FFFF-5B03-11D3-A520-00805F9BE596),
helpstring("Static members of FOHoard"),
helpcontext(0x00580000),
hidden
]
dispinterface FOHoardHelper {
properties:
methods:
[id(00000000), propget, hidden, helpstring("The type name
of this object instance (Default)")]
BSTR Item();
[id(0x00007ffd), hidden, helpstring("Returns a reference
to this helper instance"), helpcontext(0x00007ffd)]
FOHoardHelper* Me();
[id(0x00580002), helpstring("Create a new empty hoard
(collection)"), helpcontext(0x00580002)]
FOHoard* createEmpty();
};

Ruby class:

class FOHoardHelper
include WIN32OLE::VARIANT
attr_reader :lastargs
attr_reader :dispatch
attr_reader :clsid
attr_reader rogid

def initialize(obj = nil)
@clsid = "{0058FFFF-5B03-11D3-A520-00805F9BE596}"
if obj.nil?
@dispatch = WIN32OLE.new @clsid
else
@dispatch = obj
end
end

def createEmpty()
ret = @dispatch._invoke(5767170, [], [])
@lastargs = WIN32OLE::ARGV
ret
end

end

My test code:
f = FOHoardHelper.new;
hlist = f.createEmpty;

I got this error message:
F:/NetBeansProjects/TAVolTest/lib/CalendarUtils.rb:45:in `initialize':
failed to create WIN32OLE object from `{0058FFFF-5B03-11D3-
A520-00805F9BE596}' (WIN32OLERuntimeError)

HRESULT error code:0x80040154


Could you give me some help?
 
Reply With Quote
 
 
 
 
zxem
Guest
Posts: n/a
 
      12-19-2007
On Dec 19, 3:37 pm, zxem <(E-Mail Removed)> wrote:
> I am trying to create a ruby class base on a Win32 COM typelib info.
> The class I tried to create is as followed.
>
> COM Type info: (There is no registry entry for this class)
>
> [
> uuid(0058FFFF-5B03-11D3-A520-00805F9BE596),
> helpstring("Static members of FOHoard"),
> helpcontext(0x00580000),
> hidden
> ]
> dispinterface FOHoardHelper {
> properties:
> methods:
> [id(00000000), propget, hidden, helpstring("The type name
> of this object instance (Default)")]
> BSTR Item();
> [id(0x00007ffd), hidden, helpstring("Returns a reference
> to this helper instance"), helpcontext(0x00007ffd)]
> FOHoardHelper* Me();
> [id(0x00580002), helpstring("Create a new empty hoard
> (collection)"), helpcontext(0x00580002)]
> FOHoard* createEmpty();
> };
>
> Ruby class:
>
> class FOHoardHelper
> include WIN32OLE::VARIANT
> attr_reader :lastargs
> attr_reader :dispatch
> attr_reader :clsid
> attr_reader rogid
>
> def initialize(obj = nil)
> @clsid = "{0058FFFF-5B03-11D3-A520-00805F9BE596}"
> if obj.nil?
> @dispatch = WIN32OLE.new @clsid
> else
> @dispatch = obj
> end
> end
>
> def createEmpty()
> ret = @dispatch._invoke(5767170, [], [])
> @lastargs = WIN32OLE::ARGV
> ret
> end
>
> end
>
> My test code:
> f = FOHoardHelper.new;
> hlist = f.createEmpty;
>
> I got this error message:
> F:/NetBeansProjects/TAVolTest/lib/CalendarUtils.rb:45:in `initialize':
> failed to create WIN32OLE object from `{0058FFFF-5B03-11D3-
> A520-00805F9BE596}' (WIN32OLERuntimeError)
>
> HRESULT error code:0x80040154
>
> Could you give me some help?


Please ignore my question
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Q] how can I create a VB Date object from ruby using win32ole? Chuck Remes Ruby 1 01-05-2010 04:35 PM
Errors: Failed to load viewstate. & Validation of viewstate MAC failed. sck10 ASP .Net 6 09-01-2006 05:59 PM
WIN32OLE#[] and WIN32OLE#[]= method in Ruby 1.9 (or later) Masaki Suketa Ruby 4 03-27-2006 11:17 AM
In need of help. Win32Ole objWMIService.Create? x1 Ruby 1 12-07-2005 03:13 PM
QueryInterface for interface Excel._Application failed / QueryInterface for interface Word._Application failed SOLUTION Wildepiet ASP .Net 0 06-14-2004 07:28 AM



Advertisments