标 题: How use new views with a doc template?
发信人: Pacific (无情~~~Nolove), 信区: VisualC
发信站: BBS 水木清华站 (Fri Oct 16 17:47:49 1998)
In an application created with AppWizard, you have two options: change the
derivation of the current view, or create a new view and use the new view
in
your MDI application along with the original view.
To create a new view, use ClassWizard to create a new class derived from
CView. After the class has been created, the steps to use the new view or
to
modify the view provided by App Wizard are the same.
1. Modify the header file for the view class to change all references to
CView to the name of the desired view class. In this example, the class is
derived from CScrollView.
Usually, this step involves changing the class the view class is derived
from
as follows:
class CMyView : public CScrollView
2. Modify the implementation file for the view class to change all
references to CView to the name of the desired view class. This involves
changing the IMPLEMENT_DYNCREATE line as follows:
IMPLEMENT_DYNCREATE(CMyView, CScrollView)
changing the BEGIN_MESSAGE_MAP as follows:
BEGIN_MESSAGE_MAP(CMyView, CScrollView)
and changing any other references to CView to CScrollView.
3. No further modifications are required if you are modifying a view
created
by App Wizard. If you create a new view, find the AddDocTemplate() call in
the CWinApp::InitInstance() function. The third parameter to
--
老鸟有交待,中鸟要等待,菜鸟要忍耐。
老鸟级功夫:吹牛、聊天、玩MUD 、发呆。
中鸟级功夫:睡觉、灌水、玩游戏、NT&VC。
菜鸟级功夫:学习、泡妞、玩篮球、And so on
My E-Mail: Nolove@263.net
--
☆ 来源:.哈工大紫丁香 bbs.hit.edu.cn.[FROM: yazhou.bbs@bbs.net.t]
※ 修改:.fzx 于 Aug 9 16:44:15 修改本文.[FROM: heart.hit.edu.cn]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.950毫秒