Click here to Skip to main content
16,019,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: stdin always the keyboard ? Pin
Florin Crişan26-Nov-07 21:26
Florin Crişan26-Nov-07 21:26 
Questionfclose(f_ptr2) - "Access Violation or memery can not be read" Pin
mrby12326-Nov-07 6:07
mrby12326-Nov-07 6:07 
AnswerRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
Mark Salsbery26-Nov-07 6:15
Mark Salsbery26-Nov-07 6:15 
GeneralRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
mrby12326-Nov-07 6:32
mrby12326-Nov-07 6:32 
AnswerRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
Luc Pattyn26-Nov-07 6:33
sitebuilderLuc Pattyn26-Nov-07 6:33 
GeneralRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
mrby12326-Nov-07 6:52
mrby12326-Nov-07 6:52 
GeneralRe: fclose(f_ptr2) - "Access Violation or memery can not be read" [modified] Pin
Luc Pattyn26-Nov-07 7:03
sitebuilderLuc Pattyn26-Nov-07 7:03 
GeneralRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
David Crow26-Nov-07 7:22
David Crow26-Nov-07 7:22 
Luc Pattyn wrote:
there is a problem in fileName[i]=FindFileData.cFileName;

this line does NOT copy the filename, it copies the pointer to the cFileName field
in your unique FindFileData struct, hence in all iterations it will point to the
buffer containing the last data written into it.

If you want to hold all the different filenames, you must copy them, which you could
do with strcpy() or strncpy().


Not necessary at all. The statement is correct, since CString has an assignment operator that internally does the copying. fileName[0], fileName[1], fileName[2], etc will each contain different data.


"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman

"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne


GeneralRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
Luc Pattyn26-Nov-07 7:39
sitebuilderLuc Pattyn26-Nov-07 7:39 
QuestionRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
David Crow26-Nov-07 7:18
David Crow26-Nov-07 7:18 
AnswerRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
Luc Pattyn26-Nov-07 7:48
sitebuilderLuc Pattyn26-Nov-07 7:48 
AnswerRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
mrby12326-Nov-07 8:12
mrby12326-Nov-07 8:12 
GeneralRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
David Crow26-Nov-07 10:37
David Crow26-Nov-07 10:37 
GeneralRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
Mark Salsbery26-Nov-07 13:23
Mark Salsbery26-Nov-07 13:23 
GeneralRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
David Crow26-Nov-07 15:46
David Crow26-Nov-07 15:46 
GeneralRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
Sunil Shindekar26-Nov-07 23:47
Sunil Shindekar26-Nov-07 23:47 
GeneralRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
David Crow27-Nov-07 3:46
David Crow27-Nov-07 3:46 
GeneralRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
Sunil Shindekar27-Nov-07 21:06
Sunil Shindekar27-Nov-07 21:06 
QuestionRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
David Crow28-Nov-07 2:32
David Crow28-Nov-07 2:32 
Questionfclose(f_ptr2) - "Access Violation or memery can not be read" Pin
mrby12326-Nov-07 5:59
mrby12326-Nov-07 5:59 
AnswerRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
Mark Salsbery26-Nov-07 6:05
Mark Salsbery26-Nov-07 6:05 
GeneralRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
mrby12326-Nov-07 6:36
mrby12326-Nov-07 6:36 
QuestionRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
David Crow26-Nov-07 7:12
David Crow26-Nov-07 7:12 
AnswerRe: fclose(f_ptr2) - "Access Violation or memery can not be read" Pin
mrby12326-Nov-07 7:30
mrby12326-Nov-07 7:30 
QuestionLooking for a Gantt chart control Pin
Interrobang26-Nov-07 4:44
Interrobang26-Nov-07 4:44 

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.