[vtkusers] Problem in the inheritance of vtkCommand

Paul Tait - OPES Paul at opes.com.au
Mon Jun 5 20:09:45 EDT 2006


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








你 不 想 试 试 今 夏 最 “酷” 的 邮 箱 吗 ? 
HYPERLINK "http://www.126.com/" \n蕴 涵 中 华 传 统 文 化 于 世 界 一 流 科
技 之 中,创 新 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/2537646c/attachment.htm>


More information about the vtkusers mailing list