error:在使用大于号之前忘记将大于号两边的类型转化为一致

来源:互联网 发布:网络诈骗形式 编辑:程序博客网 时间:2024/05/18 00:16
代码如下:
if (ProcessRate != this->Label4->Caption){this->Label4->Caption = ProcessRate;sprintf(pLog,"更新了进度条");WriteLog(pLogPath,pLog);}
以上代码中ProcessRate 是整型的,而this->Label4->Caption却是ansiString类型的,可见两者是不能直接转换的,必须得先把this->Label4->Caption中的数字提取出来,才能比较大小。this->Label4->Caption.c_str().ToInt()转换一下。
0 0