<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_<EventWrapper,
noncopyable, Ptr<EventWrapper>>("Event", init<>())<br>
.def("f", &Event::f, &EventWrapper::default_f).<br>
implicitely_convertible<Ptr<EventWrapper>, Ptr<Event>>();<br>
register_ptr_to_python<Ptr<Event>>();<br><br>Now... when I subclass
this in Python like so:<br><br>class MyEvent(Event):<br> def f(self):<br>
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>