Antwort: VC++ pblm!

Patric.Weis at mycrona.de Patric.Weis at mycrona.de
Mon Mar 13 04:53:15 EST 2000


Hi Arvid,

The problem is that SetEndPickMethod() needs a static callback function,
and the pointer to your member function CSoccermonitorDoc::AnnotatePick()
isn't one, because it depends on the object instantiated at runtime.
One thing you can do is to use a global wrapper function, which then calls
the member function of your CSoccermonitorDoc object (you have to keep
track of this object).

e.g.:

void AnnotatePick(void *arg)
{
     theCSoccermonitorDocObject->AnnotatePick(arg);
}


and then:

iren->SetEndPickMethod(::AnnotatePick,(void *)iren);



Patric Weis
MYCRONA GmbH

- - - Original Message - - -



                                                                                                                                           
                    Arvind Lakshmikumar                                                                                                    
                    <kla at bobcat.ent.ohiou.ed        An:     vtkusers at gsao.med.ge.com                                                       
                    u>                              Kopie:                                                                                 
                    Gesendet von:                   Thema:  VC++ pblm!                                                                     
                    owner-vtkusers at gsao.gso.                                                                                               
                    med.ge.com                                                                                                             
                                                                                                                                           
                                                                                                                                           
                    12.03.00 02:54                                                                                                         
                                                                                                                                           
                                                                                                                                           



Hi,
  I am using Vtk3.1 on VisualC++(6.0). Seem to have some pblm with the
SetEndPickMethod. Here is a fragment of the code
-----------------------------------------------------------------------
iren->SetPicker(picker);
  iren->SetEndPickMethod(AnnotatePick,(void *)iren);

and AnnotatePick
 void CSoccermonitorDoc::AnnotatePick(void *arg)
{
           float *selPt;
           float *pickPos;
    char input[30];
           char buffer0[10];
           char buffer1[10];
           char buffer2[10];

           if(picker->GetCellId()<0)
                     textActor->VisibilityOff();
            else
            {
                     selPt = picker->GetSelectionPoint();
                     pickPos = picker->GetPickPosition();
                     itoa((int(pickPos[0])),buffer0,10);
        itoa((int(pickPos[1])),buffer1,10);
                     itoa((int(pickPos[2])),buffer2,10);
                     strcat(input,buffer0);
                     strcat(input,buffer1);
                     strcat(input,buffer2);
                     textMapper->SetInput(input);
                     textActor->SetPosition(selPt[0],selPt[1]);
                     textActor->VisibilityOn();
            }
     renWin->Render();
}

Now the error given is:
SetEndPickMethod' : cannot convert parameter 1 from 'void (void *)' to
'void (__cdecl *)(void *)'
        None of the functions with this name in scope match the target
type


Can't seem to figure out whats going wrong. Could someone please help me
out..

Thanks,
Arvind



*********************************************************************


                             To iterate is human...To recurse divine

Arvind Lakshmikumar
Research Assistant
Dept. of Electrical Engineering and Computer Science
Ohio University
Athens, OH 45701
Tel. No :740-593-0453(Office)
         740-592-5940(Home)

*********************************************************************





-----------------------------------------------------------------------------

This is the private VTK discussion list.  Please keep messages on-topic.
Check the FAQ at: <http://www.automatrix.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at gsao.med.ge.com>.  For help, send message body containing
"info vtkusers" to the same address.     Live long and prosper.
-----------------------------------------------------------------------------






--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------



More information about the vtkusers mailing list