Click here to Skip to main content
15,921,716 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: I guess not Pin
Paolo Messina14-Nov-01 7:12
professionalPaolo Messina14-Nov-01 7:12 
AnswerRe: Is it possible to change style only of some region in dialog? Pin
Nish Nishant14-Nov-01 16:56
sitebuilderNish Nishant14-Nov-01 16:56 
GeneralRe: Is it possible to change style only of some region in dialog? Pin
14-Nov-01 22:24
suss14-Nov-01 22:24 
GeneralToolbar alignment ! Pin
Hadi Rezaee14-Nov-01 5:05
Hadi Rezaee14-Nov-01 5:05 
GeneralOPEN DIALOG BOX Pin
14-Nov-01 4:22
suss14-Nov-01 4:22 
GeneralRe: OPEN DIALOG BOX Pin
Roger Allen14-Nov-01 6:32
Roger Allen14-Nov-01 6:32 
GeneralRe: OPEN DIALOG BOX Pin
14-Nov-01 7:14
suss14-Nov-01 7:14 
Generalfread size problems Pin
Aviv Halperin14-Nov-01 3:22
Aviv Halperin14-Nov-01 3:22 
I wanted to get a checksum of a file.
when I wrote the following function with "#define READ_BUFFER_SIZE 1024"
It didn't get the right checksum for very big files.
I changed it to "#define READ_BUFFER_SIZE 2048"
and it worked!
can anyone please explane the reason for it?
then you.
Aviv.

BOOL FileCheckSum(CString FileName, unsigned long *Sum/*UINT32 * Sum*/)
{
#define READ_BUFFER_SIZE 2048//1024

FILE *fp;
char DataBuffer[READ_BUFFER_SIZE];
INT32 length;

fp=fopen(FileName,"r");
if(fp==NULL)
return FALSE;

*Sum=0;

while(!feof(fp))
{
/* Reset the data buffer before reading */
for(int i=0;i<read_buffer_size;i++)
databuffer[i]="0;

" length="fread(DataBuffer,1,READ_BUFFER_SIZE,fp);
" while="" (length="">0)
{
if(DataBuffer[length]=='\n')
*Sum += '\r'; //need to add CR to count for every LF since MC does it
*Sum += DataBuffer[--length];
}
}

/* Add 1 to the calculated CheckSum (agreed with the BMDS) */
*Sum += 1;
fclose(fp);
return TRUE;

#undef READ_BUFFER_SIZE
}

avivhal
Generalfread size problems Pin
Aviv Halperin14-Nov-01 3:10
Aviv Halperin14-Nov-01 3:10 
GeneralRe: fread size problems Pin
Aviv Halperin14-Nov-01 3:18
Aviv Halperin14-Nov-01 3:18 
GeneralMulti-language application with resource DLL Pin
14-Nov-01 3:08
suss14-Nov-01 3:08 
Generalgetstyle Pin
confalonieri14-Nov-01 1:33
confalonieri14-Nov-01 1:33 
GeneralMulti Line List View Pin
13-Nov-01 23:23
suss13-Nov-01 23:23 
GeneralRe: Multi Line List View Pin
Nish Nishant13-Nov-01 23:58
sitebuilderNish Nishant13-Nov-01 23:58 
GeneralGrabbing contents of whole large window Pin
13-Nov-01 22:40
suss13-Nov-01 22:40 
GeneralRe: Grabbing contents of whole large window Pin
Nish Nishant13-Nov-01 23:01
sitebuilderNish Nishant13-Nov-01 23:01 
GeneralSmall and very simple thing Pin
mimi13-Nov-01 21:17
mimi13-Nov-01 21:17 
GeneralRe: Small and very simple thing Pin
Nish Nishant13-Nov-01 21:43
sitebuilderNish Nishant13-Nov-01 21:43 
GeneralRe: Small and very simple thing Pin
Michael P Butler13-Nov-01 22:17
Michael P Butler13-Nov-01 22:17 
GeneralRe: Small and very simple thing Pin
Nish Nishant13-Nov-01 22:37
sitebuilderNish Nishant13-Nov-01 22:37 
GeneralWell. Can't you help me ? Pin
mimi13-Nov-01 23:11
mimi13-Nov-01 23:11 
GeneralRe: Well. Can't you help me ? Pin
Rick York14-Nov-01 15:06
mveRick York14-Nov-01 15:06 
GeneralYou are Great , Rick !!! Manny thanks !!! Pin
mimi21-Nov-01 9:07
mimi21-Nov-01 9:07 
GeneralRe: Small and very simple thing Pin
Christian Graus14-Nov-01 14:52
protectorChristian Graus14-Nov-01 14:52 
GeneralRe: Small and very simple thing Pin
Nish Nishant14-Nov-01 16:25
sitebuilderNish Nishant14-Nov-01 16:25 

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.