Addresing AI and DI when using K8055 with mingw/gcc compiler

Hi,
I’m using wxDev-C++ IDE (mingw/gcc).
I embedded the K8055D_C.lib /.dll / .h into the source code without any problem. There are no problems finding the card and addressing the DO’s. However when trying to ‘read’ the analog inputs or the digital inputs the result is always -1.

I guess it has something to do with the .dll, but I do not understand why it is working well for the DO’s etc. but not for the DI or AI ?!?!


in the main.c

 ...
 fprintf(stdout, "\r\nAD1=%i AD2=%i", ReadAnalogChannel(1), ReadAnalogChannel(2));
 ...

in the k8055D_c.h

__declspec(dllimport) long __stdcall OpenDevice(long CardAddress);
__declspec(dllimport) VOID __stdcall CloseDevice();
__declspec(dllimport) long __stdcall ReadAnalogChannel(long Channel);
__declspec(dllimport) VOID __stdcall ReadAllAnalog(long *Data1, long *Data2);

and so on.
...

OK, that’s it. I found the problem by myself.
Greetings

Nice that you got it solved.
Looking the documentation and tutorials of the wxDev-C++, it looks really interesting programming environment.

BTW: It would be interesting to know what was the reason to the problem…