<br><div class="gmail_quote">On Sat, Feb 4, 2012 at 8:48 PM, Jim Bosch <span dir="ltr">&lt;<a href="mailto:talljimbo@gmail.com">talljimbo@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Oh, you&#39;re right.  I was confusing the manual way of doing Python-side polymorphism (derived-class holders) with the more automatic (and better) way you&#39;re doing it (with wrapper).  Your original code was fine in that regard.</div>

<br>
Anyhow, looking closer, here&#39;s what you need to do:<br>
<br>
 - Put your code back to what it was before I told you to change it.<br>
<br>
 - Add another line, after the class wrappers:<br>
<br>
register_ptr_to_python&lt; boost::shared_ptr&lt;<u></u>Communicatable&gt; &gt;();<br>
<br>
That explicitly registers a shared_ptr converter for Communicatable. I&#39;m not sure why Boost.Python doesn&#39;t automatically do that when you register converters for its derived classes (those are registered by putting the shared_pr types in the template parameters to class_).  It might just be an oversight, or it might be that doing the base class registration automatically would cause problems in some contexts.<div class="HOEnZb">
<div class="h5"><br><br></div></div></blockquote><div>The appears to do the trick.  I&#39;m wondering--how do you figure out stuff like that?  That isn&#39;t the kind of thing that could have just occurred to me.  </div><div>
<br></div><div>This little test program works, but so far I haven&#39;t resolved the crash in my more complicated code that&#39;s coming a Python subclass of a C class trying to get a callback from Python instance of a C class . . . it&#39;s rough even explaining it.  I&#39;ll have to review my code and make sure I&#39;m doing that in all the right places.  Either I get it working because of these little things here, or I&#39;ll be back with a modification of this source to show the problem with shared_ptr conversion that I was seeing.</div>
</div>