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 ResName, String FileName)
{
TResourceStream *Res = new TResourceStream((int)HInstance, ResName, RT_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...