Link to home
Start Free TrialLog in
Avatar of dvplayltd
dvplayltdFlag for Bulgaria

asked on

Why return do not terminate function in MS C2008 ++ ?

 Hi experts!

I'm new to MS C++ 2008 and need little help. I read in manual that return should break current execituon of the function, but after I finish my project by accident I find that look that is not true. Look my code:


long CCPlayCtrl::SetToZeroRemainTimeCurrFile(long lCard)
{
//  ... code

   if (!bFind)
          return -98; //Here should exit from function?!? Why do not exit and contunie with next code???


// next code write a message to the text file. I was shocked to find that bFind=false, return -98 is executed and function execution  just contunie with next row of code. WHY ???
         if (mbWriteAllCmd[lCard])
        {
             sLog.Format( _T( "CCPlayCtrl::SetToZeroRemainTimeCurrFile-->bFind=false !!!\n" ));
                                  StradisLogFunction(sLog);
        }


            lStradisDecoderSettingsFrame[iIndex]=0; lStradisDecoderSettingshWng[iIndex]=0;
            return 0;
 


 
}

Do i need to change all situations like this in my code, or this is some specific case? In any case I should know what is going on. To be more clear, this is ActiveX project (OCX) and this is one of his public functions.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dvplayltd

ASKER

10x. In final case you are right, bFind is not false, sorry for stuped question.