WIN332Ole , pass by reference

G

George Thomas

Hi,

I am trying to call a method in an ATL (C++ based) dll created by myself
through WIN32OLE of Ruby

The signature of the method in the idl file is something as follows

[id(37), helpstring("method GetCustomArea")] HRESULT GetCustomArea([out]
LONG* UpperLeft_XCord, [out] LONG* UpperLeft_YCord, [out] LONG* Width,
[out] LONG* Height, [out,retval] VARIANT_BOOL* ReturnVal);


In Ruby I have tried something as follows..

require 'win32ole'
a = WIN32OLE.new("IDof the component")
c = a.GetCustomArea(nil,nil,nil,nil)

Further querying the value as(for the first out paramter)
WIN32OLE::ARGV[0] does not give me a valid result.

I have also tried something as follows..

require 'win32ole'
a = WIN32OLE.new("IDof the component")
include WIN32OLE::VARIANT
dispid = a.ole_method('GetCustomArea').dispid
a._invoke(dispid, [nil,nil,nil,nil,nil], [VT_I4|VT_BYREF,
VT_I4|VT_BYREF,VT_I4|VT_BYREF,VT_I4|VT_BYREF,VT_BOOL|VT_BYREF])
The error in this case is

WIN32OLERuntimeError: (in OLE method '<dispatch id:37: )
OLE error code:0 in <Unknown>
<No Description>
Invalid number of parameters.
from (irb): 5: in '_invoke'
from C:/................../bin/irb:12:in '<main>'

Can some one point me in the right direction? I have several other
methods in my component. All others are working fine. However , they do
not have an [out] parameter.

Regards,
George
 

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

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top