Click here to Skip to main content
15,905,867 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
Questiondebugging multi threading application Pin
VCProgrammer5-Sep-08 1:39
VCProgrammer5-Sep-08 1:39 
AnswerRe: debugging multi threading application Pin
Sarath C5-Sep-08 1:59
Sarath C5-Sep-08 1:59 
AnswerRe: debugging multi threading application Pin
vikas amin5-Sep-08 6:31
vikas amin5-Sep-08 6:31 
AnswerRe: debugging multi threading application Pin
vikas amin5-Sep-08 6:48
vikas amin5-Sep-08 6:48 
QuestionApplication failed to initialize properly. [modified] Pin
T.RATHA KRISHNAN5-Sep-08 1:02
T.RATHA KRISHNAN5-Sep-08 1:02 
AnswerRe: Application failed to initialize properly. Pin
toxcct5-Sep-08 3:14
toxcct5-Sep-08 3:14 
AnswerRe: Application failed to initialize properly. Pin
vikas amin5-Sep-08 6:29
vikas amin5-Sep-08 6:29 
Questionsetup package using Inno Setup Pin
AnithaSubramani4-Sep-08 23:44
AnithaSubramani4-Sep-08 23:44 
AnswerRe: setup package using Inno Setup Pin
Garth J Lancaster5-Sep-08 0:16
professionalGarth J Lancaster5-Sep-08 0:16 
AnswerRe: setup package using Inno Setup Pin
sashoalm5-Sep-08 0:58
sashoalm5-Sep-08 0:58 
GeneralRe: setup package using Inno Setup Pin
AnithaSubramani6-Sep-08 0:15
AnithaSubramani6-Sep-08 0:15 
GeneralRe: setup package using Inno Setup Pin
AnithaSubramani9-Sep-08 3:07
AnithaSubramani9-Sep-08 3:07 
GeneralRe: setup package using Inno Setup Pin
sashoalm9-Sep-08 3:59
sashoalm9-Sep-08 3:59 
QuestionCapacity of USB Device Pin
cpvc++4-Sep-08 23:37
cpvc++4-Sep-08 23:37 
AnswerRe: Capacity of USB Device Pin
Naveen4-Sep-08 23:52
Naveen4-Sep-08 23:52 

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.