Click here to Skip to main content
15,905,233 members
Articles / Desktop Programming / MFC
Article

CSplitMX - File Splitting Class for Visual C++

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
29 Oct 2002CPOL 60.2K   1.2K   12   7
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
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.....

Comments and Discussions

 
GeneralDelimited file Pin
Oriocat19-Jul-04 9:39
Oriocat19-Jul-04 9:39 
GeneralRe: Delimited file Pin
Pyatex21-Sep-04 3:28
Pyatex21-Sep-04 3:28 
Generalthanks for the code Pin
NGS 54967231-Oct-02 5:30
NGS 54967231-Oct-02 5:30 
GeneralRe: thanks for the code Pin
Eugene Polonsky31-Oct-02 7:12
Eugene Polonsky31-Oct-02 7:12 
NGS: In a sense, I agree with you. But I think it's important to differentiate between constructive criticism and destructive criticism -- and I've seen a lot of the latter around here.

The goal of this site, imho, is to motivate developers to turn in the best code they possibly can, and, in return, receive equally thought out code made by others. This is what the rating system on the site is for -- well thought out, helpful articles get high ratings, poorly thought out or trivial ones get low ratings.

Besides, as someone who looks through this site daily to find code I might use, I find critical comments of others very helpful in my decisions which articles to download and look through, and which ones to leave alone. I think you'll agree there's a lot of unusable garbage on here... even if the intention of those who submitted it were good.

----------------------------------------
----I said my name wasn't important
---------------------------SlartiBartFast
GeneralRemark Pin
Geert Delmeiren31-Oct-02 3:10
Geert Delmeiren31-Oct-02 3:10 
Generalplease remove MFC dependencies Pin
Eugene Polonsky30-Oct-02 9:33
Eugene Polonsky30-Oct-02 9:33 
GeneralRe: please remove MFC dependencies Pin
Pyatex31-Oct-02 6:56
Pyatex31-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.