Witam serdecznie.
Mam taki kod w Delphi:
TDLLTKAInfo = record
typ:TDLLTKAType; //DLL type
name,author:ShortString; //name and author
ver:byte; //0.1 = 1; 0.2 = 2; 0.9 = 9; 1.0 = 10; 2.3 = 23; 13.0 = 130 etc...
end;
I potem funkcję:
function DLLInfo:TDLLTKAInfo; stdcall;
var
info:TDLLTKAInfo;
begin
//Here you need to type your DLL's info:
info.typ := TDTCosTam;
info.name := 'xyz';
info.author := 'Jakub Król';
info.ver := 11;
result:=info;
end;
Wczytuję z DLLki w programie to tak:
function DYNAMIC_DLLInfo(sDLL, sFunc : string; const DLLhandle:THandle=0 ) : TDLLTKAInfo;
type
TInfo_Func = function ():TDLLTKAInfo; stdcall;
var
Info_Func : TInfo_Func;
hDll : THandle;
FuncPtr : TFarProc;
sMsg : string;
begin
if DLLhandle>32 then
hDll:=DLLhandle else
hDll := LoadLibrary(
PChar( sDLL ) );
if(hDll > 32)then
begin
FuncPtr :=
GetProcAddress(
hDll, PChar( sFunc ) );
@Info_Func := FuncPtr;
if(nil <> @Info_Func)then
begin
Result := Info_Func;
end else
begin
DLLEntryBlad(sFunc);
end;
if DLLhandle<32 then FreeLibrary( hDll );
end else
begin
DLLFileBlad(sDLL);
end;
end;
Próbujemy z kolega różnych sztuczek, aby przepisać tą DLLke na C++, ale jakoś nam nie idzie...
Przesyła dobrze jedynie to typ, reszta puste... ;/
Jakieś wskazówki?</delphi>