a question about check box
-
I have a dlg application in which i would like to put 2 check box. For each check box there is a boolean variable, i would like to use those variables so that my app could call the right function when one of this check box is flagged. But, when i try to compile my code i have this kind of warning message: warning c4800:"int":forcing value to bool "true" or "false"(performance warning) So, i don't know if it's really a big pb. Perhaps i should use another type of button as a radio button, i don't know! Thanks in advance for your help. gerald
-
I have a dlg application in which i would like to put 2 check box. For each check box there is a boolean variable, i would like to use those variables so that my app could call the right function when one of this check box is flagged. But, when i try to compile my code i have this kind of warning message: warning c4800:"int":forcing value to bool "true" or "false"(performance warning) So, i don't know if it's really a big pb. Perhaps i should use another type of button as a radio button, i don't know! Thanks in advance for your help. gerald
-
I have a dlg application in which i would like to put 2 check box. For each check box there is a boolean variable, i would like to use those variables so that my app could call the right function when one of this check box is flagged. But, when i try to compile my code i have this kind of warning message: warning c4800:"int":forcing value to bool "true" or "false"(performance warning) So, i don't know if it's really a big pb. Perhaps i should use another type of button as a radio button, i don't know! Thanks in advance for your help. gerald
Please, post a code excerpt that raises the warning. Probably, you're doing something like this: int b; b = true; and you should be doing this: bool b; b = true; Tip: press now the reset button to test your memory.
-
Please, post a code excerpt that raises the warning. Probably, you're doing something like this: int b; b = true; and you should be doing this: bool b; b = true; Tip: press now the reset button to test your memory.
first i post the function which use it: double EuropeanSwaption::CallOrPutEuropeanSwaption(COleDateTime StartDate,COleDateTime SwaptionEndDate,COleDateTime SwapEndDate,double Strike,int BaseAnnuelle,double Nominal,int Periodicity,_variant_t RateTable,_variant_t VolatilitySurface,bool CheckPayeuse,bool CheckReceveuse) { double Price; if(CheckPayeuse==TRUE && CheckReceveuse==FALSE) Price=CallEuropeanSwaption( StartDate, SwaptionEndDate,SwapEndDate,Strike,BaseAnnuelle,Nominal,Periodicity,RateTable,VolatilitySurface); if(CheckPayeuse==FALSE && CheckReceveuse==TRUE) Price=PutEuropeanSwaption( StartDate, SwaptionEndDate,SwapEndDate,Strike,BaseAnnuelle,Nominal,Periodicity,RateTable,VolatilitySurface); if(CheckPayeuse==TRUE && CheckReceveuse==TRUE||CheckPayeuse==FALSE && CheckReceveuse==FALSE) AfxMessageBox("Il faudrait peut être faire un choix!!"); return Price; } this first function is used in the calculation part. Now i could show a sample coming from the the dlg code, i just post the line which call the function described above: m_dlgPrice=eur.CallOrPutEuropeanSwaption(m_dlgStartDate,m_dlgSwaptionEndDate,m_dlgSwapEndDate,m_dlgStrike,m_dlgModeDate,m_dlgNominal,Periodicity,"TauxZCEURO","SurfaceVolatilite",m_dlgPayeuse,m_dlgReceveuse); where eur is an EuropeanSwaption object, and m_dlgPayeuse, m_dlgReceveuse are the 2 variables linked to the 2 check box put in the dlgbox.
-
first i post the function which use it: double EuropeanSwaption::CallOrPutEuropeanSwaption(COleDateTime StartDate,COleDateTime SwaptionEndDate,COleDateTime SwapEndDate,double Strike,int BaseAnnuelle,double Nominal,int Periodicity,_variant_t RateTable,_variant_t VolatilitySurface,bool CheckPayeuse,bool CheckReceveuse) { double Price; if(CheckPayeuse==TRUE && CheckReceveuse==FALSE) Price=CallEuropeanSwaption( StartDate, SwaptionEndDate,SwapEndDate,Strike,BaseAnnuelle,Nominal,Periodicity,RateTable,VolatilitySurface); if(CheckPayeuse==FALSE && CheckReceveuse==TRUE) Price=PutEuropeanSwaption( StartDate, SwaptionEndDate,SwapEndDate,Strike,BaseAnnuelle,Nominal,Periodicity,RateTable,VolatilitySurface); if(CheckPayeuse==TRUE && CheckReceveuse==TRUE||CheckPayeuse==FALSE && CheckReceveuse==FALSE) AfxMessageBox("Il faudrait peut être faire un choix!!"); return Price; } this first function is used in the calculation part. Now i could show a sample coming from the the dlg code, i just post the line which call the function described above: m_dlgPrice=eur.CallOrPutEuropeanSwaption(m_dlgStartDate,m_dlgSwaptionEndDate,m_dlgSwapEndDate,m_dlgStrike,m_dlgModeDate,m_dlgNominal,Periodicity,"TauxZCEURO","SurfaceVolatilite",m_dlgPayeuse,m_dlgReceveuse); where eur is an EuropeanSwaption object, and m_dlgPayeuse, m_dlgReceveuse are the 2 variables linked to the 2 check box put in the dlgbox.
This is a common error: TRUE and FALSE are for type BOOL true and false are for type bool Try making them consistent and the warning will go away. Furor fit laesa saepius patientia
-
This is a common error: TRUE and FALSE are for type BOOL true and false are for type bool Try making them consistent and the warning will go away. Furor fit laesa saepius patientia
i test it and it works, thanks a lot
-
I have a dlg application in which i would like to put 2 check box. For each check box there is a boolean variable, i would like to use those variables so that my app could call the right function when one of this check box is flagged. But, when i try to compile my code i have this kind of warning message: warning c4800:"int":forcing value to bool "true" or "false"(performance warning) So, i don't know if it's really a big pb. Perhaps i should use another type of button as a radio button, i don't know! Thanks in advance for your help. gerald
Try using BOOL instead of bool for your variable. --Mark Terrano www.ensemblestudios.com (Creators of the Age of Empires series)