Im working on a project, What I want is to get data from a database (MySql) and store it in a Tree. And be able to do insertion, deletion or updates on the nodes, if any of these commands are performed on a tree then changes must reflect on the database as well. (via Windows Form)
**UPDATED**
This error shows up when I do the search Via search button
Debug Assertion Failed!
here's my tree code:
just showing the insertion module.
Nope, i didn't. (bcz i really dont know how) Im just a Noob+
search func does always return a value i have removed it with this MessageBox::Show just to know that whether my program is reaching at that point or not.
it returns a string falseCondi which I have initialiez as falseCondi="b".
search func does always return a value i have removed it with this MessageBox::Show just to know that whether my program is reaching at that point or not.
In the code you have supplied, treeSearch does not always return a value. If you're showing us significantly different code than you're using, how are we supposed to make intelligent observations about it?
In the code you have supplied, treeSearch does not always return a value. If you're showing us significantly different code than you're using, how are we supposed to make intelligent observations about it?
This line looks a bit suspious to me. Where did you get it?
std::string ststring = msclr::interop::marshal_as<std::string>(c);
Maybe you can test it in a separate program.
You should stick with one form of strings. Sure, not related with your problem, but why mix 2 different programming language together in the same application ?
You should stick with one form of strings. Sure, not related with your problem, but why mix 2 different programming language together in the same application ?
1. That's the the problem I'm sure of it, because i have tested passing the converted variable into a a standard string variable (in the search method) and its working perfectly, but when i do it with nodes it becomes pain in the a** Debug Assertion Failed!
I did a little experiment and couldn't find a problem with your tree part.
Since I used VS 2005 I could not use msclr::interop::marshal_as<std::string>(c);
and had to use a different conversion method. If you want to try it...
The only constructor that takes one parameter is the one that takes a pointer to a c-string. In your case you pass 0 as a pointer which will crash. Return an empty string instead.
Except, according to the OP that code is not representative of the actual code. He said this when I mentioned the original code didn't always return a value:
search func does always return a value i have removed it with this MessageBox::Show just to know that whether my program is reaching at that point or not.
it returns a string falseCondi which I have initialiez as falseCondi="b".
and edited the code to what you quoted... which clearly differs from his claim. So, if he's unwilling to use a debugger (which will point him directly to the offending line), and he's unwilling to post code that isn't significantly different than what he's actually using, there isn't much that can be done for him on these forums.