level 1
吾吾如泪1o
楼主
void CDVExampleView::OnDraw(CDC* /*pDC*/)
{
CDVExampleDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: 在此处为本机数据添加绘制代码
int answer;
CString msg;
msg.Format("Add 100 to m_Data?")
anwer = AfxMessageBox(msg, MB_YESNO);
if(answer == IDYES)
{
pDoc->AddData(); //Document 调用一个对象的成员函数
}
msg.Format("m_Data = %d", pDoc->m_Data);
AfxMessageBox(msg);
}
vc 版本是 2010
出错内容 :
“anwer”: 未声明的标识符
error C2664: “void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)”: 不能将参数 1 从“const char [12]”转换为“const wchar_t *”1> with1> [1> BaseType=wchar_t,1> StringTraits=StrTraitMFC_DLL<wchar_t>1> ]1> 与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换
2012年02月21日 04点02分
1
{
CDVExampleDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: 在此处为本机数据添加绘制代码
int answer;
CString msg;
msg.Format("Add 100 to m_Data?")
anwer = AfxMessageBox(msg, MB_YESNO);
if(answer == IDYES)
{
pDoc->AddData(); //Document 调用一个对象的成员函数
}
msg.Format("m_Data = %d", pDoc->m_Data);
AfxMessageBox(msg);
}
vc 版本是 2010
出错内容 :
“anwer”: 未声明的标识符
error C2664: “void ATL::CStringT<BaseType,StringTraits>::Format(const wchar_t *,...)”: 不能将参数 1 从“const char [12]”转换为“const wchar_t *”1> with1> [1> BaseType=wchar_t,1> StringTraits=StrTraitMFC_DLL<wchar_t>1> ]1> 与指向的类型无关;转换要求 reinterpret_cast、C 样式转换或函数样式转换