🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9641

Re: CopyFileEx - CopyProgressRoutine - devision by zero

#9641
From: Tommy
Date: Fri, 25 Jun 2004 23:03
47 lines
2997 bytes
Hi bob,

i could find the error yet. i set startime with this code:

GetSystemTimeAsFileTime(&StartTime.ft);


As i said the the time which is already need till the process is finished
works fine. but there is one small thing i do not like. the time differents
fluctuates very much. so my application shows that the process will be ready
in 5 minutes, but one seconds later in takes 5 hours. this depends on if
there are many small files copying at the moment or larger files.

is there perhabs any better way to calculate the time which is still need
without these large time fluctuations. when i copy completly large folder
under windows the information how long the process still needs does not show
such much fluctuations. so there should be a better way.

any ideas?

phil



"Bob Gonder" <notbg@notmindspring.invalid> schrieb im Newsbeitrag
news:ik7nd0tm3ks2oj5g6r0okaarr2g94kk97u@4ax.com...
> Tommy wrote:
>
> >now it works fine. the time which is still need to copy everything looks
> >great. only the time which the process already runs looks not great. it
> >seams as the start of this time is 2 hours. but i cant any error here at
my
> >code.
>
> You don't show how you now set StartTime.
> It's probably wrong.
>
> >   elapsed.i64 = now.i64 - StartTime.i64;
> >   FileTimeToSystemTime(&elapsed.ft, &SystemTime);
> >   pForm->LBisherdauer->Caption = pForm->FormatTime(&SystemTime);
>
> If you are setting it correctly, then set a breakpoint after you set
> StartTime, and another on the first line above.  Check that the value
> subtracted is the same as the value set. If not, then you have a bug
> elsewhere that is changing the value.
>
>
Technical Details
Message-ID: <40dcaf31@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40ce2e93@newsgroups.borland.com> <crtsc0pp05ki34cqsvkgsj721eei6g7obh@4ax.com> <40cef067$1@newsgroups.borland.com> <8hauc01e3dsrlu787m5s8jo10rpu0k3duq@4ax.com> <40d3589b@newsgroups.borland.com> <2bj7d0dc8b89se5ibtdm7nntbvsrga2lrt@4ax.com> <40d8b34c$1@newsgroups.borland.com> <qfojd0dhd57q45be09tt1u8klea9fglliq@4ax.com> <40d9f233@newsgroups.borland.com> <uavjd0lvdhuhdvosclehlarvvfagceecmn@4ax.com> <40db5933@newsgroups.borland.com> <ik7nd0tm3ks2oj5g6r0okaarr2g94kk97u@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9a3709a4832c0e51
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Tommy" <tommyw@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <40ce2e93@newsgroups.borland.com> <crtsc0pp05ki34cqsvkgsj721eei6g7obh@4ax.com> <40cef067$1@newsgroups.borland.com> <8hauc01e3dsrlu787m5s8jo10rpu0k3duq@4ax.com> <40d3589b@newsgroups.borland.com> <2bj7d0dc8b89se5ibtdm7nntbvsrga2lrt@4ax.com> <40d8b34c$1@newsgroups.borland.com> <qfojd0dhd57q45be09tt1u8klea9fglliq@4ax.com> <40d9f233@newsgroups.borland.com> <uavjd0lvdhuhdvosclehlarvvfagceecmn@4ax.com> <40db5933@newsgroups.borland.com> <ik7nd0tm3ks2oj5g6r0okaarr2g94kk97u@4ax.com>
Subject: Re: CopyFileEx - CopyProgressRoutine - devision by zero
Date: Sat, 26 Jun 2004 01:03:02 +0200
Lines: 49
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 84.129.29.209
Message-ID: <40dcaf31@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1088204593 84.129.29.209 (25 Jun 2004 16:03:13 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail