# cannot convert argument 1 from 'int (\_\_cdecl \*)(vtkMultiProcessController \*,void \*)' to 'vtkProcessFunctionType'

**URL:** https://discourse.vtk.org/t/cannot-convert-argument-1-from-int-cdecl-vtkmultiprocesscontroller-void-to-vtkprocessfunctiontype/1083
**Category:** Support
**Created:** [June 4, 2019, 4:06pm UTC](https://discourse.vtk.org/t/cannot-convert-argument-1-from-int-cdecl-vtkmultiprocesscontroller-void-to-vtkprocessfunctiontype/1083 "2019-06-04T16:06:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Famous](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/f/bc79bd/32.png) [@Famous](https://discourse.vtk.org/u/Famous)
#### Post date: [June 4, 2019, 4:06pm UTC](https://discourse.vtk.org/t/cannot-convert-argument-1-from-int-cdecl-vtkmultiprocesscontroller-void-to-vtkprocessfunctiontype/1083/1 "2019-06-04T16:06:14Z")

</div>

Hi All,

I get the following error while building my VTK project

```auto
error C2664: 'void vtkMultiProcessController::SetSingleMethod(vtkProcessFunctionType,void *)': cannot convert argument 1 from 'int (__cdecl *)(vtkMultiProcessController *,void *)' to 'vtkProcessFunctionType'

The following lines of code are relevant
vtkMultiProcessController *controller = vtkMPIController::New();
controller->Initialize(&argc, &argv);

controller->SetSingleMethod(my_function_call, 0);
controller->SingleMethodExecute();

```

my\_function\_call is defined as

`int my_function_call(vtkMultiProcessController *controller, void* vtkNotUsed(arg));`

How do I make use of the vtkProcessFunctionType class ? I can’t find any examples.

Please someone should provide me with an example. I will be very grateful.

Kind Regards

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 4, 2019, 6:17pm UTC](https://discourse.vtk.org/t/cannot-convert-argument-1-from-int-cdecl-vtkmultiprocesscontroller-void-to-vtkprocessfunctiontype/1083/2 "2019-06-04T18:17:08Z")

</div>

> [@Famous](#):
>
> int my\_function\_call(vtkMultiProcessController _controller, void_ vtkNotUsed(arg));

The declaration is:

```c
typedef void (*vtkProcessFunctionType)(vtkMultiProcessController *controller,
                                       void *userData);

```

So the return type needs to be `void`, not `int`.

---

<div class="post-metadata">

### Author: ![Famous](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/f/bc79bd/32.png) [@Famous](https://discourse.vtk.org/u/Famous)
#### Post date: [June 14, 2019, 1:32pm UTC](https://discourse.vtk.org/t/cannot-convert-argument-1-from-int-cdecl-vtkmultiprocesscontroller-void-to-vtkprocessfunctiontype/1083/3 "2019-06-14T13:32:47Z")

</div>

Thank you Ben. It has worked now.
