Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to add a independent file into a App file by VC++?

Posted on 2000-04-02
4
Medium Priority
?
216 Views
Last Modified: 2010-04-02
How to add a independent file into a App file by VC++?
And the independent file will be copied or extracted from the App, when  necessary. I need a full source VC++ examles. Thanks.
0
Comment
Question by:xiaoma
[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
  • 2
4 Comments
 
LVL 1

Expert Comment

by:ntdragon
ID: 2677454
i don't understand what you exectlly want so explaine it

i won't write your prog for you i"ll just help you

if you want to work with files try the fstream class
0
 
LVL 22

Accepted Solution

by:
nietod earned 300 total points
ID: 2677481
You can include the file your program's resources as a binary (user-defined) resource.  For example, in the .RC file place a line like

DataName DataType C:\somefile.txt

where DataName is the name (or number) you want to use to identify the resource and DataType is the name (or number) of the data type you want to clasify the resource as.

Then in your program you can use FindResource() to find the resournce, use LoadResource to load it, use GlobalLock() to get a pointer to it, then write the file information to a file (using an fstream object or using the windows WriteFile() API)

Let me know if you have any questions.
0
 

Author Comment

by:xiaoma
ID: 2695731
And How to Compress the Resource?
0
 
LVL 22

Expert Comment

by:nietod
ID: 2695934
You can compress the data before adding it to the reasource file and then uncompress it after you load it to memory.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

604 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