|
-
March 25th, 2015, 05:51 AM
#1
[RESOLVED] atlsimpstr.h access violation error
hi,
Recently, i got an "atlsimpstr.h access violation reading location" error when run my project.
I'm using two threads in my project. If i run single thread the above error did not come.
Code:
UINT MainSequence(LPVOID pVoid)
{
HWND hwnd = (HWND)pVoid;
CMainDlg *Main = CMainDlg *)pVoid;
while(1)
{
// do some process
}
return 0;
}
UINT SignalSequence(LPVOID pVoid)
{
HWND hwnd = (HWND)pVoid;
CMainDlg *Main = CMainDlg *)pVoid;
while(1)
{
// do some process
}
return 0;
}
CWinThread *tMain;
CWinThread *tSignal;
BOOL CMainDlg::OnInitDialog()
{
CDialog::OnInitDialog();
tMain = AfxBeginThread(MainSequence, LPVOID(NULL));
tSignal = AfxBeginThread(SignalSequence, LPVOID(NULL));
return TRUE;
}
If i command tMain thread , no error occurs.
How can i handle these two threads?
Regards,
SaraswathiSrinath
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|