Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

updateallviews not working from inside a thread

Dear Sir,

I have created an application to split the windows into 1 row and 2 columns. 1 column has a CFormView and the 2nd Column has a CView; CFormView class has controls for changing display at CView (PPI display and RHI display)
2 buttons at CFormView is changing the display at CView successfuly whenever the button is clicked.
CFormView receives realtime data; which i am able to update at CFormView; but the same data sent to CView is not updating.
I used UpdateAllViews() function from a Thread function to update the view. Compilation shows no errors but runtime error occurs.

Thread function
unsigned long CFormDialogView::RecvThreadFunc(LPVOID lparam)
{
.
.
.
((CFormDialogView*)lparam)->UpdateToteTrk('T');
.
.
}


void CFormDialogView::UpdateToteTrk(char ch)
{
CJlogDoc* pDoc = GetDoc();
.
.
pDoc->UpdateAllViews(NULL);
.
}

CJlogDoc * CFormDialogView::GetDoc()
{
CDocument * pFDVDoc = GetDocument();
ASSERT((CDocument *)pFDVDoc->IsKindOf(RUNTIME_CLASS(CJlogDoc)));
return (CJlogDoc*) pFDVDoc;
}


Sign In or Register to comment.