]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/contrib/activex/activex_wrap.cpp
changed to behave in same way as native win32 control and generic wxListCtrl when...
[wxWidgets.git] / wxPython / contrib / activex / activex_wrap.cpp
index 7076c339a1253c49b094fa3280adba4cc62609c4..fe5b690d884e9e174364e24a3d92cf2b59f35615 100644 (file)
@@ -398,7 +398,15 @@ SWIG_CheckLongInRange(long value, const char* type,
 SWIGSTATICINLINE(long)
 SWIG_AsLong(PyObject * obj)
 {
-  return PyInt_Check(obj) ? PyInt_AsLong(obj) : PyLong_AsLong(obj);
+    if (PyNumber_Check(obj))
+        return PyInt_AsLong(obj);
+    else {
+        PyObject* errmsg = PyString_FromFormat("Expected number, got %s",
+                                               obj->ob_type->tp_name);
+        PyErr_SetObject(PyExc_TypeError, errmsg);
+        Py_DECREF(errmsg);
+        return 0;
+    }
 }
 
 
@@ -2188,6 +2196,7 @@ static PyObject *_wrap_new_ActiveXWindow(PyObject *self, PyObject *args, PyObjec
         }
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxActiveXWindow *)new wxActiveXWindow(arg1,(CLSID const &)*arg2,arg3,(wxPoint const &)*arg4,(wxSize const &)*arg5,arg6,(wxString const &)*arg7);
         
@@ -3019,6 +3028,7 @@ static PyObject *_wrap_new_IEHtmlWindowBase(PyObject *self, PyObject *args, PyOb
         }
     }
     {
+        if (!wxPyCheckForApp()) SWIG_fail;
         PyThreadState* __tstate = wxPyBeginAllowThreads();
         result = (wxIEHtmlWindowBase *)new wxIEHtmlWindowBase(arg1,(CLSID const &)*arg2,arg3,(wxPoint const &)*arg4,(wxSize const &)*arg5,arg6,(wxString const &)*arg7);