Re: multi-thread problem
I think the problem can be corrected with a simple cast statement. And I
believe it is more of C++ issue, but I haven't used cast myself in some of
the C++ I've written so far except for this MFC program. I am learning and
would like to understand how to write the cast for this situation. I need to
convert from the main dialog to this "long int" from the ActiveX class. And
that is what I am not understanding. Could the cast be written as simple as
this statement:
CThreadTestDlg* pNum = ( m_xActxCtrl *)long pNum;
--------------------------------------------
error C2440: 'type cast' : cannot convert from 'long CThreadTestDlg::*' to
'long'
-------------------------------------------
The code written with the above statement:
UINT CThreadTestDlg::Thread1(LPVOID lParam)
{
CThreadTestDlg* pDlg = (CThreadTestDlg *)lParam;
CThreadTestDlg* pNum = ( m_xActxCtrl *)long pNum;
ActxCtrl m_xActxCtrl;
m_xActxCtrl.Open(); // open ActxCtrl
pNum = m_xActxCtrl.MemFunction();
m_xActxCtrl.Close(); // close ActxCtrl
pDlg->PostMessage(UWM_THREAD_FINISHED, (WPARAM)0, (LPARAM) pNum);
return 0;
}
I haven't tried this code yet, but I'll see how it goes.