Did somebody see something like this?
-
I was making some modifications in a code of another programmer writed, And I saw something like This.
CString str;
int i = 0;plbl.GetWinddowText(str);
for(i; i < str.GetLength(); i++)
{
str.SetAt(i, ' ');
}pbl.SetWindowText(str);
Oh my God!!! X| Did SomeBody see something like this? Please I want to see more code like this. Cheers!!!! :-D Happy Friday for All... Carlos Antollini.
-
I was making some modifications in a code of another programmer writed, And I saw something like This.
CString str;
int i = 0;plbl.GetWinddowText(str);
for(i; i < str.GetLength(); i++)
{
str.SetAt(i, ' ');
}pbl.SetWindowText(str);
Oh my God!!! X| Did SomeBody see something like this? Please I want to see more code like this. Cheers!!!! :-D Happy Friday for All... Carlos Antollini.
-
I was making some modifications in a code of another programmer writed, And I saw something like This.
CString str;
int i = 0;plbl.GetWinddowText(str);
for(i; i < str.GetLength(); i++)
{
str.SetAt(i, ' ');
}pbl.SetWindowText(str);
Oh my God!!! X| Did SomeBody see something like this? Please I want to see more code like this. Cheers!!!! :-D Happy Friday for All... Carlos Antollini.
Maybe he's just making sure :-) Or, he comes from the days of old "C" dynamic memory allocation, where you always had to make sure. Reminds me of the CArray class for MFC (I think) where you have to call the member function (Get At) through the whole array, and finally RemoveAll, because RemoveAll doesn't de-allocate the objects in the heap.
int i = 0;
while (i < myArray.GetSize() )
{
delete myArray.GetAt( i++ );
}myArray.RemoveAll();
I don't know much of allocations/deallocating since I come from a C++ world, but why doesn't RemoveAll clear the array and deallocate all objects associated with the array? Sam C ---- MIS Director Hospitality Marketing Associates
-
Maybe he's just making sure :-) Or, he comes from the days of old "C" dynamic memory allocation, where you always had to make sure. Reminds me of the CArray class for MFC (I think) where you have to call the member function (Get At) through the whole array, and finally RemoveAll, because RemoveAll doesn't de-allocate the objects in the heap.
int i = 0;
while (i < myArray.GetSize() )
{
delete myArray.GetAt( i++ );
}myArray.RemoveAll();
I don't know much of allocations/deallocating since I come from a C++ world, but why doesn't RemoveAll clear the array and deallocate all objects associated with the array? Sam C ---- MIS Director Hospitality Marketing Associates
Hey, Sam is Nice to have news of you!!!! Nice Weekend. Carlos Antollini.
-
Maybe he's just making sure :-) Or, he comes from the days of old "C" dynamic memory allocation, where you always had to make sure. Reminds me of the CArray class for MFC (I think) where you have to call the member function (Get At) through the whole array, and finally RemoveAll, because RemoveAll doesn't de-allocate the objects in the heap.
int i = 0;
while (i < myArray.GetSize() )
{
delete myArray.GetAt( i++ );
}myArray.RemoveAll();
I don't know much of allocations/deallocating since I come from a C++ world, but why doesn't RemoveAll clear the array and deallocate all objects associated with the array? Sam C ---- MIS Director Hospitality Marketing Associates
-
Hey, Sam is Nice to have news of you!!!! Nice Weekend. Carlos Antollini.
Carlos, how's it going? If you read my other post what happened is that for 3 weeks my home computer has been down, because I did an update to WinXP RC2 with a CD made from a bad ISO I downloaded, the install probably had nothing to do with what happened next and that was total hard disk failure, or so I thought, but after replacing my drive, my computer was still not resonding. To make a long story short I had to replace my mboard, CPU, and memory. But now I'm back online (couldn't log on from work :-) ) and it is great to hear from everybody and that everyone is doing well. Sam C ---- MIS Director Hospitality Marketing Associates
-
Maybe he's just making sure :-) Or, he comes from the days of old "C" dynamic memory allocation, where you always had to make sure. Reminds me of the CArray class for MFC (I think) where you have to call the member function (Get At) through the whole array, and finally RemoveAll, because RemoveAll doesn't de-allocate the objects in the heap.
int i = 0;
while (i < myArray.GetSize() )
{
delete myArray.GetAt( i++ );
}myArray.RemoveAll();
I don't know much of allocations/deallocating since I come from a C++ world, but why doesn't RemoveAll clear the array and deallocate all objects associated with the array? Sam C ---- MIS Director Hospitality Marketing Associates
RemoveAll will remove the elements in the array, but it won't cleanup those elements. If the elements are pointers then you'll need to deallocate those pointers before your remove them from the array. cheers, Chris Maunder (CodeProject)
-
You dont have to do that, you can write your own 'DeleteItem()' (or whatever it is called, forgot that) and it will be called when you remove elements from the array.
-
Maybe he's just making sure :-) Or, he comes from the days of old "C" dynamic memory allocation, where you always had to make sure. Reminds me of the CArray class for MFC (I think) where you have to call the member function (Get At) through the whole array, and finally RemoveAll, because RemoveAll doesn't de-allocate the objects in the heap.
int i = 0;
while (i < myArray.GetSize() )
{
delete myArray.GetAt( i++ );
}myArray.RemoveAll();
I don't know much of allocations/deallocating since I come from a C++ world, but why doesn't RemoveAll clear the array and deallocate all objects associated with the array? Sam C ---- MIS Director Hospitality Marketing Associates
Otherwise you could not store anything but pointers to dynamically created objects in the CArray. :rose:
-
I was making some modifications in a code of another programmer writed, And I saw something like This.
CString str;
int i = 0;plbl.GetWinddowText(str);
for(i; i < str.GetLength(); i++)
{
str.SetAt(i, ' ');
}pbl.SetWindowText(str);
Oh my God!!! X| Did SomeBody see something like this? Please I want to see more code like this. Cheers!!!! :-D Happy Friday for All... Carlos Antollini.