<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hello,<br><br>I have created a Python wrapper using a custom smart pointer that 
is defined <br>in the following manner:<br><br>class_&lt;EventWrapper, 
noncopyable, Ptr&lt;EventWrapper&gt;&gt;("Event", init&lt;&gt;())<br>&nbsp;&nbsp;&nbsp; 
.def("f", &amp;Event::f, &amp;EventWrapper::default_f).<br>&nbsp; 
implicitely_convertible&lt;Ptr&lt;EventWrapper&gt;, Ptr&lt;Event&gt;&gt;();<br>&nbsp; 
register_ptr_to_python&lt;Ptr&lt;Event&gt;&gt;();<br><br>Now... when I subclass 
this in Python like so:<br><br>class MyEvent(Event):<br>&nbsp; def f(self):<br>&nbsp;&nbsp;&nbsp; 
return 42<br><br>I can use MyEvent as expected only within Python code... when I 
pass an <br>instance of MyEvent to C++, and then C++ passes MyEvent back 
to<br>Python, I no longer am able to call the overridden method f in 
Python.<br>Calling f in Python invokes Event::f, as opposed to 
MyEvent.f<br><br>This only happens when I construct MyEvent in Python code, pass 
the instance <br>to some C++ code, and have the C++ code pass back the 
MyEvent instance<br>back to Python.<br><br>Any ideas why this may 
be?<br><br>Thanks. <br><br /><hr />Tell the whole story with photos, right from your Messenger window.  <a href='http://go.microsoft.com/?linkid=9650732' target='_new'>Learn how!</a></body>
</html>