[vtkusers] Problem in the inherit ance of vtkCommand

Alexander.Wang zjjywmy at 163.com
Mon Jun 5 22:05:35 EDT 2006


 
Hi Paul Tait and Drew,
 
Thank BOTH of you! And What you said does work.
I greatly appreciate your timely help.
 
Alex
 



-----原始邮件-----
发件人:"Paul Tait - OPES" 
发送时间:2006-06-06 08:09:45
收件人:"'Alexander.Wang'" ,"'vtkusers '" 
抄送:(无)
主题:RE: [vtkusers] Problem in the inheritance of vtkCommand




MFC is using DEBUG_NEW which has 3 arguments. Just use ::new (globla scope) and it will do what YOU want
 
Paul Tait


-----Original Message-----
From: vtkusers-bounces+paul=opes.com.au at vtk.org [mailto:vtkusers-bounces+paul=opes.com.au at vtk.org] On Behalf Of Alexander.Wang
Sent: Monday, 5 June 2006 10:29 AM
To: vtkusers 
Subject: [vtkusers] Problem in the inheritance of vtkCommand


 
Hi all,
 
I want to have some callback for the interaction. I defined a class vtkDicomObserver inherited from vtkCommand, but there is a problem in the method NEW. When compiling the code of this method, the compiler tell me: error C2660: 'new' : function does not take 3 parameters. The program is running under Windows XP and MSVC 6.0, as a SDI project. Can anyone give me some advice? Here is the reference code.
 
//Code Begin
class vtkDicomObserver : public vtkCommand
{
public:
 virtual char const * GetClassName() const
 {
  return "vtkDicomObserver";
 }
 static vtkDicomObserver * New()
 {
  return new vtkDicomObserver;
//error occurs when compiling this sentence
 }
 vtkDicomObserver()
 {
  this->ImageViewer=NULL;
  this->ImgRenderWindowInteractor=NULL;
 }
 virtual void Execute(vtkObject *, unsigned long event, void* )
 {
  if(this->ImageViewer)
  {
   ...
  }
 }
 vtkImageViewer * ImageViewer;
 vtkRenderWindowInteractor * ImgRenderWindowInteractor;
 CPoint Point;
};

//Code End
 
Thanks in advance!
 
Yours sincerely,
Alexander







你 不 想 试 试 今 夏 最 “酷” 的 邮 箱 吗 ? 
蕴 涵 中 华 传 统 文 化 于 世 界 一 流 科 技 之 中,创 新 Ajax 技 术,126 “D 计 划”火 热 体 验 中 ! 

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.1/355 - Release Date: 2/06/2006



--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.1/355 - Release Date: 2/06/2006
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060606/6b654316/attachment.htm>


More information about the vtkusers mailing list