Solved

Extracting a user defined file from a  resource file

Posted on 1998-12-01
3
130 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…

691 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