Changeset 21 in dev for ProjectEditor/IconEditor.cpp
- Timestamp:
- Dec 29, 2006, 12:25:04 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ProjectEditor/IconEditor.cpp
r3 r21 275 275 } 276 276 i=GetFileSize(hFile,NULL); 277 buffer=(char *) GlobalAlloc(GMEM_FIXED,i+1);277 buffer=(char *)HeapAlloc(hHeap,0,i+1); 278 278 ReadFile(hFile,buffer,i,&dw,NULL); 279 279 CloseHandle(hFile); … … 283 283 pIconDir=(ICONDIR *)buffer; 284 284 IconNum=pIconDir->idCount; 285 bool FileOk = true; 285 286 for(i=0;i<IconNum;i++){ 286 287 pIconDirEntry=(ICONDIRENTRY *)(buffer+sizeof(ICONDIR)+sizeof(ICONDIRENTRY)*i); … … 290 291 291 292 dwBytesInRes[i]=pIconDirEntry->dwBytesInRes; 293 294 //対応チェック 295 BITMAPINFOHEADER *pBmpInfoHdr=(BITMAPINFOHEADER *)pImageBuffer[i]; 296 if( !(pBmpInfoHdr->biBitCount == 4 || pBmpInfoHdr->biBitCount == 8 ) ){ 297 //16色、256色以外の場合 298 //未対応 299 FileOk = false; 300 } 292 301 } 293 302 … … 295 304 lstrcat(str,str2); 296 305 mdic.szTitle=str; 306 307 HeapDefaultFree(buffer); 308 309 if( !FileOk ){ 310 for(i=0;i<IconNum;i++){ 311 HeapDefaultFree( pImageBuffer[i] ); 312 } 313 314 char msg[1024]; 315 sprintf( msg, "\"%s\"\n\n16色または256色以外の形式のファイルには対応していません。", filepath ); 316 MessageBox( hOwner, msg, "ActiveBasic", MB_OK | MB_ICONEXCLAMATION ); 317 return; 318 } 297 319 } 298 320 else{
Note:
See TracChangeset
for help on using the changeset viewer.