summaryrefslogtreecommitdiff
path: root/ext/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-25 12:13:57 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-25 12:13:57 +0000
commit148d57526496579d6711bbec0d7d76c3ea59466b (patch)
tree24bd1a18f79184b7b56b081a91ba409a18301ec8 /ext/win32ole
parent87f80a7dd7ab801e6645a22a33d3a818daa861e4 (diff)
* ext/win32ole/win32ole.c (ole_invoke, add_event_callback,
rescue_callback): refactoring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole')
-rw-r--r--ext/win32ole/win32ole.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index 5443c15..6ea4662 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -118,7 +118,7 @@
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-#define WIN32OLE_VERSION "1.2.8"
+#define WIN32OLE_VERSION "1.2.9"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -3229,7 +3229,7 @@ ole_invoke(int argc, VALUE *argv, VALUE self, USHORT wFlags, BOOL is_bracket)
if (is_bracket) {
DispID = DISPID_VALUE;
argc += 1;
- rb_funcall(paramS, rb_intern("unshift"), 1, cmd);
+ rb_ary_unshift(paramS, cmd);
} else {
wcmdname = ole_vstr2wc(cmd);
hr = pole->pDispatch->lpVtbl->GetIDsOfNames( pole->pDispatch, &IID_NULL,
@@ -7511,12 +7511,10 @@ rescue_callback(VALUE arg)
{
VALUE e = rb_errinfo();
- VALUE c = rb_funcall(e, rb_intern("class"), 0);
VALUE bt = rb_funcall(e, rb_intern("backtrace"), 0);
VALUE msg = rb_funcall(e, rb_intern("message"), 0);
- c = rb_funcall(c, rb_intern("to_s"), 0);
bt = rb_ary_entry(bt, 0);
- fprintf(stdout, "%s: %s (%s)\n", StringValuePtr(bt), StringValuePtr(msg), StringValuePtr(c));
+ fprintf(stdout, "%s: %s (%s)\n", StringValuePtr(bt), StringValuePtr(msg), rb_obj_classname(e));
rb_backtrace();
ruby_finalize();
exit(-1);
@@ -8097,10 +8095,7 @@ add_event_call_back(VALUE obj, VALUE event, VALUE data)
events = rb_ary_new();
rb_ivar_set(obj, id_events, events);
}
- at = ole_search_event_at(events, event);
- if (at >= 0) {
- rb_ary_delete_at(events, at);
- }
+ ole_delete_event(events, event);
rb_ary_push(events, data);
}