[vtkusers] SetProgressMethod

Jorrit Schaap jorrit at lkeb.azl.nl
Mon Oct 30 12:27:10 EST 2000


this error means that can can't set a funtion that is a memebr of a class as an argument for
another function, using void pointers.

you have to make something like this:

void MyProgressFunc(void *pseudoThis)
{
    (qvChamferCostFunction *)pseudoThis->DoProgressMethod();
}

and then

this->thresh1->GetImageThreshold()->SetProgressMethod(this);

I think this will help you on your way. If not, mail me.
Greetz, Jorrit


Marcel van Straten wrote:

> Hi all,
>
> I'm trying to use SetProgressMethod in C++ to show the progress of a filter.
> I implemented it this way:
>
> ////////////////////////////////////////////////////////////////////////////
> ////////////////////////
> // Progress monitoring
> ////////////////////////////////////////////////////////////////////////////
> ////////////////////////
> void qvChamferCostFunction::Progress(void *arg) {
>  vtkImageThreshold *thresh = (vtkImageThreshold *)arg;
>    cout << "Progress: " << thresh->GetProgress() << "\n";
>
> }
>
> ...
> qvChamferCostFunction::qvChamferCostFunction(QWidget *parent, const char
> *name):QVBox (parent, name)
> {
> ...
>
> this->thresh1->GetImageThreshold()->SetProgressMethod(this->Progress,this->t
> hresh1);
> ...
> }
>
> When compiling (MS VC++) I get the following error:
> error C2664: 'SetProgressMethod' : cannot convert parameter 1 from 'void
> (void *)' to 'void (__cdecl *)(void *)'
>         None of the functions with this name in scope match the target type
>
> If you know what's wrong, please help me,
>
> thanks in advance,
> Marcel
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers





More information about the vtkusers mailing list