EastDrawDoc.cpp 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. // EastDrawDoc.cpp : implementation of the CEastDrawDoc class
  2. //
  3. #include "stdafx.h"
  4. #include "EastDraw.h"
  5. #include "EastDrawDoc.h"
  6. #include"EastDrawView.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CEastDrawDoc
  14. IMPLEMENT_DYNCREATE(CEastDrawDoc, CDocument)
  15. BEGIN_MESSAGE_MAP(CEastDrawDoc, CDocument)
  16. //{{AFX_MSG_MAP(CEastDrawDoc)
  17. ON_COMMAND(ID_FILE_SAVE_AS_Bmp, OnFILESAVEASBmp)
  18. //}}AFX_MSG_MAP
  19. END_MESSAGE_MAP()
  20. /////////////////////////////////////////////////////////////////////////////
  21. // CEastDrawDoc construction/destruction
  22. CEastDrawDoc::CEastDrawDoc()
  23. {
  24. // TODO: add one-time construction code here
  25. m_bChangeTitle=false;
  26. m_TotalSize=CSize(2000,2000);
  27. m_CenterPoint=CPoint(-1000,-1000);
  28. }
  29. CEastDrawDoc::~CEastDrawDoc()
  30. {
  31. }
  32. BOOL CEastDrawDoc::OnNewDocument()
  33. {
  34. if (!CDocument::OnNewDocument())
  35. return FALSE;
  36. // TODO: add reinitialization code here
  37. // (SDI documents will reuse this document)
  38. return TRUE;
  39. }
  40. /////////////////////////////////////////////////////////////////////////////
  41. // CEastDrawDoc serialization
  42. void CEastDrawDoc::Serialize(CArchive& ar)
  43. {
  44. if (ar.IsStoring())
  45. {
  46. ar<<m_TotalSize;
  47. ar<<m_CenterPoint;
  48. // TODO: add storing code here
  49. }
  50. else
  51. {
  52. ar>>this->m_TotalSize;
  53. ar>>m_CenterPoint;
  54. // TODO: add loading code here
  55. }
  56. m_DLineArray.Serialize(ar);
  57. m_CurveArray.Serialize(ar);
  58. m_RectangleArray.Serialize(ar);
  59. m_PolygonArray.Serialize(ar);
  60. m_RoundRectangleArray.Serialize(ar);
  61. m_RoundArray.Serialize(ar);
  62. m_EllipseArray.Serialize(ar);
  63. m_LiEllipseArray.Serialize(ar);
  64. m_RoundArcArray.Serialize(ar);
  65. m_PolyBezierArray.Serialize(ar);
  66. m_TextArray.Serialize(ar);
  67. m_EllipseArcArray.Serialize(ar);
  68. }
  69. /////////////////////////////////////////////////////////////////////////////
  70. // CEastDrawDoc diagnostics
  71. #ifdef _DEBUG
  72. void CEastDrawDoc::AssertValid() const
  73. {
  74. CDocument::AssertValid();
  75. }
  76. void CEastDrawDoc::Dump(CDumpContext& dc) const
  77. {
  78. CDocument::Dump(dc);
  79. }
  80. #endif //_DEBUG
  81. /////////////////////////////////////////////////////////////////////////////
  82. // CEastDrawDoc commands
  83. BOOL CEastDrawDoc::SaveBitMap(CFile&file)
  84. {
  85. CEastDrawView*pView;
  86. POSITION pos=GetFirstViewPosition();
  87. pView=(CEastDrawView*)GetNextView(pos);
  88. return pView->SaveDIB(NULL,file);
  89. }
  90. void CEastDrawDoc::AddTempFile()
  91. {
  92. m_bChangeTitle=true;
  93. HANDLE hFind;
  94. WIN32_FIND_DATA dataFind;
  95. BOOL bMoreFiles=TRUE;
  96. CString strTitle;
  97. strTitle=GetTitle();
  98. char tmpPathc[_MAX_PATH+1];
  99. GetTempPath(_MAX_PATH,tmpPathc);
  100. CString tmpPath=tmpPathc;
  101. hFind=FindFirstFile(tmpPath+"\\EdTemp",&dataFind);
  102. if(hFind==INVALID_HANDLE_VALUE)
  103. {
  104. FindClose(hFind);
  105. ::CreateDirectory(tmpPath+"\\EdTemp",NULL);
  106. ::CreateDirectory(tmpPath+"\\EdTemp\\"+strTitle,NULL);
  107. }
  108. else
  109. {
  110. FindClose(hFind);
  111. hFind=FindFirstFile(tmpPath+"\\EdTemp\\"+strTitle,&dataFind);
  112. if(hFind==INVALID_HANDLE_VALUE)
  113. {
  114. ::CreateDirectory(tmpPath+"\\EdTemp\\"+strTitle,NULL);
  115. }
  116. }
  117. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"),CFile::modeReadWrite|CFile::modeCreate);
  118. file1.Close();
  119. CFile file2(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"),CFile::modeReadWrite|CFile::modeCreate);
  120. file2.Close();
  121. CFile file3(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"),CFile::modeReadWrite|CFile::modeCreate);
  122. file3.Close();
  123. CFile file4(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"),CFile::modeReadWrite|CFile::modeCreate);
  124. file4.Close();
  125. CFile file5(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"),CFile::modeReadWrite|CFile::modeCreate);
  126. file5.Close();
  127. CFile file6(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),CFile::modeReadWrite|CFile::modeCreate);
  128. file6.Close();
  129. FindClose(hFind);
  130. }
  131. void CEastDrawDoc::AutoSave()
  132. {
  133. CString strTitle;
  134. strTitle=GetTitle();
  135. char tmpPathc[_MAX_PATH+1];
  136. GetTempPath(_MAX_PATH,tmpPathc);
  137. CString tmpPath=tmpPathc;
  138. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"),CFile::modeReadWrite|CFile::modeCreate);
  139. CArchive ar(&file1,CArchive::store);
  140. Serialize(ar);
  141. //file1.Close();
  142. CFile file2(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"),CFile::modeReadWrite|CFile::modeCreate);
  143. CArchive ar2(&file2,CArchive::store);
  144. Serialize(ar2);
  145. /// file2.Close();
  146. CFile file3(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"),CFile::modeReadWrite|CFile::modeCreate);
  147. CArchive ar3(&file3,CArchive::store);
  148. Serialize(ar3);
  149. CFile file4(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"),CFile::modeReadWrite|CFile::modeCreate);
  150. CArchive ar4(&file4,CArchive::store);
  151. Serialize(ar4);
  152. CFile file5(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"),CFile::modeReadWrite|CFile::modeCreate);
  153. CArchive ar5(&file5,CArchive::store);
  154. Serialize(ar5);
  155. CFile file6(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),CFile::modeReadWrite|CFile::modeCreate);
  156. CArchive ar6(&file6,CArchive::store);
  157. Serialize(ar6);
  158. //file3.Close();
  159. }
  160. BOOL CEastDrawDoc::OnOpenDocument(LPCTSTR lpszPathName)
  161. {
  162. if (!CDocument::OnOpenDocument(lpszPathName))
  163. return FALSE;
  164. // TODO: Add your specialized creation code here
  165. return TRUE;
  166. }
  167. void CEastDrawDoc::ExchangeSave(int index,int&rtimes)
  168. {
  169. //Requeue(index,rtimes);
  170. CString strTitle;
  171. strTitle=GetTitle();
  172. char tmpPathc[_MAX_PATH+1];
  173. GetTempPath(_MAX_PATH,tmpPathc);
  174. CString tmpPath=tmpPathc;
  175. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"));
  176. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"));
  177. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"));
  178. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"));
  179. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"));
  180. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"));
  181. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"),CFile::modeReadWrite|CFile::modeCreate);
  182. CArchive ar(&file1,CArchive::store);
  183. Serialize(ar);
  184. //OPENFILENAME ofn; // older version
  185. //memset(&ofn, 0, sizeof(ofn));
  186. //ofn.lStructSize = sizeof(ofn);
  187. //int nResult = ::GetOpenFileName(&ofn);
  188. }
  189. void CEastDrawDoc::OnBUTTON32858OnDo(int index)
  190. {
  191. CString strTitle;
  192. strTitle=GetTitle();
  193. char tmpPathc[_MAX_PATH+1];
  194. GetTempPath(_MAX_PATH,tmpPathc);
  195. CString tmpPath=tmpPathc;
  196. // CString str;
  197. // str.Format("%d",index);
  198. //AfxMessageBox(str);
  199. if(index==0)
  200. {
  201. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"),CFile::modeReadWrite|CFile::modeCreate|CFile::modeNoTruncate);
  202. CArchive ar(&file1,CArchive::load);
  203. Serialize(ar);
  204. }
  205. if(index==1)
  206. {
  207. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"),CFile::modeReadWrite|CFile::modeCreate|CFile::modeNoTruncate);
  208. CArchive ar(&file1,CArchive::load);
  209. Serialize(ar);
  210. }
  211. if(index==2)
  212. {
  213. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"),CFile::modeReadWrite|CFile::modeCreate|CFile::modeNoTruncate);
  214. CArchive ar(&file1,CArchive::load);
  215. Serialize(ar);
  216. }
  217. if(index==3)
  218. {
  219. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"),CFile::modeReadWrite|CFile::modeCreate|CFile::modeNoTruncate);
  220. CArchive ar(&file1,CArchive::load);
  221. Serialize(ar);
  222. }
  223. if(index==4)
  224. {
  225. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"),CFile::modeReadWrite|CFile::modeCreate|CFile::modeNoTruncate);
  226. CArchive ar(&file1,CArchive::load);
  227. Serialize(ar);
  228. }
  229. if(index==5)
  230. {
  231. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),CFile::modeReadWrite|CFile::modeCreate|CFile::modeNoTruncate);
  232. CArchive ar(&file1,CArchive::load);
  233. Serialize(ar);
  234. }
  235. }
  236. void CEastDrawDoc::OnFILESAVEASBmp()
  237. {
  238. // TODO: Add your command handler code here
  239. TCHAR szFilters[]=_T("BMP 文件(*.bmp)|*.bmp|所有文件(*.*)|*.*||");
  240. CFileDialog dlg(false,_T("bmp"),_T("*.bmp"),OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,szFilters);
  241. if(dlg.DoModal()==IDOK)
  242. {
  243. CFile file;
  244. CFileException fe;
  245. if (!file.Open(dlg.GetPathName(), CFile::modeCreate |
  246. CFile::modeWrite ,&fe))
  247. {
  248. fe.ReportError();
  249. fe.Delete();
  250. return ;
  251. }
  252. BOOL bSuccess = FALSE;
  253. TRY
  254. {
  255. BeginWaitCursor();
  256. bSuccess = SaveBitMap(file);
  257. file.Close();
  258. }
  259. CATCH (CException, eSave)
  260. {
  261. file.Abort();
  262. EndWaitCursor();
  263. eSave->ReportError();
  264. eSave->Delete();
  265. return ;
  266. }
  267. END_CATCH
  268. EndWaitCursor();
  269. if (!bSuccess)
  270. {
  271. CString strMsg;
  272. strMsg.Format("保存失败,请稍后重试");
  273. AfxMessageBox(strMsg);
  274. }
  275. }
  276. }
  277. void CEastDrawDoc::ReMoveTemp()
  278. {
  279. CString strTitle;
  280. strTitle=GetTitle();
  281. char tmpPathc[_MAX_PATH+1];
  282. GetTempPath(_MAX_PATH,tmpPathc);
  283. CString tmpPath=tmpPathc;
  284. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"));
  285. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"));
  286. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"));
  287. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"));
  288. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"));
  289. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"));
  290. ::RemoveDirectory(_T(tmpPath+"\\EdTemp\\"+strTitle));
  291. ::RemoveDirectory(_T(tmpPath+"\\EdTemp\\"));
  292. }
  293. void CEastDrawDoc::Requeue(int &index, int &rtimes)
  294. {
  295. CString strTitle;
  296. strTitle=GetTitle();
  297. char tmpPathc[_MAX_PATH+1];
  298. GetTempPath(_MAX_PATH,tmpPathc);
  299. CString tmpPath=tmpPathc;
  300. if(index==0)
  301. {
  302. rtimes=rtimes<6?rtimes:6;
  303. }
  304. if(index==1)
  305. {
  306. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"));
  307. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"));
  308. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"));
  309. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"));
  310. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"));
  311. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"));
  312. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),CFile::modeReadWrite|CFile::modeCreate);
  313. rtimes=rtimes<5?rtimes:5;
  314. }
  315. if(index==2)
  316. {
  317. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"));
  318. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"));
  319. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"));
  320. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"));
  321. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"));
  322. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"));
  323. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),CFile::modeReadWrite|CFile::modeCreate);
  324. CFile file2(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"),CFile::modeReadWrite|CFile::modeCreate);
  325. rtimes=rtimes<4?rtimes:4;
  326. }
  327. if(index==3)
  328. {
  329. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"));
  330. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"));
  331. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"));
  332. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"));
  333. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"));
  334. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"));
  335. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),CFile::modeReadWrite|CFile::modeCreate);
  336. CFile file2(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"),CFile::modeReadWrite|CFile::modeCreate);
  337. CFile file3(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"),CFile::modeReadWrite|CFile::modeCreate);
  338. rtimes=rtimes<3?rtimes:3;
  339. }
  340. if(index==4)
  341. {
  342. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"));
  343. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"));
  344. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"));
  345. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"));
  346. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"));
  347. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"));
  348. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),CFile::modeReadWrite|CFile::modeCreate);
  349. CFile file2(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"),CFile::modeReadWrite|CFile::modeCreate);
  350. CFile file3(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"),CFile::modeReadWrite|CFile::modeCreate);
  351. CFile file4(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"),CFile::modeReadWrite|CFile::modeCreate);
  352. rtimes=rtimes<2?rtimes:2;
  353. }
  354. if(index==5)
  355. {
  356. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"));
  357. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"));
  358. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"));
  359. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"));
  360. CFile::Remove(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"));
  361. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),_T(tmpPath+"\\EdTemp\\"+strTitle+"\\First.ed"));
  362. CFile file1(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Six.ed"),CFile::modeReadWrite|CFile::modeCreate);
  363. CFile file2(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Fifth.ed"),CFile::modeReadWrite|CFile::modeCreate);
  364. CFile file3(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Forth.ed"),CFile::modeReadWrite|CFile::modeCreate);
  365. CFile file4(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Third.ed"),CFile::modeReadWrite|CFile::modeCreate);
  366. CFile file5(_T(tmpPath+"\\EdTemp\\"+strTitle+"\\Second.ed"),CFile::modeReadWrite|CFile::modeCreate);
  367. rtimes=rtimes<1?rtimes:1;
  368. }
  369. }
  370. void CEastDrawDoc::SetTitle(LPCTSTR lpszTitle)
  371. {
  372. // TODO: Add your specialized code here and/or call the base class
  373. if(m_bChangeTitle)
  374. {
  375. CString strTitle;
  376. strTitle=GetTitle();
  377. char tmpPathc[_MAX_PATH+1];
  378. GetTempPath(_MAX_PATH,tmpPathc);
  379. CString tmpPath=tmpPathc;
  380. CFile::Rename(_T(tmpPath+"\\EdTemp\\"+strTitle),_T(tmpPath+"\\EdTemp\\"+lpszTitle));
  381. }
  382. CDocument::SetTitle(lpszTitle);
  383. }