Click here to Skip to main content
15,867,453 members
Articles / Desktop Programming / MFC
Article

Counting Lines in a MS VC++ 6.0 project

Rate me:
Please Sign up or sign in to vote.
4.33/5 (15 votes)
4 Aug 2001 151.4K   1.9K   33   28
A program that counts the lines (source, comments, blank) in every file included in a MS VC++ 6.0 project

Sample Image - LineCounter.gif

Introduction

Ever wondered how many lines a project you have worked on for a month (or maybe for a year!)? Well, we did this for you :)

This program (LineCounter) was developed with one purpose only: to count your lines!

The program is able to count source code, comments (both styles: "// comment" and "/* comment */"), and blank lines. It shows the results in a couple of editboxes, and has a preview window (right click on the list).

The program opens the project file (.dsp) and throws it through the parsing code. After parsing is done the list of project files is steped-by-step and lines are counted.

That's it! The source code is pretty self explanatory, so I guess you'll manage.

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


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 3 Pin
jyl_hrb17-Apr-11 21:41
jyl_hrb17-Apr-11 21:41 
Questionhow to use the code counter in perl? Pin
moaweah naser17-Jul-07 20:27
moaweah naser17-Jul-07 20:27 
AnswerRe: how to use the code counter in perl? Pin
AS-codeproject14-Aug-07 12:09
AS-codeproject14-Aug-07 12:09 
GeneralSome Modifications I would suggest Pin
Ray Steel13-Oct-04 13:44
Ray Steel13-Oct-04 13:44 
Generalthis is definitely a useful tool, and... Pin
Zhefu Zhang2-Dec-03 8:10
Zhefu Zhang2-Dec-03 8:10 
GeneralRe: this is definitely a useful tool, and... Pin
Anonymous16-Sep-04 22:05
Anonymous16-Sep-04 22:05 
Generalyour program is not counting lines correctly Pin
evilman1-Feb-03 9:33
evilman1-Feb-03 9:33 
Questionwhy? Pin
Ivan Tsygulev24-Dec-02 23:24
Ivan Tsygulev24-Dec-02 23:24 
GeneralMmmmh... Pin
Rage26-Nov-02 4:45
professionalRage26-Nov-02 4:45 
Questiondoes anyone really need this? Pin
mystro_AKA_kokie19-May-02 9:03
mystro_AKA_kokie19-May-02 9:03 
AnswerRe: does anyone really need this? Pin
20-May-02 9:27
suss20-May-02 9:27 
GeneralRe: does anyone really need this? Pin
PerFnurt6-Feb-04 15:24
PerFnurt6-Feb-04 15:24 
Interesting, since my experience is that its the figuring out what code to type, rather than the amount typed that has an impact on the project's budget.

But then, what do I know....Im just a programmer....
AnswerRe: does anyone really need this? Pin
28-May-02 13:45
suss28-May-02 13:45 
AnswerRe: does anyone really need this? Pin
Nelno18-Dec-02 15:27
Nelno18-Dec-02 15:27 
GeneralRe: does anyone really need this? Pin
Dimitris Vasiliadis19-Mar-03 8:40
Dimitris Vasiliadis19-Mar-03 8:40 
GeneralIt is not bad, Indeed it is much useful than that upstair guy whose article is 3- pt Pin
Zhefu Zhang11-Nov-03 11:11
Zhefu Zhang11-Nov-03 11:11 
GeneralHmm, .dsw Pin
12-Dec-01 3:19
suss12-Dec-01 3:19 
GeneralGood work Pin
KingsGambit8-Aug-01 23:09
KingsGambit8-Aug-01 23:09 
QuestionAnd those constructions? Pin
6-Aug-01 11:19
suss6-Aug-01 11:19 
GeneralTeacher caught me using Java... Pin
Stephen Kellett6-Aug-01 11:01
Stephen Kellett6-Aug-01 11:01 
GeneralRe: Teacher caught me using Java... Pin
6-Aug-01 11:20
suss6-Aug-01 11:20 
GeneralRe: Teacher caught me using Java... Pin
Paul Evans25-Mar-03 5:41
Paul Evans25-Mar-03 5:41 
QuestionIt's a dupe? Pin
George5-Aug-01 16:46
George5-Aug-01 16:46 
AnswerRe: It's a dupe? Pin
5-Aug-01 21:25
suss5-Aug-01 21:25 
GeneralRe: It's a dupe? Pin
Brian V Shifrin6-Aug-01 12:06
Brian V Shifrin6-Aug-01 12:06 

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.