📄 finiteelecview.cpp
字号:
// FiniteElecView.cpp : implementation of the CFiniteElecView class
//
#include "stdafx.h"
#include "FiniteElec.h"
#include "FiniteElecDoc.h"
#include "FiniteElecView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFiniteElecView
IMPLEMENT_DYNCREATE(CFiniteElecView, CHtmlView)
BEGIN_MESSAGE_MAP(CFiniteElecView, CHtmlView)
//{{AFX_MSG_MAP(CFiniteElecView)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CHtmlView::OnFilePrint)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFiniteElecView construction/destruction
CFiniteElecView::CFiniteElecView()
{
// TODO: add construction code here
m_viewID=10;
}
CFiniteElecView::~CFiniteElecView()
{
}
BOOL CFiniteElecView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CHtmlView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CFiniteElecView drawing
void CFiniteElecView::OnDraw(CDC* pDC)
{
CFiniteElecDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
void CFiniteElecView::OnInitialUpdate()
{
CHtmlView::OnInitialUpdate();
// TODO: This code navigates to a popular spot on the web.
// change the code to go where you'd like.
// Navigate2(_T("about:blank"),NULL,NULL);
CString startpath,filepath;
char appPath[255];
int length=0;
// GetModuleFileName(NULL, appPath.GetBuffer(MAX_PATH), MAX_PATH);
GetModuleFileName(NULL, appPath, MAX_PATH);
startpath=CString(appPath);
length=startpath.GetLength();
for(int i=length-1;i>=0;i--)
{
if(startpath.GetAt(i)=='\\')
break;
startpath.Delete(i);
}
// startpath="E:\\王李斌\\软件设计\\原创软件\\FiniteElec\\work\\start.txt";
startpath=startpath+"work\\start.htm";
if(m_viewID==1)
{
filepath=((CFiniteElecDoc*)GetDocument())->m_strInputFileName;
if(filepath==_T(""))
{
AfxMessageBox("你还没有保存模型数据体文件,请先保存。");
// ((CFiniteElecDoc*)GetDocument())->OnFileSavemodel();
Navigate2(_T("about:blank"),NULL,NULL);
return;
}
Navigate2(filepath,NULL,NULL);
}
else if(m_viewID==2)
{
filepath=((CFiniteElecDoc*)GetDocument())->m_strOutputFileName;
if(filepath==_T(""))
{
AfxMessageBox("你还没有保存运算分析结果文件,请先保存。");
// ((CFiniteElecDoc*)GetDocument())->OnFileSave();
Navigate2(_T("about:blank"),NULL,NULL);
return;
}
Navigate2(filepath,NULL,NULL);
}
else if(m_viewID==10)
{
Navigate2(_T("about:blank"),NULL,NULL);
}
}
/////////////////////////////////////////////////////////////////////////////
// CFiniteElecView printing
/////////////////////////////////////////////////////////////////////////////
// CFiniteElecView diagnostics
#ifdef _DEBUG
void CFiniteElecView::AssertValid() const
{
CHtmlView::AssertValid();
}
void CFiniteElecView::Dump(CDumpContext& dc) const
{
CHtmlView::Dump(dc);
}
CFiniteElecDoc* CFiniteElecView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CFiniteElecDoc)));
return (CFiniteElecDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CFiniteElecView message handlers
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -