static VALUE ole_type_helpcontext(ITypeInfo *pTypeInfo) { HRESULT hr; DWORD helpcontext; hr = ole_docinfo_from_type(pTypeInfo, NULL, NULL, &helpcontext, NULL); if(FAILED(hr)) return Qnil; return INT2FIX(helpcontext); }
static VALUE ole_type_helpfile(ITypeInfo *pTypeInfo) { HRESULT hr; BSTR bhelpfile; hr = ole_docinfo_from_type(pTypeInfo, NULL, NULL, NULL, &bhelpfile); if(FAILED(hr)) { return Qnil; } return WC2VSTR(bhelpfile); }
/* * call-seq: * WIN32OLE_METHOD#event_interface * * Returns event interface name if the method is event. * tobj = WIN32OLE_TYPE.new('Microsoft Excel 9.0 Object Library', 'Workbook') * method = WIN32OLE_METHOD.new(tobj, 'SheetActivate') * puts method.event_interface # => WorkbookEvents */ static VALUE folemethod_event_interface(VALUE self) { BSTR name; struct olemethoddata *pmethod; HRESULT hr; TypedData_Get_Struct(self, struct olemethoddata, &olemethod_datatype, pmethod); if(folemethod_event(self) == Qtrue) { hr = ole_docinfo_from_type(pmethod->pTypeInfo, &name, NULL, NULL, NULL); if(SUCCEEDED(hr)) return WC2VSTR(name); } return Qnil; }