file list in mfc
-
how can I iterate file pointer within a file consisting list of file. that is, when ever it iterates i get next list file using vc++(mfc) kamalesh
-
how can I iterate file pointer within a file consisting list of file. that is, when ever it iterates i get next list file using vc++(mfc) kamalesh
-
how can I iterate file pointer within a file consisting list of file. that is, when ever it iterates i get next list file using vc++(mfc) kamalesh
As far as I can understand this,You have a file with some file name's stored in it.SO you want to move to the next record(filename) in your file when user takes /performs some action and show the text/name of the file. Am I right? If yes, you can go ahead with this method : 1) Open the file. 2) Read the first element. (eg. Do this in while loop) 3) Prompt the user if he want to see the next name. 4) A)yes . show the next entry in the file B)No . Break out of the loop. You can use fread for reading the elements in the file. Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_ -- modified at 6:53 Friday 23rd June, 2006
-
how can I iterate file pointer within a file consisting list of file. that is, when ever it iterates i get next list file using vc++(mfc) kamalesh
kamalesh82 wrote:
how can I iterate file pointer within a file consisting list of file.
That really depends on how you are reading the file. Any read operation on a file will advance the file pointer automatically. You can also do it programmatically via
fseek()
,SetFilePointer()
, orCFile::Seek()
.kamalesh82 wrote:
that is, when ever it iterates i get next list file using vc++(mfc)
Are you using the
CFileFind
?
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
-
how can I iterate file pointer within a file consisting list of file. that is, when ever it iterates i get next list file using vc++(mfc) kamalesh
I htink that you mean that you have a text file, containing file names, each file name on a line of text and you want to iterate throug it. If that is true, you have to read the file one char at a time and stop when you get to the combination CRLF (0x0d 0x0a).This is an line end. If your text file is written in UNICODE be aware that 1 unicode char has 16 bits(2 bytes).The "normal" one has 8 bits(1 byte).
-
how can I iterate file pointer within a file consisting list of file. that is, when ever it iterates i get next list file using vc++(mfc) kamalesh