[id(3), helpstring("メソッド MsgOkCancel")] HRESULT MsgOkCancel( [in] BSTR Value, [out,retval] BOOL *pVal );
STDMETHOD(MsgOkCancel)( BSTR Value, BOOL *pVal );
STDMETHODIMP CMyAPI::MsgOkCancel( BSTR Value, BOOL *pVal ) { _bstr_t bstrValue; LboxWintool Wintool; bstrValue.operator = (Value); *pVal = LboxBool( Wintool.MsgOkCancel((LPTSTR)bstrValue) ); return S_OK; }
Set obj = CreateObject("MyCom.MyAPI") if obj.MsgOkCancel("OK または キャンセル を選択" ) then obj.MsgBox( "OK" ) else obj.MsgBox( "キャンセル" ) end if