summaryrefslogtreecommitdiff
path: root/ext/win32ole/win32ole_typelib.c
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-12 14:00:45 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-08-12 14:00:45 +0000
commit7bf7bb84d3f9390f787d3ba594893f904dc47dc1 (patch)
treeedee61a3323fa82e4cfc01581273f947df8d019d /ext/win32ole/win32ole_typelib.c
parenteac5e58bb444523cfed7c9e6fdf671a3769ff6f1 (diff)
* ext/win32ole/win32ole.c: refactoring. move
ole_typelib_from_itypeinfo into win32ole_typelib.c. * ext/win32ole/win32ole.h: ditto. * ext/win32ole/win32ole_typelib.h: ditto. * ext/win32ole/win32ole_typelib.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole/win32ole_typelib.c')
-rw-r--r--ext/win32ole/win32ole_typelib.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/win32ole/win32ole_typelib.c b/ext/win32ole/win32ole_typelib.c
index fc164f2..f5ecd4c 100644
--- a/ext/win32ole/win32ole_typelib.c
+++ b/ext/win32ole/win32ole_typelib.c
@@ -103,6 +103,22 @@ itypelib(VALUE self)
return ptlib->pTypeLib;
}
+VALUE
+ole_typelib_from_itypeinfo(ITypeInfo *pTypeInfo)
+{
+ HRESULT hr;
+ ITypeLib *pTypeLib;
+ unsigned int index;
+ VALUE retval = Qnil;
+
+ hr = pTypeInfo->lpVtbl->GetContainingTypeLib(pTypeInfo, &pTypeLib, &index);
+ if(FAILED(hr)) {
+ return Qnil;
+ }
+ retval = create_win32ole_typelib(pTypeLib);
+ return retval;
+}
+
/*
* Document-class: WIN32OLE_TYPELIB
*