Click here to Skip to main content
12,952,443 members (41,066 online)
Click here to Skip to main content
Add your own
alternative version


13 bookmarked
Posted 29 Oct 2002

CSplitMX - File Splitting Class for Visual C++

, 29 Oct 2002 CPOL
Rate this:
Please Sign up or sign in to vote.
This class splits a source file into many smaller pieces which can be distributed accross the web or on floppy disk.


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.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Sydea Studios Antigua
Antigua and Barbuda Antigua and Barbuda
I am in the process of obtaining a bachelors degree in Computer Engineering. My interests are pattern recognition, biometrics, cryptography especially steganography. I enjoy writing.....

You may also be interested in...

Comments and Discussions

GeneralDelimited file Pin
Oriocat19-Jul-04 9:39
memberOriocat19-Jul-04 9:39 
GeneralRe: Delimited file Pin
Pyatex21-Sep-04 3:28
memberPyatex21-Sep-04 3:28 
Generalthanks for the code Pin
NGS 54967231-Oct-02 5:30
sussNGS 54967231-Oct-02 5:30 
GeneralRe: thanks for the code Pin
Eugene Polonsky31-Oct-02 7:12
memberEugene Polonsky31-Oct-02 7:12 
GeneralRemark Pin
Geert Delmeiren31-Oct-02 3:10
sussGeert Delmeiren31-Oct-02 3:10 
Generalplease remove MFC dependencies Pin
Eugene Polonsky30-Oct-02 9:33
memberEugene Polonsky30-Oct-02 9:33 
GeneralRe: please remove MFC dependencies Pin
Pyatex31-Oct-02 6:56
memberPyatex31-Oct-02 6:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170525.1 | Last Updated 30 Oct 2002
Article Copyright 2002 by Pyatex
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid