BSTR m_type = m_Node->Getattributes()->getNamedItem("TYPE")->Gettext();
char *s_type =_com_util::ConvertBSTRToString(m_type);
if(s_type == "1")
{
//do something
}
为什么他总是不相等啊?我把s_type强制转换成int同样int 1还是不等于1。
我真没招了,高手们帮忙啊。
char *s_type =_com_util::ConvertBSTRToString(m_type);
if(s_type == "1")
{
//do something
}
为什么他总是不相等啊?我把s_type强制转换成int同样int 1还是不等于1。
我真没招了,高手们帮忙啊。
CString str;
str=s_type;
str.Find("1")!=-1说明找到了"1"字符串
{
//do something
}
要不采用CString类型,可以直接用==