Solved

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

Posted on 2000-04-02
4
206 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 100 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
C++ assignment question 7 269
Lambda for random numbers problem 7 121
C++ get user from AD  (VS6) 7 97
Eclipse IDE - Cannot copy/paste from console output 8 323
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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

726 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