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

C / C++ / MFC

 
AnswerRe: bugs when type-casting a float to double Pin
cmk31-Aug-05 5:22
cmk31-Aug-05 5:22 
QuestionWhat can I do if I want the CEdit box only receive the numbers? Pin
pantao55130-Aug-05 18:02
pantao55130-Aug-05 18:02 
AnswerRe: What can I do if I want the CEdit box only receive the numbers? Pin
Barm30-Aug-05 18:14
Barm30-Aug-05 18:14 
GeneralRe: What can I do if I want the CEdit box only receive the numbers? Pin
pantao55130-Aug-05 19:36
pantao55130-Aug-05 19:36 
Questionhow to delete say some 50 bytes from the begning of the file Pin
pradish30-Aug-05 17:32
pradish30-Aug-05 17:32 
AnswerRe: how to delete say some 50 bytes from the begning of the file Pin
Christian Graus30-Aug-05 17:41
protectorChristian Graus30-Aug-05 17:41 
AnswerRe: how to delete say some 50 bytes from the begning of the file Pin
Garth J Lancaster30-Aug-05 18:36
professionalGarth J Lancaster30-Aug-05 18:36 
AnswerRe: how to delete say some 50 bytes from the begning of the file Pin
John R. Shaw30-Aug-05 21:05
John R. Shaw30-Aug-05 21:05 
They're both right (accept Christian ment bytes not bits).

Here's a couple of old fashion ways (still apply):

// Slow
1) Read byte 50+i. // where i starts at 0.
2) Copy byte 50+i to byte i.
3) Repeat 1 and 2, util you reach the end of the file.
4) Set file size to the original size - 50.

// Faster
1) Open a temporary file.
2) Copy all the bytes, starting at byte 50, from original file to the temporary file.
3) Delete the original file.
4) Rename the temporary file to the origninal files name.

// THIS FITS BETTER (given enough memory)
1) Read the entire (original) file into memory.
2) Copy the data back to the file starting with byte 50.
(no memcpy or memmove required).
3) Set file size to the original size - 50.

Use your imagination, there are other ways. Even if there was a function call to do this for you, it would still do it the same way.

INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
Questionerror C2227 Pin
Member 216100430-Aug-05 16:59
Member 216100430-Aug-05 16:59 
AnswerRe: error C2227 Pin
Christian Graus30-Aug-05 17:10
protectorChristian Graus30-Aug-05 17:10 
GeneralRe: error C2227 Pin
Member 216100430-Aug-05 17:30
Member 216100430-Aug-05 17:30 
GeneralRe: error C2227 Pin
Christian Graus30-Aug-05 17:39
protectorChristian Graus30-Aug-05 17:39 
GeneralRe: error C2227 Pin
30-Aug-05 17:58
suss30-Aug-05 17:58 
GeneralRe: error C2227 Pin
Christian Graus30-Aug-05 18:15
protectorChristian Graus30-Aug-05 18:15 
GeneralRe: error C2227 Pin
Member 216100430-Aug-05 19:48
Member 216100430-Aug-05 19:48 
GeneralRe: error C2227 Pin
Christian Graus1-Sep-05 12:26
protectorChristian Graus1-Sep-05 12:26 
AnswerRe: error C2227 Pin
kakan30-Aug-05 19:10
professionalkakan30-Aug-05 19:10 
General[Msg Deleted] Pin
sunit530-Aug-05 22:17
sunit530-Aug-05 22:17 
GeneralRe: error C2227 Pin
sunit530-Aug-05 22:20
sunit530-Aug-05 22:20 
AnswerRe: error C2227 Pin
ThatsAlok30-Aug-05 20:54
ThatsAlok30-Aug-05 20:54 
QuestionTab view like visual.net Pin
zhangwm30-Aug-05 16:21
zhangwm30-Aug-05 16:21 
AnswerRe: Tab view like visual.net Pin
Christian Graus30-Aug-05 16:29
protectorChristian Graus30-Aug-05 16:29 
GeneralRe: Tab view like visual.net Pin
zhangwm30-Aug-05 17:07
zhangwm30-Aug-05 17:07 
GeneralRe: Tab view like visual.net Pin
Christian Graus30-Aug-05 17:09
protectorChristian Graus30-Aug-05 17:09 
QuestionWriting to an html file with character set euc-jp Pin
babyspidy30-Aug-05 16:19
babyspidy30-Aug-05 16:19 

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.