> You can start with the python object and then get the C++ object that implements it:

> ExtensionObject<MyClass> obj( args[0] ); // exception thrown
> if wrong type
> MyClass *p = obj.extensionObject(); // get C++ pointer

Ok, so basicly I just pass the ExtensionObject<T> around, and can use th extensionObject() method to get a pointer to the c++ object.

One thing I cant work out though, what do I construct the ExtensionObject class with if I have not yet created an object to store in it?
I need to have the Py::ExtensionObject<Input> input in the D3D classes deffinition, but I cant actauly create an Input instance untill later in the constructor

class D3d : public Py::PythonExtension<D3d>
    Py::ExtensionObject<Input> input;

{//error C2512: 'Py::ExtensionObject<T>' : no appropriate default constructor available
...create window and dx stuff
    input = new Input(this, hwnd);//cant create the Input instance untill after some other stuff is created

Great search results, great prizes. BigSnapSearch.com Search now