Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Please help !!!!

Please help !!!!

Scheduled Pinned Locked Moved C / C++ / MFC
questiondatabaseperformancehelptutorial
16 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bravoone_2006
    wrote on last edited by
    #1

    How can i load my data more fast in my ListCtrl ? I have my database in another computer on ODBC so in my computer ! VisualFoxpro 6.0 database ! This code works and i have some speed but if is posibile to have more speed please help me with an example ! this is my code : ...must be something to do , to have more speed !!!!!!!! void CMyListCtrl::FillList() { CDatabase_Plan* pPlan = new CDatabase_Plan(); if (!pPlan->Open()) return; if (pPlan->IsOpen()) { int x = 0; m_list.LockWindowUpdate(); while (!pPlan->IsEOF() ) { int nItem = m_list.InsertItem(x, pPlan->m_name); m_list.SetItemText(nItem, 1, pPlan->m_den); pPlan->MoveNext(); x++; } } m_list.UnlockWindowUpdate(); m_list.Invalidate(); m_list.UpdateWindow(); pPlan->Close(); }

    Bravoone

    R L H 3 Replies Last reply
    0
    • B Bravoone_2006

      How can i load my data more fast in my ListCtrl ? I have my database in another computer on ODBC so in my computer ! VisualFoxpro 6.0 database ! This code works and i have some speed but if is posibile to have more speed please help me with an example ! this is my code : ...must be something to do , to have more speed !!!!!!!! void CMyListCtrl::FillList() { CDatabase_Plan* pPlan = new CDatabase_Plan(); if (!pPlan->Open()) return; if (pPlan->IsOpen()) { int x = 0; m_list.LockWindowUpdate(); while (!pPlan->IsEOF() ) { int nItem = m_list.InsertItem(x, pPlan->m_name); m_list.SetItemText(nItem, 1, pPlan->m_den); pPlan->MoveNext(); x++; } } m_list.UnlockWindowUpdate(); m_list.Invalidate(); m_list.UpdateWindow(); pPlan->Close(); }

      Bravoone

      R Offline
      R Offline
      Rinu_Raj
      wrote on last edited by
      #2

      Please use the notification LVN_GETDISPINFO for implementing virtual list concept for example see the link http://www.codeproject.com/listctrl/virtuallist.asp Regards RinuRaj

      B D 2 Replies Last reply
      0
      • R Rinu_Raj

        Please use the notification LVN_GETDISPINFO for implementing virtual list concept for example see the link http://www.codeproject.com/listctrl/virtuallist.asp Regards RinuRaj

        B Offline
        B Offline
        Bravoone_2006
        wrote on last edited by
        #3

        No , my code works but he need ... something ... maybe MoveNext have a problem i dont no please help me !

        Bravoone

        H B 2 Replies Last reply
        0
        • B Bravoone_2006

          No , my code works but he need ... something ... maybe MoveNext have a problem i dont no please help me !

          Bravoone

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          Whats problem with MoveNext

          _**


          **_

          WhiteSky


          1 Reply Last reply
          0
          • B Bravoone_2006

            No , my code works but he need ... something ... maybe MoveNext have a problem i dont no please help me !

            Bravoone

            B Offline
            B Offline
            Bravoone_2006
            wrote on last edited by
            #5

            maybe MoveNext is slow !? i dont now! please help !

            Bravoone

            V 1 Reply Last reply
            0
            • B Bravoone_2006

              maybe MoveNext is slow !? i dont now! please help !

              Bravoone

              V Offline
              V Offline
              vinclaro001
              wrote on last edited by
              #6

              Have you tried profiling to code to see why it's too slow? I recommend looking at the DevPartner Profiler from here[^]

              1 Reply Last reply
              0
              • B Bravoone_2006

                How can i load my data more fast in my ListCtrl ? I have my database in another computer on ODBC so in my computer ! VisualFoxpro 6.0 database ! This code works and i have some speed but if is posibile to have more speed please help me with an example ! this is my code : ...must be something to do , to have more speed !!!!!!!! void CMyListCtrl::FillList() { CDatabase_Plan* pPlan = new CDatabase_Plan(); if (!pPlan->Open()) return; if (pPlan->IsOpen()) { int x = 0; m_list.LockWindowUpdate(); while (!pPlan->IsEOF() ) { int nItem = m_list.InsertItem(x, pPlan->m_name); m_list.SetItemText(nItem, 1, pPlan->m_den); pPlan->MoveNext(); x++; } } m_list.UnlockWindowUpdate(); m_list.Invalidate(); m_list.UpdateWindow(); pPlan->Close(); }

                Bravoone

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Hello, i wondered, why you use this: m_list.LockWindowUpdate(); // why LockWindowUpdate(); ???? you see your results after all the records r reading!? What when you want to read 100000 records? wait so long to see something? // you should show the items in the list, i just make a litle function, only when they is finish, all items are showed! show the items immediately nt nItem = m_list.InsertItem(x, pPlan->m_name); // dont need nItem, use x instead! when you use SetItemText directly after InsertItem, it is the same index m_list.SetItemText(x, 1, pPlan->m_den); pPlan->MoveNext(); x++; this maybe: void CMyListCtrl::FillList() { CDatabase_Plan* pPlan = new CDatabase_Plan(); if (!pPlan->Open()) return; if (pPlan->IsOpen()) { int x = 0; //m_list.LockWindowUpdate(); // dont loock the window! while (!pPlan->IsEOF() ) { //int nItem = m_list.InsertItem(x, pPlan->m_name); // dont use for all next item an new variable m_list.InsertItem(x, pPlan->m_name); //m_list.SetItemText(nItem, 1, pPlan->m_den); m_list.SetItemText(x, 1, pPlan->m_den); // use the same! pPlan->MoveNext(); x++; } } //m_list.UnlockWindowUpdate(); m_list.Invalidate(); m_list.UpdateWindow(); pPlan->Close(); } this is an litle idea from me...hope this helps litle :) regards break;

                B 1 Reply Last reply
                0
                • L Lost User

                  Hello, i wondered, why you use this: m_list.LockWindowUpdate(); // why LockWindowUpdate(); ???? you see your results after all the records r reading!? What when you want to read 100000 records? wait so long to see something? // you should show the items in the list, i just make a litle function, only when they is finish, all items are showed! show the items immediately nt nItem = m_list.InsertItem(x, pPlan->m_name); // dont need nItem, use x instead! when you use SetItemText directly after InsertItem, it is the same index m_list.SetItemText(x, 1, pPlan->m_den); pPlan->MoveNext(); x++; this maybe: void CMyListCtrl::FillList() { CDatabase_Plan* pPlan = new CDatabase_Plan(); if (!pPlan->Open()) return; if (pPlan->IsOpen()) { int x = 0; //m_list.LockWindowUpdate(); // dont loock the window! while (!pPlan->IsEOF() ) { //int nItem = m_list.InsertItem(x, pPlan->m_name); // dont use for all next item an new variable m_list.InsertItem(x, pPlan->m_name); //m_list.SetItemText(nItem, 1, pPlan->m_den); m_list.SetItemText(x, 1, pPlan->m_den); // use the same! pPlan->MoveNext(); x++; } } //m_list.UnlockWindowUpdate(); m_list.Invalidate(); m_list.UpdateWindow(); pPlan->Close(); } this is an litle idea from me...hope this helps litle :) regards break;

                  B Offline
                  B Offline
                  Bravoone_2006
                  wrote on last edited by
                  #8

                  ok Thanks for your help but my problem i think is movenext !? please help ! is slow i need more speed how ?!!!!

                  Bravoone

                  L 1 Reply Last reply
                  0
                  • B Bravoone_2006

                    ok Thanks for your help but my problem i think is movenext !? please help ! is slow i need more speed how ?!!!!

                    Bravoone

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    Hello, if this is an CRecordset, try to use an open type like CRecordset::forwardOnly, means you want only to rad one more, from begin to end! This brings you litle more speed, if you solve you problem please post here for me and others to now how! regards

                    B B 2 Replies Last reply
                    0
                    • L Lost User

                      Hello, if this is an CRecordset, try to use an open type like CRecordset::forwardOnly, means you want only to rad one more, from begin to end! This brings you litle more speed, if you solve you problem please post here for me and others to now how! regards

                      B Offline
                      B Offline
                      Bravoone_2006
                      wrote on last edited by
                      #10

                      how to use forwardonly ?my CRecordSet is snapshot !!!!

                      Bravoone

                      1 Reply Last reply
                      0
                      • L Lost User

                        Hello, if this is an CRecordset, try to use an open type like CRecordset::forwardOnly, means you want only to rad one more, from begin to end! This brings you litle more speed, if you solve you problem please post here for me and others to now how! regards

                        B Offline
                        B Offline
                        BadKarma
                        wrote on last edited by
                        #11

                        again if it is the recordset and specialy the MoveNext part you could do the following: make sure you don't collect record by record. Normaly a movenext requests only the next item from the server meaning just on record per fetch(data receivig) you can retrieve multilple records in a single fetch. Check the following Fetching Records in Bulk[^] for more details.

                        codito ergo sum

                        B 1 Reply Last reply
                        0
                        • B BadKarma

                          again if it is the recordset and specialy the MoveNext part you could do the following: make sure you don't collect record by record. Normaly a movenext requests only the next item from the server meaning just on record per fetch(data receivig) you can retrieve multilple records in a single fetch. Check the following Fetching Records in Bulk[^] for more details.

                          codito ergo sum

                          B Offline
                          B Offline
                          Bravoone_2006
                          wrote on last edited by
                          #12

                          how ? please help me with an example !

                          Bravoone

                          B 1 Reply Last reply
                          0
                          • B Bravoone_2006

                            how ? please help me with an example !

                            Bravoone

                            B Offline
                            B Offline
                            Bravoone_2006
                            wrote on last edited by
                            #13

                            Please help me because i dont understand how can i implement this !?

                            Bravoone

                            B 1 Reply Last reply
                            0
                            • B Bravoone_2006

                              Please help me because i dont understand how can i implement this !?

                              Bravoone

                              B Offline
                              B Offline
                              Bravoone_2006
                              wrote on last edited by
                              #14

                              How can i do this with my code ? void CDatabase_Note::DoBulkFieldExchange( CFieldExchange* pFX ) { // call the Bulk RFX functions // for field data members pFX->SetFieldType( CFieldExchange::outputColumn ); RFX_Text_Bulk( pFX, _T( "[debit]" ), &m_debit, &m_credit, 30 ); } i have a error cannot convert from CString to char please someoane help me ?!!!!

                              Bravoone

                              1 Reply Last reply
                              0
                              • R Rinu_Raj

                                Please use the notification LVN_GETDISPINFO for implementing virtual list concept for example see the link http://www.codeproject.com/listctrl/virtuallist.asp Regards RinuRaj

                                D Offline
                                D Offline
                                David Crow
                                wrote on last edited by
                                #15

                                Rinu_Raj wrote:

                                Please use the notification LVN_GETDISPINFO for implementing virtual list concept

                                This type of control has already been suggested here, and probably more than once. He's not into research, though, but just wants someone else to do all of his work. :(


                                "Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.

                                "Judge not by the eye but by the heart." - Native American Proverb

                                1 Reply Last reply
                                0
                                • B Bravoone_2006

                                  How can i load my data more fast in my ListCtrl ? I have my database in another computer on ODBC so in my computer ! VisualFoxpro 6.0 database ! This code works and i have some speed but if is posibile to have more speed please help me with an example ! this is my code : ...must be something to do , to have more speed !!!!!!!! void CMyListCtrl::FillList() { CDatabase_Plan* pPlan = new CDatabase_Plan(); if (!pPlan->Open()) return; if (pPlan->IsOpen()) { int x = 0; m_list.LockWindowUpdate(); while (!pPlan->IsEOF() ) { int nItem = m_list.InsertItem(x, pPlan->m_name); m_list.SetItemText(nItem, 1, pPlan->m_den); pPlan->MoveNext(); x++; } } m_list.UnlockWindowUpdate(); m_list.Invalidate(); m_list.UpdateWindow(); pPlan->Close(); }

                                  Bravoone

                                  H Offline
                                  H Offline
                                  Hamid Taebi
                                  wrote on last edited by
                                  #16

                                  Its a suggestion if we suppose that you have 1000 records in your database and now you want to read their you can break their to 1000/5=200 and then create 5 thread in each thread you insert a loop for read of database in last thread on the loop you use from while (!pPlan->IsEOF() )i think its good than to use a loop for read 1000 records on runtime

                                  _**


                                  **_

                                  WhiteSky


                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • World
                                  • Users
                                  • Groups