| 发表于:2007-07-10 21:25:252楼 得分:100 |
bool cmainframe::createinfowindows(cdoctemplate *pdoctemplate,cstring strtitle) { if(pdoctemplate==null) { assert(0); return false; } cmdichildwnd* pactivechild = mdigetactive(); if(pactivechild==null) { assert(0); return false; } cdocument* pdocument=pactivechild-> getactivedocument(); if ( !pactivechild ¦ ¦ !pdocument ) { trace( "warning: no active document for windownew command\n "); afxmessagebox(afx_idp_command_failure); return false; } assert_valid(pdoctemplate); cframewnd* pframe=pdoctemplate-> createnewframe(pdocument, pactivechild); if (pframe == null) { trace( "warning: failed to create new frame\n "); afxmessagebox(afx_idp_command_failure); return false; } pframe-> modifystyle(fws_addtotitle,0,0); pframe-> setwindowtext(strtitle); pdoctemplate-> initialupdateframe(pframe, pdocument); return true; } bool fun() { cmultidoctemplate* pdoctemplate; pdoctemplate = new cmultidoctemplate( idr_ribbontype, runtime_class(c.......doc), runtime_class(cchildframe), runtime_class(c...view)); createinfowindows(pdoctemplate, "标题 "); ....................................... } | | |
|