|
Flaviu_2006 wrote: //--------- i need some help please -------------//
hum, yeah, that's definitely a good sumarize of your problem... i think you could add VERY URGENT in it !
|
|
|
|
|
|
You can use from a query and I remember that you said you have 60000 records and I said to you I searched for you for speed and I found a good link but I losed it if you can find this site on this site you can see algorithms for search on databases I guess its very helpful for you
|
|
|
|
|
what site ?
please tell me !!!!!!!!!!!!!
Bravoone
|
|
|
|
|
I said i found for you morning but I losed it Im sorry in fact I see your questions about speed (i think more 15 question ) and I searched but I losed Im sorry.
|
|
|
|
|
|
This is not and IDE, not need to comment your lines?
//-----Why the hell you add these extra pipes and slashes? Doesn't it look aweful ?----//
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
but I think in VC we use //statement not //statement//
|
|
|
|
|
// hey but adding a // at the end of the comment line says that the comment is over. We use in our VC++ //
/* you get me or not */ ?? ;P
<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[ ]--
[My Current Status]
Link2006 wrote:Let's take it outside of CP
Jeremy : Please don't.I would love to see this.I'm making the popcorn already.
|
|
|
|
|
in my header file i wrote this code:
class CMyDlg : public CDialog
{
public:
int varCount;
vector<<int> intVec;
}
and in the cpp file wrote this code :
void CQMDlg::OnGetvarCountButton()
{
for(int i=0;i!=varCount;i++)
{
intVec.push_back(i);
}
}
there is no error in compilation but when i press that specific button, program hangs.
can somebody help me?
thanks
|
|
|
|
|
Have stepped in to the code ? what varCount is expected to initialize with? Probably its not initializing properly and going into loop.
|
|
|
|
|
How exactly have you initialized varCount ?
Your loop has a problem:
for(int i=0;i!=varCount;i++)
while i is not equal to varCount, thats just asking for trouble. Try changing it to
for(int i=0;i<varCount;i++)
|
|
|
|
|
thank you guys.
yes, my problem was in varCount initialization.
and i have another problem. when i write
intVec.
the property container menu of intVec doesn't appears.
|
|
|
|
|
Intellisense doesn't work ? That doesn't really matter, does it ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Many times, deleting .ncb file in project folder and rebuilding application do work.
|
|
|
|
|
thanks
i deleted the .ncb file and now it's working.
|
|
|
|
|
waldermort wrote: while i is not equal to varCount, thats just asking for trouble
How?
|
|
|
|
|
Because, it can easily happen, that you skip that specific value, for whatever reason. You could accidently increase the counter twice, initialize it with a value larger than varCount and stuff like that. It's just a matter of clean and readable code. If you want a loop to run as long as i is less or equal some other value, then you should write your condition that way. Lots of problems and timewasting during debugging happen due to such dirty practices.
Then again, STL-Iterators work just that way ( it = YourVector.begin(); it != YourVector.end(); it++ ), but that don't mean it's good =).
|
|
|
|
|
Actually, I dont follow coding style, by OP,too. All points mentioned by you are valid.
But in given code , that doesn't matter.
As revealed later, it was initializatin problem.
|
|
|
|
|
prasad_som wrote: But in given code , that doesn't matter.
As revealed later, it was initializatin problem.
Actually, he probably would have caught it sooner because I'm guessing it was something like this:
void CQMDlg::OnGetvarCountButton()
{
varCount = -1;
for(int i=0; i!=varCount; ++i)
{
intVec.push_back(i);
}
}
Which will run forever, whereas if the code was written as:
void CQMDlg::OnGetvarCountButton()
{
varCount = -1;
for(int i=0; i<varCount; ++i)
{
intVec.push_back(i);
}
}
It would have been caught immediately since the vector would have been empty.
As a side note, STL's iterators use != for a reason. For most of the containers, there is no guarantee that the memory locations are sequential, so you can't do a < comparison to find the end of the loop.
-- modified at 10:18 Thursday 21st September, 2006
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
Zac Howland wrote: for(int i=0; i!=varCount; ++i
True, I never come across such code,too.
|
|
|
|
|
Hello everyone,
I m trying to populate my Combobox but i m not successfull as yet.
as usuall I have enetred the data in properties DATA tab of ComboBox
I tryed with insertstring and additem method also but nothing is working.At runtime my ComboBox expands blankly it does not show any data
Thanx,
namy.
namy
|
|
|
|
|
|
Hello prasad,
Yes if u can please give the code
I m same namy i have just changed my name to namy1
thanx
|
|
|
|
|
Can you show snippet code
|
|
|
|