N
netwinds
Unregistered / Unconfirmed
GUEST, unregistred user!
function f_enc_EncryStrHex(strSource:String;strKey:String)Char;stdcall;
var
myenc:Tencript;
begin
myenc:= Tencript.Create(Application);
Result := PChar(myenc.EncryStrHex(strSource, strKey));
myenc.Free;
end;
这样在 delphi 调与与在 vb 中调用都可以,mydes.EncryStrHex 是一个加密的过程,不管它。但当加密的字符超长时,比如找度超过 10000 时,则在 delphi 与 vb 中都会出错。
后改成:
function f_enc_EncryStrHex(strSource:String;strKey:String)Char;stdcall;
var
myenc:Tencript;
strTemp: array[0..300000] of Char;
begin
myenc:= Tencript.Create(Application);
StrLCopy(@strTemp,PChar(myenc.EncryStrHex(strSource, strKey)),300000);
Result :=@strTemp[0];
myenc.Free;
end;
之后在 delphi 中调用不会出错,再大都没问题。但在 vb 中调用却返回空,也不会提示错误。
请教,要怎么操作,才可在 delphi 与 vb 中都可返回正确的值。
高手在哪??????
没分了,帮个忙吧。
var
myenc:Tencript;
begin
myenc:= Tencript.Create(Application);
Result := PChar(myenc.EncryStrHex(strSource, strKey));
myenc.Free;
end;
这样在 delphi 调与与在 vb 中调用都可以,mydes.EncryStrHex 是一个加密的过程,不管它。但当加密的字符超长时,比如找度超过 10000 时,则在 delphi 与 vb 中都会出错。
后改成:
function f_enc_EncryStrHex(strSource:String;strKey:String)Char;stdcall;
var
myenc:Tencript;
strTemp: array[0..300000] of Char;
begin
myenc:= Tencript.Create(Application);
StrLCopy(@strTemp,PChar(myenc.EncryStrHex(strSource, strKey)),300000);
Result :=@strTemp[0];
myenc.Free;
end;
之后在 delphi 中调用不会出错,再大都没问题。但在 vb 中调用却返回空,也不会提示错误。
请教,要怎么操作,才可在 delphi 与 vb 中都可返回正确的值。
高手在哪??????
没分了,帮个忙吧。