]> git.sesse.net Git - vlc/blobdiff - projects/activex/vlccontrol.h
Replace libvlc_exception_get_message with libvlc_errmsg
[vlc] / projects / activex / vlccontrol.h
index fa19b31fac53c8fffaa162fec1231de5fc39e906..31b6919fad3273483f865875b2efee03e119cac8 100644 (file)
@@ -15,9 +15,9 @@
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #ifndef _VLCCONTROL_H_
@@ -29,7 +29,8 @@ class VLCControl : public IVLCControl
 {
 public:
 
-    VLCControl(VLCPlugin *p_instance) :  _p_instance(p_instance), _p_typeinfo(NULL) {};
+    VLCControl(VLCPlugin *p_instance):
+        _p_instance(p_instance), _p_typeinfo(NULL) { }
     virtual ~VLCControl();
 
     // IUnknown methods
@@ -46,10 +47,12 @@ public:
             return NOERROR;
         }
         return _p_instance->pUnkOuter->QueryInterface(riid, ppv);
-    };
+    }
 
-    STDMETHODIMP_(ULONG) AddRef(void) { return _p_instance->pUnkOuter->AddRef(); };
-    STDMETHODIMP_(ULONG) Release(void) { return _p_instance->pUnkOuter->Release(); };
+    STDMETHODIMP_(ULONG) AddRef(void)
+        { return _p_instance->pUnkOuter->AddRef(); }
+    STDMETHODIMP_(ULONG) Release(void)
+        { return _p_instance->pUnkOuter->Release(); }
 
     // IDispatch methods
     STDMETHODIMP GetTypeInfoCount(UINT*);
@@ -98,6 +101,14 @@ public:
 private:
 
     HRESULT      getTypeInfo();
+    HRESULT      exception_bridge(libvlc_exception_t *ex)
+    {
+        if( ! libvlc_exception_raised(ex) )
+            return NOERROR;
+        _p_instance->setErrorInfo(IID_IVLCControl, libvlc_errmsg());
+        libvlc_exception_clear(ex);
+        return E_FAIL;
+    }
 
     VLCPlugin *_p_instance;
     ITypeInfo *_p_typeinfo;