[vtkusers] Problem with vtkCommand and MFC.

pinoxioc vn pinoxio_kt at yahoo.com
Wed Sep 20 20:20:55 EDT 2006


Please help me!
  I'm using VisualC++ 6.0
I created a class which is inherited from vtkCommand
//--------------------------------------------------
class ExCallback : public vtkCommand
{
public:
  static ExCallback *New()
    { return ::new ExCallback; }
    virtual void Execute(vtkObject *caller, unsigned long, void*)
    {
   vtkRenderWindowInteractor  *interactor = reinterpret_cast<vtkRenderWindowInteractor *>(caller);
                int X = interactor->GetEventPosition()[0];
               int Y = interactor->GetEventPosition()[1];
                  interactor->GetPicker()->Pick(X,Y,0.0,aRenderer);
    }
private:
  ExCallback(): Renderer(0) {}
public:
  vtkRenderer *Renderer;
};
  //-----------------------------------
  Then compiled ===> No ERROR occurs
  But when it was used in a function :
  void myFunc()
{
     ....................................
    ExCallback *myCallback = ExCallback::New();
   //error occurs when compiling this sentence
     myCallback->Renderer = Renderer;
         
     ................................
}
2 errors occur :
error LNK2001: unresolved external symbol "public: virtual char const * __thiscall vtkObjectBase::GetClassNameW(void)const " (?GetClassNameW at vtkObjectBase@@UBEPBDXZ)
  fatal error LNK1120: 1 unresolved externals
   
  My email address : pinoxio_kt at yahoo.com
  Thank you !
  
 

 		
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls.  Great rates starting at 1¢/min.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060920/a691da4f/attachment.htm>


More information about the vtkusers mailing list