Solved

Extracting a user defined file from a  resource file

Posted on 1998-12-01
3
128 Views
Last Modified: 2010-04-04
I have compiled a few Text-Based files into a resource file and I would like to be able to save them to file, before executing another windows app to read them and produce the required report. How can I save them to disk ...
0
Comment
Question by:taskforce
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1348742
By code or manually?

Use TFileStream, or AssignFile, ...

Zif.
0
 

Author Comment

by:taskforce
ID: 1348743
The dilema : I have text based files that I want to use at some point. I have compiled these into my EXE file as a resource. I now need to know how to programatically extract these before I can use them. i.e. SaveToFile('TextFile.Txt')
0
 
LVL 3

Accepted Solution

by:
williams2 earned 100 total points
ID: 1348744
Hmm.. Dear TaskForce, you are not good at asking questions. Do you need to save the file from within your application, then the easiest way to do it is like:

var
  SL: TStringList;
Begin
  SL:= TStringList.Create;
  //.. Add some strings ...
  SL.SaveToFile(Filename.TXT);
  SL.free;
End;

or do you want to extract the text from your ressource file? in that case you should use TRessourceStream to first load the .exe file with the .LoadFromFile method, and then identify the ressource type you are looking for.

/Williams
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question