Re: [C++-sig] Injecting void* and HWND handling code from Py++

2012-05-29 Thread Roman Yakovenko
On Mon, May 28, 2012 at 6:37 AM, Suresh Joshi wrote: > Hello all! > > I had a question about how to handle void* and HWNDs from within Python > using Boost::Python and Py++. Reading through the Py++ documentation, I'm > loving how I can slice and dice my classes/wrappers and seemingly do > whateve

Re: [C++-sig] Mysterious triggerings of "UNREF invalid object" in _Py_ForgetReference

2012-05-29 Thread Niall Douglas
On 27 May 2012 at 10:26, Adam Preble wrote: > I don't know if I can build on Linux but I have see ways to play with the > clock and setting affinity. However, I don't know how to take the GIL > properly during destruction. What we're talking about is a shared_ptr to > an interface that was creat

Re: [C++-sig] Injecting instance of object into main module

2012-05-29 Thread Niall Douglas
You're passing a null object pointer, so BPL correctly fails an assertion check? Niall On 28 May 2012 at 21:39, Adam Preble wrote: > I wanted to provide an instance of a particular object I'm using for > Stackless Python state management. I'm trying to take over the green > thread management s

Re: [C++-sig] Injecting void* and HWND handling code from Py++

2012-05-29 Thread Niall Douglas
On 27 May 2012 at 20:37, Suresh Joshi wrote: > (2) From Python, I would like to manipulate the memory of a buffer stored > within Foo. In my REAL code, the only accessor I can use is Address() which > returns a void pointer, which Py++/BP flips into an opaque pointer (which I > don't think I can u

Re: [C++-sig] Injecting instance of object into main module

2012-05-29 Thread Adam Preble
The object was declared in the class and instantiated when an instance of that object is created. It wasn't a pointer I failed to construct. I managed to screw around with the Python documentation awhile and get something like this working: boost::python::handle<> mainHandle(boost::python::b