Código:
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:
IShellLinkW = interface(IUnknown) { sl }
[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.
He cambiado declaraciones de variables, modificado parámetros ,en fin le he dado a esto muchas vueltas...No le encuentro la solución.
¿Podria alguien ayudarme? ¡ Gracias!
Saludos a todos.