No, I don't know ahead of time.
But I've had some success... this seems to work for my test file, should it hold up 
for other files?  I'm guessing that I had to add 2 to each line for a carriage return 
+ line feed.

CStdioFile stdioFile;
double dReadLen = 0;
CString inStr;
// open file here... (not shown)
double dFileLen = stdioFile.GetLength();

while (stdioFile.ReadString(inStr))
{
    // add 2 for carriage return + line feed??
    dLenRead += inStr.GetLength() + 2;
    double dPercent = (100*dReadLen)/dFileLen;
}


> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Paul Grenyer
> Sent: Wednesday, September 29, 2004 3:33 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [msvc] percent read
> 
> 
> Hi
> 
> > Visual C++ 6.0
> >
> > If I have a large CStdioFile that I am reading, line by line, with
> CStdioFile::ReadString, what's a
> > quick way to know how much percent complete I am in the 
> read operation?
> This is for a
> > CProgressCtrl so approximate is ok.
> 
> Do you know how many lines you're reading upfront?
> 
> Regards
> Paul
> 
> Paul Grenyer
> email: [EMAIL PROTECTED]
> web: http://www.paulgrenyer.co.uk
> 
> PG: Contains mild violence and peril.
> 
> 
> _______________________________________________
> msvc mailing list
> [EMAIL PROTECTED]
> See 
> http://beginthread.com/mailman/listinfo/msvc_beginthread.com 
> for subscription changes, and list archive.
> 

_______________________________________________
msvc mailing list
[EMAIL PROTECTED]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription 
changes, and list archive.

Reply via email to