mr76
asked on
Please Look at this code!!!
function TfrmAbout.GetProgramVersio n(path : string) : string;
var
nZero,nSize : integer;
lpData : pointer;
p : pointer;
begin
result:='Unknown';
nSize:=GetFileVersionInfoS ize(pchar( path),nZer o);
if nSize>0 then
begin
getmem(lpData,nSize);
if GetFileVersionInfo(pchar(p ath),0,nSi ze,lpData) then
if VerQueryValue(lpData,'\',p ,nZero) then
begin
result:=inttostr(tVSFIXEDF ILEINFO(p^ ).dwFileVe rsionMS shr 16)+'.'+
inttostr(tVSFIXEDFILEINFO( p^).dwFile VersionMS and $FFFF)+'.'+
inttostr(tVSFIXEDFILEINFO( p^).dwFile VersionLS shr 16)+'.'+
inttostr(tVSFIXEDFILEINFO( p^).dwFile VersionLS and $FFFF);
end;
freemem(lpData,nSize);
end;
end;
When I compile this functin I get
'Types of actual and formal var parameters must be identical'. On line 2 and 7.
Thanks
mr76
var
nZero,nSize : integer;
lpData : pointer;
p : pointer;
begin
result:='Unknown';
nSize:=GetFileVersionInfoS
if nSize>0 then
begin
getmem(lpData,nSize);
if GetFileVersionInfo(pchar(p
if VerQueryValue(lpData,'\',p
begin
result:=inttostr(tVSFIXEDF
inttostr(tVSFIXEDFILEINFO(
inttostr(tVSFIXEDFILEINFO(
inttostr(tVSFIXEDFILEINFO(
end;
freemem(lpData,nSize);
end;
end;
When I compile this functin I get
'Types of actual and formal var parameters must be identical'. On line 2 and 7.
Thanks
mr76
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or as inthe stated, cardinal will work too :)
Heath
Heath
listenning
hamsterrrn
ASKER
Thanks Barry
You must eat sleep and breathe this stuff.
You must eat sleep and breathe this stuff.
yep, but i still dont know what im talking about ;-)
function TForm1.GetProgramVersion(p
var
nZero,nSize : DWORD;
lpData : pointer;
p : pointer;
begin
result:='Unknown';
nSize:=GetFileVersionInfoS
if nSize>0 then
begin
getmem(lpData,nSize);
if GetFileVersionInfo(pchar(p
if VerQueryValue(lpData,'\',p
begin
result:=inttostr(tVSFIXEDF
inttostr(tVSFIXEDFILEINFO(
inttostr(tVSFIXEDFILEINFO(
inttostr(tVSFIXEDFILEINFO(
end;
freemem(lpData,nSize);
end;
end;
Heath