Click here to Skip to main content
16,010,544 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CListBox and Scrollbar... Pin
l a u r e n24-Mar-01 3:09
l a u r e n24-Mar-01 3:09 
GeneralRe: CListBox and Scrollbar... Pin
3-Jul-01 5:35
suss3-Jul-01 5:35 
Generalwin95 exe's jump to win2000 - (Painful) Pin
Gerry23-Mar-01 5:40
Gerry23-Mar-01 5:40 
GeneralRe: win95 exe's jump to win2000 - (Painful) Pin
Kannan Kalyanaraman23-Mar-01 18:55
Kannan Kalyanaraman23-Mar-01 18:55 
GeneralRe: win95 exe's jump to win2000 - (Painful) Pin
l a u r e n23-Mar-01 21:57
l a u r e n23-Mar-01 21:57 
GeneralRe: win95 exe's jump to win2000 - (Painful) Pin
Erik Funkenbusch23-Mar-01 21:56
Erik Funkenbusch23-Mar-01 21:56 
GeneralGetting the original URL of a Temp. Internet File Pin
23-Mar-01 5:11
suss23-Mar-01 5:11 
GeneralAfxBeginThread and EndThread Pin
Vickie23-Mar-01 4:25
Vickie23-Mar-01 4:25 
Dear all,

I'm writting a MFC program that enables the user to enter the URL, and then
press "Start" button to start downloading the html from that URL. So I have
create a WorkerThread to handle the downloading process so that the user can
press "Stop" button to terminate the downloading process.
After successful or unsuccessful downloading of html, it should call a
Text-to-speech function to speak to the user about the status of download.
However, the text-to-speech function cannot work when there is another
thread running.
I have tried to create another thread to call the TTS function, but it
failed too.

My question is :where does the thread return when it finished??
Is there anyother method to call my TTS() function when the thread is
finished?

Here is my program:
// myappdlg.cpp
static UINT workerthreadcontrol ( void * pRTclass )

void myappdlg.OnStart()
{
downloadHTML();
}

void downloadHTML()
{
.....
CWinThread* pWorkerThread;
pWorkerThread = AfxBeginThread ( workerthreadcontrol, this,
THREAD_PRIORITY_NORMAL, 0,
CREATE_SUSPENDED );
m_Startbtn.EnableWindow( False );
m_Stopbtn.EnableWindow( True );
pWorkerThread->ResumeThread();
.....
}

UINT workerthreadcontrol( void * pRTclass )
{
myappdlg pDlg = (myappdlg*) pRTclass;
pDlg->WorkerThreadProcess();

return 0;
}
void WorkerThreadProcess()
{
doing downloading.........
}

// Where should I put this function???
void TTS( LPCTSTR Text )
{
Speak out Text.....
}

Thanks a lot for your help....

Best Regards,
Vickie


GeneralRe: AfxBeginThread and EndThread Pin
Michael Dunn23-Mar-01 15:45
sitebuilderMichael Dunn23-Mar-01 15:45 
GeneralURGENT: Convert CHAR dimension into BSTR Pin
23-Mar-01 3:58
suss23-Mar-01 3:58 
GeneralRe: URGENT: Convert CHAR dimension into BSTR Pin
Gerry23-Mar-01 5:57
Gerry23-Mar-01 5:57 
GeneralRe: URGENT: Convert CHAR dimension into BSTR Pin
23-Mar-01 9:21
suss23-Mar-01 9:21 
GeneralRe: URGENT: Convert CHAR dimension into BSTR Pin
25-Mar-01 20:36
suss25-Mar-01 20:36 
Generalthe ATL way Pin
23-Mar-01 9:59
suss23-Mar-01 9:59 
GeneralRe: URGENT: Convert CHAR dimension into BSTR Pin
Ancient Dragon23-Mar-01 20:04
Ancient Dragon23-Mar-01 20:04 
GeneralJosephus Problem (Linked List) Pin
23-Mar-01 3:18
suss23-Mar-01 3:18 
Generalostringstream and <sstream> Pin
23-Mar-01 3:05
suss23-Mar-01 3:05 
GeneralRe: ostringstream and <sstream> Pin
sticky7223-Mar-01 3:09
sticky7223-Mar-01 3:09 
GeneralRe: ostringstream and <sstream> Pin
Erik Funkenbusch23-Mar-01 22:03
Erik Funkenbusch23-Mar-01 22:03 
QuestionGetting TypeLibrary Name?? Pin
ernst.maurer23-Mar-01 1:04
ernst.maurer23-Mar-01 1:04 
QuestionGetting TypeLibrary Name?? Pin
ernst.maurer23-Mar-01 1:01
ernst.maurer23-Mar-01 1:01 
GeneralProblem about sprite animation Pin
kyousuke22-Mar-01 23:42
kyousuke22-Mar-01 23:42 
GeneralRe: Problem about sprite animation Pin
l a u r e n23-Mar-01 0:35
l a u r e n23-Mar-01 0:35 
GeneralRe: Problem about sprite animation Pin
kyousuke23-Mar-01 6:19
kyousuke23-Mar-01 6:19 
GeneralRe: Problem about sprite animation Pin
23-Mar-01 8:32
suss23-Mar-01 8:32 

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.