LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Incompatible Pointer

hallo, in a controller-project (not CVI) I use a self-written pointerList. This list-structure has some function-pointers e.g. "int (*compare)(void*, void*)" to do something with the objects putted into the list later. so I can put into one list structures of type ABCD, in the other list structures of type EFGH and have not to manipulate the list-definition. I have only to write the methodes and initialize the list with function-pointer to these. NOW i want to do this in CVI, but the compiler says "Incompatible functions found int (*compare) (ABCD*, ABCD*) but expected int (*compare) (void*, void*)" Is there a possibility to make the compiler eating this (an option ?) or have you another idea? best regards Simon
0 Kudos
Message 1 of 2
(3,034 Views)
The arguments to you function pointer need to match the arguments to the function you are loading into it.
 
If you function pointer is:
 
int (*compare)(void*,void*)
 
you function prototype has to be:
 
int FunctionName1(void *a, void *b);
int FunctionName2(void *c, void *d); 
0 Kudos
Message 2 of 2
(3,025 Views)