hi,
i'm having problems trying to make a library work for which i only have c examples and headers, where i have to pass a NULL parameter to a function..
the c declaration:
int32 __CFUNC DAQmxReadAnalogF64 (TaskHandle taskHandle, int32 numSampsPerChan, float64 timeout, bool32 fillMode, float64 readArray[], uInt32 arraySizeInSamps, int32 *sampsPerChanRead, bool32 *reserved);
my translation:
DECLARE FUNCTION DAQmxReadAnalogF64 LIB "nicaiu.dll" ALIAS "DAQmxReadAnalogF64" (BYVAL TaskHandle AS DWORD, BYVAL numSampsPerChan AS LONG, BYVAL timout AS DOUBLE, BYVAL fillMode AS DWORD,_
BYREF buffer() AS DOUBLE, BYVAL arraySizeInSamps AS LONG, BYREF sampsPerChanRead AS LONG, BYREF reserved AS DWORD) AS LONG
Now the problem is that the function insists that the last parameter, 'reserved' is a NULL. I tried just filling in literal 0, a variable with value 0 and a pointer to a variable with value 0, but that does not work. The program compiles and runs, but the function returns a error "Reserved parameter must be NULL".
So can someone explain what exactly that 'NULL' is in c and how you pass it from powerbasic?
many thanks!
i'm having problems trying to make a library work for which i only have c examples and headers, where i have to pass a NULL parameter to a function..
the c declaration:
int32 __CFUNC DAQmxReadAnalogF64 (TaskHandle taskHandle, int32 numSampsPerChan, float64 timeout, bool32 fillMode, float64 readArray[], uInt32 arraySizeInSamps, int32 *sampsPerChanRead, bool32 *reserved);
my translation:
DECLARE FUNCTION DAQmxReadAnalogF64 LIB "nicaiu.dll" ALIAS "DAQmxReadAnalogF64" (BYVAL TaskHandle AS DWORD, BYVAL numSampsPerChan AS LONG, BYVAL timout AS DOUBLE, BYVAL fillMode AS DWORD,_
BYREF buffer() AS DOUBLE, BYVAL arraySizeInSamps AS LONG, BYREF sampsPerChanRead AS LONG, BYREF reserved AS DWORD) AS LONG
Now the problem is that the function insists that the last parameter, 'reserved' is a NULL. I tried just filling in literal 0, a variable with value 0 and a pointer to a variable with value 0, but that does not work. The program compiles and runs, but the function returns a error "Reserved parameter must be NULL".
So can someone explain what exactly that 'NULL' is in c and how you pass it from powerbasic?
many thanks!
Comment