Andrzej
March 24th, 2004, 02:38 PM
I have been trying to put my function in new thread, but I have still problem with set values of my UI controls. I know that I should use message to access UI elements from MFC thread. Colud anybody of us help me and show how to do it. Please let me explaim details ...
in CBaxView derrived from CFormView class I run my very big consumming CPU's time function (LoadBaxToTables()) it is memeber fun. of my CBaxHandling class derriverd from CObject.
void CBaxhView::OnFileLoaddb()
{
//create modeless dlg. to inform user about current step of running process
m_pDlgPerform = new CDlgPerform(this);
m_pDlgPerform->Create(IDD_DIALOG1_PERFORM_INFO);
m_pDlgPerform->ShowWindow(SW_SHOW);
// Load data to arrays, it is my luckless function
m_bax.LoadBaxToTables(); // CBaxHandling m_bax
....
}
Could you give me any suggestion or any example, how to run this function as new thread and simultaneously inform user via CDlgPerform about current step of function?
I am able to run this function as new thread but without possibilities informations for user. Whe I try to "touch" ui elements from my thread I receive errors.
Thanks in advance.
in CBaxView derrived from CFormView class I run my very big consumming CPU's time function (LoadBaxToTables()) it is memeber fun. of my CBaxHandling class derriverd from CObject.
void CBaxhView::OnFileLoaddb()
{
//create modeless dlg. to inform user about current step of running process
m_pDlgPerform = new CDlgPerform(this);
m_pDlgPerform->Create(IDD_DIALOG1_PERFORM_INFO);
m_pDlgPerform->ShowWindow(SW_SHOW);
// Load data to arrays, it is my luckless function
m_bax.LoadBaxToTables(); // CBaxHandling m_bax
....
}
Could you give me any suggestion or any example, how to run this function as new thread and simultaneously inform user via CDlgPerform about current step of function?
I am able to run this function as new thread but without possibilities informations for user. Whe I try to "touch" ui elements from my thread I receive errors.
Thanks in advance.