From cd3d7fe846d4671671612658c9f76ce1ec4c3d56 Mon Sep 17 00:00:00 2001 From: suke Date: Fri, 15 Aug 2014 11:36:12 +0000 Subject: * ext/win32ole/win32ole.c: seperate WIN32OLE_EVENT src from win32ole.c. * ext/win32ole/win32ole.h: ditto. * ext/win32ole/win32ole_event.c: ditto. * ext/win32ole/win32ole_event.h: ditto. * ext/win32ole/depend: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/win32ole/win32ole.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'ext/win32ole/win32ole.h') diff --git a/ext/win32ole/win32ole.h b/ext/win32ole/win32ole.h index 672e3472f3..880fe86466 100644 --- a/ext/win32ole/win32ole.h +++ b/ext/win32ole/win32ole.h @@ -108,6 +108,17 @@ #define OLE_GET_TYPEATTR(X, Y) ((X)->lpVtbl->GetTypeAttr((X), (Y))) #define OLE_RELEASE_TYPEATTR(X, Y) ((X)->lpVtbl->ReleaseTypeAttr((X), (Y))) +struct oledata { + IDispatch *pDispatch; +}; + +#define OLEData_Get_Struct(obj, pole) {\ + Data_Get_Struct(obj, struct oledata, pole);\ + if(!pole->pDispatch) {\ + rb_raise(rb_eRuntimeError, "failed to get Dispatch Interface");\ + }\ +} + VALUE cWIN32OLE; LCID cWIN32OLE_lcid; @@ -119,6 +130,7 @@ VALUE reg_get_val(HKEY hkey, const char *subkey); VALUE reg_get_val2(HKEY hkey, const char *subkey); void ole_initialize(void); VALUE default_inspect(VALUE self, const char *class_name); +char *ole_wc2mb(LPWSTR pw); VALUE ole_wc2vstr(LPWSTR pw, BOOL isfree); #define WC2VSTR(x) ole_wc2vstr((x), TRUE) @@ -141,6 +153,7 @@ HRESULT typelib_from_val(VALUE obj, ITypeLib **pTypeLib); #include "win32ole_variable.h" #include "win32ole_method.h" #include "win32ole_param.h" +#include "win32ole_event.h" #include "win32ole_variant.h" #include "win32ole_record.h" #include "win32ole_error.h" -- cgit v1.2.3