Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3021

MFC ProgressBar makes Application Slow

$
0
0
Hello
I have a problem with my progress bar:
Code:

                        std::string line;
                        std::ifstream infile(ExtractFromFile, std::ios::binary);
                        while (std::getline(infile, line))
                        {
                                MainDialog->StockList.push_back(line.c_str());
                                TProgressBar.SetStep(1);
                                TProgressBar.StepIt();
                        }

My list has about 5 MB. If i use TProgressBar stepit() then it takes about 20 seconds, without it it takes about 1 second. The difference is huge.
Is there any way to make it faster ?
Thank you!

Viewing all articles
Browse latest Browse all 3021