From: William N. <fir...@ho...> - 2008-12-30 16:28:04
|
> 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; ... } D3d::D3d(...) {//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 } _________________________________________________________________ Get a bird’s eye view of the world with Multimap http://clk.atdmt.com/GBL/go/115454059/direct/01/ |