Click here to Skip to main content
13,049,814 members (78,092 online)

C / C++ / MFC

 
AnswerRe: How to get detail error info from E_FAIL? Pin
Argonia14-Jan-13 2:01
memberArgonia14-Jan-13 2:01 
QuestionVideo Capture using DirectShow only works for first time.? Pin
mbatra3110-Jan-13 20:25
membermbatra3110-Jan-13 20:25 
AnswerRe: Video Capture using DirectShow only works for first time.? Pin
_AnsHUMAN_ 11-Jan-13 2:05
group_AnsHUMAN_ 11-Jan-13 2:05 
AnswerRe: Video Capture using DirectShow only works for first time.? Pin
Vaclav_Sal14-Jan-13 16:10
memberVaclav_Sal14-Jan-13 16:10 
Questionhow to unsigned int64 to two unsigned int32 values Pin
vishalgpt9-Jan-13 22:22
membervishalgpt9-Jan-13 22:22 
AnswerRe: how to unsigned int64 to two unsigned int32 values Pin
Jochen Arndt9-Jan-13 23:06
memberJochen Arndt9-Jan-13 23:06 
GeneralRe: how to unsigned int64 to two unsigned int32 values Pin
vishalgpt9-Jan-13 23:32
membervishalgpt9-Jan-13 23:32 
GeneralRe: how to unsigned int64 to two unsigned int32 values Pin
Jochen Arndt9-Jan-13 23:58
memberJochen Arndt9-Jan-13 23:58 
GeneralRe: how to unsigned int64 to two unsigned int32 values Pin
vishalgpt10-Jan-13 0:08
membervishalgpt10-Jan-13 0:08 
AnswerRe: [SOLVED] how to unsigned int64 to two unsigned int32 values Pin
«_Superman_»10-Jan-13 18:39
member«_Superman_»10-Jan-13 18:39 
GeneralRe: [SOLVED] how to unsigned int64 to two unsigned int32 values Pin
vishalgpt14-Jan-13 15:25
membervishalgpt14-Jan-13 15:25 
GeneralRe: [SOLVED] how to unsigned int64 to two unsigned int32 values Pin
«_Superman_»14-Jan-13 17:55
member«_Superman_»14-Jan-13 17:55 
GeneralRe: [SOLVED] how to unsigned int64 to two unsigned int32 values Pin
vishalgpt14-Jan-13 19:01
membervishalgpt14-Jan-13 19:01 
QuestionHow do you get the file size for an open file? Pin
Member 41945938-Jan-13 3:29
memberMember 41945938-Jan-13 3:29 
I have the following code:

    FILE *fp = stdin;
 
    if ((fp = fopen(argv[optind], "rb")) == NULL) {
         printf("Cannot open file %s\n", argv[optind]);
         return 2;
    }


It executes correctly and the correct file is accessed.

I added the following to get the file size:

SizeLow = GetFileSize(_fileno(fp), & SizeHigh);
if ((SizeLow == 0xFFFFFFFF) && ((Error = GetLastError()) != NO_ERROR)) {
     printf("Cannot read file size for %s, error %d\n", argv[optind], Error);
     help();
     return 2;
}
if (binary && (SizeHigh > 0x70000000)) {
    printf("File too big for Binary Mode\n");
    help();
    return 2;
}
__asm {
          mov   eax,SizeLow
          mov   edx,SizeHigh
          cmp   binary,TRUE
          jnz   Bytes
          shld  edx,eax,3
          shl   eax,3
      Bytes:
          mov   DWORD PTR totalc,eax
          mov   DWORD PTR totalc+4,edx
      }


When I execute I get the following:

ent.exe f:\tst1.tst  >ent1.txt
Cannot read file size for f:\tst1.tst, error 6


What am I doing wrong with the the GetFileSize call?

In case you are wondering, this is a modification to John Walker's ENT to speed up execution for huge files.

Dave.
AnswerRe: How do you get the file size for an open file? Pin
Jochen Arndt8-Jan-13 4:14
memberJochen Arndt8-Jan-13 4:14 
GeneralRe: How do you get the file size for an open file? Pin
Member 41945938-Jan-13 10:27
memberMember 41945938-Jan-13 10:27 
GeneralRe: How do you get the file size for an open file? Pin
Member 41945938-Jan-13 12:24
memberMember 41945938-Jan-13 12:24 
QuestionWhile launching a winapp as ole server some time OnFIleNew() failed Pin
vermaashish_mca8-Jan-13 1:36
membervermaashish_mca8-Jan-13 1:36 
AnswerRe: While launching a winapp as ole server some time OnFIleNew() failed Pin
Jochen Arndt8-Jan-13 2:51
memberJochen Arndt8-Jan-13 2:51 
GeneralTreeview After Select Event Pin
Varun Pandey7-Jan-13 2:49
memberVarun Pandey7-Jan-13 2:49 
GeneralRe: Treeview After Select Event Pin
jeron17-Jan-13 5:08
memberjeron17-Jan-13 5:08 
QuestionIt's too slow to use the DrawDibDraw to draw a frame. Pin
yu-jian4-Jan-13 3:31
groupyu-jian4-Jan-13 3:31 
Questionwriting a plug in for internet browsers Pin
muharrem2-Jan-13 1:28
membermuharrem2-Jan-13 1:28 
AnswerRe: writing a plug in for internet browsers Pin
Richard MacCutchan2-Jan-13 1:33
mvpRichard MacCutchan2-Jan-13 1:33 
GeneralRe: writing a plug in for internet browsers Pin
muharrem2-Jan-13 2:07
membermuharrem2-Jan-13 2:07 
GeneralRe: writing a plug in for internet browsers Pin
Richard MacCutchan2-Jan-13 4:20
mvpRichard MacCutchan2-Jan-13 4:20 
QuestionEmpty String Pin
john563230-Dec-12 20:27
memberjohn563230-Dec-12 20:27 
AnswerRe: Empty String Pin
Richard MacCutchan30-Dec-12 22:22
mvpRichard MacCutchan30-Dec-12 22:22 
AnswerRe: Empty String Pin
Chris Meech31-Dec-12 1:57
memberChris Meech31-Dec-12 1:57 
AnswerRe: Empty String Pin
DavidCrow31-Dec-12 5:25
memberDavidCrow31-Dec-12 5:25 
AnswerRe: Empty String Pin
manem21k2-Jan-13 1:26
membermanem21k2-Jan-13 1:26 
GeneralRe: Empty String Pin
jeron12-Jan-13 4:21
memberjeron12-Jan-13 4:21 
GeneralRe: Empty String Pin
manem21k2-Jan-13 22:32
membermanem21k2-Jan-13 22:32 
QuestionRe: Empty String Pin
CPallini2-Jan-13 10:09
mvpCPallini2-Jan-13 10:09 
QuestionCMFCPropertyGridProperty - Protected methods don't get called Pin
Simon Langdon10-Dec-12 1:08
memberSimon Langdon10-Dec-12 1:08 
Questionhow to find out the codes who eat up my memory? Pin
Falconapollo7-Dec-12 2:32
memberFalconapollo7-Dec-12 2:32 
AnswerRe: how to find out the codes who eat up my memory? Pin
Richard MacCutchan7-Dec-12 2:54
mvpRichard MacCutchan7-Dec-12 2:54 
QuestionRe: how to find out the codes who eat up my memory? Pin
DavidCrow7-Dec-12 2:55
memberDavidCrow7-Dec-12 2:55 
AnswerRe: how to find out the codes who eat up my memory? Pin
Falconapollo7-Dec-12 3:11
memberFalconapollo7-Dec-12 3:11 
QuestionRe: how to find out the codes who eat up my memory? Pin
DavidCrow7-Dec-12 3:25
memberDavidCrow7-Dec-12 3:25 
AnswerRe: how to find out the codes who eat up my memory? Pin
Falconapollo7-Dec-12 3:28
memberFalconapollo7-Dec-12 3:28 
AnswerRe: how to find out the codes who eat up my memory? Pin
Joe Woodbury7-Dec-12 8:30
memberJoe Woodbury7-Dec-12 8:30 
AnswerRe: how to find out the codes who eat up my memory? Pin
vr9999999998-Dec-12 1:25
membervr9999999998-Dec-12 1:25 
AnswerRe: how to find out the codes who eat up my memory? Pin
PecuniousPete11-Dec-12 20:42
memberPecuniousPete11-Dec-12 20:42 
QuestionCComboBox for lots and lots of options Pin
Mattias G4-Dec-12 3:09
memberMattias G4-Dec-12 3:09 
AnswerRe: CComboBox for lots and lots of options Pin
Richard MacCutchan4-Dec-12 4:40
mvpRichard MacCutchan4-Dec-12 4:40 
GeneralRe: CComboBox for lots and lots of options Pin
Mattias G4-Dec-12 9:56
memberMattias G4-Dec-12 9:56 
GeneralRe: CComboBox for lots and lots of options Pin
Richard MacCutchan4-Dec-12 21:15
mvpRichard MacCutchan4-Dec-12 21:15 
GeneralRe: CComboBox for lots and lots of options Pin
Rolf Kristensen5-Dec-12 7:13
memberRolf Kristensen5-Dec-12 7:13 
QuestionHow To Use Macro In dsp file(VC6.0 *.dsp file) Pin
yingkou27-Nov-12 14:59
memberyingkou27-Nov-12 14:59 

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.


Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 25 Jul 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid