[C++-sig] Re: Virtual member functions cause exception in get_derived_class_object

David Abrahams dave at boost-consulting.com
Thu Apr 1 22:45:55 CEST 2004

"David Rostowsky" <drostowsky at radioframenetworks.com> writes:

> Attached are the files in question. Thanks for the direction. Im a newbie to
> these lists. In my original post I was trying to post the minimal that
> failed, so hence I wanted to give everything in the follow-up. Ill try to
> find a happier middle ground for future posts.

Also, it'd be good to post instructions for running the test;
e.g. where is the test script placed?

Incidentally, the slightly modified program I enclosed produces:

  C++   : Initializing Python and loading script
  'import site' failed; use -v for traceback
  Python: Import SUCCEEDED!!!
  C++   : Ptr=0x00867958
  C++   : test1ptr->Get() in C++ before Python call: 0
  Python: msg =  Test String argument from c++
  Python: Identity of 'local' MyClass object: C++   : Ptr=0x00868B70
  Python: Current state: 0
  Python: New state    : 1234
  Python: Identity of exposed cppObj: C++   : Ptr=0x00867958
  Python: cppObj.Get() on entry: 0
  Python: cppObj.Get() on exit : 9
  C++   : callPython() returned: 999
  C++   : test1ptr->Get() after Python call:  9
  C++   : Press any key to quit

-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.cpp
Type: text/x-cplusplus
Size: 6628 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20040401/cea93be6/attachment.bin>
-------------- next part --------------

Dave Abrahams
Boost Consulting

More information about the Cplusplus-sig mailing list