⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 book_text10.htm

📁 深入编程内幕vc++ 非常适合处学者学习
💻 HTM
📖 第 1 页 / 共 5 页
字号:
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">}<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 0cm; mso-line-height-alt: 1.3pt"><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">这其中</SPAN><SPAN 
            lang=EN-US>pInfo_&gt;SetMaxPage((Recnumber+4)/5)</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">用来设置打印的最大页数。</SPAN><SPAN 
            lang=EN-US>Recnumber </SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">是我们通过访问数据库计算出来的记录条数。我们前面说过,每五条记录分一页,(</SPAN><SPAN 
            lang=EN-US>Recnumber+4</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">)</SPAN><SPAN 
            lang=EN-US>/5</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">就可以得到页数。</SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 0cm; mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
            </SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">下面是</SPAN><SPAN 
            lang=EN-US>OnBeginPrinting</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">中的代码</SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 0cm; mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">m_bPrintEnd=false;<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 0cm; mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">StuRecSet_&gt;MoveFirst();<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 0cm; mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">if 
            (StuRecSet_&gt;IsEOF())<O:P> </O:P></SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 20pt; mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">m_bPrintEnd=true;<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 20pt; mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US>m_bPrintEnd</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">是我们往</SPAN><SPAN 
            lang=EN-US>CPrintView </SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">类中添加的一个用来指示是否该结束打印的成员。</SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 0cm; mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">void 
            CPrintView::OnPrepareDC(CDC* pDC, CPrintInfo* pInfo) 
            <O:P></O:P></SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 0cm; mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">{<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 0cm; mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black"><SPAN 
            style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; 
            </SPAN>CScrollView::OnPrepareDC(pDC, pInfo);<O:P> </O:P></SPAN></P>
            <P class=MsoNormal style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="FONT-SIZE: 10.5pt; BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-size: 10.0pt; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black"><SPAN 
            style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; </SPAN>// TODO: Add your 
            specialized code here and/or call the base class<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormalIndent style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black"><SPAN 
            style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; </SPAN>if 
            (pInfo!=NULL)<O:P> </O:P></SPAN></P>
            <P class=MsoNormalIndent style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black"><SPAN 
            style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; </SPAN><SPAN 
            style="mso-spacerun: yes">&nbsp; 
            </SPAN>pInfo_&gt;m_bContinuePrinting=!m_bPrintEnd;<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 0cm; mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">}<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 20pt; mso-line-height-alt: 1.3pt"><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">上面是虚函数</SPAN><SPAN 
            lang=EN-US>OnPrepareDC</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">中的代码,注意</SPAN><SPAN 
            lang=EN-US>if<SPAN style="mso-spacerun: yes">&nbsp; 
            </SPAN>(pInfo!=NULL) </SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">的判断,我们要识别是否是为打印做准备。</SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 20pt; mso-line-height-alt: 1.3pt"><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">下面是最重要的</SPAN><SPAN 
            lang=EN-US>OnPrint</SPAN><SPAN 
            style="FONT-FAMILY: 宋体; mso-hansi-font-family: 'Times New Roman'; mso-ascii-font-family: 'Times New Roman'">中的代码:</SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 0cm; mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">void 
            CPrintView::OnPrint(CDC* pDC, CPrintInfo* pInfo) 
            <O:P></O:P></SPAN></P>
            <P class=MsoNormalIndent 
            style="TEXT-INDENT: 0cm; mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">{<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormalIndent style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">// 
            TODO: Add your specialized code here and/or <O:P></O:P></SPAN></P>
            <P class=MsoNormalIndent style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">//call 
            the base class<O:P> </O:P></SPAN></P>
            <P class=MsoNormalIndent style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">int 
            Curpage=pInfo_&gt;m_nCurPage;<O:P> </O:P></SPAN></P>
            <P class=MsoNormalIndent style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">StuRecSet_&gt;SetAbsolutePosition((Curpage_1)*5);<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormalIndent style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">&nbsp;<O:P> 
            </O:P></SPAN></P>
            <P class=MsoNormalIndent style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">//Assume 
            to print 5 records every page<O:P> </O:P></SPAN></P>
            <P class=MsoNormalIndent style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black"><SPAN 
            style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp; </SPAN>TEXTMETRIC 
            tm;<O:P> </O:P></SPAN></P>
            <P class=MsoNormalIndent style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">int 
            nColumnWidth[4];<O:P> </O:P></SPAN></P>
            <P class=MsoNormalIndent style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black">int 
            i,j;<O:P> </O:P></SPAN></P>
            <P class=MsoNormalIndent style="mso-line-height-alt: 1.3pt"><SPAN 
            lang=EN-US 
            style="BACKGROUND: #d9d9d9; FONT-FAMILY: 'Courier New'; mso-bidi-font-family: 'Times New Roman'; mso-shading: white; mso-pattern: gray-15 black"><SPAN 
            style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp; 
            </SPAN>pDC_&gt;SetMapMode(MM_TWIPS);<O:P> </O:P></SPAN></P>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -