Sigo tratando de resolver los múltiples errores de compilación que me da el Ares,
estoy parado aquí ahora....no lo encuentro..????
Código Delphi
[-]
function estrai_path_da_lnk(filen:widestring):widestring;
var
AnObj: IUnknown;
ShLink: IShellLinkW;
PFile: IPersistFile;
Data: TWin32FindData;
Buffer: array [0..255] of widechar;
begin
result:='';
try
AnObj := CreateComObject(CLSID_ShellLink);
ShLink := AnObj as IShellLinkW;
PFile := AnObj as IPersistFile;
PFile.Load(PWChar(FileN), STGM_READ);
ShLink.GetPath(Buffer, Sizeof(Buffer), Data, SLGP_UNCPRIORITY);
result := Buffer;
except
end;
end;
En esta linea es donde dá el siguiente error:
ShLink.GetPath(Buffer, Sizeof(Buffer), Data, SLGP_UNCPRIORITY);
[DCC Error] helper_urls.pas(153): E2033 Types of actual and formal var parameters must be identical
En ShlObj.pas:
Código Delphi
[-]
IShellLinkW = interface(IUnknown)
[SID_IShellLinkW]
function GetPath(pszFile: PWideChar; cchMaxPath: Integer;
var pfd: TWin32FindDataW; fFlags: DWORD): HResult; stdcall;
De la "Guia de Referencia de Delphi":
(E2033)Types of actual and formal var parameters must be identical:
For a variable parameter, the actual argument must be of the exact type of the formal parameter.
Código Delphi
[-]
program Produce;
procedure SwapBytes(var B1, B2: Byte);
var
Temp: Byte;
begin
Temp := B1; B1 := B2; B2 := Temp;
end;
var
C1, C2: 0..255;
begin
SwapBytes(C1,C2);
end.
Arguments C1 and C2 are not acceptable to SwapBytes, although they have the exact memory representation and range that a
Byte has.
Código Delphi
[-]
program Solve;
procedure SwapBytes(var B1, B2: Byte);
var
Temp: Byte;
begin
Temp := B1; B1 := B2; B2 := Temp;
end;
var
C1, C2: Byte;
begin
SwapBytes(C1,C2);
end.
So you actually have to declare C1 and C2 as Bytes to make this example compile.
He realizado varias pruebas, pero, no lo pillo....
¿Alguna idea? Por supuesto gracias de antemano...
Saludos
Miguel