Original Post
Another basic question to help my understanding of Boost::Python. Say I have a class in C++ CEntity that is exported to Python using: If I derive from CEntity in Python: I get a traceback when calling the super class' __init__ function. Do I need to wrap (wrapper.h?) the constructor in Boost? I presumed this would "just work" as it's fairly standard/basic OO/Python stuff. Unfortunately I'm trying to add scripting to an MFC app of mine, so joyous days are ahead! Thanks
void export_entity()
{
class_ <CObject,boost::noncopyable>("Object",no_init)
;
class_<CEntity,boost::noncopyable,bases<CObject>>("Entity", init<const CString&>())
;
}
class MyEntity(Entity):
def __init__(self, name):
Entity.__init__(self, name)
print "MyEntity - " + name
Boost.Python.ArgumentError: Python argument types in
Entity.__init__(MyEntity, str)
did not match C++ signature:
__init__(struct _object *, class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > >)