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

C / C++ / MFC

 
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 
GeneralRe: All member variables contain same value Pin
BuckBrown22-Feb-06 12:59
BuckBrown22-Feb-06 12:59 
Thanks,

Because my file is comma delimited with variable length fields, some with white space in them I used the approach below. Works great!

Buck

CString in_buffer;
char buffer[32];

FILE* infile;
char* config_file = "Config.txt";

infile = fopen(config_file, "r");

int end_of_file = 0;

CInstrument Inst;

// Here is where the input read from the Config.txt file and stored in the respective variables.
while (!end_of_file)
{
fscanf(infile, "%[^,]", &buffer);
in_buffer.Format("%s", &buffer);
Inst.m_Type = in_buffer;

fscanf(infile, "%[,]", &buffer);
fscanf(infile, "%[^,]", &buffer);
in_buffer.Format("%s", &buffer);
Inst.m_Name = in_buffer;

fscanf(infile, "%[,]", &buffer);
fscanf(infile, "%[^,]", &buffer);
in_buffer.Format("%s", &buffer);
Inst.m_GPIB = in_buffer;

fscanf(infile, "%[,]", &buffer);
fscanf(infile, "%[^\n]", &buffer);
in_buffer.Format("%s", &buffer);
Inst.m_Channels = in_buffer;

fscanf(infile, "%[\n]", &buffer);

m_ListInstruments.AddString(Inst.m_Name);

if (feof(infile))
end_of_file = 1;
}



Buck
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 
AnswerRe: LGPL query Pin
Joe Woodbury22-Feb-06 8:26
professionalJoe Woodbury22-Feb-06 8:26 

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.