[C++-sig] Passing a reference to my object to python

Lawrence Spector Lawrence.Spector at CanfieldSci.com
Tue Jul 3 15:30:41 CEST 2007


So far, what I've done is build a Boost.Python extension for my python
script to use.  It exposes one class for the script to use, let's say
called CppClass.  This seems to work okay.  I'm using Boost.Python and
the Python API to interpret the script from C++ code.  During this
process, I want to pass a reference to an instance of the object that
already exists in my C++ code.  I tried the following:

 

boost::python::object myObject(CppClass);


When I run, I get a first chance exception:
boost::python::error_already_set.



I'm sure I'm missing something important.  Any idea what's going wrong?

 

Thanks in advance,

 

Lawrence

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20070703/2bdd4545/attachment.htm>


More information about the Cplusplus-sig mailing list