Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 25-05-2008
Mav Mav is offline
Miembro
 
Registrado: jun 2007
Posts: 39
Poder: 0
Mav Va por buen camino
ERROR:ShLink.GetPath(Buffer, Sizeof(Buffer), Data, SLGP_UNCPRIORITY)

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.
Responder Con Cita
  #2  
Antiguo 25-05-2008
Avatar de xEsk
[xEsk] xEsk is offline
Miembro Premium
 
Registrado: feb 2006
Posts: 454
Poder: 19
xEsk Va por buen camino
Hola, prueba cambiando
Código Delphi [-]
Data: TWin32FindData;
por
Código Delphi [-]
Data: TWin32FindDataW;

El error ya te esta dando una pista de cual es el problema, que los tipos deben ser identicos, y si te fijas el tipo del parametro pfd es TWin32FindDataW y no TWin32FindData.

Cita:
function GetPath(pszFile: PWideChar; cchMaxPath: Integer; var pfd: TWin32FindDataW; fFlags: DWORD): HResult; stdcall;
Saludos.
Responder Con Cita
  #3  
Antiguo 26-05-2008
Mav Mav is offline
Miembro
 
Registrado: jun 2007
Posts: 39
Poder: 0
Mav Va por buen camino
Si,si! ¡Correcto, muchas gracias!
Como no lo ví, si lo tenía delante...
Saludos
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
solucion a Error Invalid blob handle in record buffer memehua Conexión con bases de datos 2 26-09-2011 22:03:14
Editar un buffer JoseFco OOP 42 13-10-2008 16:17:00
Bitmap buffer fitolanga Gráficos 4 21-04-2007 15:58:29
Error Invalid blob handle in record buffer??? sin usar "Blobs to cache" varuhs Conexión con bases de datos 4 22-01-2007 21:19:53
Problema con Double Buffer guillonet C++ Builder 0 29-08-2006 19:26:22


La franja horaria es GMT +2. Ahora son las 12:33:50.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi