Click here to Skip to main content
15,887,304 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Disable Task Manager from MFC Pin
super22-Feb-06 12:04
professionalsuper22-Feb-06 12:04 
GeneralRe: Disable Task Manager from MFC Pin
JBAK_CP24-Feb-06 12:26
JBAK_CP24-Feb-06 12:26 
QuestionAll member variables contain same value Pin
BuckBrown22-Feb-06 8:44
BuckBrown22-Feb-06 8:44 
AnswerRe: All member variables contain same value Pin
Joe Woodbury22-Feb-06 9:22
professionalJoe Woodbury22-Feb-06 9:22 
GeneralRe: All member variables contain same value Pin
BuckBrown22-Feb-06 10:55
BuckBrown22-Feb-06 10:55 
GeneralRe: All member variables contain same value Pin
Joe Woodbury22-Feb-06 11:00
professionalJoe Woodbury22-Feb-06 11:00 
GeneralRe: All member variables contain same value Pin
BuckBrown22-Feb-06 11:06
BuckBrown22-Feb-06 11:06 
GeneralRe: All member variables contain same value Pin
Joe Woodbury22-Feb-06 11:14
professionalJoe Woodbury22-Feb-06 11:14 
Of immediate concern, and I think the ultimate cause, is that you are using the CString variables directly, without getting the buffers. This is overwriting the null string the CString variables point to by default.

You should do:

fscanf(infile, "%s", Inst.m_Type.GetBuffer(32));<br />
Inst.m_Type.ReleaseBuffer();


This is rather unsafe since it assumes it will read only 32 characters.

With VS 2007, you could do:

fscanf_s(infile, "%s", Inst.m_Type.GetBuffer(32), 32);<br />
Inst.m_Type.ReleaseBuffer();


If you know they are numbers, I'd use ints rather than CStrings and change the fscanf to:

fscanf(infile, "%d", &Inst.m_Type);


Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke


-- modified at 17:14 Wednesday 22nd February, 2006
GeneralRe: All member variables contain same value Pin
BuckBrown22-Feb-06 12:59
BuckBrown22-Feb-06 12:59 
GeneralRe: All member variables contain same value Pin
Blake Miller23-Feb-06 4:53
Blake Miller23-Feb-06 4:53 
AnswerRe: All member variables contain same value Pin
carks22-Feb-06 9:23
carks22-Feb-06 9:23 
GeneralRe: All member variables contain same value Pin
BuckBrown22-Feb-06 11:04
BuckBrown22-Feb-06 11:04 
QuestionRe: All member variables contain same value Pin
David Crow22-Feb-06 9:37
David Crow22-Feb-06 9:37 
AnswerRe: All member variables contain same value Pin
BuckBrown22-Feb-06 11:05
BuckBrown22-Feb-06 11:05 
GeneralRe: All member variables contain same value Pin
David Crow23-Feb-06 2:29
David Crow23-Feb-06 2:29 
Questionlist view / how do i get a list of all selected items? Pin
Sebastian Pipping22-Feb-06 7:09
Sebastian Pipping22-Feb-06 7:09 
AnswerRe: list view / how do i get a list of all selected items? Pin
James R. Twine22-Feb-06 7:27
James R. Twine22-Feb-06 7:27 
GeneralRe: list view / how do i get a list of all selected items? Pin
Sebastian Pipping22-Feb-06 7:57
Sebastian Pipping22-Feb-06 7:57 
AnswerRe: list view / how do i get a list of all selected items? Pin
David Crow22-Feb-06 7:38
David Crow22-Feb-06 7:38 
GeneralRe: list view / how do i get a list of all selected items? Pin
Sebastian Pipping22-Feb-06 8:04
Sebastian Pipping22-Feb-06 8:04 
QuestionAccess to COM methods inside Windows Service ATL Pin
cmacgowan22-Feb-06 6:03
cmacgowan22-Feb-06 6:03 
QuestionLGPL query Pin
Chintoo72322-Feb-06 5:51
Chintoo72322-Feb-06 5:51 
AnswerRe: LGPL query Pin
Chris Losinger22-Feb-06 7:45
professionalChris Losinger22-Feb-06 7:45 
GeneralRe: LGPL query Pin
Chintoo72322-Feb-06 15:21
Chintoo72322-Feb-06 15:21 
GeneralRe: LGPL query Pin
Chris Losinger22-Feb-06 16:01
professionalChris Losinger22-Feb-06 16:01 

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.