Gast
#296304
Hallo Forum, ich habe folgendes Problem, ich möchte einen AT90S2313 der bei mir am USB Port hängt über ein selbstgeschriebenes C++ Programm ansprechen nur ich bekomme es einfach nicht hin die DLL zu verwenden. Das Code Beispiel von Igor Cesko lässt sich nicht Compilieren und ich habe auch keine Erfahrungen mit dem Einbinden von DLLs in C++ Programmen. Ich hoffe ihr könnt mir dabei helfen. Vielen Dank schonmal im Vorraus Mfg Björn Hier erstmal der Code von Igor Cesko: ##################################################################### #ifdef __cplusplus extern "C" { #endif #define AVR309DLL "AVR309.dll"; //return values from AVR309DLL functions: #define NO_ERROR 0; #define DEVICE_NOT_PRESENT 1; #define NO_DATA_AVAILABLE 2; #define INVALID_BAUDRATE 3; #define OVERRUN_ERROR 4; #define INVALID_DATABITS 5; #define INVALID_PARITY 6; #define INVALID_STOPBITS 7; int __stdcall DoGetInfraCode(uchar * TimeCodeDiagram, int DummyInt, int * DiagramLength); int __stdcall DoSetDataPortDirection(uchar DirectionByte); int __stdcall DoGetDataPortDirection(uchar * DataDirectionByte); int __stdcall DoSetOutDataPort(uchar DataOutByte); int __stdcall DoGetOutDataPort(uchar * DataOutByte); int __stdcall DoGetInDataPort(uchar * DataInByte); int __stdcall DoSetDataPortDirections(uchar DirectionByteB, uchar DirectionByte, uchar DirectionByte, uchar UsedPorts); int __stdcall DoGetDataPortDirections(uchar * DataDirectionByteB, uchar * DataDirectionByteC, uchar * DataDirectionByteD, uchar * UsedPorts); int __stdcall DoSetOutDataPorts(uchar DataOutByteB, uchar DataOutByteC, uchar DataOutByteD, uchar UsedPorts); int __stdcall DoGetOutDataPorts(uchar * DataOutByteB, uchar * DataOutByteC, uchar * DataOutByteD, uchar * UsedPorts); int __stdcall DoGetInDataPorts(uchar * DataInByteB, uchar * DataInByteC, uchar * DataInByteD, uchar * UsedPorts); int __stdcall DoEEPROMRead(ushort Address, uchar * DataInByte); int __stdcall DoEEPROMWrite(ushort Address, uchar DataOutByte); int __stdcall DoRS232Send(uchar DataOutByte); int __stdcall DoRS232Read(uchar * DataInByte); int __stdcall DoSetRS232Baud(int BaudRate); int __stdcall DoGetRS232Baud(int * BaudRate); int __stdcall DoGetRS232Buffer(uchar * RS232Buffer, int DummyInt, int * RS232BufferLength); int __stdcall DoRS232BufferSend(uchar * RS232Buffer, int DummyInt, int * RS232BufferLength); int __stdcall DoSetRS232DataBits(uchar DataBits); int __stdcall DoGetRS232DataBits(uchar * DataBits); int __stdcall DoSetRS232Parity(uchar Parity); int __stdcall DoGetRS232Parity(uchar * Parity); int __stdcall DoSetRS232StopBits(uchar StopBits); int __stdcall DoGetRS232StopBits(uchar * StopBits); #ifdef __cplusplus } #endif ###################################################################### Und die Fehlermeldungen: orland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland moep.cpp: Error E2147 usb.cpp 18: 'uchar' cannot start a parameter declaration Error E2147 usb.cpp 19: 'uchar' cannot start a parameter declaration Error E2147 usb.cpp 20: 'uchar' cannot start a parameter declaration Error E2147 usb.cpp 21: 'uchar' cannot start a parameter declaration Error E2147 usb.cpp 22: 'uchar' cannot start a parameter declaration Error E2147 usb.cpp 23: 'uchar' cannot start a parameter declaration Error E2147 usb.cpp 25: 'uchar' cannot start a parameter declaration Error E2303 usb.cpp 25: Type name expected Error E2147 usb.cpp 26: 'uchar' cannot start a parameter declaration Error E2303 usb.cpp 26: Type name expected Error E2147 sub.cpp 27: 'uchar' cannot start a parameter declaration Error E2303 usb.cpp 27: Type name expected Error E2147 usb.cpp 28: 'uchar' cannot start a parameter declaration Error E2303 usb.cpp 28: Type name expected Error E2147 usb.cpp 29: 'uchar' cannot start a parameter declaration Error E2303 usb.cpp 29: Type name expected Error E2147 usb.cpp 31: 'ushort' cannot start a parameter declaration Error E2303 usb.cpp 31: Type name expected Error E2147 usb.cpp 32: 'ushort' cannot start a parameter declaration Error E2303 usb.cpp 32: Type name expected Error E2147 usb.cpp 33: 'uchar' cannot start a parameter declaration Error E2147 usb.cpp 34: 'uchar' cannot start a parameter declaration Error E2147 usb.cpp 37: 'uchar' cannot start a parameter declaration Error E2147 usb.cpp 38: 'uchar' cannot start a parameter declaration Error E2147 usb.cpp 39: 'uchar' cannot start a parameter declaration Error E2228 usb.cpp 39: Too many error or warning messages *** 26 errors in Compile *** ################################################################ die uchar hab ich schonmal in unsigned char umgeschrieben aber geht trotzdem nicht :-(