7fd59977 |
1 | // OCC_BaseChildFrame.cpp: implementation of the OCC_BaseChildFrame class. |
2 | // |
3 | ////////////////////////////////////////////////////////////////////// |
4 | |
5 | #include "stdafx.h" |
6 | |
7 | #include "OCC_BaseChildFrame.h" |
8 | |
9 | #include <res\OCC_Resource.h> |
10 | |
11 | ///////////////////////////////////////////////////////////////////////////// |
12 | // OCC_BaseChildFrame |
13 | |
14 | IMPLEMENT_DYNCREATE (OCC_BaseChildFrame, CMDIChildWnd) |
15 | |
16 | BEGIN_MESSAGE_MAP(OCC_BaseChildFrame, CMDIChildWnd) |
17 | //{{AFX_MSG_MAP(OCC_BaseChildFrame) |
18 | //}}AFX_MSG_MAP |
19 | END_MESSAGE_MAP() |
20 | |
21 | ///////////////////////////////////////////////////////////////////////////// |
22 | // OCC_BaseChildFrame construction/destruction |
23 | |
24 | OCC_BaseChildFrame::OCC_BaseChildFrame() |
25 | { |
26 | } |
27 | |
28 | OCC_BaseChildFrame::~OCC_BaseChildFrame() |
29 | { |
30 | } |
31 | |
32 | ///////////////////////////////////////////////////////////////////////////// |
33 | // OCC_BaseChildFrame diagnostics |
34 | |
35 | #ifdef _DEBUG |
36 | void OCC_BaseChildFrame::AssertValid() const |
37 | { |
5c1f974e |
38 | CMDIChildWnd::AssertValid(); |
7fd59977 |
39 | } |
40 | |
41 | void OCC_BaseChildFrame::Dump(CDumpContext& dc) const |
42 | { |
5c1f974e |
43 | CMDIChildWnd::Dump(dc); |
7fd59977 |
44 | } |
45 | |
46 | #endif //_DEBUG |
47 | |
48 | ///////////////////////////////////////////////////////////////////////////// |
49 | // OCC_BaseChildFrame message handlers |
50 | |
51 | void OCC_BaseChildFrame::ActivateFrame(int nCmdShow) |
52 | { |
5c1f974e |
53 | POSITION pos=AfxGetApp()->GetFirstDocTemplatePosition(); |
54 | CDocTemplate* DocT=AfxGetApp()->GetNextDocTemplate(pos); |
55 | |
56 | POSITION FirstDocPosition =DocT->GetFirstDocPosition(); |
57 | POSITION p = FirstDocPosition; |
58 | |
59 | CDocument* doc; |
60 | doc = NULL; |
61 | |
62 | if(FirstDocPosition!=NULL) |
63 | { |
64 | doc = DocT->GetNextDoc(p); |
65 | if(AfxIsValidAddress(doc, sizeof(CDocument)) && p == NULL) |
66 | { |
67 | ASSERT_VALID(doc); |
68 | POSITION position = doc->GetFirstViewPosition(); |
69 | if(position != NULL) |
70 | doc ->GetNextView(position); |
71 | if (position == NULL) |
72 | nCmdShow = SW_SHOWMAXIMIZED; |
73 | } |
74 | } |
75 | |
76 | CMDIChildWnd::ActivateFrame(nCmdShow); |
7fd59977 |
77 | } |
78 | |