Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 09-11-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.331
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
Obtener la descripcion de un package en ejecucion ($D)

Pues eso, estoy liado con un tema de packages (espero compartirlo pronto con vosotros) y se me ha presentado una duda.
En el DPK de un package se puede utilizar la directiva {$D} o {$DESCRIPTION} para especificar una descripción para ese package.

Por ejemplo:

Código:
package PlugBase;

{$R *.res}
{$ALIGN 8}
{$ASSERTIONS ON}
{$BOOLEVAL OFF}
{$DEBUGINFO ON}
{$EXTENDEDSYNTAX ON}
{$IMPORTEDDATA ON}
{$IOCHECKS ON}
{$LOCALSYMBOLS ON}
{$LONGSTRINGS ON}
{$OPENSTRINGS ON}
{$OPTIMIZATION ON}
{$OVERFLOWCHECKS OFF}
{$RANGECHECKS OFF}
{$REFERENCEINFO ON}
{$SAFEDIVIDE OFF}
{$STACKFRAMES OFF}
{$TYPEDADDRESS OFF}
{$VARSTRINGCHECKS ON}
{$WRITEABLECONST OFF}
{$MINENUMSIZE 1}
{$IMAGEBASE $400000}
{$DESCRIPTION 'Objetos estandard'}
{$RUNONLY}
{$IMPLICITBUILD OFF}

requires
rtl,
vcl;
En ejecución voy a cargar ese package dinámicamente y me gustaría obtener esa descripción. Se que se puede (al menos Delphi lo hace) ya que es el texto que se muestra cuando en diseño (en el IDE) se carga un package.
Imagen del IDE.


He buscado, pero hoy estoy un poco/bastante espeso, así que si alguien sabe por donde van los tiros que me "ilumine".

Gracias.
__________________
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
  #2  
Antiguo 09-11-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.331
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
Me contesto yo mismo. Mirando en la ayuda sobre funciones referentes a packages he encontrado esto:


function GetPackageDescription(ModuleName: PChar): string;

==> Returns the description resource from a package.

==> Call GetPackageDescription to obtain the description stored with the named package. If the package does not have a description resource, GetPackageDescription returns an empty string.


No la he probado todavía, pero la descripción parece clara; Cuando la pruebe os digo algo.

P.D: Ya dije que estaba "empanao"...
__________________
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.

Última edición por Neftali [Germán.Estévez] fecha: 09-11-2007 a las 12:41:51.
Responder Con Cita
  #3  
Antiguo 09-11-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.331
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
Efectívamente funciona como se esperaba...

Código:
procedure TForm1.Button4Click(Sender: TObject);
var
  Str: String;
begin
  if OpenDialog1.Execute then begin

    Str := GetPackageDescription(pChar(OpenDialog1.FileName));

    // Algo
    if (Str = '') then begin
      memo1.Lines.Add('Parece que no tienes Descriupcion');
    end
    else begin
      memo1.Lines.Add('Descripcion: '   Str);
    end;
  end;
end;
__________________
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
  #4  
Antiguo 09-11-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.331
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
Gracias a todos por vuestras respuestas.
__________________
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
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
Obtener Componentes de un form en tiempo de ejecucion el-Cubil.com.ar Varios 2 21-10-2005 18:22:11
Obtener el Nombre de un Campo en Tiempo Ejecucion Jvilomar Conexión con bases de datos 2 02-08-2004 23:05:22
Descripción del error Novás Varios 1 23-07-2004 13:18:15
Descripcion Columnas OmarPerez Firebird e Interbase 1 16-04-2004 19:50:13
Descripcion de errores senpiterno Varios 9 13-04-2004 21:40:28


La franja horaria es GMT +2. Ahora son las 18:32:42.


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