Creation of OLE Compound file ?

          I  want  write the VC code which will take a list of files of different types (eg: x.doc, x.bmp,x.ppt) and embedds all the files in to a single file.
 I have few doubts. They are
Can this problem be solved using OLE Compound file ?
Can this problem be solved using RichEdit control?

I have few more doubts.They are

Using  StgCreateDocFile() create Compound file, which returns a IStorage pointer, using this
IStorage pointer can we embedd the files  in to the above created Compund file?

Can we use OleCreateFromFile() ?

Looking for reply....


Who is Participating?
galkinConnect With a Mentor Commented:
// this is code for creating new compound file
// if you want to browse existing compounf file
// use StgOpenStorage instead


LPSTORAGE lpStorage;
                        0, &lpStorage);

if(sc != S_OK)

// you can also created additional storages from root
// storage with with lpStorage->CreateStorage

COleStreamFile stream;

if(!stream.OpenStream(lpStorage, _T("your stream name")))

// you can use stream as CFile derive class or create CArchive
// object tired to this CFile derived object

CArchive ar(&file, CArchive::load | CArchive::bNoFlushOnDelete);

Tommy HuiEngineerCommented:
The answer to your program is a storage file. Each of the files you mentioned can be stored as a stream (IStream) in the storage file. Don't forget that you can use a hierarchy of streams and storages within a storage file as well.
ocxAuthor Commented:
I would like to know at implementaion level.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.