Einzelnen Beitrag anzeigen

Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#6

Re: DLL einbinden, in Klasse oder global

  Alt 11. Nov 2009, 15:43
Hi,

Du kannst das Kapseln, aber dann nicht so, sondern:

Delphi-Quellcode:
TspsIo = class
public
  constructor create(Addr : String);
  function IPSOpen(IPAdr : PChar; Rack : LongWord; Slot : LongWord; RxTimeout : LongWord; TxTimeout : LongWord ; ConnectTimeout : LongWord): LongInt;
end;

implementation

const
  spsDll = 'IPS7LNK.DLL';

function IPS7Open (IPAdr : PChar; Rack : LongWord; Slot : LongWord; RxTimeout : LongWord; TxTimeout : LongWord ; ConnectTimeout : LongWord) : LongInt; stdcall; external spsDll name 'IPS7Open';


function TSPSIO.IPSOpen(IPAdr : PChar; Rack : LongWord; Slot : LongWord; RxTimeout : LongWord; TxTimeout : LongWord ; ConnectTimeout : LongWord): LongInt;
begin
  Result := IPS7Open(IPAdr,Rack,Slot,RxTimeout,TxTimeout,ConnectTimeout);
end;
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
  Mit Zitat antworten Zitat