En Fri, 27 Jul 2007 16:06:32 -0300, Brad Johnson <[EMAIL PROTECTED]> escribió:
> PyObject* o = PyDict_GetItemString(_d, "_outcatcher"); > PyObject* a = PyObject_GetAttrString(o, "data"); > ::MessageBox(NULL, PyString_AsString(a), _T(""), NULL); > > However, it only works twice. On the third try, I get an access > violation trying to access the stdout object (for a print statement). > The pointer appears to be valid, but all of the data has overwritten > with 0xDBDBDBDB, with obvious consequences. By far, the most common problem extending/embedding Python is to do wrong reference counts. Read http://docs.python.org/ext/refcounts.html again (I hope you already did!) and make sure you don't hold a pointer to an object without incrementing its reference count, by example. If you can shrink your application to the minimum code that shows the problem, try posting it here. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list