• 大小: 24.39MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-07-23
  • 语言: 其他
  • 标签: 单文档  显示图片  

资源简介

配合单文档调用opencv的代码

资源截图

代码片段和文件信息


// MainFrm.cpp : CMainframe 类的实现
//

#include “stdafx.h“
#include “testtuxiangchuli.h“

#include “MainFrm.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

// CMainframe

IMPLEMENT_DYNCREATE(CMainframe CframeWndEx)

const int  iMaxUserToolbars = 10;
const UINT uiFirstUserToolBarId = AFX_IDW_CONTROLBAR_FIRST + 40;
const UINT uiLastUserToolBarId = uiFirstUserToolBarId + iMaxUserToolbars - 1;

BEGIN_MESSAGE_MAP(CMainframe CframeWndEx)
ON_WM_CREATE()
ON_COMMAND(ID_VIEW_CUSTOMIZE &CMainframe::OnViewCustomize)
ON_REGISTERED_MESSAGE(AFX_WM_CREATETOOLBAR &CMainframe::OnToolbarCreateNew)
END_MESSAGE_MAP()

static UINT indicators[] =
{
ID_SEPARATOR           // 状态行指示器
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};

// CMainframe 构造/析构

CMainframe::CMainframe()
{
// TODO: 在此添加成员初始化代码
}

CMainframe::~CMainframe()
{
}

int CMainframe::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CframeWndEx::OnCreate(lpCreateStruct) == -1)
return -1;

BOOL bNameValid;

// 设置用于绘制所有用户界面元素的视觉管理器
CMFCVisualManager::SetDefaultManager(RUNTIME_CLASS(CMFCVisualManagerVS2008));

if (!m_wndMenuBar.Create(this))
{
TRACE0(“未能创建菜单栏\n“);
return -1;      // 未能创建
}

m_wndMenuBar.SetPanestyle(m_wndMenuBar.GetPanestyle() | CBRS_SIZE_DYNAMIC | CBRS_TOOLTIPS | CBRS_FLYBY);

// 防止菜单栏在激活时获得焦点
CMFCPopupMenu::SetForceMenuFocus(FALSE);

if (!m_wndToolBar.CreateEx(this TBstyle_FLAT WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(theApp.m_bHiColorIcons ? IDR_MAINframe_256 : IDR_MAINframe))
{
TRACE0(“未能创建工具栏\n“);
return -1;      // 未能创建
}

CString strToolBarName;
bNameValid = strToolBarName.LoadString(IDS_TOOLBAR_STANDARD);
ASSERT(bNameValid);
m_wndToolBar.SetWindowText(strToolBarName);

CString strCustomize;
bNameValid = strCustomize.LoadString(IDS_TOOLBAR_CUSTOMIZE);
ASSERT(bNameValid);
m_wndToolBar.EnableCustomizeButton(TRUE ID_VIEW_CUSTOMIZE strCustomize);

// 允许用户定义的工具栏操作:
InitUserToolbars(NULL uiFirstUserToolBarId uiLastUserToolBarId);

if (!m_wndStatusBar.Create(this))
{
TRACE0(“未能创建状态栏\n“);
return -1;      // 未能创建
}
m_wndStatusBar.SetIndicators(indicators sizeof(indicators)/sizeof(UINT));

// TODO: 如果您不希望工具栏和菜单栏可停靠,请删除这五行
m_wndMenuBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockPane(&m_wndMenuBar);
DockPane(&m_wndToolBar);


// 启用 Visual Studio 2005 样式停靠窗口行为
CDockingManager::SetDockingMode(DT_SMART);
// 启用 Visual Studio 2005 样式停靠窗口自动隐藏行为
EnableAutoHidePanes(CBRS_ALIGN_ANY);

// 启用工具栏和停靠窗口菜单替换
EnablePaneMenu(TRUE ID_VIEW_CUSTOMIZE strCustomize ID_VIEW_TOOLBAR);

// 启用快速(按住 Alt 拖动)工具栏自定义
CMFCToolBar::EnableQuickCustomization();

if (CMFCToolBar::GetUserImages() == NULL)
{
// 加载用户定义的工具栏图像
if (m_UserImages.Load(_T(“.\\UserImages.bmp“)))
{
C

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件     265216  2016-11-24 19:18  testtuxiangchuli\Debug\testtuxiangchuli.exe

     文件    2019248  2016-11-24 19:18  testtuxiangchuli\Debug\testtuxiangchuli.ilk

     文件    5499904  2016-11-24 19:18  testtuxiangchuli\Debug\testtuxiangchuli.pdb

     文件      92686  2016-10-22 11:20  testtuxiangchuli\testtuxiangchuli\815208360-327112ae2d3bef96.jpg

     文件     110163  2016-10-22 11:20  testtuxiangchuli\testtuxiangchuli\815208360-5afe0406cbeb43b7.jpg

     文件      14566  2016-10-22 11:20  testtuxiangchuli\testtuxiangchuli\815208360-606106cead53f2c8.jpg

     文件     137562  2016-11-21 16:24  testtuxiangchuli\testtuxiangchuli\d62a6059252dd42a75acc6d4003b5bb5c9eab82c.jpg

     文件       4024  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\cl.command.1.tlog

     文件      73470  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\CL.read.1.tlog

     文件       2686  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\CL.write.1.tlog

     文件          2  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\link-cvtres.read.1.tlog

     文件          2  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\link-cvtres.write.1.tlog

     文件       4116  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\link.command.1.tlog

     文件      11498  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\link.read.1.tlog

     文件       1488  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\link.write.1.tlog

     文件      82940  2016-11-21 16:45  testtuxiangchuli\testtuxiangchuli\Debug\MainFrm.obj

     文件        804  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\mt.command.1.tlog

     文件        824  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\mt.read.1.tlog

     文件        538  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\mt.write.1.tlog

     文件       1332  2016-11-21 16:45  testtuxiangchuli\testtuxiangchuli\Debug\rc.command.1.tlog

     文件       4388  2016-11-21 16:45  testtuxiangchuli\testtuxiangchuli\Debug\rc.read.1.tlog

     文件        606  2016-11-21 16:45  testtuxiangchuli\testtuxiangchuli\Debug\rc.write.1.tlog

     文件     642956  2016-11-21 16:45  testtuxiangchuli\testtuxiangchuli\Debug\stdafx.obj

     文件       4280  2016-11-21 16:44  testtuxiangchuli\testtuxiangchuli\Debug\testtuxiangchuli.Build.CppClean.log

     文件        915  2016-11-21 16:45  testtuxiangchuli\testtuxiangchuli\Debug\testtuxiangchuli.exe.embed.manifest

     文件        980  2016-11-21 16:45  testtuxiangchuli\testtuxiangchuli\Debug\testtuxiangchuli.exe.embed.manifest.res

     文件        640  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\testtuxiangchuli.exe.intermediate.manifest

     文件         60  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\testtuxiangchuli.lastbuildstate

     文件       3544  2016-11-24 19:18  testtuxiangchuli\testtuxiangchuli\Debug\testtuxiangchuli.log

     文件      58178  2016-11-21 16:45  testtuxiangchuli\testtuxiangchuli\Debug\testtuxiangchuli.obj

............此处省略44个文件信息

评论

共有 条评论