Hi,
I had the same problems.
Is it possible to get a smal simple code which runs on MS Visual Express C ++ 2008.
I do not understand all things in the code that you linked here.
I found this code which does not run in MS Visual Express C ++ 2008. Is it possible to turn this to a MS VE C++ 2008 code?:
main.cpp:
#include <windows.h>
#include “k8055.cpp”
int main(){
init();
OpenDevice(0);
WriteAllDigital(255);//Schaltet Alle Digitalen Ports ein
CloseDevice();
return 0;
}
k8055.cpp:
typedef void(__stdcall *t_func)(long );
typedef void(__stdcall *t_func0)();
typedef long(__stdcall *t_func1)();
typedef void(__stdcall *t_func2)(long *, long *);
typedef void(__stdcall *t_func3)(long , long );
typedef long(__stdcall *t_func4)(long );
typedef bool(__stdcall *t_func5)(long );
//Allgemeine Arbeitsweisen
t_func4 OpenDevice;
t_func0 CloseDevice;
//Analog in Digital konvertiern
t_func4 ReadAnalogChannel;
t_func2 ReadAllAnalog;
//Digital in Analog konvertieren
t_func3 OutputAnalogChannel;
t_func3 OutputAllAnalog;
t_func ClearAnalogChannel;
t_func0 ClearAllAnalog;
t_func SetAnalogChannel;
t_func0 SetAllAnalog;
//Digitaler Ausgang
t_func WriteAllDigital;
t_func ClearDigitalChannel;
t_func0 ClearAllDigital;
t_func SetDigitalChannel;
t_func0 SetAllDigital;
//Digitaler Eingang
t_func5 ReadDigitalChannel;
t_func1 ReadAllDigital;
//Zählerfunktionen
t_func3 ReadCounter;
t_func ResetCounter;
t_func3 SetCounterDebounceTime;
HINSTANCE hModule;
int init()
{
hModule = LoadLibrary(“k8055d.dll”);
OpenDevice = (t_func4) GetProcAddress(hModule, “OpenDevice”);
CloseDevice = (t_func0) GetProcAddress(hModule, “CloseDevice”);
ReadAnalogChannel = (t_func4) GetProcAddress(hModule, “ReadAnalogChannel”);
ReadAllAnalog = (t_func2) GetProcAddress(hModule, “ReadAllAnalog”);
OutputAnalogChannel = (t_func3) GetProcAddress(hModule, “OutputAnalogChannel”);
OutputAllAnalog = (t_func3) GetProcAddress(hModule, “OutputAllAnalog”);
ClearAnalogChannel = (t_func) GetProcAddress(hModule, “ClearAnalogChannel”);
ClearAllAnalog = (t_func0) GetProcAddress(hModule, “ClearAllAnalog”);
SetAnalogChannel = (t_func) GetProcAddress(hModule, “SetAnalogChannel”);
SetAllAnalog = (t_func0) GetProcAddress(hModule, “SetAllAnalog”);
WriteAllDigital = (t_func) GetProcAddress(hModule, “WriteAllDigital”);
ClearDigitalChannel = (t_func) GetProcAddress(hModule, “ClearDigitalChannel”);
SetDigitalChannel = (t_func) GetProcAddress(hModule, “SetDigitalChannel”);
SetAllDigital = (t_func0) GetProcAddress(hModule, “SetAllDigital”);
ReadDigitalChannel = (t_func5) GetProcAddress(hModule, “ReadDigitalChannel”);
ReadAllDigital = (t_func1) GetProcAddress(hModule, “ReadAllDigital”);
ReadCounter = (t_func3) GetProcAddress(hModule, “ReadCounter”);
ResetCounter = (t_func) GetProcAddress(hModule, “ResetCounter”);
SetCounterDebounceTime = (t_func3) GetProcAddress(hModule, “SetCounterDebounceTime”);
}
I