Zabrałem się za tą nieszczęsną listę, ale niestety mi nie chce działać. Wyskakuje mi taki błąd przy dodawaniu do listy:
Oto kod z dll, ponieważ to właśnie w nim bym chciał zrobić tą listę.:
type
PElement = ^TElement;
TElement = record
Next: PElement;
Nazwa: string[30];
Cena: currency;
Gatunek: string[15];
Platforma: string[10];
end;
var
poczatek:PElement;
c: integer=0;
//POCZĄTEK LISTY
procedure start; stdcall;
begin
poczatek := nil;
end;
//DODAWANIE DO LISTY
procedure dodajl(naz:string;cen:currency;gat:string;pla:string); stdcall;
var
nowy: PElement;
begin
inc(c);
New(nowy);
nowy^.Next := nil;
nowy^.Nazwa := naz;
nowy^.Cena := cen;
nowy^.Gatunek := gat;
nowy^.Platforma :=pla;
if poczatek = nil then
begin
poczatek := nowy;
end else begin
while poczatek^.next <> nil do poczatek := poczatek^.next;
poczatek^.next := nowy;
end;
end;
exports // eksportuj procedurę
dodajl,start;
I funkcja która z korzysta z dll:
procedure start; external 'dll.dll';
procedure dodajl(naz:string;cen:currency;gat:string;pla:string); external 'dll.dll';
(...)
start;
dodajl(edit1.Text,strtocurr(edit2.Text),edit3.Text,edit4.Text);
Skoro już teraz mam taki problem, to co to będzie przy sortowaniu ;D
Wie ktoś jak to naprawić?