Click here to Skip to main content
16,011,702 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Browse/Open dialog box Pin
ThatsAlok6-Sep-05 18:59
ThatsAlok6-Sep-05 18:59 
QuestionRead Files Pin
RedDragon2k6-Sep-05 10:11
RedDragon2k6-Sep-05 10:11 
AnswerRe: Read Files Pin
bugDanny6-Sep-05 10:24
bugDanny6-Sep-05 10:24 
GeneralRe: Read Files Pin
RedDragon2k6-Sep-05 11:02
RedDragon2k6-Sep-05 11:02 
GeneralRe: Read Files Pin
Anonymous6-Sep-05 13:54
Anonymous6-Sep-05 13:54 
GeneralRe: Read Files Pin
bugDanny7-Sep-05 8:26
bugDanny7-Sep-05 8:26 
Answer[Message Deleted] Pin
kakan6-Sep-05 20:39
professionalkakan6-Sep-05 20:39 
AnswerRe: Read Files Pin
kakan6-Sep-05 20:40
professionalkakan6-Sep-05 20:40 
Antoher way to do it, "the old fashion way".

bool ReadKonfig()
{
char lineBuf[300];
int i;
FILE * fil;

if((fil = fopen("C:\\TheFile.ini", "rt")) == NULL) {
// Couldn't open the file
return false;
}

// The file is open, read it.
while(fgets(lineBuf, sizeof(lineBuf), fil) != NULL) {
// We have a line

// Remove trailing crlf's.
for(i = strlen(lineBuf) - 1; i >= 0; i--) {
if(lineBuf[i] == '\r' || lineBuf[i] == '\n') lineBuf[i] = '\0';
}

// Ignore comments.
// The line is considdered a comment if the line starts with a ';', '#', space, tab or is empty.
if(lineBuf[0] == ';' || lineBuf[0] == '#' || lineBuf[0] == ' ' || lineBuf[0] == '\t'
|| !strlen(lineBuf)) continue;

// It's a real line, process it.

// ...
}
fclose(fil);
return true;
}

GeneralRe: Read Files Pin
RedDragon2k7-Sep-05 2:49
RedDragon2k7-Sep-05 2:49 
GeneralRe: Read Files Pin
kakan8-Sep-05 0:23
professionalkakan8-Sep-05 0:23 
GeneralRe: Read Files Pin
RedDragon2k8-Sep-05 1:02
RedDragon2k8-Sep-05 1:02 
GeneralRe: Read Files Pin
kakan8-Sep-05 1:44
professionalkakan8-Sep-05 1:44 
QuestionMinimize RAM-usage in MFC? Pin
Gadjuka6-Sep-05 10:06
Gadjuka6-Sep-05 10:06 
AnswerRe: Minimize RAM-usage in MFC? Pin
Blake Miller6-Sep-05 12:30
Blake Miller6-Sep-05 12:30 
GeneralRe: Minimize RAM-usage in MFC? Pin
Gadjuka6-Sep-05 12:46
Gadjuka6-Sep-05 12:46 
AnswerRe: Minimize RAM-usage in MFC? Pin
David Crow6-Sep-05 17:14
David Crow6-Sep-05 17:14 
GeneralRe: Minimize RAM-usage in MFC? Pin
Gadjuka6-Sep-05 23:24
Gadjuka6-Sep-05 23:24 
QuestionHow do I get my IP address ? Pin
Shay Harel6-Sep-05 9:37
Shay Harel6-Sep-05 9:37 
AnswerRe: How do I get my IP address ? Pin
David Crow6-Sep-05 9:50
David Crow6-Sep-05 9:50 
General[Message Deleted] Pin
Shay Harel6-Sep-05 10:35
Shay Harel6-Sep-05 10:35 
GeneralRe: How do I get my IP address ? Pin
Shay Harel6-Sep-05 10:37
Shay Harel6-Sep-05 10:37 
GeneralRe: How do I get my IP address ? Pin
Jörgen Sigvardsson6-Sep-05 11:44
Jörgen Sigvardsson6-Sep-05 11:44 
GeneralRe: How do I get my IP address ? Pin
Shay Harel6-Sep-05 14:19
Shay Harel6-Sep-05 14:19 
AnswerRe: How do I get my IP address ? Pin
ThatsAlok6-Sep-05 19:02
ThatsAlok6-Sep-05 19:02 
GeneralRe: How do I get my IP address ? Pin
David Crow7-Sep-05 2:26
David Crow7-Sep-05 2: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.