Re: mfc threads and stdcall function
Z.K. wrote:
I am trying to convert a Win32 program using threads to
MFC, but I am having trouble with a library I am using
that uses __stdcall in its function definition. How do I
get this to work in MFC? Everytime I try to compile I
get this error:
Z.K.
////////////////////////////////////////////////////////////////////
error C2664:
'CPhidgetInterfaceKit_set_OnSensorChange_Handler' :
cannot convert parameter 2 from 'int (long,void
*,int,int)' to 'int (__stdcall *)(long,void *,in t,int)'
None of the functions with this name in scope
match the target type
//////////////////////////////////////////////////////////////////////
//from phidget20.h
int __stdcall
CPhidgetInterfaceKit_set_OnSensorChange_Handler
(CPhidgetInterfaceKitHandle, int (__stdcall * fptr)
(CPhidgetInterfaceKitHandle, void *, int, int), void *);
int __stdcall
IFK_SensorChangeHandler(CPhidgetInterfaceKitHandle IFK,
void *userptr, int Index, int Value)
{
printf("Sensor %d is %d \n", Index, Value);
return 0;
}
If you declare IFK_SensorChangeHandler in some other place,
then specify __stdcall there, too.