functionA()
{
......//some other code
functionB();
......//some other code}functionB()
{
init_code();
.....
hHANDLE = CreateThread(NULL, 0, functionC, NULL, 0, &dwThrdID)
}functionC()
{
.......
deal_with_something(); //some error will be happen in the process by exterior cause
.......
}我想在functionC()错误发生后返回到functionA()从新执行
怎么办呢?
{
......//some other code
functionB();
......//some other code}functionB()
{
init_code();
.....
hHANDLE = CreateThread(NULL, 0, functionC, NULL, 0, &dwThrdID)
}functionC()
{
.......
deal_with_something(); //some error will be happen in the process by exterior cause
.......
}我想在functionC()错误发生后返回到functionA()从新执行
怎么办呢?
try{functionC()}
catch(...)
{functionA()}
{
for(;;)
{ //some codes here
if(FuncB()) //Test the return code
...//some codes here
}
}DWORD FuncB()
{
DWORD dwThreadRtnCode;
CreateThread(FuncC);
dwThreadRtnCode = GetThreadExitCode(..)
if(dwThreadRtnCode==STILL_ACTIVE)
....
else
return dwThreadRtnCode;
}static Unit funcc()
{
//return 1 if some error caused otherwise return 0
}