H
hyxic
Unregistered / Unconfirmed
GUEST, unregistred user!
请问各位大侠:我在调用动态链接库时返回数据丢失了,具体如下:
1。动态链接库:
function resd()char:Export;
begin
Result:=pchar('00-12-5B-23-AD-5F');
end;
2.调用
procedure TForm1.Button1Click(Sender: TObject);
var
TFc:Function ()char;stdcall; Handle:THandle;
begin
Handle:=LoadLibrary('GetSysInfo.dll');
if Handle>=32 then
TFc:= GetProcAddress(Handle,PChar('GetMacAddress')); //get Proaddres
if Assigned(TFc) then
Edit1.Text:=TFc();
FreeLibrary(Handle);
end;
结果返回的数据只有'00-12-5B-23-AD-5',最后的'F'不见了,赏老多分了
1。动态链接库:
function resd()char:Export;
begin
Result:=pchar('00-12-5B-23-AD-5F');
end;
2.调用
procedure TForm1.Button1Click(Sender: TObject);
var
TFc:Function ()char;stdcall; Handle:THandle;
begin
Handle:=LoadLibrary('GetSysInfo.dll');
if Handle>=32 then
TFc:= GetProcAddress(Handle,PChar('GetMacAddress')); //get Proaddres
if Assigned(TFc) then
Edit1.Text:=TFc();
FreeLibrary(Handle);
end;
结果返回的数据只有'00-12-5B-23-AD-5',最后的'F'不见了,赏老多分了