Registriert seit: 28. Jan 2006
Ort: Görlitz / Sachsen
489 Beiträge
Delphi 2007 Professional
|
Problem DLL aufruf
24. Mai 2010, 03:17
Delphi-Quellcode:
typedef int (*callback) (char channel, int deb, int size);
extern "C"
{
__declspec(dllexport)
int __cdecl upload_bin_image
(
char channel,
int deb,
int size,
const char *szFichier,
int write_sam_file,
char *resultat
);
__declspec(dllexport)
int __cdecl download_bin_image
(
char channel,
int deb,
int size,
int offset,
const char *fichier,
const char *path,
char *resultat
);
__declspec(dllexport)
int __cdecl set_dll_parameter(char opt, unsigned int param);
__declspec(dllexport)
int __cdecl boot_bin_target(char channel, const char *fichier_fls, char *resultat2, char *resultat);
__declspec(dllexport)
char *__cdecl get_dll_version();
__declspec(dllexport)
int __cdecl open_comm_port
(
char channel,
const char *szPort,
const char *szPort2,
unsigned int speed,
char *resultat
);
__declspec(dllexport)
int __cdecl close_comm_port(char channel, char *resultat);
__declspec(dllexport)
int __cdecl force_target_reset(char channel, char, char, char, char, char *);
__declspec(dllexport)
int __cdecl init_callback(callback fct);
hab ich mit
Delphi-Quellcode:
type
callback = Integer;
channel = Integer;
deb = Integer;
Size = Integer;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
Function upload_bin_image(Channel,deb,size : Integer; OutFile : String;
write_sam_file : Integer; result1 : String):Integer; cdecl; external 'DownloadDll.dll';
Function download_bin_image(Channel,deb,size,Offset : Integer;
InFile,Path : String; result1 : String):Integer; cdecl; external 'DownloadDll.dll';
Function set_dll_parameter(opt : String; param : Integer): Integer;
cdecl; external 'DownloadDll.dll';
Function boot_bin_target(channel : Integer; flsFile, result2, result1 : String): Integer;
cdecl; external 'DownloadDll.dll';
Function get_dll_version: String; cdecl; external 'DownloadDll.dll';
Function close_comm_port(channel : Integer; result1 : String): Integer;
cdecl; external 'DownloadDll.dll';
Function open_comm_port(channel : Integer; Port1,Port2 : String; Speed : Integer; result1 : String): Integer;
cdecl; external 'DownloadDll.dll';
übersetzt aber schon die Function get_dll_version gibt falsche werte aus
Marcel
|
|
Zitat
|