diff options
author | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-09 13:03:10 +0000 |
---|---|---|
committer | suke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-07-09 13:03:10 +0000 |
commit | a2ae6182ae3757b98c2902c8ee3bfea50e4ec12b (patch) | |
tree | 420af79c011c3eded51ab0f2026cdd69a260d227 | |
parent | 682d1bb06848766847e505ce7e529f065ba6431b (diff) | |
download | ruby-a2ae6182ae3757b98c2902c8ee3bfea50e4ec12b.tar.gz |
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
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | ext/win32ole/tests/testOLEMETHOD.rb | 5 | ||||
-rw-r--r-- | ext/win32ole/tests/testWIN32OLE.rb | 5 | ||||
-rw-r--r-- | ext/win32ole/win32ole.c | 6 |
4 files changed, 24 insertions, 3 deletions
@@ -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. diff --git a/ext/win32ole/tests/testOLEMETHOD.rb b/ext/win32ole/tests/testOLEMETHOD.rb index b52052e669..390c9999f8 100644 --- a/ext/win32ole/tests/testOLEMETHOD.rb +++ b/ext/win32ole/tests/testOLEMETHOD.rb @@ -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 diff --git a/ext/win32ole/tests/testWIN32OLE.rb b/ext/win32ole/tests/testWIN32OLE.rb index ca966f0cce..185670c9fc 100644 --- a/ext/win32ole/tests/testWIN32OLE.rb +++ b/ext/win32ole/tests/testWIN32OLE.rb @@ -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 # --------------------- diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c index 8202d92e6e..61bc4d3e04 100644 --- a/ext/win32ole/win32ole.c +++ b/ext/win32ole/win32ole.c @@ -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; } |