Solved

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

Posted on 2000-04-02
4
176 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
  • 2
4 Comments
 
LVL 1

Expert Comment

by:ntdragon
Comment Utility
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
Comment Utility
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
Comment Utility
And How to Compress the Resource?
0
 
LVL 22

Expert Comment

by:nietod
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
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.

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now