| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1464 人关注过本帖
标题:VS2010 Win32应用程序写MFC,编译出错
只看楼主 加入收藏
nandiin
Rank: 2
等 级:论坛游民
帖 子:29
专家分:25
注 册:2013-2-28
结帖率:100%
收藏
 问题点数:0 回复次数:4 
VS2010 Win32应用程序写MFC,编译出错
我是现在VC++6.0里写的,一个很简单的程序 就是一开始全屏白,再全屏黑,再绘制三个白色的圆。
是用来图像识别时的边缘检测和矩阵转换的(这个跟本程序本身没关系····)

还有一些功能需要用到openCV,又不像下一个老版本的openCV去配合VC++6.0就把程序挪到VS2010里去执行,可是编译报错很恶心,头文件都编不过去···谁能帮忙解答一下吗。
下面
1#头文件
2#源文件
3#报错 内容
搜索更多相关主题的帖子: 应用程序 源文件 
2013-03-01 11:16
nandiin
Rank: 2
等 级:论坛游民
帖 子:29
专家分:25
注 册:2013-2-28
收藏
得分:0 
程序代码:
#ifndef _FULLSCREEN
#define _FULLSCREEN
#include <AFXWIN.H>
class CFullScrnApp:public CWinApp
{
private:
protected:
public:
    virtual BOOL InitInstance();
};
class CFullScrnWindow:public CFrameWnd
{
public:
    CFullScrnWindow();
    afx_msg void OnNcPaint();
    afx_msg void OnTimer(UINT);
    DECLARE_MESSAGE_MAP()
};
#endif
2013-03-01 11:16
nandiin
Rank: 2
等 级:论坛游民
帖 子:29
专家分:25
注 册:2013-2-28
收藏
得分:0 
程序代码:
//*****************
// Full Screen Test
//*****************
#include "FullScreenApp.h"
#define GAP 1000
#define ID_TIMER1 1
#define ID_TIMER2 2
CFullScrnApp FullScrnApp;
int nFullWidth=GetSystemMetrics(SM_CXSCREEN);  
int nFullHeight=GetSystemMetrics(SM_CYSCREEN);

BEGIN_MESSAGE_MAP(CFullScrnWindow,CFrameWnd)
ON_WM_NCPAINT()
ON_WM_TIMER()
END_MESSAGE_MAP()

BOOL CFullScrnApp::InitInstance()
{
    m_pMainWnd=new CFullScrnWindow();
    m_pMainWnd->ShowWindow(SW_SHOWMAXIMIZED);
    m_pMainWnd->UpdateWindow();
    return TRUE;
}
CFullScrnWindow::CFullScrnWindow()
{
    Create(NULL,"FullScreenTest",WS_OVERLAPPEDWINDOW,CRect(0,0,nFullWidth,nFullHeight));
    SetWindowLong(this->m_hWnd,GWL_STYLE,255);
    SetTimer(ID_TIMER1,GAP,NULL);
    SetTimer(ID_TIMER2,GAP*2,NULL);
}
void CFullScrnWindow::OnNcPaint()   
{  
    CWindowDC dc(this); 
    dc.FillSolidRect(0,0,nFullWidth,nFullHeight,RGB(255,255,255)); 
}
void CFullScrnWindow::OnTimer(UINT nIDEvent)
{
    CWindowDC dc(this);
    if (nIDEvent==1)
    {
        dc.FillSolidRect(0,0,nFullWidth,nFullHeight,RGB(0,0,0)); 
        KillTimer(ID_TIMER1);
    }
    else if(nIDEvent==2)
    {        
        CBrush cBrush;
        CWindowDC dc(this);
        cBrush.CreateSolidBrush(RGB(255,255,255));
        dc.Ellipse(10,0,80,70);
        dc.Ellipse(1277,10,1347,80);
        dc.Ellipse(752,615,822,685);
        KillTimer(ID_TIMER2);
    }
}
2013-03-01 11:17
nandiin
Rank: 2
等 级:论坛游民
帖 子:29
专家分:25
注 册:2013-2-28
收藏
得分:0 
1>------ Build started: Project: FullScreen, Configuration: Debug Win32 ------
1>  FullScreen.cpp
1>  _WIN32_WINNT not defined. Defaulting to _WIN32_WINNT_MAXVER (see WinSDKVer.h)
1>d:\program files (x86)\microsoft visual studio 10.0\vc\include\afxwin.h(137): error C2011: 'CSize' : 'class' type redefinition
1>          d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atltypes.h(26) : see declaration of 'CSize'
1>d:\program files (x86)\microsoft visual studio 10.0\vc\include\afxwin.h(176): error C2011: 'CPoint' : 'class' type redefinition
1>          d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atltypes.h(69) : see declaration of 'CPoint'
1>d:\program files (x86)\microsoft visual studio 10.0\vc\include\afxwin.h(225): error C2011: 'CRect' : 'class' type redefinition
1>          d:\program files (x86)\microsoft visual studio 10.0\vc\atlmfc\include\atltypes.h(125) : see declaration of 'CRect'
1>d:\program files (x86)\microsoft visual studio 10.0\vc\include\afxwin.h(3195): error C2079: 'CFrameWnd::m_rectBorder' uses undefined class 'CRect'
1>d:\program files (x86)\microsoft visual studio 10.0\vc\include\afxwin.h(3741): error C2079: 'CScrollView::m_totalLog' uses undefined class 'CSize'
1>d:\program files (x86)\microsoft visual studio 10.0\vc\include\afxwin.h(3742): error C2079: 'CScrollView::m_totalDev' uses undefined class 'CSize'
1>d:\program files (x86)\microsoft visual studio 10.0\vc\include\afxwin.h(3743): error C2079: 'CScrollView::m_pageDev' uses undefined class 'CSize'
1>d:\program files (x86)\microsoft visual studio 10.0\vc\include\afxwin.h(3744): error C2079: 'CScrollView::m_lineDev' uses undefined class 'CSize'
1>d:\program files (x86)\microsoft visual studio 10.0\vc\include\afxwin.h(3870): error C2079: 'CWinThread::m_ptCursorLast' uses undefined class 'CPoint'
1>e:\vs2010 workspace\fullscreen\fullscreen\fullscreen.h(4): fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
2013-03-01 11:18
nandiin
Rank: 2
等 级:论坛游民
帖 子:29
专家分:25
注 册:2013-2-28
收藏
得分:0 
卸载重装vs2010解决
2013-03-06 16:26
快速回复:VS2010 Win32应用程序写MFC,编译出错
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030524 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved