|
Start your debugger and tell us exactly at which line of code it crashes (press F5 instead of Ctrl + F5).
* me *
|
|
|
|
|
hope this will help u.
after F5
Loaded 'C:\WINNT\system32\ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINNT\system32\KERNEL32.DLL', no matching symbolic information found.
First-chance exception in OnlyWords.exe (NTDLL.DLL): 0xC0000005: Access Violation.
The thread 0x258 has exited with code -1073741510 (0xC000013A).
The program 'D:\Parichay\OnlyWords\Debug\OnlyWords.exe' has exited with code -1073741510 (0xC000013A).
|
|
|
|
|
You are kiding aren't you ?? I simply ask you to tell us where the debugger stops when it crashes. At which line of code in your program excactly (there is a yellow arrow next to your code) ?
I think your eally need to learn a little bit to work with your debugger. I cannot imagine my life without one . No seriously, try to play a little bit with your debugger to see how to use it. It will be a very good friend that will help you in many many situations.
|
|
|
|
|
77F8910E cmp dword ptr [edx+14h],0
after F5 arrow stopes here ....
i have just started learning VC++ so i have very less idea abt Debuggers..
|
|
|
|
|
Ok, so it is not directly in your code probably.
Now, put a breakpoint at the very begining of your program (by going on the line and pressing F9). Then ,put several breakpoints in relevant points in your program. Each time you press F5, the programm will advance to the next bbreakpoint. And there, you can watch to your variables and things like that. Try to play with it and understand how it works, it is really usefull and it will really help you a lot !
|
|
|
|
|
Thanks for the inforamtion.
it will help me a lot....
i will try to do that..
|
|
|
|
|
It crashes at here:
} while (_findnext (File_handle, &file_s) == 0);<br />
Maxwell Chen
|
|
|
|
|
Why implement a binary tree yourself? Use std::set or std::multiset . Then you get a self balancing binary tree instead of you home spun version which isn't self balancing and thus can degenerate to linear rather then logarithmic performance. Your program is written at an unnecessarily low level - A common mistake with C++ programmers, especially those with a background in C (in my opinion).
Steve
|
|
|
|
|
Stephen Hewitt wrote: Your program is written at an unnecessarily low level - A common mistake with C++ programmers, especially those with a background in C (in my opinion)
This is so true. It takes time for him to catch up this sense.
But maybe he hadn't known the existing one, std::set , to use.
Sometimes it might be of fun to code one's own toy (BTree in this case) to enjoy how it works.
Maxwell Chen
|
|
|
|
|
Does the "crash" occur while adding nodes to the tree, printing the nodes, or scanning the folders? Please try to narrow it down a bit further so that we don't have to examine unnecessary code. You'll get much more help that way.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
program does not produce any output i dnt knwo where it is getting generated.
|
|
|
|
|
By following what I described in the thread just below. Use your debugger !
|
|
|
|
|
But you mentioned a compiler error. What is it? It will be a 4-digit number preceded by a C.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
This instruction at "0X77f8910e" referenced memory at "0xc7c7cf0".The memory could not be "read".
|
|
|
|
|
That's a run-time error, not a compilation error. There's a big difference between the two.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
parichaybp wrote: while (fscanf(fp, "%s", &words)!= -1) //while not the end of the file
fscanf() can also return 0 , which indicates a potential problem, but the while loop would continue. Is this intentional?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
parichaybp wrote: root1 = addtree (root1, words);
Why do you keep reassigning a new value to root1 ? That variable should point to the root of the tree no matter what.
parichaybp wrote: #define MAX_LEN 100
Paths can be longer than 100 characters. Use MAX_PATH instead.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
parichaybp wrote: if (strcmp (file_s.name, ".") == 0 || strcmp (file_s.name, "..") == 0)
This can be shortened to just a single comparison:
if (file_s.name[0] == '.') This does nothing for your problem, but it does help to remove unnecessary code.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Have you tried just navigating through the files/folders without adding anything to the tree data structure?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Geez... Why don't you use the debugger for that purpose ? It is the purpose of such a tool and it is much more helpfull (and faster) than posting a message on a forum.
We cannot tell the problem just by what you posted (and don't post the complete code because the problem will be the same).
Start your debugger (press F5) and see where it crashes. You can look through the call stack windows to see in which function it crashes. You can also set breakpoints (F9) to step into your code to see where it crashes.
|
|
|
|
|
This is the think that should be done before posting your coding problem on codeproject. This helps alot...
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
It crashes at here:
} while (_findnext (File_handle, &file_s) == 0);
Maxwell Chen
|
|
|
|
|
Hi,
Can u plz tell me how to correct the error??
|
|
|
|
|
hai,
I dont know the difference between what is the SendMessage and PostMessage and Difference between SendMessage and Postmessage.
Krishna
|
|
|
|
|
It can be said that SendMessage is Synchronous in nature and PostMessage is Asynchronous in nature.
Check out this[^] and this[^]
Please google before posting a question.
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|