|
The problem might be in your class CNote. What does it look like?
|
|
|
|
|
CNote is CRecordset class default generated by microsoft visual c++
Bravoone
|
|
|
|
|
i have the database on ODBC !
Bravoone
|
|
|
|
|
I Googled around for "CRecordset slow" and found this at http://forums.mysql.com/read.php?45,99701,99721#msg-99721[^]
The text:
Resolved:
Apparently, for whatever reason, Microsoft's CRecordset C/C++ class is literally copying the entire table over to the local client with the CRecordset::Open function.
This is probably why the original coders were using a dynaset when we were using MSACCESS, but when I switched over to MYSQL, dynaset's were not supported with the MySQL/ODBC drivers so I used snapshots instead.
I changed the logic to use a direct SQL command and its lightning fast now.
Try my Google search (and variations). I guess you will find the reason (and the solution) of your problems.
-- modified at 5:52 Wednesday 16th August, 2006
Don't ask me how to run a direct SQL query from your program, Iv'e never done it. But there is heaps of samples out there.
|
|
|
|
|
ok i have find something but it must... change my all code and ... if is another way ?! Please help me !!!!!!!!!!!!!!!!!!!!
i need an example ! please !
Bravoone
|
|
|
|
|
Flaviu_2006 wrote: ok i have find something but it must... change my all code and ... if is another way ?! Please help me !!!!!!!!!!!!!!!!!!!!
What is so hard about changing from dynaset to snapshot?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Flaviu_2006 wrote: ...i must wait up to 10 min to load the data !
How many items are being loaded? If it's more than just a few thousand, you'll need to use a "virtual" list control.
What does CNote::GetSQL() look like?
Flaviu_2006 wrote:
int x = 0;
while(!pNote->IsEOF())
{
int nItem = m_list4.InsertItem(x, pNote->m_name);
m_list4.SetItemText(nItem, 1, pNote->m_city);
pNote->MoveNext();
x++;
}
If my code was not any better than what you had, then why are you using it?
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I think you modifiy his code in previous thread but i dont know why he doesnt try to use from answers
|
|
|
|
|
WhiteSky wrote: I think you modifiy his code in previous thread...
I was not questioning that.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Did you try to use from threads?
|
|
|
|
|
I wnat to create pointer to an array of 10 objects of class One. Can u tell me the various ways to do this.
Thank you.
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: I wnat to create pointer to an array of 10 objects of class One. Can u tell me the various ways to do this.
Thank you.
new
CTypedPtrArray
CArray
STL Classes More Info[^].
|
|
|
|
|
|
|
Have you tried:
One arr[10];
One *p = arr;
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello,
I have selected my button style to be 'Flat'. I do not want the borders around it. Is there a way to do that?
Thanks.
Fortitudine Vincimus!
|
|
|
|
|
you may need to make owner drawn button.
|
|
|
|
|
Do you have derived CButton and if yes do you use from WM_DRAWITEM in your code
|
|
|
|
|
I got the idea what should be done.
Thanks.
Fortitudine Vincimus!
|
|
|
|
|
|
hi all,
in main class i created some class objects using NEW operator and in destructor i used delete operator to delete that created objects
but its not entering into destructor when i exit my application
plz help in this issue
Thank you
venu
|
|
|
|
|
g venu wrote: in main class i created some class objects using NEW operator and in destructor i used delete operator to delete that created objects
When you "new" an object the constructor for the corresponding object gets called and when you "delete" an object the destructor for that object get's called.
But you are saying it doesn't enter the destructor for the corresponding objects when you exit the application. The destructor get's called when you delete the object. Only objects created on stack get's destroyed automatically, the rest should be deleted.
|
|
|
|
|
Post some code, it's much more clear than an explanation. As I understand, you allocate some objects with new:
MyClass* pClass = new MyClass;
And you try to delete the memory inside the destructor ?
MyClass::~MyClass
{
delete this;
}
This will never work. When you create a class with new, its destructor will be called only when you delete the object. You must delete the object outside the destructor.
|
|
|
|
|
i created objects like this and
void mymainDlg::CreateTabWindows()
{
m_phoneDlg = new CGlobe7Phone();
m_phoneDlg->Create(IDD_PHONE,this);
m_TelevisionDlg = new CGlobe7Television();
m_TelevisionDlg->Create(IDD_DIALOG_INTERNET_TELEVISION,this);
m_MessageCenterDlg = new CGlobe7MessageCenter();
m_MessageCenterDlg->Create(IDD_DIALOG_MESSAGECENTER,this);
}
i used destructor like this but it does'nt work and showing memory leaks
mymainDlg::~mymainDlg()
{
delete m_phoneDlg;
delete m_TelevisionDlg;
delete m_MessageCenterDlg;
}
Thank you
venu
|
|
|
|
|
Looks alright to me. Try placing breakpoints in the destructor. The memory leak could be from any of your created dialogs too. Check that any allocated memory in those dialogs is freed when it is destroyed.
|
|
|
|