I am trying to plot my data in my worker thread. I did as follows (I also attaching an example project), but I got run time error.
I am using Measurement Studio 6.0 and Visual Studio 6.0 SP#5.
I read some answers on this problem. Maybe, CoInitialize() is hint. However, I cannot understand how to use this function. How I can access?
Please read my example:
UINT ThreadProc(LPVOID lParam);
......
BOOL CMyThreadDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
......
// TODO: Add extra initialization here
AfxBeginThread(ThreadProc,(LPVOID)this);
return TRUE; // return TRUE unless you set the focus to a control
}
UINT ThreadProc(LPVOID lParam)
{
C
MyThreadDlg* pDlg = (CMyThreadDlg*)lParam;
CNiReal64Vector tData;
CNiMath::SineWave(tData,200,1.0);
pDlg->m_graph.PlotY(tData);
return (UINT)0;
}