<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 9pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>Hi,<BR>
I am writing a program&nbsp;by vtkSphereWidget ( using C++ ) ,and I want to connect my render window with the mouse event , so I use the AddObserver() function ,&nbsp;at&nbsp;the same time , I&nbsp;write a new function&nbsp;that could be invoked ,&nbsp;its name is MyFunction()&nbsp;.&nbsp;As the usage of AddObserver()&nbsp;, my code is : <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sphereWidget-&gt;AddObserver( InteractionEvent, MyFunction&nbsp;);<BR>
but there is a error :&nbsp;'unsigned long __thiscall vtkObject::AddObserver(unsigned long,class vtkCommand *,float)' : cannot convert parameter 2 from 'void' to 'class vtkCommand *' .<BR>
So why is&nbsp;it ? and&nbsp;how can&nbsp;I use the AddObserver() ? Could you give me an example ? thank you !<BR><br /><hr />中国十大热门旅游景点 <a href='http://search.msn.com/results.aspx?q=%E4%B8%AD%E5%9B%BD%E5%8D%81%E5%A4%A7%E9%A3%8E%E6%99%AF&mkt=zh-CN&form=QBRE' target='_new'>了解更多信息!</a></body>
</html>