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

C / C++ / MFC

 
AnswerRe: Browse/Open dialog box Pin
Ravi Bhavnani6-Sep-05 10:38
professionalRavi Bhavnani6-Sep-05 10:38 
AnswerRe: Browse/Open dialog box Pin
David Crow6-Sep-05 17:10
David Crow6-Sep-05 17:10 
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 
RedDragon2k wrote:
ifstream fin(strFilename);

This part should work, but I'm not as familiar with using ifstream as just plain fstream. As an alternative, you could try
<br />
fstream fin;<br />
fin.open(strFilename, ios::in);<br />

But what you have should work. I have two other thoughts:

Is the file referred to by strFilename in the same folder as your program? It's possible that the call ifstream fin(strFilename); is simply not opening the file. If strFilename is a string with the whole path, is the file really there? If strFilename is a string with just the file, is the file in the same directory as the program? Don't forget your error checking!

Second idea, as mentioned in a response earlier, have you tried outputting the buffer at each iteration. If so, is anything being outputted? If not, then the file was probably never opened and fin does not point to a file descripter. Is the contents outputted appropriate? What are the contents of the file? If my previous guesses are incorrect, I guess I'd have to know what the file is.

Hope this helps!

Danny
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 
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 

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.