Click here to Skip to main content
15,895,370 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WM_PAINT and WM_ERASEBKGND Pin
Member 16192558-Mar-10 20:40
Member 16192558-Mar-10 20:40 
GeneralRe: WM_PAINT and WM_ERASEBKGND Pin
Nishad S8-Mar-10 22:02
Nishad S8-Mar-10 22:02 
QuestionAny way to start an application at bootup? Pin
ShaluMalu29-Jan-07 19:37
ShaluMalu29-Jan-07 19:37 
AnswerRe: Any way to start an application at bootup? Pin
Naveen29-Jan-07 20:34
Naveen29-Jan-07 20:34 
AnswerRe: Any way to start an application at bootup? Pin
Roger Stoltz29-Jan-07 21:43
Roger Stoltz29-Jan-07 21:43 
AnswerRe: Any way to start an application at bootup? Pin
James R. Twine30-Jan-07 1:23
James R. Twine30-Jan-07 1:23 
QuestionProblem with WriteFile Pin
amitmistry_petlad 29-Jan-07 19:14
amitmistry_petlad 29-Jan-07 19:14 
AnswerRe: Problem with WriteFile Pin
Stephen Hewitt29-Jan-07 19:34
Stephen Hewitt29-Jan-07 19:34 
Change this:
bool hResult=WriteFile(hFile,&startstring,(amit+1)*sizeof(string),&iBytesWritten,NULL);
to this:
bool hResult = WriteFile(hFile, startstring.c_str(), startstring.length(), &iBytesWritten, NULL);

There are other problems. For example, why use a BYTE below?
BYTE amit =startstring.length();
std::string::size_type is the correct type to use here.

On a last note, why use WriteFile at all? Use std::ofstream instead. Avoid needlessly mixing the low-level (WriteFile) with the high-level (std::string).


Steve

GeneralRe: Problem with WriteFile Pin
amitmistry_petlad 29-Jan-07 22:09
amitmistry_petlad 29-Jan-07 22:09 
GeneralRe: Problem with WriteFile Pin
David Crow30-Jan-07 2:30
David Crow30-Jan-07 2:30 
GeneralRe: Problem with WriteFile Pin
amitmistry_petlad 30-Jan-07 2:35
amitmistry_petlad 30-Jan-07 2:35 
QuestionRe: Problem with WriteFile Pin
David Crow30-Jan-07 2:43
David Crow30-Jan-07 2:43 
AnswerRe: Problem with WriteFile Pin
amitmistry_petlad 30-Jan-07 3:11
amitmistry_petlad 30-Jan-07 3:11 
GeneralRe: Problem with WriteFile Pin
David Crow30-Jan-07 3:29
David Crow30-Jan-07 3:29 
GeneralRe: Problem with WriteFile Pin
Stephen Hewitt30-Jan-07 11:34
Stephen Hewitt30-Jan-07 11:34 
GeneralRe: Problem with WriteFile Pin
amitmistry_petlad 30-Jan-07 16:47
amitmistry_petlad 30-Jan-07 16:47 
GeneralRe: Problem with WriteFile Pin
Stephen Hewitt30-Jan-07 16:54
Stephen Hewitt30-Jan-07 16:54 
GeneralRe: Problem with WriteFile Pin
amitmistry_petlad 30-Jan-07 18:00
amitmistry_petlad 30-Jan-07 18:00 
GeneralRe: Problem with WriteFile Pin
Stephen Hewitt30-Jan-07 18:07
Stephen Hewitt30-Jan-07 18:07 
GeneralRe: Problem with WriteFile Pin
amitmistry_petlad 30-Jan-07 18:58
amitmistry_petlad 30-Jan-07 18:58 
GeneralRe: Problem with WriteFile Pin
Stephen Hewitt30-Jan-07 19:24
Stephen Hewitt30-Jan-07 19:24 
GeneralRe: Problem with WriteFile Pin
amitmistry_petlad 30-Jan-07 19:47
amitmistry_petlad 30-Jan-07 19:47 
Questionfatal error C1001: INTERNAL COMPILER ERROR Pin
devvvy29-Jan-07 15:31
devvvy29-Jan-07 15:31 
AnswerRe: fatal error C1001: INTERNAL COMPILER ERROR Pin
Michael Dunn29-Jan-07 15:41
sitebuilderMichael Dunn29-Jan-07 15:41 
AnswerRe: fatal error C1001: INTERNAL COMPILER ERROR Pin
Stephen Hewitt29-Jan-07 16:16
Stephen Hewitt29-Jan-07 16:16 

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.