WIN32OLE - failed to create WIN32OLE

Z

zxem

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 :progid

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?
 
Z

zxem

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 :progid

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top