資源簡介
VC++2012 Prim 最小生成樹 動態演示

代碼片段和文件信息
//?MainFrm.cpp?:?implementation?of?the?CMainframe?class
//
#include?“stdafx.h“
#include?“Prim.h“
#include?“MyDialog.h“
#include?“MainFrm.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
const?int?big?=?999?;
struct?edge
{
int?weight;
int?one;
int?another;
};
int?count?=?0?;
/////////////////////////////////////////////////////////////////////////////
//?CMainframe
IMPLEMENT_DYNCREATE(CMainframe?CframeWnd)
BEGIN_MESSAGE_MAP(CMainframe?CframeWnd)
//{{AFX_MSG_MAP(CMainframe)
ON_WM_CREATE()
ON_COMMAND(ID_MENUITEM32771?OnMenuitem32771)
ON_COMMAND(ID_MENUITEM32772?OnMenuitemNew)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static?UINT?indicators[]?=
{
ID_SEPARATOR???????????//?status?line?indicator
ID_INDICATOR_CAPS
ID_INDICATOR_NUM
ID_INDICATOR_SCRL
};
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?construction/destruction
CMainframe::CMainframe()
{
//?TODO:?add?member?initialization?code?here
}
CMainframe::~CMainframe()
{
}
int?CMainframe::OnCreate(LPCREATESTRUCT?lpCreateStruct)
{
if?(CframeWnd::OnCreate(lpCreateStruct)?==?-1)
return?-1;
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(IDR_MAINframe))
{
TRACE0(“Failed?to?create?toolbar\n“);
return?-1;??????//?fail?to?create
}
if?(!m_wndStatusBar.Create(this)?||
!m_wndStatusBar.SetIndicators(indicators
??sizeof(indicators)/sizeof(UINT)))
{
TRACE0(“Failed?to?create?status?bar\n“);
return?-1;??????//?fail?to?create
}
//?TODO:?Delete?these?three?lines?if?you?don‘t?want?the?toolbar?to
//??be?dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return?0;
}
BOOL?CMainframe::PreCreateWindow(CREATESTRUCT&?cs)
{
if(?!CframeWnd::PreCreateWindow(cs)?)
return?FALSE;
//?TODO:?Modify?the?Window?class?or?styles?here?by?modifying
//??the?CREATESTRUCT?cs
return?TRUE;
}
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?diagnostics
#ifdef?_DEBUG
void?CMainframe::AssertValid()?const
{
CframeWnd::AssertValid();
}
void?CMainframe::Dump(CDumpContext&?dc)?const
{
CframeWnd::Dump(dc);
}
#endif?//_DEBUG
/////////////////////////////////////////////////////////////////////////////
//?CMainframe?message?handlers
void?CMainframe::OnMenuitem32771()?
{
//?TODO:?Add?your?command?handler?code?here
CDC?*?pDC?=?GetDC?()?;
pDC?->Ellipse?(83050880100)?;
pDC?->Ellipse?(630240680290)?;
pDC?->Ellipse?(730450780500)?;
pDC?->Ellipse?(830240880290)?;
pDC?->Ellipse?(10002401050290)?;
pDC?->Ellipse?(930450980500)?;
//pDC?->SetTextColor??(RGB?(25500));
pDC?->TextOut?(85570“1“)?;//255?55
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????49044??2011-01-03?02:22??Prim\Debug\MainFrm.obj
?????文件??????10999??2011-01-02?23:29??Prim\Debug\MyDialog.obj
?????文件?????135220??2011-01-03?02:22??Prim\Debug\Prim.exe
?????文件?????333612??2011-01-03?02:22??Prim\Debug\Prim.ilk
?????文件??????22496??2011-01-02?23:25??Prim\Debug\Prim.obj
?????文件????5499520??2011-01-01?02:21??Prim\Debug\Prim.pch
?????文件?????508928??2011-01-03?02:22??Prim\Debug\Prim.pdb
?????文件???????7460??2011-01-02?23:27??Prim\Debug\Prim.res
?????文件??????14276??2011-01-01?02:21??Prim\Debug\PrimDoc.obj
?????文件??????27779??2011-01-02?23:25??Prim\Debug\PrimView.obj
?????文件?????105302??2011-01-01?02:21??Prim\Debug\StdAfx.obj
?????文件?????214016??2011-01-03?02:22??Prim\Debug\vc60.idb
?????文件?????364544??2011-01-03?02:22??Prim\Debug\vc60.pdb
?????文件??????10278??2011-01-03?02:23??Prim\MainFrm.cpp
?????文件???????1527??2011-01-02?23:23??Prim\MainFrm.h
?????文件???????1156??2011-01-02?23:29??Prim\MyDialog.cpp
?????文件???????1168??2011-01-02?23:17??Prim\MyDialog.h
?????文件??????44196??2011-01-02?23:27??Prim\Prim.aps
?????文件???????2656??2011-01-03?02:23??Prim\Prim.clw
?????文件???????4173??2011-01-01?02:18??Prim\Prim.cpp
?????文件???????4638??2011-01-02?23:18??Prim\Prim.dsp
?????文件????????516??2011-01-01?02:18??Prim\Prim.dsw
?????文件???????1334??2011-01-01?02:18??Prim\Prim.h
?????文件??????66560??2011-01-03?02:23??Prim\Prim.ncb
?????文件??????50688??2011-01-03?02:23??Prim\Prim.opt
?????文件???????1126??2011-01-03?02:22??Prim\Prim.plg
?????文件??????12254??2011-01-02?23:27??Prim\Prim.rc
?????文件???????1702??2011-01-01?02:18??Prim\PrimDoc.cpp
?????文件???????1453??2011-01-01?02:18??Prim\PrimDoc.h
?????文件???????4536??2011-01-02?23:21??Prim\PrimView.cpp
............此處省略15個文件信息
- 上一篇:基于MFC的登陸界面
- 下一篇:譚浩強----C語言程序設計第二版高清晰PDF版
評論
共有 條評論