-
October 10th, 2010, 08:35 PM
#1
reading a file
I have to get all filepaths of C:\windows\system32\ into a vector of strings, and check their contents. I put this reading and checking in a worker thread but it always results in a Runtime error that the application has to stop in an unusual way
For sometimes to other directories, it works, but sometimes fails with the same error message at the Crtdebug()...
Code:
For each file names
Read its content
check it against some critieria
-
October 10th, 2010, 09:08 PM
#2
Re: reading a file
Oh it should be something like this (clearer)
Code:
for each of the files (i=0;i<|files|-1)
read the first file content
for each of the files (j=i+1;j<|files|)
read the second on
if (content file 1 and content file 2 satisfy some criteria)
printf ("Satisfy")
I do this on Vista, VS10
Last edited by Sharpie; October 10th, 2010 at 09:11 PM.
-
October 11th, 2010, 03:26 AM
#3
Re: reading a file
I am confused... Are you doing it using VB?
Didn't you try to debug your code?
Victor Nijegorodov
-
October 11th, 2010, 03:59 AM
#4
Re: reading a file
Originally Posted by VictorN
I am confused... Are you doing it using VB?
Didn't you try to debug your code?
Thank you
I think I am alittle out of my mind, not confused. I think I am writing this post in VC++
and my mind is about VB.
Anyway, debuging in my problem leads me nowhere, there are lots of files in that directory, do you know a technique to get me to the line where error occurs ?
-
October 11th, 2010, 04:05 AM
#5
Re: reading a file
Have a look at Call Stack window...
Victor Nijegorodov
-
October 11th, 2010, 04:10 AM
#6
Re: reading a file
Oh I see it.
A file in my vector doesn't have a full initialization, it doesn't have a file name, and other properties as included in my struct; all are named as <Bad struct> etc
This is odd! Before running the thread above, I already put them all in my vector and it initialise correctly. What else should I do next ?
-
October 11th, 2010, 04:15 AM
#7
Re: reading a file
Originally Posted by Sharpie
Oh I see it.
A file in my vector doesn't have a full initialization, it doesn't have a file name, and other properties as included in my struct; all are named as <Bad struct> etc
Sorry, I have no idea what your "vector" is and why it "doesn't have a full initialization".
So, the only tip I can give you - debug your code step by step to see what where and why goes wrong...
Victor Nijegorodov
-
October 11th, 2010, 04:30 AM
#8
Re: reading a file
Originally Posted by VictorN
Sorry, I have no idea what your "vector" is and why it "doesn't have a full initialization".
So, the only tip I can give you - debug your code step by step to see what where and why goes wrong...
Ok don't worry about my vector contents, it only ails in the thread. You know, actually I don't even need to code this part
When a user choose to look up what he wants in his windows drive, I can make a fake process as if the search has been done and finish the work sooner and cleaner. Your advice for me to step one by one over 17000 elements in my vector is really inappropriate, but I thank you for your input very much. Oh well I might be thinking I can step over a double loop with F5, which seemingly is unable to accomplish because the mentioned runtime error will just again show up, the whole debug process becomes exactly the same as running the program then, finally useless. I am bored!
-
October 11th, 2010, 04:34 AM
#9
Re: reading a file
Well, again: you didn't provide any useful/detailed description about your program, so don't expect any detailed help!
Victor Nijegorodov
-
October 11th, 2010, 07:56 PM
#10
Re: reading a file
Originally Posted by VictorN
Well, again: you didn't provide any useful/detailed description about your program, so don't expect any detailed help!
Yes, the truth is that my programming skill is actually very bad.
My teacher tells me that in real life, it's not really about how much one learns in school, it's about how much one can manage. Now I see it, that's really a good condolence for me to move on programming this application otherwise I should quit it.
-
October 12th, 2010, 01:03 AM
#11
Re: reading a file
Originally Posted by Sharpie
My teacher tells me that in real life, it's not really about how much one learns in school, it's about how much one can manage.
Correct!
Originally Posted by Sharpie
... Now I see it, that's really a good condolence for me to move on programming this application otherwise I should quit it.
Victor Nijegorodov
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|