[vtkusers] VC++ 7 Doc/View Architeture & vtkCommand

Luis Alberto Pereira l.a.pereira at uol.com.br
Wed Jun 2 12:00:04 EDT 2004


Dears,

 

I'm a novice user of vtk library.

Can anyone help me about the vtkcommand use in a vc++ 7 Doc/View
Architeture ?

My problem is:

 

1) I created a class in CView.h (CView class):

 

#include "vtkCommand.h"

 

class vtkMyCallback : public vtkCommand

{

public:

  static vtkMyCallback *New() 

    { return new vtkMyCallback; }

  virtual void Execute(vtkObject *caller, unsigned long, void*)

    {

      vtkRenderer *renderer = reinterpret_cast<vtkRenderer*>(caller);

      cout << renderer->GetActiveCamera()->GetPosition()[0] << " "

           << renderer->GetActiveCamera()->GetPosition()[1] << " "

           << renderer->GetActiveCamera()->GetPosition()[2] << "\n";

    }

};

 

2) Following, I inserted in constructor of  CView.cpp (CView Class) the
code:

 

  vtkMyCallback *mo1 = vtkMyCallback::New();

  this->ren->AddObserver(vtkCommand::StartEvent,mo1);

  mo1->Delete();

 

The compilation finish ok, but in link fase, I'm getting follow message:

 

libcimtd.lib(iostrini.obj) : error LNK2005: "void __cdecl operator
delete(void *,int,char const *,int)" (??3 at YAXPAXHPBDH@Z) already defined
in nafxcwd.lib(afxmem.obj)

Debug/DgDecor.exe : fatal error LNK1169: one or more multiply defined
symbols found

 

Can anyone help me solve this problem ?

 

Thanks,

 

Luis Alberto

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040602/14a6635d/attachment.htm>


More information about the vtkusers mailing list