How can I update data outside of MFC dialog class?

AlexS13 41 Reputation points
2022-02-03T09:44:53.053+00:00

Hello I have a function that retrieve some data from a database and I want to see how many time has left in a progress bar and percentage in static text. The thing is that my function is not an mfc class , while retrieving progressbar moves but static text is only updated when function is finished.

Mfc class (function call):

retrievePredictions.getTxPredictions(m_vTransmitters, predictionTable, &m_vPredictions);

Retrieve data class:

for (auto predictionTableRow = 1; predictionTableRow < predictionsTableRows; predictionTableRow++)
    {
        // First Check if tx id exists in vector with retrieved txs
        txID = predictionsTable->GetFormattedValue(predictionTableRow, txIDCol);
        isTxIdExistInRetrievedTxs = std::find(vTxNames.begin(), vTxNames.end(), txID) != vTxNames.end();

        if (isTxIdExistInRetrievedTxs)
        {

            //Get TX's SIGNAL
            getSubGridOfTableRow(predictionTableRow, iPredictionTable, singalCol, &predictions.SignalsGrid);

            // Get tx's pathloss grid
            getSubGridOfTableRow(predictionTableRow, iPredictionTable, pathlossCol, &predictions.PathLossGrid);

            // Get tx's lower pathloss grid
            getSubGridOfTableRow(predictionTableRow, iPredictionTable, pathlossCol, &predictions.LowrerPathlossGrid);

            //return prediction object
            oPredictions->push_back(predictions);

            progressBarPos = predictionTableRow * 100 / predictionsTableRows;
            m_ProgressBar->Position->SetPos(progressBarPos);
            m_ProgressBar->Percentage->SetString(ToCstring(progressBarPos)); //Here I want to update static text

        }
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,521 questions
{count} votes