枚举类型转换错误. [英] Enumeration Casting type error.

查看:239
本文介绍了枚举类型转换错误.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

typedef enum {cstDisableState=0, cstUncheckedState=1, cstCheckedState} eCellCheckStateType;

void SetCheck(eCellCheckStateType bChecked);

CGridCellCheck* pCell = dynamic_cast<CGridCellCheck*>(
                                            m_gridctrl.GetCell(row, Column));

if (pCell)
{
pCell->SetCheck(static_cast<ecellcheckstatetype>(cstUncheckedState)); //error is here
}

error C2664: ''CGridCellTriStateCheck::SetCheck'' : cannot convert parameter 1 from ''CSFT::eCellCheckStateType'' to ''eCellCheckStateType''
        Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
</ecellcheckstatetype>



我在做什么错?



What am i doing wrong?

推荐答案

您是否在不同的命名空间或类中两次定义了相同的枚举?
Do you have the same enum defined twice in different namespaces or classes?


这篇关于枚举类型转换错误.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆