How can I update data outside of MFC dialog class?
AlexS13
41
Reputation points
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
}