Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

CSplitMX - File Splitting Class for Visual C++

0.00/5 (No votes)
29 Oct 2002 1  
This class splits a source file into many smaller pieces which can be distributed accross the web or on floppy disk.

Introduction

Ok, lets get started. CSplitMX adds file splitting capabilities to any Windows application written in Visual C++. I have always wanted an easy class that allowed me to split files into smaller pieces but only could find either VB sources or none at all. I have then decided to write the class myself. The source is relatively easy to understand even if they are not commented, but anywhere here is the rundown. To use CSplitMX include the two files Split.cpp and Split.h in your project and link split.h to the class/files you want to use the splitting functions in.

Using the code:

CString m_FileName = "My.exe"; // file larger than 720 KB

int cSize = 720000; // 720 KB

CSplitMX MX;
MX.Init(); // this allows the class to reset all its internal attributes

MX.SetFileName(m_FileName); // sets the name of the source file been split

MX.SetSplitSize(cSize); // sets the split size to 720KB

MX.SplitFile(); // this function splits the file

The demo project demonstrates the necessary approach to the class.

Have fun.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here