DLL'de şunun gibi birşeyler olmalı:
Kod: Tümünü seç
var s: String;
function KelimeleriGetir: PChar; stdcall;
var
sl: TStringList;
begin
sl := TStringList.Create;
sl.Add('Kopyala');
sl.Add('Kes');
sl.Add('Yapıştır');
//...
s := sl.Text;
Result := PChar(s);
end;
exports
KelimeleriGetir;
Daha sonra programın içerisinde:
Kod: Tümünü seç
type
TKelimeler = function(): PChar; stdcall;
var
sl: TStringList;
func: TKelimeler;
DllHnd : cardinal;
DllIsmi: string;
begin
if (Türkçe Seçili ise) then
DllIsmi := 'TR.dll'
else
DllIsmi := 'EN.dll';
DllHnd := LoadLibrary(DllIsmi);
if DllHnd <> 0 then
begin
@func := GetProcAddress(DllHnd, 'KelimeleriGetir') ;
if Assigned(func) then
begin
sl := TStringList.Create;
try
sl.Text := func;
//Bundan sonra kelimeleri istediğin gibi kullanabilirsin
//sl[0] = Kopyala, sl[1] = Kes vs..
finally
sl.Free;
end;
end;
FreeLibrary(DllHnd) ;
end;