東軟總結02 文件類的相關操作

2021-06-16 15:27:43 字數 4512 閱讀 2880

在文件類中找到序列函式serialize(carchive &ar)

void chomework_jiangjiedoc::serialize(carchive& ar)

else

}

新建檔案時觸發事件:找到onnewdocument()

bool chomework_jiangjiedoc::onnewdocument()

關閉程式時,提醒使用者是否儲存:view中要儲存的動作之後新增:

pdoc->setmodifiedflag();
整個view類**:

// homework_jiangjieview.cpp : implementation of the chomework_jiangjieview class

//#include "stdafx.h"

#include "homework_jiangjie.h"

#include "homework_jiangjiedoc.h"

#include "homework_jiangjieview.h"

#ifdef _debug

#define new debug_new

#undef this_file

static char this_file = __file__;

#endif

/// chomework_jiangjieview

implement_dyncreate(chomework_jiangjieview, cview)

begin_message_map(chomework_jiangjieview, cview)

//}afx_msg_map

// standard printing commands

on_command(id_file_print, cview::onfileprint)

on_command(id_file_print_direct, cview::onfileprint)

on_command(id_file_print_preview, cview::onfileprintpreview)

end_message_map()

/// chomework_jiangjieview construction/destruction

chomework_jiangjieview::chomework_jiangjieview()

chomework_jiangjieview::~chomework_jiangjieview()

bool chomework_jiangjieview::precreatewindow(createstruct& cs)

/// chomework_jiangjieview drawing

void chomework_jiangjieview::ondraw(cdc* pdc)

/// chomework_jiangjieview printing

bool chomework_jiangjieview::onprepareprinting(cprintinfo* pinfo)

void chomework_jiangjieview::onbeginprinting(cdc* /*pdc*/, cprintinfo* /*pinfo*/)

void chomework_jiangjieview::onendprinting(cdc* /*pdc*/, cprintinfo* /*pinfo*/)

/// chomework_jiangjieview diagnostics

#ifdef _debug

void chomework_jiangjieview::assertvalid() const

void chomework_jiangjieview::dump(cdumpcontext& dc) const

chomework_jiangjiedoc* chomework_jiangjieview::getdocument() // non-debug version is inline

#endif //_debug

/// chomework_jiangjieview message handlers

void chomework_jiangjieview::onlbuttondown(uint nflags, cpoint point)

void chomework_jiangjieview::onrbuttondown(uint nflags, cpoint point)

doc類:

// homework_jiangjiedoc.cpp : implementation of the chomework_jiangjiedoc class

//#include "stdafx.h"

#include "homework_jiangjie.h"

#include "homework_jiangjiedoc.h"

#ifdef _debug

#define new debug_new

#undef this_file

static char this_file = __file__;

#endif

/// chomework_jiangjiedoc

implement_dyncreate(chomework_jiangjiedoc, cdocument)

begin_message_map(chomework_jiangjiedoc, cdocument)

//}afx_msg_map

end_message_map()

/// chomework_jiangjiedoc construction/destruction

chomework_jiangjiedoc::chomework_jiangjiedoc():ncount(0)

chomework_jiangjiedoc::~chomework_jiangjiedoc()

bool chomework_jiangjiedoc::onnewdocument()

/// chomework_jiangjiedoc serialization

void chomework_jiangjiedoc::serialize(carchive& ar)

else }

/// chomework_jiangjiedoc diagnostics

#ifdef _debug

void chomework_jiangjiedoc::assertvalid() const

void chomework_jiangjiedoc::dump(cdumpcontext& dc) const

#endif //_debug

/// chomework_jiangjiedoc commands

doc.h:

// homework_jiangjiedoc.h : inte***ce of the chomework_jiangjiedoc class///

#if !defined(afx_homework_jiangjiedoc_h__04f202fd_45d8_4b07_9c20_a15c605b0064__included_)

#define afx_homework_jiangjiedoc_h__04f202fd_45d8_4b07_9c20_a15c605b0064__included_

#if _msc_ver > 1000

#pragma once

#endif // _msc_ver > 1000

class chomework_jiangjiedoc : public cdocument

}afx_virtual

// implementation

public:

virtual ~chomework_jiangjiedoc();

#ifdef _debug

virtual void assertvalid() const;

virtual void dump(cdumpcontext& dc) const;

#endif

protected:

// generated message map functions

protected:

//}afx_msg

declare_message_map()};/

//}// microsoft visual c++ will insert additional declarations immediately before the previous line.

#endif // !defined(afx_homework_jiangjiedoc_h__04f202fd_45d8_4b07_9c20_a15c605b0064__included_)

其他檔案不用變化。

東軟面試總結

東軟,來我們學校招人,由於想接觸下面試,所以參加了筆試,感覺題目還是很基礎很基礎的。今天,通知面試,去了之後,面試官還是蠻和藹的,先是自我介紹,然後問了寢室同學腫麼評價你的,然後介紹專案,然後給了基礎的題目讓做幾個,全都是基礎的,但是有兩個雖然之前看過,但是還是沒有答上來,在此總結下。可能是第一次面...

成都東軟 1034

2013年6月3日13 11 54 題目 description 輸入一串字元,將其中的大寫變成小寫,若不為大寫則原樣輸出 input 任意字串 長度在100以內 以回車表示輸入結束 output 將其中的大寫 輸出相應的小寫,若不為大寫則原樣輸出 sample input a123b sample...

成都東軟 1037

2013年6月3日14 08 14 編譯器 codeblocks10.05 題目 description 驗證尼科徹斯定理,即 任何乙個正整數的立方都可以寫成一串連續奇數的和。input 任一正整數 output 該數的立方分解為一串連續奇數的和 sample input 13 sample out...