Changeset 622 in dev for trunk/ab5.0/abdev/abdev
- Timestamp:
- May 21, 2008, 1:16:21 PM (16 years ago)
- Location:
- trunk/ab5.0/abdev/abdev
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/abdev/abdev/Common.h
r620 r622 664 664 char *ReadBuffer( const std::string &path ); 665 665 char *ReadBuffer_NonErrMsg( const std::string &path ); 666 _int8 WriteBuffer(c har *path,char *buffer,int length, bool isEnableError = true);667 _int8 WriteBuffer_NonErrMsg(c har *path,char *buffer,int length);666 _int8 WriteBuffer(const std::string &path,char *buffer,int length, bool isEnableError = true); 667 _int8 WriteBuffer_NonErrMsg(const std::string &path,char *buffer,int length); 668 668 void GetRelationalPath(char *path,char *dir); 669 669 void GetFullPath(char *path,const char *dir); -
trunk/ab5.0/abdev/abdev/FileOperation.cpp
r621 r622 57 57 return buffer; 58 58 } 59 _int8 WriteBuffer(c har *path,char *buffer,int length, bool isEnableError){59 _int8 WriteBuffer(const std::string &path,char *buffer,int length, bool isEnableError){ 60 60 HANDLE hFile; 61 61 DWORD dw; 62 hFile=CreateFile(path ,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);62 hFile=CreateFile(path.c_str(),GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL); 63 63 if(hFile==INVALID_HANDLE_VALUE){ 64 64 char temporary[MAX_PATH]; … … 75 75 return 1; 76 76 } 77 _int8 WriteBuffer_NonErrMsg(c har *path,char *buffer,int length){77 _int8 WriteBuffer_NonErrMsg(const std::string &path,char *buffer,int length){ 78 78 return WriteBuffer( path, buffer, length, false ); 79 79 } -
trunk/ab5.0/abdev/abdev/Resource.cpp
r620 r622 17 17 HANDLE hFile; 18 18 19 lstrcpy(temporary,projectInfo.ResourceFileName); 20 lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() ); 21 22 hFile=CreateFile(temporary,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 19 hFile=CreateFile( projectInfo.GetResourceFileFullPath().c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL); 23 20 if(hFile==INVALID_HANDLE_VALUE) return; 24 21 i2=GetFileSize(hFile,NULL); … … 123 120 } 124 121 125 //リソースが空の場合126 if(projectInfo.res.NumberOfCursorRes==0&&127 projectInfo.res.NumberOfBitmapRes==0&&128 projectInfo.res.NumberOfIconRes==0)129 projectInfo.ResourceFileName[0]=0;130 131 122 HeapDefaultFree(buffer); 132 123 } … … 137 128 int i2,i3; 138 129 char temporary[MAX_PATH]; 139 140 if(!projectInfo.ResourceFileName[0])141 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo.GetName().c_str());142 130 143 131 //"カーソル ファイルを指定してください" … … 242 230 char temporary[MAX_PATH]; 243 231 244 if(!projectInfo.ResourceFileName[0])245 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo.GetName().c_str());246 247 232 //"ビットマップ ファイルを指定してください" 248 233 if(!GetFilePathDialog(hOwner,temporary,BitmapFileFilter,STRING_FILEOPENTITLE_BITMAP,TRUE)) return; … … 355 340 int i2,i3; 356 341 char temporary[MAX_PATH]; 357 358 if(!projectInfo.ResourceFileName[0])359 sprintf(projectInfo.ResourceFileName,"%s.rc",projectInfo.GetName().c_str());360 342 361 343 //"アイコン ファイルを指定してください" -
trunk/ab5.0/abdev/abdev/include/ProjectManager/ProjectManager.h
r621 r622 27 27 } 28 28 29 const std::string GetResourceFileFullPath() const 30 { 31 return this->GetWorkDir().GetFullPath( this->GetName() + ".rc" ); 32 } 33 29 34 bool IsOpened() const 30 35 { … … 40 45 41 46 CDBFileInfo *pobj_DBFileInfo; 42 43 char ResourceFileName[MAX_PATH];44 47 45 48 int NumberOfMenu; -
trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp
r621 r622 196 196 temporary[i2]=buffer[i]; 197 197 } 198 if(temporary[0]!='\0'&&(!(temporary[0]=='0'&&temporary[1]=='\0'))){ 199 lstrcpy(this->ResourceFileName,temporary); 200 GetResourceData(); 201 } 202 else{ 203 sprintf(this->ResourceFileName,"%s.rc",this->GetName().c_str()); 204 } 198 199 // このパラメータは使用しなくなった 205 200 } 206 201 else if(lstrcmpi(temporary,"SOURCE")==0&&buffer[i]=='\r'&&buffer[i+1]=='\n'){ … … 244 239 } 245 240 sprintf(this->lpszOutput_Debug,".\\%s_debug.exe",this->GetName().c_str()); 241 } 242 243 // リソースを読み込む 244 Jenga::Common::Path resourcePath( projectInfo.GetResourceFileFullPath() ); 245 if( resourcePath.IsExistFile() ) 246 { 247 GetResourceData(); 246 248 } 247 249 … … 347 349 sprintf(buffer+i2,"#DEBUG_EXE_PATH=%s\r\n\r\n",this->szExePath); 348 350 i2+=lstrlen(buffer+i2); 349 if(this->ResourceFileName[0]){350 sprintf(buffer+i2,"#RESOURCE=%s\r\n\r\n",this->ResourceFileName);351 i2+=lstrlen(buffer+i2);352 }353 else{354 lstrcpy(buffer+i2,"#RESOURCE=0\r\n\r\n");355 i2+=lstrlen(buffer+i2);356 }357 351 sprintf(buffer+i2,"#SOURCE\r\n"); 358 352 i2+=lstrlen(buffer+i2); … … 369 363 ////////////////////////////////// 370 364 // リソースファイル(*.rc、resource.ab)を作成 371 if(this->ResourceFileName[0]){365 { 372 366 i2=0; 373 367 i3=101; … … 392 386 393 387 //保存(resource.ab) 394 lstrcpy(temporary,"resource.ab"); 395 lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() ); 396 WriteBuffer(temporary,buffer,i2); 388 WriteBuffer(this->GetWorkDir().GetFullPath( "resource.ab" ),buffer,i2); 397 389 398 390 i2=0; … … 424 416 425 417 //保存 426 lstrcpy(temporary,this->ResourceFileName); 427 lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() ); 428 WriteBuffer(temporary,buffer,i2); 418 WriteBuffer(this->GetResourceFileFullPath(),buffer,i2); 429 419 } 430 420 … … 498 488 i2+=lstrlen(buffer+i2); 499 489 } 500 if(this->ResourceFileName[0]){ 501 //リソースファイルが含まれる場合 502 lstrcpy(buffer+i2,"\r\n"); 503 i2+=lstrlen(buffer+i2); 504 lstrcpy(buffer+i2,"'リソースファイル\r\n"); 505 i2+=lstrlen(buffer+i2); 506 lstrcpy(buffer+i2,"#include \"resource.ab\"\r\n"); 507 i2+=lstrlen(buffer+i2); 508 sprintf(buffer+i2,"#resource \"%s.rc\"\r\n",this->GetName().c_str()); 509 i2+=lstrlen(buffer+i2); 510 } 490 491 //リソースファイル 492 lstrcpy(buffer+i2,"\r\n"); 493 i2+=lstrlen(buffer+i2); 494 lstrcpy(buffer+i2,"'リソースファイル\r\n"); 495 i2+=lstrlen(buffer+i2); 496 lstrcpy(buffer+i2,"#include \"resource.ab\"\r\n"); 497 i2+=lstrlen(buffer+i2); 498 sprintf(buffer+i2,"#resource \"%s.rc\"\r\n",this->GetName().c_str()); 499 i2+=lstrlen(buffer+i2); 511 500 512 501 //保存
Note:
See TracChangeset
for help on using the changeset viewer.