第一次学习vc++vista所以用的vs2008档案->新增->专案->mfc应用程式->名字->下一步->单一文件界面->完成
然后找到Chello1View 这里奇怪的是我的类别搜寻器是没有的,就是没有filter... 很不方便,在vs2008里怎么调出来哦?// Chello1View 描繪void Chello1View::OnDraw(CDC* pDC)
{
Chello1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc); int num[5]={2,4,6,8,10};
int sum=0;
for(int i=0;i<=4;i++){
sum+=num[i];
}
Cstring strNum;
strNum.Format("%d",sum);
pDc->TextOut(0,0,"Sum is ",+strNum); // TODO: 在此加入原生資料的描繪程式碼
}然后调试,好多错误:
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(59) : error C2065: 'Cstring' : 未宣告的識別項
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(59) : error C2146: 語法錯誤 : 遺漏 ';' (在識別項 'strNum' 之前)
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(59) : error C2065: 'strNum' : 未宣告的識別項
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(60) : error C2065: 'strNum' : 未宣告的識別項
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(60) : error C2228: '.Format' 的左邊必須有類別/結構/等位
1> 型別為 ''unknown-type''
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(61) : error C2065: 'pDc' : 未宣告的識別項
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(61) : error C2227: '->TextOutW' 的左邊必須指向類別/結構/等位/泛型型別
1> 型別為 ''unknown-type''
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(61) : error C2065: 'strNum' : 未宣告的識別項
谢谢哦!~
然后找到Chello1View 这里奇怪的是我的类别搜寻器是没有的,就是没有filter... 很不方便,在vs2008里怎么调出来哦?// Chello1View 描繪void Chello1View::OnDraw(CDC* pDC)
{
Chello1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc); int num[5]={2,4,6,8,10};
int sum=0;
for(int i=0;i<=4;i++){
sum+=num[i];
}
Cstring strNum;
strNum.Format("%d",sum);
pDc->TextOut(0,0,"Sum is ",+strNum); // TODO: 在此加入原生資料的描繪程式碼
}然后调试,好多错误:
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(59) : error C2065: 'Cstring' : 未宣告的識別項
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(59) : error C2146: 語法錯誤 : 遺漏 ';' (在識別項 'strNum' 之前)
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(59) : error C2065: 'strNum' : 未宣告的識別項
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(60) : error C2065: 'strNum' : 未宣告的識別項
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(60) : error C2228: '.Format' 的左邊必須有類別/結構/等位
1> 型別為 ''unknown-type''
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(61) : error C2065: 'pDc' : 未宣告的識別項
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(61) : error C2227: '->TextOutW' 的左邊必須指向類別/結構/等位/泛型型別
1> 型別為 ''unknown-type''
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(61) : error C2065: 'strNum' : 未宣告的識別項
谢谢哦!~
解决方案 »
- 如何实现内核级保护进程?在网上看到如下代码,不知如何使用,在VC中可以编译吗(是不是编译成SYS文件啊),如何配置DDK啊?
- 关于串口通信接收数据问题
- 网络编程问题100求助
- 用VC++对EXCEL进行创建,存取如何进行,很急谢谢
- 客户端的本机通信的小代码总是一闪而过,我加了system("pause");还是不行,代码没报错,我贴出来了
- 文件夹的属性是FILE_ATTRIBUTE_DIRECTORY,那么文件 和 驱动器呢?
- 如何能暂停程序以便看清输出的结果
- 高分求助:DBGrid控件
- 第一个进该贴回复的得到 40分
- 会网络编程的请进....
- VC++ + SQL的数据库编程
- CImage的一个问题
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(61) : error C2065: 'pDc' : 未宣告的識別項
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(61) : error C2227: '->TextOutW' 的左邊必須指向類別/結構/等位/泛型型別还有错误哦!~还有能不能告诉我 怎么调出 filter... ~~谢谢~~~
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> 指向的型別沒有相關; 轉換必須有 reinterpret_cast、C-Style 轉換或函式樣式轉換
1>c:\users\calm\documents\visual studio 2008\projects\hello1\hello1\hello1view.cpp(61) : error C2678: 二元運算子 '+' : 找不到使用左方運算元型別 'const char [8]' 的運算子 (或是沒有可接受的轉換)
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(654): 可能是 'ATL::CSimpleStringT<BaseType,t_bMFCDLL> ATL::CSimpleStringT<BaseType,t_bMFCDLL>::operator +(const ATL::CSimpleStringT<BaseType,t_bMFCDLL> &,const ATL::CSimpleStringT<BaseType,t_bMFCDLL> &)' [使用與引數相關的查閱找到]
1> with
1> [
1> BaseType=wchar_t,
1> t_bMFCDLL=true
1> ]
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(665): 或 'ATL::CSimpleStringT<BaseType,t_bMFCDLL> ATL::CSimpleStringT<BaseType,t_bMFCDLL>::operator +(const ATL::CSimpleStringT<BaseType,t_bMFCDLL> &,const wchar_t *)' [使用與引數相關的查閱找到]
1> with
1> [
1> BaseType=wchar_t,
1> t_bMFCDLL=true
1> ]
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\atlsimpstr.h(676): 或 'ATL::CSimpleStringT<BaseType,t_bMFCDLL> ATL::CSimpleStringT<BaseType,t_bMFCDLL>::operator +(const wchar_t *,const ATL::CSimpleStringT<BaseType,t_bMFCDLL> &)' [使用與引數相關的查閱找到]
1> with
1> [
1> BaseType=wchar_t,
1> t_bMFCDLL=true
1> ]
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2033): 或 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const ATL::CStringT<BaseType,StringTraits> &,const ATL::CStringT<BaseType,StringTraits> &)' [使用與引數相關的查閱找到]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2042): 或 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const ATL::CStringT<BaseType,StringTraits> &,const wchar_t *)' [使用與引數相關的查閱找到]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2051): 或 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const wchar_t *,const ATL::CStringT<BaseType,StringTraits> &)' [使用與引數相關的查閱找到]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2060): 或 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const ATL::CStringT<BaseType,StringTraits> &,wchar_t)' [使用與引數相關的查閱找到]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2070): 或 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(const ATL::CStringT<BaseType,StringTraits> &,char)' [使用與引數相關的查閱找到]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2080): 或 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(wchar_t,const ATL::CStringT<BaseType,StringTraits> &)' [使用與引數相關的查閱找到]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> c:\program files\microsoft visual studio 9.0\vc\atlmfc\include\cstringt.h(2090): 或 'ATL::CStringT<BaseType,StringTraits> ATL::CStringT<BaseType,StringTraits>::operator +(char,const ATL::CStringT<BaseType,StringTraits> &)' [使用與引數相關的查閱找到]
1> with
1> [
1> BaseType=wchar_t,
1> StringTraits=StrTraitMFC_DLL<wchar_t>
1> ]
1> 當嘗試符合引數清單 '(const char [8], CString)' 時
1>已將建置記錄儲存於 "file://c:\Users\calm\Documents\Visual Studio 2008\Projects\hello1\hello1\Debug\BuildLog.htm"
1>hello1 - 2 個錯誤,0 個警告
========== 建置: 0 成功、1 失敗、0 最新、0 略過 ==========
{
Chello1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc); int num[5]={2,4,6,8,10};
int sum=0;
for(int i=0;i<=4;i++){
sum+=num[i];
}
Cstring strNum;
strNum.Format(_T("%d"),sum);
pDC->TextOut(0,0,_T("Sum is "),+strNum); // TODO: 在此加入原生資料的描繪程式碼
}
{
Chello1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc); int num[5]={2,4,6,8,10};
int sum=0;
for(int i=0;i <=4;i++){
sum+=num[i];
}
CString strNum;
strNum.Format(_T("%d"),sum);
pDC->TextOut(0,0,_T("Sum is ,")+strNum); // TODO: 在此加入原生資料的描繪程式碼
}
{
Chello1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc); int num[5]={2,4,6,8,10};
int sum=0;
for(int i=0;i <=4;i++){
sum+=num[i];
}
CString strNum;
strNum.Format(_T("%d"),sum);
pDC->TextOut(0,0,_T("Sum is ,")+strNum); // TODO: 在此加入原生資料的描繪程式碼
}
{
Chello1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc); // TODO: 在此加入原生資料的描繪程式碼
int num[5]={2,4,6,8,10};
int sum=0;
for(int i=0;i<=4;i++){
sum+=num[i];
}
Cstring strNum;
strNum.Format(_T("Sum is %d"), sum);
pDc->TextOutW(0, 0, strNum);
}
void Chello1View::OnDraw(CDC* pDC)
{
Chello1Doc* pDoc = GetDocument();
ASSERT_VALID(pDoc); // TODO: 在此加入原生資料的描繪程式碼
int num[5]={2,4,6,8,10};
int sum=0;
for(int i=0;i<=4;i++){
sum+=num[i];
}
CString strNum;
strNum.Format(_T("Sum is %d"), sum);
pDC->TextOutW(0, 0, strNum);
}