summaryrefslogtreecommitdiff
path: root/ext/win32ole/win32ole.c
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-19 13:15:59 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-06-19 13:15:59 +0000
commit0976e9e32f2b92038da4c7b11bb94bbae6284362 (patch)
tree9ed5b7366120bdd27570cdc1ef41ccc7f850bc67 /ext/win32ole/win32ole.c
parent2513839a86deaa420e6a22e45399a18bd01b0afe (diff)
support some kind of method of word. [ruby-Bugs#3237]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole/win32ole.c')
-rw-r--r--ext/win32ole/win32ole.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 96a2c096ed..6b7d2569d3 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -78,7 +78,7 @@
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-#define WIN32OLE_VERSION "0.6.8"
+#define WIN32OLE_VERSION "0.6.9"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -2101,6 +2101,18 @@ ole_invoke(argc, argv, self, wFlags)
&IID_NULL, lcid, wFlags,
&op.dp, &result,
&excepinfo, &argErr);
+
+ /* mega kludge. if a method in WORD is called and we ask
+ * for a result when one is not returned then
+ * hResult == DISP_E_EXCEPTION. this only happens on
+ * functions whose DISPID > 0x8000 */
+ if ((hr == DISP_E_EXCEPTION || hr == DISP_E_MEMBERNOTFOUND) && DispID > 0x8000) {
+ memset(&excepinfo, 0, sizeof(EXCEPINFO));
+ hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DispID,
+ &IID_NULL, lcid, wFlags,
+ &op.dp, NULL,
+ &excepinfo, &argErr);
+ }
for(i = cNamedArgs; i < op.dp.cArgs; i++) {
n = op.dp.cArgs - i + cNamedArgs - 1;
VariantClear(&op.dp.rgvarg[n]);
@@ -2127,19 +2139,6 @@ ole_invoke(argc, argv, self, wFlags)
}
}
- /* mega kludge. if a method in WORD is called and we ask
- * for a result when one is not returned then
- * hResult == DISP_E_EXCEPTION. this only happens on
- * functions whose DISPID > 0x8000 */
- if (hr == DISP_E_EXCEPTION && DispID > 0x8000) {
- memset(&excepinfo, 0, sizeof(EXCEPINFO));
- VariantInit(&result);
- hr = pole->pDispatch->lpVtbl->Invoke(pole->pDispatch, DispID,
- &IID_NULL, lcid, wFlags,
- &op.dp, &result,
- &excepinfo, &argErr);
-
- }
}
/* clear dispatch parameter */
if(op.dp.cArgs > cNamedArgs) {