Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Otros entornos y lenguajes > C++ Builder
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

 
 
Herramientas Buscar en Tema Desplegado
  #10  
Antiguo 24-02-2024
jesusgandia1966 jesusgandia1966 is offline
Miembro
 
Registrado: mar 2015
Posts: 27
Poder: 0
jesusgandia1966 Va por buen camino
Si me quedó claro, y entendí que al crear el puntero con:
Código PHP:
TResourceStream *Res = new TResourceStream((int)HInstance"C"RT_RCDATA); 
Estoy accediendo a la posición de memoria que solo ocupa el fichero "C" y no a todo el contenido del fichero de RECURSOS. Por tanto mi petición no tenía ninguna lógica.
Es normal crear una instancia para cada fichero contenido en el fichero de recursos y empleando la función sencilla que escribiste a mi entender es la forma correcta.
Código PHP:
void __fastcall SaveResource(String ResNameString FileName)
{
  
TResourceStream *Res = new TResourceStream((int)HInstanceResNameRT_RCDATA);
  
__try{
     
Res->SaveToFile(FileName);
  }
  
__finally{
     
delete Res;
  }

Tal como tu dices, ya vi que en la ayuda del STUDIO 10.3.3 se dice como crear y utilizar el FICHERO DE RECURSOS, la confusion me llego porque del STUDIO 2010 al STUDIO 10.3 ha cambiado su forma.
AYUDA STUDIO 10.3.3:
Código PHP:
/*This example shows how to load the text from a txt file using a resource file. 

To build and test this example: 

Create a Multi-Device Application.
Add the following controls on the form: 
TButton
TLabel
Add the txt file to the project's folder.
Go to Project > Resources and Images... and add the txt file.
Build the project to generate the .rc file that contains the reference to the txt file.
Open the <project_name>_<resources>.rc file where you can see the name of the resource, the type, and the name of the file.
Resource_1 RCDATA "<file_name>.txt"
*/

void __fastcall TForm1::Button1Click(TObject *Sender) {
  
TResourceStream *Stream = new TResourceStream((int)HInstance"<Resource identifier>"RT_RCDATA); //RT_RCDATA is the Resource Type.
  
__try {
    
TStringList *List = new TStringList;
    
__try {
      List->
LoadFromStream(Stream);
      
Label1->Text = List->Text;
    }
    
__finally {
      List->
DisposeOf();
    }
  }
  
__finally {
    
Stream->DisposeOf();
  }


Gracias escafandra...
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 archivo de recursos danielmj Varios 10 28-04-2014 14:40:25
Extraer Archivo de los recursos odiseeus C++ Builder 1 29-10-2013 14:41:53
PNG en archivo de recursos (.res) jandro Varios 10 27-01-2010 20:00:45
Archivo de recursos Esau Varios 3 04-11-2004 10:13:44
Crear un archivo de recursos soul6301 Varios 1 19-08-2004 20:24:07


La franja horaria es GMT +2. Ahora son las 17:06:21.


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