event_interface()
public
Show source
/*
* 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(self)
VALUE self;
{
BSTR name;
struct olemethoddata *pmethod;
HRESULT hr;
Data_Get_Struct(self, struct olemethoddata, 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;
}