Click here to Skip to main content
15,916,842 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionI have written a pipe-like class. Would you tell me some advices on it? Pin
xiaochnegwx8-Jul-03 22:37
xiaochnegwx8-Jul-03 22:37 
GeneralSTRANGE!!!!!!!!!! Pin
vcseeker8-Jul-03 22:19
vcseeker8-Jul-03 22:19 
GeneralAnyone????????? Pin
vcseeker9-Jul-03 1:23
vcseeker9-Jul-03 1:23 
GeneralRe: Anyone????????? Pin
Rage9-Jul-03 2:04
professionalRage9-Jul-03 2:04 
QuestionWhich one is best for Wait in a thread? Pin
chen8-Jul-03 21:53
chen8-Jul-03 21:53 
AnswerRe: Which one is best for Wait in a thread? Pin
Magnus Westin8-Jul-03 23:01
Magnus Westin8-Jul-03 23:01 
AnswerRe: Which one is best for Wait in a thread? Pin
Mike Dimmick8-Jul-03 23:14
Mike Dimmick8-Jul-03 23:14 
GeneralRe: Which one is best for Wait in a thread? Pin
chen9-Jul-03 0:09
chen9-Jul-03 0:09 
Hi, Magnus and Mike,

Thanks for reply.

I have try to the following to methods in the loop

for(session=1; session<=2; session++)
{
....
....
here a command will tell the cd-driver, the first session data finished
and then the driver write the leadout datd (now i need the thread do nothing until the leadout finished) ...

Method_1 or Method_2
}

Method_1:
while(ts->m_CD.test_unit_ready() != 1) //unit not ready
Sleep(100);

Method_2:
while(ses != 2)
{
if(WAIT_OBJECT_0 == WaitForSingleObject(ts->pThread->m_hThread, 100))
{
ResetEvent(ts->pThread->m_hThread);
}
if(ts->m_CD.test_unit_ready() == 1)
{
SetEvent(ts->pThread->m_hThread);
break;
}
}

It seems both method cannot work.
any ideas?






chen
GeneralRe: Which one is best for Wait in a thread? Pin
Magnus Westin9-Jul-03 7:14
Magnus Westin9-Jul-03 7:14 
GeneralCommand Line Options Pin
BoudewijnEctor8-Jul-03 21:44
BoudewijnEctor8-Jul-03 21:44 
GeneralRe: Command Line Options Pin
giorgos8-Jul-03 21:52
giorgos8-Jul-03 21:52 
GeneralRe: Command Line Options Pin
David Crow9-Jul-03 3:55
David Crow9-Jul-03 3:55 
GeneralMDI - PLEASE URGENT Pin
giorgos8-Jul-03 21:30
giorgos8-Jul-03 21:30 
GeneralRe: MDI - PLEASE URGENT Pin
Ryan Binns8-Jul-03 21:52
Ryan Binns8-Jul-03 21:52 
GeneralRe: MDI - PLEASE URGENT Pin
giorgos8-Jul-03 22:12
giorgos8-Jul-03 22:12 
GeneralRe: MDI - PLEASE URGENT Pin
Ryan Binns8-Jul-03 22:15
Ryan Binns8-Jul-03 22:15 
GeneralRe: MDI - PLEASE URGENT Pin
giorgos8-Jul-03 22:23
giorgos8-Jul-03 22:23 
GeneralRe: MDI - PLEASE URGENT Pin
Ryan Binns8-Jul-03 22:27
Ryan Binns8-Jul-03 22:27 
GeneralABS( ) Pin
DaveE9th8-Jul-03 20:49
DaveE9th8-Jul-03 20:49 
GeneralRe: ABS( ) Pin
Ryan Binns8-Jul-03 20:54
Ryan Binns8-Jul-03 20:54 
GeneralRe: ABS( ) Pin
peterchen9-Jul-03 1:59
peterchen9-Jul-03 1:59 
GeneralRe: ABS( ) Pin
DaveE9th9-Jul-03 4:01
DaveE9th9-Jul-03 4:01 
QuestionHow to store a numeric value to *.mdb table from edit box Pin
Emre Zorlu8-Jul-03 20:14
Emre Zorlu8-Jul-03 20:14 
AnswerRe: How to store a numeric value to *.mdb table from edit box Pin
Toni788-Jul-03 20:25
Toni788-Jul-03 20:25 
AnswerRe: How to store a numeric value to *.mdb table from edit box Pin
Terry O'Nolley10-Jul-03 8:18
Terry O'Nolley10-Jul-03 8:18 

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.