1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

convert dispid in Ruby and C by INT2NUM and NUM2INT.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
suke 2005-07-09 13:03:10 +00:00
parent 682d1bb068
commit a2ae6182ae
4 changed files with 24 additions and 3 deletions

View file

@ -1,3 +1,14 @@
Sat Jul 9 22:02:37 2005 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* ext/win32ole/win32ole.c (ole_method_dispid): convert dispid
in Ruby and C by INT2NUM and NUM2INT.
* ext/win32ole/win32ole.c (ole_invoke2): ditto.
* ext/win32ole/test/testWIN32OLE.rb: ditto.
* ext/win32ole/test/testOLEMETHOD.rb: ditto.
Fri Jul 8 15:45:04 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/rss.rb (RSS::VERSION): 0.1.4 -> 0.1.5.

View file

@ -84,4 +84,9 @@ class TestOLEMETHOD < RUNIT::TestCase
m = WIN32OLE_METHOD.new(@excel_app, 'QueryInterface')
assert_equal(0, m.offset_vtbl)
end
def test_dispid
tobj = WIN32OLE_TYPE.new('Microsoft Shell Controls And Automation', 'FolderItem2')
method = WIN32OLE_METHOD.new(tobj, 'InvokeVerb')
assert_equal(1610743824, method.dispid)
end
end

View file

@ -319,6 +319,11 @@ class TestWin32OLE_WITH_MSI < Test::Unit::TestCase
@record[ "StringData", 1 ] = 'ffff'
assert_equal('ffff', @record.StringData(1))
end
def test__invoke
shell=WIN32OLE.new('Shell.Application')
assert_equal(shell.NameSpace(0).title, shell._invoke(0x60020002, [0], [WIN32OLE::VARIANT::VT_VARIANT]).title)
end
end
# ---------------------

View file

@ -79,7 +79,7 @@
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
#define WIN32OLE_VERSION "0.6.4"
#define WIN32OLE_VERSION "0.6.5"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@ -2368,7 +2368,7 @@ ole_invoke2(self, dispid, args, types, dispkind)
dispParams.rgdispidNamedArgs[0] = DISPID_PROPERTYPUT;
}
hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, FIX2INT(dispid),
hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, NUM2INT(dispid),
&IID_NULL, LOCALE_SYSTEM_DEFAULT,
dispkind,
&dispParams, &result,
@ -5411,7 +5411,7 @@ ole_method_dispid(pTypeInfo, method_index)
hr = pTypeInfo->lpVtbl->GetFuncDesc(pTypeInfo, method_index, &pFuncDesc);
if (FAILED(hr))
return dispid;
dispid = INT2FIX(pFuncDesc->memid);
dispid = INT2NUM(pFuncDesc->memid);
pTypeInfo->lpVtbl->ReleaseFuncDesc(pTypeInfo, pFuncDesc);
return dispid;
}