Solved

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

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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

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