Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 18-08-2008
Avatar de Delphius
[Delphius] Delphius is offline
Miembro Premium
 
Registrado: jul 2004
Ubicación: Salta, Argentina
Posts: 5.582
Poder: 27
Delphius Va camino a la fama
Cita:
Empezado por BuRtOn Ver Mensaje
Huy gracias...Delphius una pregunta, es que a mi me gusta entender las cosas, y mi pregunta es, para que utilizas el PChar, que funcion cumple..???, es que lo he visto en otra ocasion....por ejemplo cuandop trate de editar el binario en el registro, tu me pasaste un codigo y obtenia un PChar....gracias a todos por su grandioso tiempo..
Por empezar, TApplication.MessageBox() necesita de 2 parámetros PChar. Un PChar es un tipo un tanto especial... para hacerlo simple es un puntero a un conjunto de caracteres. De modo que cuando uno hace PChar(Algo), le está indicando que lea el contenido de la dirección de memoria de la variable algo.

Lo que sucede es que si uno pone un string cualquiera en dichos parámetros el compilador solito no reniega y se encarga de hacer la "conversión" necesaria. Pero si tu quieres mostrar el contenido de una variable string, el compilador te dirá que es incompatible el String con PChar. Necesitarás hacer uso de PChar.

Por otro lado, te tengo una sorpresita. Esto dice la ayuda sobre TApplication.MessageBox():

Cita:
Use MessageBox to display a generic dialog box a message and one or more buttons. Caption is the caption of the dialog box and is optional.

MessageBox is an encapsulation of the Windows API MessageBox function. TApplication’s encapsulation of MessageBox automatically supplies the missing window handle parameter needed for the Windows API function.

The value of the Text parameter is the message, which can be longer than 255 characters if necessary. Long messages are automatically wrapped in the message box.

The value of the Caption parameter is the caption that appears in the title bar of the dialog box. Captions can be longer than 255 characters, but don't wrap. A long caption results in a wide message box.

The Flags parameter specifies what buttons appear on the message box and the behavior (possible return values). The following table lists the possible values. These values can be combined to obtain the desired effect.
Presta atención a lo resaltado. Dice que los mensajes largos son cortados, para mostrarlos en otra linea. ¿Será?

Hagamos la prueba:
Código Delphi [-]
procedure TForm1.Button1Click(Sender: TObject);
var texto: string;
begin
  texto := 'Este texto es lo suficientemente grande como para que tal vez no entre en un "dialogo normal"... hay que ver como se vé.... y continua.... y continua... ¿Tendrá fin esto? Veamos... che... ¿Se pasa a la segunda línea?';
  Application.MessageBox(PChar(texto),'titulo',MB_OK)
end;

¿Como se vé? ¿Lo corta? ¿Te gusta como queda?

No más te lo dejo como dato curioso Tu saca conclusiones. ¿Lo cortamos a mano?

Saludos,
__________________
Delphius
[Guia de estilo][Buscar]
Responder Con Cita
 



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
Problema con MessageDLG o Application.MessageBox federico1 Varios 4 26-12-2006 18:54:41
¿Application.MessageBox? Ledian_Fdez Varios 8 23-10-2006 22:19:44
Application.MessageBox !!! !3d1@n Varios 2 07-03-2005 20:22:20
problema con application.MessageBox ctronx Varios 3 12-01-2005 17:27:44
Ayuda con el Application.MessageBox? danytorres Varios 7 16-07-2003 21:05:32


La franja horaria es GMT +2. Ahora son las 11:27:40.


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