Click here to Skip to main content
15,922,407 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: VC++ and CRystalReport Pin
liquid_6-Sep-08 10:48
liquid_6-Sep-08 10:48 
QuestionThreads Pin
bhanu_85095-Sep-08 3:35
bhanu_85095-Sep-08 3:35 
AnswerRe: Threads Pin
David Crow5-Sep-08 3:53
David Crow5-Sep-08 3:53 
AnswerRe: Threads Pin
JudyL_MD5-Sep-08 4:38
JudyL_MD5-Sep-08 4:38 
GeneralRe: Threads Pin
bhanu_85096-Sep-08 0:12
bhanu_85096-Sep-08 0:12 
GeneralRe: Threads Pin
JudyL_MD6-Sep-08 2:46
JudyL_MD6-Sep-08 2:46 
AnswerRe: Threads Pin
Roger Stoltz5-Sep-08 4:42
Roger Stoltz5-Sep-08 4:42 
QuestionHow can Extract String ? Pin
Le@rner5-Sep-08 2:54
Le@rner5-Sep-08 2:54 
AnswerRe: How can Extract String ? Pin
_AnsHUMAN_ 5-Sep-08 2:57
_AnsHUMAN_ 5-Sep-08 2:57 
GeneralRe: How can Extract String ? Pin
toxcct5-Sep-08 3:07
toxcct5-Sep-08 3:07 
GeneralRe: How can Extract String ? Pin
_AnsHUMAN_ 5-Sep-08 3:20
_AnsHUMAN_ 5-Sep-08 3:20 
GeneralRe: How can Extract String ? Pin
toxcct5-Sep-08 3:37
toxcct5-Sep-08 3:37 
AnswerRe: How can Extract String ? Pin
Michael Dunn5-Sep-08 8:24
sitebuilderMichael Dunn5-Sep-08 8:24 
GeneralRe: How can Extract String ? Pin
Jerry Jeremiah7-Sep-08 11:21
Jerry Jeremiah7-Sep-08 11:21 
Questionuuid operator Pin
George_George5-Sep-08 2:15
George_George5-Sep-08 2:15 
AnswerRe: uuid operator Pin
_AnsHUMAN_ 5-Sep-08 2:56
_AnsHUMAN_ 5-Sep-08 2:56 
GeneralRe: uuid operator Pin
George_George7-Sep-08 17:23
George_George7-Sep-08 17:23 
AnswerRe: uuid operator Pin
cmk5-Sep-08 3:54
cmk5-Sep-08 3:54 
GeneralRe: uuid operator Pin
George_George7-Sep-08 17:20
George_George7-Sep-08 17:20 
QuestionA C++ Question Pin
False Chicken5-Sep-08 2:13
False Chicken5-Sep-08 2:13 
AnswerRe: A C++ Question Pin
Nibu babu thomas5-Sep-08 2:15
Nibu babu thomas5-Sep-08 2:15 
AnswerRe: A C++ Question Pin
toxcct5-Sep-08 3:10
toxcct5-Sep-08 3:10 
QuestionApplication crashes on calling settimer from a thread function Pin
manoharbalu5-Sep-08 2:05
manoharbalu5-Sep-08 2:05 
I have created a dialog to display message on my application for 5 seconds after which the dialog closes. I created the dialog using the following code before which I update the display message text for the dialog

sDispMsg = (CString)"Setting up the Design Condition";
CProgressDlg pProg;
pProg.DoModal();


The above code is within a function. When I call the function it works fine. But when I call the above function after creating a thread using the code:

if( bAteRunThreadActive == FALSE )
{
htAteRunThread = CreateThread( NULL,0,(LPTHREAD_START_ROUTINE)tExecuteAte,(LPVOID)NULL,NULL,&dwAteRunThreadID );
if( dwAteRunThreadID == NULL )
{
AfxMessageBox( "ATE Thread Creation Failed" );
return;
}
bAteRunThreadActive = TRUE;
}

Note that when I am creating the dialog inside the thread function, my application crashes at the point after I call the Settimer in the below code. When I call normally outside the thread in a normal function it works fine. Also when I did a step by step debugging it works fine in the thread function also.

Pls provide some solution.


//My Dialog code
BOOL CProgressDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// TODO: Add extra initialization here
GetDlgItem(IDC_STATIC_DISPMSG)->SetWindowText(sDispMsg);
tID = SetTimer(1,5000, NULL);

return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

void CProgressDlg::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default

/* int nRet = 5; */

KillTimer(tID);
//EndDialog(0);
CDialog::OnCancel();

// DestroyWindow();
// AfxGetMainWnd()->UpdateWindow();

//CDialog::OnTimer(nIDEvent);
}
AnswerRe: Application crashes on calling settimer from a thread function Pin
Roger Stoltz5-Sep-08 2:57
Roger Stoltz5-Sep-08 2:57 
AnswerRe: Application crashes on calling settimer from a thread function Pin
vikas amin5-Sep-08 6:41
vikas amin5-Sep-08 6:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.