Function CreateCode(name, encrypt_template:PChar; hardwareID:LongInt; otherinfo:Word): PChar; CDecl; external 'codegen.dll';
Function HexToInt(hexstring:PChar) : LongInt ; StdCall ; External 'codegen.dll';
procedure TForm1.Button1Click(Sender: TObject);
var
name,template,s:string;
hardwareid:longint;
otherinfo:word;
begin
name:='test';
template:='can u help me?';
s:='4C82-DC47';
otherinfo:=0;
hardwareid:=hextoint(pchar(s));
edit4.Text:=inttostr(hardwareid);
s:=CreateCode(pchar(name),pchar(template),hardwareid,otherinfo);
ShowMessage(a);
end;