Click here to Skip to main content
15,920,111 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to detect Internet connection on machine? Pin
David Crow11-Sep-07 4:25
David Crow11-Sep-07 4:25 
AnswerRe: How to detect Internet connection on machine? Pin
bob1697211-Sep-07 2:05
bob1697211-Sep-07 2:05 
AnswerRe: How to detect Internet connection on machine? Pin
bob1697211-Sep-07 2:08
bob1697211-Sep-07 2:08 
AnswerRe: How to detect Internet connection on machine? Pin
David Crow11-Sep-07 3:13
David Crow11-Sep-07 3:13 
Questionmap file with 0 size Pin
Vinod CS10-Sep-07 22:46
Vinod CS10-Sep-07 22:46 
AnswerRe: map file with 0 size Pin
Naveen10-Sep-07 23:13
Naveen10-Sep-07 23:13 
GeneralRe: map file with 0 size Pin
Vinod CS11-Sep-07 17:42
Vinod CS11-Sep-07 17:42 
AnswerRe: map file with 0 size Pin
Sameerkumar Namdeo10-Sep-07 23:30
Sameerkumar Namdeo10-Sep-07 23:30 
From Jeffrey Richter's book ....

If you want to create the file-mapping object so that it reflects the current size of the file, you can pass 0 for both parameters. If you intend only to read from the file or to access the file without changing its size, pass 0 for both parameters. If you intend to append data to the file, you will want to choose a maximum file size that leaves you some breathing room. If the file on disk currently contains 0 bytes, you can't pass two zeros to CreateFileMapping's dwMaximumSizeHigh and dwMaximumSizeLow parameters. Doing so tells the system that you want a file-mapping object with 0 bytes of storage in it. This is an error and CreateFileMapping will return NULL.

Since you are using PAGE_READWRITE in CreateFileMapping....Your intension might be to write something in file whose size you have given to be 0 in CreateFileMapping.

I think you can map (using flag PAGE_READWRITE)file whose size is zero by specifying some number > 0 as dwMaximumSizeLow parameter of CreateFileMapping(). This number will be equal to no.of bytes that you want to write to file. The file will be expanded to that size if its size was initially zero.

bye.


GeneralRe: map file with 0 size [modified] Pin
Vinod CS11-Sep-07 17:44
Vinod CS11-Sep-07 17:44 
QuestionPNG Alpha blending/channel in VC++ 6.0? Pin
StarMeteor10-Sep-07 22:33
StarMeteor10-Sep-07 22:33 
AnswerRe: PNG Alpha blending/channel in VC++ 6.0? Pin
Mark Salsbery11-Sep-07 8:04
Mark Salsbery11-Sep-07 8:04 
GeneralRe: PNG Alpha blending/channel in VC++ 6.0? Pin
StarMeteor11-Sep-07 16:45
StarMeteor11-Sep-07 16:45 
GeneralRe: PNG Alpha blending/channel in VC++ 6.0? Pin
Mark Salsbery12-Sep-07 6:17
Mark Salsbery12-Sep-07 6:17 
GeneralRe: PNG Alpha blending/channel in VC++ 6.0? Pin
StarMeteor12-Sep-07 17:21
StarMeteor12-Sep-07 17:21 
GeneralRe: PNG Alpha blending/channel in VC++ 6.0? Pin
Mark Salsbery13-Sep-07 5:24
Mark Salsbery13-Sep-07 5:24 
Questiondont replace the ok button coding in that ok button e want enter coding Pin
yadahav10-Sep-07 22:02
yadahav10-Sep-07 22:02 
AnswerRe: dont replace the ok button coding in that ok button e want enter coding Pin
Cedric Moonen10-Sep-07 22:27
Cedric Moonen10-Sep-07 22:27 
QuestionStoping thread.... Pin
neha.agarwal2710-Sep-07 22:01
neha.agarwal2710-Sep-07 22:01 
AnswerRe: Stoping thread.... Pin
Cedric Moonen10-Sep-07 22:04
Cedric Moonen10-Sep-07 22:04 
AnswerRe: Stoping thread.... Pin
Sreedhar DV10-Sep-07 22:11
Sreedhar DV10-Sep-07 22:11 
AnswerRe: Stoping thread.... Pin
David Crow11-Sep-07 3:15
David Crow11-Sep-07 3:15 
QuestionHow to create enter botton in mfc? Pin
yadahav10-Sep-07 21:34
yadahav10-Sep-07 21:34 
AnswerRe: How to create enter botton in mfc? Pin
jhwurmbach10-Sep-07 21:45
jhwurmbach10-Sep-07 21:45 
AnswerRe: How to create enter botton in mfc? Pin
Naveen10-Sep-07 21:47
Naveen10-Sep-07 21:47 
AnswerRe: How to create enter botton in mfc? Pin
Hamid_RT11-Sep-07 1:55
Hamid_RT11-Sep-07 1:55 

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.