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 06-06-2007
Avatar de jorgegetafe
jorgegetafe jorgegetafe is offline
Miembro
 
Registrado: dic 2006
Posts: 238
Poder: 18
jorgegetafe Va por buen camino
De un edit a un string

Hola tengo un edit (edit1) y quiero que lo que se escriba dentro pase a ser string para utilizar este código:

Código Delphi [-]
PROCEDURE TForm1.ToolButton40Click(Sender: TObject);
 VAR
  direccion: STRING;
 BEGIN
  direccion:= edit1.Text;
    TRY
      ShellExecute(0, 'open', direccion, NIL, NIL, SW_SHOW)
    Except
      showmessage ('La disquetera no está lista o no tiene disquetera.');
    END;
END;

En la linea
Código Delphi [-]
ShellExecute(0, 'open', direccion, NIL, NIL, SW_SHOW)
me dice que hay tipos incompatibles PAnsirChar (que no se lo que es) con un string.

Una manita porfa. Muchas gracias.
Responder Con Cita
  #2  
Antiguo 06-06-2007
tito_lolo tito_lolo is offline
Registrado
 
Registrado: jun 2007
Posts: 4
Poder: 0
tito_lolo Va por buen camino
Prueba a poner

Código Delphi [-]
ShellExecute(0, 'open', pchar(direccion), NIL, NIL, SW_SHOW);

Lo que hacemos es un cast de string a PAnsirChar.

Un saludo
Responder Con Cita
  #3  
Antiguo 06-06-2007
Avatar de jorgegetafe
jorgegetafe jorgegetafe is offline
Miembro
 
Registrado: dic 2006
Posts: 238
Poder: 18
jorgegetafe Va por buen camino
Funciona, mil gracias. :-)
Responder Con Cita
  #4  
Antiguo 06-06-2007
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.286
Poder: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Añade:

Código Delphi [-]
...  PChar(direccion)...

Si te hace falta en algun parámetro más le haces lo mismo.
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita
  #5  
Antiguo 06-06-2007
Avatar de jorgegetafe
jorgegetafe jorgegetafe is offline
Miembro
 
Registrado: dic 2006
Posts: 238
Poder: 18
jorgegetafe Va por buen camino
Con eso es suficiente ;-) gracias de todas formas.
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
Unir Edit con Edit Caral Varios 8 17-11-2006 21:37:35
PHP Edit roman PHP 5 30-08-2006 03:42:29
(const Value: string) vs (Value: string) eliash OOP 10 14-12-2005 19:10:13
problemas con el el .Edit: qryCONSULTA.Edit McRose Conexión con bases de datos 3 07-06-2005 15:46:39
key en edit botones67 Varios 7 15-07-2003 14:00:32


La franja horaria es GMT +2. Ahora son las 00:49:25.


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