- Timestamp:
- Jul 21, 2008, 5:42:40 PM (16 years ago)
- Location:
- trunk/ab5.0/abdev/abdev
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/abdev/Debugger.cpp
r651 r705 485 485 } 486 486 487 HANDLE hFile;488 487 char temporary[MAX_PATH]; 489 488 GetTempPath(MAX_PATH,temporary); … … 494 493 sprintf(temporary,"%sab_breakpoint.tmp",pj_editor_Dir); 495 494 496 hFile=CreateFile(temporary,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_TEMPORARY,NULL); 495 ATL::CHandle hFile(CreateFile(temporary,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_TEMPORARY,NULL)); 496 if(hFile==INVALID_HANDLE_VALUE){ 497 hFile.Detach(); 498 return; 499 } 497 500 DWORD dwAccBytes; 498 501 WriteFile(hFile,buffer,lstrlen(buffer),&dwAccBytes,NULL); 499 CloseHandle(hFile);500 502 501 503 HeapDefaultFree(buffer); -
trunk/ab5.0/abdev/abdev/DocumentAdvice.cpp
r629 r705 186 186 if(i3==MdiInfo.size()){ 187 187 //ファイルから開く 188 HANDLE fh; 189 fh=CreateFile(temporary,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 188 ATL::CHandle fh(CreateFile(temporary,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 190 189 if(fh==INVALID_HANDLE_VALUE){ 190 fh.Detach(); 191 191 goto finish; 192 192 } … … 198 198 temp3[FileSize]=0; 199 199 200 CloseHandle(fh);201 200 } 202 201 else{ -
trunk/ab5.0/abdev/abdev/FileOperation.cpp
r700 r705 27 27 DWORD dw; 28 28 char *buffer,temporary[MAX_PATH]; 29 HANDLE hFile; 30 31 hFile=CreateFile(path.c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 29 30 ATL::CHandle hFile(CreateFile(path.c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 32 31 if(hFile==INVALID_HANDLE_VALUE){ 32 hFile.Detach(); 33 33 //"\"%s\" ファイルの読み込みに失敗しました。" 34 34 sprintf(temporary,STRING_ERROR_CANT_FILEOPEN,path.c_str()); … … 41 41 ReadFile(hFile,buffer,i,&dw,0); 42 42 buffer[dw]=0; 43 CloseHandle(hFile);44 43 return buffer; 45 44 } 46 45 char *ReadBuffer_NonErrMsg( const std::string &path ){ 47 46 extern HANDLE hHeap; 48 int i;49 47 DWORD dw; 50 char *buffer; 51 HANDLE hFile; 52 53 hFile=CreateFile(path.c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 54 if(hFile==INVALID_HANDLE_VALUE) return 0; 55 i=GetFileSize(hFile,0); 56 buffer=(char *)HeapAlloc(hHeap,0,i+1); 48 49 ATL::CHandle hFile(CreateFile(path.c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 50 if(hFile==INVALID_HANDLE_VALUE){ 51 hFile.Detach(); 52 return 0; 53 } 54 int i=GetFileSize(hFile,0); 55 char *buffer=(char *)HeapAlloc(hHeap,0,i+1); 57 56 ReadFile(hFile,buffer,i,&dw,0); 58 57 buffer[dw]=0; 59 CloseHandle(hFile);60 58 return buffer; 61 59 } 62 60 _int8 WriteBuffer(const std::string &path,const char *buffer,int length, bool isEnableError) 63 61 { 64 HANDLE hFile;65 62 DWORD dw; 66 hFile=CreateFile(path.c_str(),GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);63 ATL::CHandle hFile(CreateFile(path.c_str(),GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL)); 67 64 if(hFile==INVALID_HANDLE_VALUE){ 65 hFile.Detach(); 66 68 67 char temporary[MAX_PATH]; 69 70 68 if( isEnableError ){ 71 69 //"\"%s\" ファイルへの書き込みに失敗しました。" … … 76 74 } 77 75 if(length) WriteFile(hFile,buffer,length,&dw,NULL); 78 CloseHandle(hFile);79 76 return 1; 80 77 } … … 371 368 int WndNum,i2; 372 369 char temporary[MAX_PATH],str[MAX_PATH],str2[32]; 373 HANDLE fh;374 370 DWORD dummy; 375 371 … … 404 400 if(SaveFileName){ 405 401 lstrcpy(temporary,SaveFileName); 406 if((fh=CreateFile(temporary,GENERIC_WRITE,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL))==INVALID_HANDLE_VALUE){ 407 sprintf(str,STRING_FILE_OVERWRIDE,temporary); 408 if(MessageBox(hOwner,str,APPLICATION_NAME,MB_YESNO|MB_ICONINFORMATION)==IDNO){ 409 return 0; 402 { 403 ATL::CHandle fh(CreateFile(temporary,GENERIC_WRITE,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL)); 404 if(fh==INVALID_HANDLE_VALUE){ 405 fh.Detach(); 406 sprintf(str,STRING_FILE_OVERWRIDE,temporary); 407 if(MessageBox(hOwner,str,APPLICATION_NAME,MB_YESNO|MB_ICONINFORMATION)==IDNO){ 408 return 0; 409 } 410 410 } 411 411 } 412 CloseHandle(fh);413 412 414 413 //ドキュメント セレクト コンボボックスから消去 … … 478 477 //////////////////////// 479 478 480 fh=CreateFile(temporary,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL); 481 if(fh==INVALID_HANDLE_VALUE){ 482 sprintf(str,STRING_ERROR_CANT_FILESAVE,temporary); 483 MessageBox(hOwner,str,STRING_ERROR,MB_OK|MB_ICONSTOP); 484 return 0; 485 } 486 WriteFile(fh,pBuf,strlen(pBuf),&dummy,NULL); 487 SetFileIdentityFromFile(*MdiInfo[WndNum], fh); 488 CloseHandle(fh); 479 { 480 ATL::CHandle fh(CreateFile(temporary,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL)); 481 if(fh==INVALID_HANDLE_VALUE){ 482 fh.Detach(); 483 sprintf(str,STRING_ERROR_CANT_FILESAVE,temporary); 484 MessageBox(hOwner,str,STRING_ERROR,MB_OK|MB_ICONSTOP); 485 return 0; 486 } 487 WriteFile(fh,pBuf,strlen(pBuf),&dummy,NULL); 488 SetFileIdentityFromFile(*MdiInfo[WndNum], fh); 489 } 489 490 490 491 … … 501 502 if(SaveFileName){ 502 503 lstrcpy(temporary,SaveFileName); 503 if((fh=CreateFile(temporary,GENERIC_WRITE,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL))==INVALID_HANDLE_VALUE){ 504 sprintf(str,STRING_FILE_OVERWRIDE,temporary); 505 if(MessageBox(hOwner,str,APPLICATION_NAME,MB_YESNO|MB_ICONINFORMATION)==IDNO){ 506 CloseHandle(fh); 507 return 0; 504 { 505 ATL::CHandle fh(CreateFile(temporary,GENERIC_WRITE,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL)); 506 if(fh==INVALID_HANDLE_VALUE){ 507 fh.Detach(); 508 sprintf(str,STRING_FILE_OVERWRIDE,temporary); 509 if(MessageBox(hOwner,str,APPLICATION_NAME,MB_YESNO|MB_ICONINFORMATION)==IDNO){ 510 return 0; 511 } 508 512 } 509 513 } 510 CloseHandle(fh);511 514 MdiInfo[WndNum]->path = temporary; 512 515 i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(LONG_PTR)MdiInfo[WndNum]->title.c_str()); -
trunk/ab5.0/abdev/abdev/FileTree.cpp
r663 r705 11 11 int i; 12 12 char temporary[MAX_PATH]; 13 HANDLE hFile;14 13 FILETIME LastWriteTime,LocalTime; 15 14 SYSTEMTIME SystemTime; … … 31 30 32 31 //最終更新日時を表示 33 hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);32 ATL::CHandle hFile(CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 34 33 if(hFile==INVALID_HANDLE_VALUE){ 34 hFile.Detach(); 35 35 //"エラー" 36 36 lstrcpy(temporary,STRING_ERROR); … … 54 54 SystemTime.wHour,SystemTime.wMinute,SystemTime.wSecond, 55 55 SystemTime.wYear,SystemTime.wMonth,SystemTime.wDay); 56 CloseHandle(hFile);57 56 } 58 57 SetDlgItemText(hwnd,IDC_UPDATE_TIME,temporary); -
trunk/ab5.0/abdev/abdev/IconEditor.cpp
r700 r705 263 263 264 264 //ファイル読み込み(正常に読み込めるかの確認も含む) 265 HANDLE hFile; 266 DWORD dw; 267 hFile=CreateFile(filepath,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 268 if(hFile==INVALID_HANDLE_VALUE){ 269 //"\"%s\" ファイルの読み込みに失敗しました。" 270 sprintf(str,STRING_ERROR_CANT_FILEOPEN,filepath); 271 MessageBox(hOwner,str,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION); 272 return; 273 } 274 i=GetFileSize(hFile,NULL); 275 buffer=(char *)HeapAlloc(hHeap,0,i+1); 276 ReadFile(hFile,buffer,i,&dw,NULL); 277 CloseHandle(hFile); 265 { 266 DWORD dw; 267 ATL::CHandle hFile(CreateFile(filepath,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 268 if(hFile==INVALID_HANDLE_VALUE){ 269 hFile.Detach(); 270 //"\"%s\" ファイルの読み込みに失敗しました。" 271 sprintf(str,STRING_ERROR_CANT_FILEOPEN,filepath); 272 MessageBox(hOwner,str,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION); 273 return; 274 } 275 i=GetFileSize(hFile,NULL); 276 buffer=(char *)HeapAlloc(hHeap,0,i+1); 277 ReadFile(hFile,buffer,i,&dw,NULL); 278 } 278 279 279 280 ICONDIR *pIconDir; … … 518 519 519 520 //ファイルへ書き込み 520 HANDLE hFile;521 521 DWORD dummy; 522 hFile=CreateFile(filepath,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);522 ATL::CHandle hFile(CreateFile(filepath,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL)); 523 523 if(hFile==INVALID_HANDLE_VALUE){ 524 hFile.Detach(); 524 525 //"\"%s\" ファイルへの書き込みに失敗しました。" 525 526 sprintf(temporary,STRING_ERROR_CANT_FILESAVE,filepath); … … 529 530 WriteFile(hFile,buffer,i2,&dummy,NULL); 530 531 SetFileIdentityFromFile(*MdiInfo[WndNum], hFile); 531 CloseHandle(hFile);532 532 } 533 533 -
trunk/ab5.0/abdev/abdev/ProjectControl.cpp
r655 r705 827 827 //保存 828 828 sprintf(temporary,"%s%s.pj",dir,NewProjectInfo.name); 829 if(hFind=FindFirstFile(temporary,&wfd)){ 830 if(hFind!=INVALID_HANDLE_VALUE){ 831 FindClose(hFind); 832 833 //"指定したディレクトリにはすでにプロジェクトが存在します。上書きしますか?" 834 if(MessageBox(hOwner,STRING_ERROR_PROJECT_OVERWRITE,APPLICATION_NAME,MB_YESNO|MB_ICONEXCLAMATION)==IDNO) return; 835 } 829 hFind=FindFirstFile(temporary,&wfd); 830 if(hFind!=INVALID_HANDLE_VALUE){ 831 FindClose(hFind); 832 833 //"指定したディレクトリにはすでにプロジェクトが存在します。上書きしますか?" 834 if(MessageBox(hOwner,STRING_ERROR_PROJECT_OVERWRITE,APPLICATION_NAME,MB_YESNO|MB_ICONEXCLAMATION)==IDNO) return; 836 835 } 837 836 if(!WriteBuffer(temporary,buffer,i)) return; … … 1812 1811 BOOST_FOREACH( const ActiveBasic::PM::FM::File &file, folder.files ) 1813 1812 { 1814 HANDLE hFile=CreateFile(file.GetFullPath().c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);1815 1813 FILETIME sourceTime; 1816 GetFileTime(hFile,NULL,NULL,&sourceTime); 1817 CloseHandle(hFile); 1814 { 1815 ATL::CHandle hFile(CreateFile(file.GetFullPath().c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 1816 GetFileTime(hFile,NULL,NULL,&sourceTime); 1817 } 1818 1818 1819 1819 if(sourceTime.dwHighDateTime>exeTime.dwHighDateTime|| … … 1827 1827 BOOL IsNeedCompileForProject(BOOL bDebug){ 1828 1828 char temporary[MAX_PATH]; 1829 HANDLE hFind ,hFile;1829 HANDLE hFind; 1830 1830 WIN32_FIND_DATA wfd; 1831 1831 FILETIME SourceTime,ExeTime; … … 1839 1839 FindClose(hFind); 1840 1840 1841 hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 1842 GetFileTime(hFile,NULL,NULL,&ExeTime); 1843 CloseHandle(hFile); 1841 { 1842 ATL::CHandle hFile(CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 1843 GetFileTime(hFile,NULL,NULL,&ExeTime); 1844 } 1844 1845 1845 1846 if( IsNeedCompileForProject( projectInfo.fileSystem.root, ExeTime ) ) … … 1852 1853 lstrcpy(temporary,"CallBack.wbp"); 1853 1854 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1854 hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 1855 GetFileTime(hFile,NULL,NULL,&SourceTime); 1856 CloseHandle(hFile); 1855 { 1856 ATL::CHandle hFile(CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 1857 GetFileTime(hFile,NULL,NULL,&SourceTime); 1858 } 1857 1859 if(SourceTime.dwHighDateTime>ExeTime.dwHighDateTime|| 1858 1860 SourceTime.dwHighDateTime==ExeTime.dwHighDateTime&& … … 1862 1864 lstrcpy(temporary,"MakeWindow.wbp"); 1863 1865 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 1864 hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 1865 GetFileTime(hFile,NULL,NULL,&SourceTime); 1866 CloseHandle(hFile); 1866 { 1867 ATL::CHandle hFile(CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 1868 GetFileTime(hFile,NULL,NULL,&SourceTime); 1869 } 1867 1870 if(SourceTime.dwHighDateTime>ExeTime.dwHighDateTime|| 1868 1871 SourceTime.dwHighDateTime==ExeTime.dwHighDateTime&& -
trunk/ab5.0/abdev/abdev/SubOperation.cpp
r698 r705 1001 1001 //256色の標準パレットを読み込む 1002 1002 extern RGBQUAD DefaultColorTable256[256]; 1003 HANDLE hFile;1004 DWORD dw;1005 1003 const std::string pltPath = ActiveBasic::Common::Environment::GetAbdevSystemDirPath() + "\\8bit.plt"; 1006 hFile=CreateFile(pltPath.c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 1007 if(hFile==INVALID_HANDLE_VALUE){ 1008 //"\"%s\" ファイルの読み込みに失敗しました。" 1009 sprintf(str,STRING_ERROR_CANT_FILEOPEN,temporary); 1010 MessageBox(NULL,str,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION); 1011 return 0; 1012 } 1013 ReadFile(hFile,DefaultColorTable256,sizeof(RGBQUAD)*256,&dw,NULL); 1014 CloseHandle(hFile); 1004 { 1005 ATL::CHandle hFile(CreateFile(pltPath.c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 1006 if(hFile==INVALID_HANDLE_VALUE){ 1007 hFile.Detach(); 1008 //"\"%s\" ファイルの読み込みに失敗しました。" 1009 sprintf(str,STRING_ERROR_CANT_FILEOPEN,temporary); 1010 MessageBox(NULL,str,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION); 1011 return 0; 1012 } 1013 DWORD dw; 1014 ReadFile(hFile,DefaultColorTable256,sizeof(RGBQUAD)*256,&dw,NULL); 1015 } 1015 1016 1016 1017 … … 1267 1268 { 1268 1269 char temporary[MAX_PATH],temp2[MAX_PATH],temp3[MAX_PATH]; 1269 HANDLE hFind ,hFile;1270 HANDLE hFind; 1270 1271 WIN32_FIND_DATA wfd; 1271 1272 FILETIME SourceTime,ExeTime; … … 1281 1282 FindClose(hFind); 1282 1283 1283 hFile=CreateFile(filepath.c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 1284 GetFileTime(hFile,NULL,NULL,&SourceTime); 1285 CloseHandle(hFile); 1286 1287 hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 1288 GetFileTime(hFile,NULL,NULL,&ExeTime); 1289 CloseHandle(hFile); 1284 { 1285 CHandle hFile(CreateFile(filepath.c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 1286 GetFileTime(hFile,NULL,NULL,&SourceTime); 1287 } 1288 { 1289 CHandle hFile(CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 1290 GetFileTime(hFile,NULL,NULL,&ExeTime); 1291 } 1290 1292 1291 1293 if(SourceTime.dwHighDateTime<ExeTime.dwHighDateTime) return 0; -
trunk/ab5.0/abdev/abdev/abdev.cpp
r700 r705 757 757 758 758 if(filepath){ 759 HANDLE hFile=CreateFile(filepath,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);759 ATL::CHandle hFile(CreateFile(filepath,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 760 760 if(hFile==INVALID_HANDLE_VALUE){ 761 hFile.Detach(); 761 762 sprintf(str,STRING_ERROR_CANT_FILEOPEN,filepath); 762 763 ::MessageBox(hOwner,str,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION); … … 809 810 DWORD dw; 810 811 ReadFile(hFile,temp,length,&dw,NULL); 811 CloseHandle(hFile);812 812 for(i=0;i<length;i++){ 813 813 if(temp[i]=='\0') temp[i]=' '; -
trunk/ab5.0/abdev/abdev/include/WindowComponents/MdiChild.h
r489 r705 20 20 END_MSG_MAP() 21 21 22 LRESULT OnCreate(LPCREATESTRUCT lpcs){22 LRESULT OnCreate(LPCREATESTRUCT){ 23 23 SetMsgHandled(false); 24 24 return 1; -
trunk/ab5.0/abdev/abdev/src/MainFrame.cpp
r697 r705 549 549 //エラー部分を反転表示 550 550 DWORD AccBytes; 551 HANDLE fh; 552 sprintf(temporary,"%spgm.tmp",pj_editor_Dir); 553 fh=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 554 ReadFile(fh,temporary,MAX_PATH,&AccBytes,NULL); 555 CloseHandle(fh); 551 { 552 sprintf(temporary,"%spgm.tmp",pj_editor_Dir); 553 ATL::CHandle fh(CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL)); 554 if(fh==INVALID_HANDLE_VALUE){ 555 fh.Detach(); 556 return 0; 557 } 558 ReadFile(fh,temporary,MAX_PATH,&AccBytes,NULL); 559 } 556 560 temporary[AccBytes]=0; 557 561 HWND hChild=::GetWindow(hClient,GW_CHILD); … … 1111 1115 1112 1116 CreateProcess( NULL, args, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS, NULL, NULL, &si, &pi ); 1117 CloseHandle( pi.hProcess ); 1118 CloseHandle( pi.hThread ); 1113 1119 } 1114 1120 … … 1130 1136 sprintf(temporary,"%s\r\n%s",projectInfo.szExePath,projectInfo.szCmdLine); 1131 1137 sprintf(temp2,"%spgm.tmp",pj_editor_Dir); 1132 HANDLE hFile=CreateFile(temp2,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_TEMPORARY,NULL); 1133 DWORD dwAccessBytes; 1134 WriteFile(hFile,temporary,lstrlen(temporary),&dwAccessBytes,NULL); 1135 CloseHandle(hFile); 1138 { 1139 ATL::CHandle hFile(CreateFile(temp2,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_TEMPORARY,NULL)); 1140 if(hFile==INVALID_HANDLE_VALUE){ 1141 hFile.Detach(); 1142 MessageBox(TEXT("デバッグ用ファイルを開けませんでした。")); 1143 return; 1144 } 1145 DWORD dwAccessBytes; 1146 WriteFile(hFile,temporary,lstrlen(temporary),&dwAccessBytes,NULL); 1147 } 1136 1148 1137 1149 //ソースファイル名をtemp2へ
Note:
See TracChangeset
for help on using the changeset viewer.