I am writing my first appalication and I need A DLL, But I dont seem to be gettin any joy gettin it to work. I have a problem with a var not being declared, but I thought that becuase it was a part of the DLL function, I did'nt do that.Can you have a look at it? How do you create the actual DLL? If I try to run it, It exspects statements.
DLL
------------------------------------------------------
library collexconv;
uses
ShareMem,
SysUtils,
Classes;
{$R *.res}
Function VarCreate (S: String): String stdcall;
begin
ExtVar := copy(S,8,4);
InOut := copy(S,13,3);
Line := copy(S,12,3);
CallDate := copy(S,21,2);
CallMonth := copy(S,24,2);
CallYear := copy(S,27,2);
CallTime := copy(S,30,5);
CallDur := copy(S,36,8);
Number := copy(s,60,27);
CallRing: = copy(S,89,5);
Account:= copy(S,106,16);
end;
exports
ExtVar, InOut, Line, CallDate, CallMonth, CallYear, Calltime,
CallDur, Number, CallRing, Account;
end.
-------------------------------------
Application
interface
uses
Function VarCreate (S: string): string; stdcall; external 'collexconv.dll';
procedure TMainForm.CdrButtonOKClick(Sender: TObject);
begin
Assignfile(CdrText, CdrImportEdit.Text);
Reset(CdrText);
while not EOF(CdrText) do begin
ReadLn (CdrText, Buffer1);
ExtNum := ExtVar(Buffer1);//Problems here with Var not declared
OutgoingSQLEdit.Lines.Add(Extnum);
end;
CloseFile(CdrText);
end.
DLL
------------------------------------------------------
library collexconv;
uses
ShareMem,
SysUtils,
Classes;
{$R *.res}
Function VarCreate (S: String): String stdcall;
begin
ExtVar := copy(S,8,4);
InOut := copy(S,13,3);
Line := copy(S,12,3);
CallDate := copy(S,21,2);
CallMonth := copy(S,24,2);
CallYear := copy(S,27,2);
CallTime := copy(S,30,5);
CallDur := copy(S,36,8);
Number := copy(s,60,27);
CallRing: = copy(S,89,5);
Account:= copy(S,106,16);
end;
exports
ExtVar, InOut, Line, CallDate, CallMonth, CallYear, Calltime,
CallDur, Number, CallRing, Account;
end.
-------------------------------------
Application
interface
uses
Function VarCreate (S: string): string; stdcall; external 'collexconv.dll';
procedure TMainForm.CdrButtonOKClick(Sender: TObject);
begin
Assignfile(CdrText, CdrImportEdit.Text);
Reset(CdrText);
while not EOF(CdrText) do begin
ReadLn (CdrText, Buffer1);
ExtNum := ExtVar(Buffer1);//Problems here with Var not declared
OutgoingSQLEdit.Lines.Add(Extnum);
end;
CloseFile(CdrText);
end.