J
jxgangzhao
Unregistered / Unconfirmed
GUEST, unregistred user!
dll 代碼如下:
library Encrypt;
uses
SysUtils,
Classes,
penniesint in 'penniesint.pas';
function encryptHex
(sourcechar;outstrchar;Encrypt:boolean;keychar):word;stdcall;
begin
astr:=source;
outstr:=source;
end;
exports
encryptHex;
begin
end.
調用過程為:
proceudre dllResultTest()
var
source,outstr,key:string;
begin
source:='1000';
encrypthex(pchar(source),pchar(outstr),true,pchar('123'));
end;
penniesint.pas為:
unit penniesint;
interface
function encryptHex(
sourcechar;outstrchar;Encrypt:boolean;keychar):word;stdcall;
implementation
function encryptHex;external 'Encrypt.dll' name 'encryptHex';
問題點:
outstr輸出的字符不等於'1000'.請問這是為什麼.應該怎麼寫才對.
library Encrypt;
uses
SysUtils,
Classes,
penniesint in 'penniesint.pas';
function encryptHex
(sourcechar;outstrchar;Encrypt:boolean;keychar):word;stdcall;
begin
astr:=source;
outstr:=source;
end;
exports
encryptHex;
begin
end.
調用過程為:
proceudre dllResultTest()
var
source,outstr,key:string;
begin
source:='1000';
encrypthex(pchar(source),pchar(outstr),true,pchar('123'));
end;
penniesint.pas為:
unit penniesint;
interface
function encryptHex(
sourcechar;outstrchar;Encrypt:boolean;keychar):word;stdcall;
implementation
function encryptHex;external 'Encrypt.dll' name 'encryptHex';
問題點:
outstr輸出的字符不等於'1000'.請問這是為什麼.應該怎麼寫才對.