Click here to Skip to main content
15,917,176 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Using Math constants in vc++ 6 Pin
vikashparida16-May-04 19:46
vikashparida16-May-04 19:46 
Generaladd with carry instruction on Pentium family Pin
the Seeker15-May-04 16:47
the Seeker15-May-04 16:47 
GeneralRe: add with carry instruction on Pentium family Pin
Kamyar Souri15-May-04 21:22
Kamyar Souri15-May-04 21:22 
GeneralRe: add with carry instruction on Pentium family Pin
the Seeker16-May-04 0:33
the Seeker16-May-04 0:33 
GeneralWriteFile help Pin
Ryan McDermott15-May-04 16:30
Ryan McDermott15-May-04 16:30 
GeneralRe: WriteFile help Pin
Michael Dunn15-May-04 17:45
sitebuilderMichael Dunn15-May-04 17:45 
GeneralRe: WriteFile help Pin
Ryan McDermott15-May-04 18:29
Ryan McDermott15-May-04 18:29 
GeneralRe: WriteFile help Pin
Michael Dunn15-May-04 18:38
sitebuilderMichael Dunn15-May-04 18:38 
You're still not passing the right number. Your source buffer is a string, which is 5 bytes long (4 letters plus the terminating 0). You're saying write 10 bytes, which makes WriteFile() read off the end of your string. This may crash, or if not it's writing random bytes to the file. Here's the preferred way:
BOOL bSuccess = WriteFile ( hFile, buffer, strlen(buffer), &byte, NULL );
Notice I'm checking the return value too Wink | ;)

--Mike--
Personal stuff:: Ericahist | Homepage
Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt
CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ

----
Actual sign at the laundromat I go to: "No tinting or dying."
GeneralRe: WriteFile help Pin
Ryan McDermott15-May-04 19:13
Ryan McDermott15-May-04 19:13 
GeneralRe: WriteFile help Pin
Monty215-May-04 20:24
Monty215-May-04 20:24 
GeneralRe: WriteFile help Pin
Garth J Lancaster16-May-04 1:34
professionalGarth J Lancaster16-May-04 1:34 
Generalwoops Pin
Garth J Lancaster16-May-04 1:36
professionalGarth J Lancaster16-May-04 1:36 
GeneralMFC Dependancy written into EXE. Pin
N4X3M15-May-04 15:12
N4X3M15-May-04 15:12 
GeneralRe: MFC Dependancy written into EXE. Pin
TigerNinja_15-May-04 15:21
TigerNinja_15-May-04 15:21 
GeneralRe: MFC Dependancy written into EXE. Pin
N4X3M15-May-04 15:35
N4X3M15-May-04 15:35 
GeneralRe: MFC Dependancy written into EXE. Pin
TigerNinja_16-May-04 15:04
TigerNinja_16-May-04 15:04 
GeneralRe: MFC Dependancy written into EXE. Pin
Michael Dunn15-May-04 16:18
sitebuilderMichael Dunn15-May-04 16:18 
Generalabout using MSChart Pin
yingkou15-May-04 14:42
yingkou15-May-04 14:42 
GeneralGetting a pointer to a context menu Pin
srev15-May-04 13:11
srev15-May-04 13:11 
GeneralRe: Getting a pointer to a context menu Pin
valikac15-May-04 15:27
valikac15-May-04 15:27 
GeneralRe: Getting a pointer to a context menu Pin
srev16-May-04 7:37
srev16-May-04 7:37 
GeneralMapped Network drive (connect to it) Pin
scott987uk15-May-04 12:35
scott987uk15-May-04 12:35 
GeneralRe: Mapped Network drive (connect to it) Pin
valikac15-May-04 15:28
valikac15-May-04 15:28 
GeneralRe: Mapped Network drive (connect to it) Pin
scott987uk15-May-04 15:32
scott987uk15-May-04 15:32 
Generalalphabetize list box at run time Pin
Selevercin15-May-04 12:05
Selevercin15-May-04 12:05 

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.