Index: trunk/ab5.0/abdev/abdev/Common.h
===================================================================
--- trunk/ab5.0/abdev/abdev/Common.h	(revision 622)
+++ trunk/ab5.0/abdev/abdev/Common.h	(revision 623)
@@ -404,23 +404,7 @@
 //////////////////
 //リソース情報
-struct RESITEMINFO{
-	char *IdName;
-	char *path;
-
-	HTREEITEM hTreeItem;
-};
-struct RESOURCEINFO{
-	int NumberOfCursorRes;
-	RESITEMINFO *pCursorResInfo;
-	HTREEITEM hCursorTreeItem;
-
-	int NumberOfBitmapRes;
-	RESITEMINFO *pBitmapResInfo;
-	HTREEITEM hBitmapTreeItem;
-
-	int NumberOfIconRes;
-	RESITEMINFO *pIconResInfo;
-	HTREEITEM hIconTreeItem;
-};
+extern HTREEITEM hCursorTreeItemForProjectView;
+extern HTREEITEM hBitmapTreeItemForProjectView;
+extern HTREEITEM hIconTreeItemForProjectView;
 
 
@@ -999,5 +983,4 @@
 
 //Resource.cpp
-void GetResourceData(void);
 void Project_CursorResInsert(void);
 void Project_Cursor_Delete(int CursorInfoNum);
Index: trunk/ab5.0/abdev/abdev/DrawWindow.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/DrawWindow.cpp	(revision 622)
+++ trunk/ab5.0/abdev/abdev/DrawWindow.cpp	(revision 623)
@@ -991,10 +991,12 @@
 	else if(pWindowInfo->bgColor>=0x1000){
 		//ビットマップ
-		for(i2=0;i2<projectInfo.res.NumberOfBitmapRes;i2++){
-			if(lstrcmp(projectInfo.res.pBitmapResInfo[pWindowInfo->bgColor-0x1000].IdName,
-				projectInfo.res.pBitmapResInfo[i2].IdName)==0) break;
-		}
-		if(i2!=projectInfo.res.NumberOfBitmapRes){
-			lstrcpy(temporary,projectInfo.res.pBitmapResInfo[i2].path);
+		for(i2=0;i2<projectInfo.resourceManager.bitmapResources.size();i2++){
+			if( projectInfo.resourceManager.bitmapResources[pWindowInfo->bgColor-0x1000].idName == projectInfo.resourceManager.bitmapResources[i2].idName )
+			{
+				break;
+			}
+		}
+		if(i2!=projectInfo.resourceManager.bitmapResources.size()){
+			lstrcpy(temporary,projectInfo.resourceManager.bitmapResources[i2].filepath.c_str());
 			lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );
 			hImage=LoadImage(NULL,temporary,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE);
@@ -1358,11 +1360,14 @@
 					lstrcpy(temporary,pChildInfo->ImageCtrlInfo.path);
 				else{
-					for(i2=0;i2<projectInfo.res.NumberOfIconRes;i2++){
-						if(lstrcmp(pChildInfo->ImageCtrlInfo.path,
-							projectInfo.res.pIconResInfo[i2].IdName)==0) break;
+					for(i2=0;i2<projectInfo.resourceManager.iconResources.size();i2++)
+					{
+						if( projectInfo.resourceManager.iconResources[i2].idName == pChildInfo->ImageCtrlInfo.path )
+						{
+							break;
+						}
 					}
-					if(i2==projectInfo.res.NumberOfIconRes) goto NonIconImage;
-
-					lstrcpy(temporary,projectInfo.res.pIconResInfo[i2].path);
+					if(i2==projectInfo.resourceManager.iconResources.size()) goto NonIconImage;
+
+					lstrcpy(temporary,projectInfo.resourceManager.iconResources[i2].filepath.c_str());
 				}
 				lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );
@@ -1402,11 +1407,13 @@
 					lstrcpy(temporary,pChildInfo->ImageCtrlInfo.path);
 				else{
-					for(i2=0;i2<projectInfo.res.NumberOfBitmapRes;i2++){
-						if(lstrcmp(pChildInfo->ImageCtrlInfo.path,
-							projectInfo.res.pBitmapResInfo[i2].IdName)==0) break;
+					for(i2=0;i2<projectInfo.resourceManager.bitmapResources.size();i2++){
+						if( projectInfo.resourceManager.bitmapResources[i2].idName == pChildInfo->ImageCtrlInfo.path )
+						{
+							break;
+						}
 					}
-					if(i2==projectInfo.res.NumberOfBitmapRes) goto NonBitmapImage;
-
-					lstrcpy(temporary,projectInfo.res.pBitmapResInfo[i2].path);
+					if(i2==projectInfo.resourceManager.bitmapResources.size()) goto NonBitmapImage;
+
+					lstrcpy(temporary,projectInfo.resourceManager.bitmapResources[i2].filepath.c_str());
 				}
 				lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );
Index: trunk/ab5.0/abdev/abdev/ProjectControl.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/ProjectControl.cpp	(revision 622)
+++ trunk/ab5.0/abdev/abdev/ProjectControl.cpp	(revision 623)
@@ -191,9 +191,9 @@
 						}
 					}
-					for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
-						if(projectInfo.res.pIconResInfo[i].hTreeItem==hTreeItem){
-							lstrcpy(temporary,projectInfo.res.pIconResInfo[i].path);
-							lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );
-							NewIconEditWindow(temporary);
+					for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
+						if(projectInfo.resourceManager.iconResources[i].hTreeItem==hTreeItem){
+							NewIconEditWindow(
+								projectInfo.GetWorkDir().GetFullPath( projectInfo.resourceManager.iconResources[i].filepath ).c_str()
+							);
 							break;
 						}
@@ -202,9 +202,9 @@
 				case IDM_MATERIALTREE_DELETE:
 					hTreeItem=TreeView_GetSelection(hMaterialTreeView);
-					for(i=0;i<projectInfo.res.NumberOfCursorRes;i++){
-						if(projectInfo.res.pCursorResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.cursorResources.size();i++){
+						if(projectInfo.resourceManager.cursorResources[i].hTreeItem==hTreeItem){
 
 							//"%s カーソルをプロジェクトから削除します。よろしいですか？"
-							sprintf(str,STRING_PJ_CHECK_DELETECURSOR,projectInfo.res.pCursorResInfo[i].IdName);
+							sprintf(str,STRING_PJ_CHECK_DELETECURSOR,projectInfo.resourceManager.cursorResources[i].idName.c_str());
 							if(IDCANCEL==MessageBox(hOwner,str,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
 
@@ -213,9 +213,9 @@
 						}
 					}
-					for(i=0;i<projectInfo.res.NumberOfBitmapRes;i++){
-						if(projectInfo.res.pBitmapResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.bitmapResources.size();i++){
+						if(projectInfo.resourceManager.bitmapResources[i].hTreeItem==hTreeItem){
 
 							//"%s ビットマップをプロジェクトから削除します。よろしいですか？"
-							sprintf(str,STRING_PJ_CHECK_DELETEBITMAP,projectInfo.res.pBitmapResInfo[i].IdName);
+							sprintf(str,STRING_PJ_CHECK_DELETEBITMAP,projectInfo.resourceManager.bitmapResources[i].idName.c_str());
 							if(IDCANCEL==MessageBox(hOwner,str,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
 
@@ -224,9 +224,9 @@
 						}
 					}
-					for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
-						if(projectInfo.res.pIconResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
+						if(projectInfo.resourceManager.iconResources[i].hTreeItem==hTreeItem){
 
 							//"%s アイコンをプロジェクトから削除します。よろしいですか？"
-							sprintf(str,STRING_PJ_CHECK_DELETEICON,projectInfo.res.pIconResInfo[i].IdName);
+							sprintf(str,STRING_PJ_CHECK_DELETEICON,projectInfo.resourceManager.iconResources[i].idName.c_str());
 							if(IDCANCEL==MessageBox(hOwner,str,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
 
@@ -261,18 +261,18 @@
 					extern char NewIdName[MAX_PATH];
 					hTreeItem=TreeView_GetSelection(hMaterialTreeView);
-					for(i=0;i<projectInfo.res.NumberOfCursorRes;i++){
-						if(projectInfo.res.pCursorResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.cursorResources.size();i++){
+						if(projectInfo.resourceManager.cursorResources[i].hTreeItem==hTreeItem){
 							Project_Cursor_RenameID(i);
 							break;
 						}
 					}
-					for(i=0;i<projectInfo.res.NumberOfBitmapRes;i++){
-						if(projectInfo.res.pBitmapResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.bitmapResources.size();i++){
+						if(projectInfo.resourceManager.bitmapResources[i].hTreeItem==hTreeItem){
 							Project_Bitmap_RenameID(i);
 							break;
 						}
 					}
-					for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
-						if(projectInfo.res.pIconResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
+						if(projectInfo.resourceManager.iconResources[i].hTreeItem==hTreeItem){
 							Project_Icon_RenameID(i);
 						}
@@ -313,24 +313,23 @@
 					break;
 				case IDM_MATERIALTREE_ICON_SETMAIN:
-					RESITEMINFO TempIconResInfo;
 					hTreeItem=TreeView_GetSelection(hMaterialTreeView);
-					for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
-						if(projectInfo.res.pIconResInfo[i].hTreeItem==hTreeItem){
+					for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
+						if(projectInfo.resourceManager.iconResources[i].hTreeItem==hTreeItem){
 							if(i==0) break;
 
-							TempIconResInfo=projectInfo.res.pIconResInfo[i];
-							for(;i>0;i--)
-								projectInfo.res.pIconResInfo[i]=projectInfo.res.pIconResInfo[i-1];
-							projectInfo.res.pIconResInfo[0]=TempIconResInfo;
-
-							tvItem.hItem=projectInfo.res.pIconResInfo[1].hTreeItem;
+							ActiveBasic::Common::ResourceItem tempItem = projectInfo.resourceManager.iconResources[i];
+							Jenga::Common::EraseVectorItem<ActiveBasic::Common::ResourceItems>( projectInfo.resourceManager.iconResources, i );
+							projectInfo.resourceManager.iconResources.insert( projectInfo.resourceManager.iconResources.begin(), tempItem );
+
+							tvItem.hItem=projectInfo.resourceManager.iconResources[1].hTreeItem;
 							tvItem.mask=TVIF_TEXT;
-							tvItem.pszText=projectInfo.res.pIconResInfo[1].IdName;
-							tvItem.cchTextMax=lstrlen(projectInfo.res.pIconResInfo[1].IdName)+1;
+							lstrcpy( temporary, projectInfo.resourceManager.iconResources[1].idName.c_str() );
+							tvItem.pszText = temporary;
+							tvItem.cchTextMax=lstrlen(temporary)+1;
 							TreeView_SetItem(hMaterialTreeView,&tvItem);
 
-							tvItem.hItem=projectInfo.res.pIconResInfo[0].hTreeItem;
+							tvItem.hItem=projectInfo.resourceManager.iconResources[0].hTreeItem;
 							tvItem.mask=TVIF_TEXT;
-							sprintf(temporary,"%s (Main)",projectInfo.res.pIconResInfo[0].IdName);
+							sprintf(temporary,"%s (Main)",projectInfo.resourceManager.iconResources[0].idName.c_str());
 							tvItem.pszText=temporary;
 							tvItem.cchTextMax=lstrlen(temporary)+1;
@@ -1142,10 +1141,11 @@
 	tv.item.pszText=temporary;
 	tv.hParent=TreeView_InsertItem(hMaterialTreeView,&tv);
-	projectInfo.res.hCursorTreeItem=tv.hParent;
-	for(i=0;i<projectInfo.res.NumberOfCursorRes;i++){
+	hCursorTreeItemForProjectView = tv.hParent;
+	for(i=0;i<projectInfo.resourceManager.cursorResources.size();i++){
 		tv.item.iImage=6;
 		tv.item.iSelectedImage=6;
-		tv.item.pszText=projectInfo.res.pCursorResInfo[i].IdName;
-		projectInfo.res.pCursorResInfo[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
+		lstrcpy( temporary, projectInfo.resourceManager.cursorResources[i].idName.c_str() );
+		tv.item.pszText=temporary;
+		projectInfo.resourceManager.cursorResources[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
 	}
 
@@ -1157,10 +1157,11 @@
 	tv.item.pszText=temporary;
 	tv.hParent=TreeView_InsertItem(hMaterialTreeView,&tv);
-	projectInfo.res.hBitmapTreeItem=tv.hParent;
-	for(i=0;i<projectInfo.res.NumberOfBitmapRes;i++){
+	hBitmapTreeItemForProjectView = tv.hParent;
+	for(i=0;i<projectInfo.resourceManager.bitmapResources.size();i++){
 		tv.item.iImage=5;
 		tv.item.iSelectedImage=5;
-		tv.item.pszText=projectInfo.res.pBitmapResInfo[i].IdName;
-		projectInfo.res.pBitmapResInfo[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
+		lstrcpy( temporary, projectInfo.resourceManager.bitmapResources[i].idName.c_str() );
+		tv.item.pszText=temporary;
+		projectInfo.resourceManager.bitmapResources[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
 	}
 
@@ -1172,14 +1173,17 @@
 	tv.item.pszText=temporary;
 	tv.hParent=TreeView_InsertItem(hMaterialTreeView,&tv);
-	projectInfo.res.hIconTreeItem=tv.hParent;
-	for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
+	hIconTreeItemForProjectView = tv.hParent;
+	for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
 		tv.item.iImage=4;
 		tv.item.iSelectedImage=4;
 		if(i==0){
-			sprintf(temporary,"%s (Main)",projectInfo.res.pIconResInfo[i].IdName);
-			tv.item.pszText=temporary;
+			sprintf(temporary,"%s (Main)",projectInfo.resourceManager.iconResources[i].idName.c_str());
 		}
-		else tv.item.pszText=projectInfo.res.pIconResInfo[i].IdName;
-		projectInfo.res.pIconResInfo[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
+		else
+		{
+			sprintf(temporary,"%s",projectInfo.resourceManager.iconResources[i].idName.c_str());
+		}
+		tv.item.pszText=temporary;
+		projectInfo.resourceManager.iconResources[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
 	}
 
@@ -1353,6 +1357,6 @@
 						}
 						else if(lstrcmpi(temporary,"icon")==0){
-							for(i3=0;i3<projectInfo.res.NumberOfIconRes;i3++){
-								if(lstrcmpi(projectInfo.res.pIconResInfo[i3].path,temp2)==0){
+							for(i3=0;i3<projectInfo.resourceManager.iconResources.size();i3++){
+								if(lstrcmpi(projectInfo.resourceManager.iconResources[i3].filepath.c_str(),temp2)==0){
 									NewIconEditWindow( projectInfo.GetWorkDir().GetFullPath( temp2 ).c_str() );
 									break;
@@ -1474,6 +1478,6 @@
 						}
 						else if(lstrcmpi(temporary,"icon")==0){
-							for(i3=0;i3<projectInfo.res.NumberOfIconRes;i3++){
-								if(lstrcmpi(projectInfo.res.pIconResInfo[i3].path,temp2)==0){
+							for(i3=0;i3<projectInfo.resourceManager.iconResources.size();i3++){
+								if(lstrcmpi(projectInfo.resourceManager.iconResources[i3].filepath.c_str(),temp2)==0){
 									NewIconEditWindow( projectInfo.GetWorkDir().GetFullPath( temp2 ).c_str() );
 									break;
@@ -1593,6 +1597,6 @@
 		else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
 			if(MdiInfo[WndNum].MdiIconEditInfo->bModify){
-				for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
-					lstrcpy(temporary,projectInfo.res.pIconResInfo[i].path);
+				for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
+					lstrcpy(temporary,projectInfo.resourceManager.iconResources[i].filepath.c_str());
 					lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );
 					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) sw=1;
@@ -1686,9 +1690,9 @@
 		}
 		else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
-			for(i=0;i<projectInfo.res.NumberOfIconRes;i++){
-				lstrcpy(temporary,projectInfo.res.pIconResInfo[i].path);
+			for(i=0;i<projectInfo.resourceManager.iconResources.size();i++){
+				lstrcpy(temporary,projectInfo.resourceManager.iconResources[i].filepath.c_str());
 				lstrcpy( temporary, projectInfo.GetWorkDir().GetFullPath( temporary ).c_str() );
 				if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
-					sprintf(buffer+i2,"icon,%s\r\n",projectInfo.res.pIconResInfo[i].path);
+					sprintf(buffer+i2,"icon,%s\r\n",projectInfo.resourceManager.iconResources[i].filepath.c_str());
 					i2+=lstrlen(buffer+i2);
 					break;
Index: trunk/ab5.0/abdev/abdev/RadSupport.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/RadSupport.cpp	(revision 622)
+++ trunk/ab5.0/abdev/abdev/RadSupport.cpp	(revision 623)
@@ -106,10 +106,13 @@
 						lstrcpy(temporary,pWindowInfo->childWindowInfos[i2]->ImageCtrlInfo.path);
 					else{
-						for(i3=0;i3<projectInfo.res.NumberOfIconRes;i3++){
-							if(lstrcmp(pWindowInfo->childWindowInfos[i2]->ImageCtrlInfo.path,
-								projectInfo.res.pIconResInfo[i3].IdName)==0) break;
+						for(i3=0;i3<projectInfo.resourceManager.iconResources.size();i3++)
+						{
+							if( projectInfo.resourceManager.iconResources[i3].idName == pWindowInfo->childWindowInfos[i2]->ImageCtrlInfo.path )
+							{
+								break;
+							}
 						}
-						if(i3==projectInfo.res.NumberOfIconRes) temporary[0]=0;
-						else lstrcpy(temporary,projectInfo.res.pIconResInfo[i3].path);
+						if(i3==projectInfo.resourceManager.iconResources.size()) temporary[0]=0;
+						else lstrcpy(temporary,projectInfo.resourceManager.iconResources[i3].filepath.c_str());
 					}
 					if(temporary[0]){
@@ -124,10 +127,12 @@
 						lstrcpy(temporary,pWindowInfo->childWindowInfos[i2]->ImageCtrlInfo.path);
 					else{
-						for(i3=0;i3<projectInfo.res.NumberOfBitmapRes;i3++){
-							if(lstrcmp(pWindowInfo->childWindowInfos[i2]->ImageCtrlInfo.path,
-								projectInfo.res.pBitmapResInfo[i3].IdName)==0) break;
+						for(i3=0;i3<projectInfo.resourceManager.bitmapResources.size();i3++){
+							if( projectInfo.resourceManager.bitmapResources[i3].idName == pWindowInfo->childWindowInfos[i2]->ImageCtrlInfo.path )
+							{
+								break;
+							}
 						}
-						if(i3==projectInfo.res.NumberOfBitmapRes) temporary[0]=0;
-						else lstrcpy(temporary,projectInfo.res.pBitmapResInfo[i3].path);
+						if(i3==projectInfo.resourceManager.bitmapResources.size()) temporary[0]=0;
+						else lstrcpy(temporary,projectInfo.resourceManager.bitmapResources[i3].filepath.c_str());
 					}
 					if(temporary[0]){
Index: trunk/ab5.0/abdev/abdev/RadToolsAndPropertyProc.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/RadToolsAndPropertyProc.cpp	(revision 622)
+++ trunk/ab5.0/abdev/abdev/RadToolsAndPropertyProc.cpp	(revision 623)
@@ -564,6 +564,6 @@
 				SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_BGCOLOR2);
 
-				for(i3=0;i3<projectInfo.res.NumberOfBitmapRes;i3++)
-					SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_ADDSTRING,0,(long)projectInfo.res.pBitmapResInfo[i3].IdName);
+				for(i3=0;i3<projectInfo.resourceManager.bitmapResources.size();i3++)
+					SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_ADDSTRING,0,(long)projectInfo.resourceManager.bitmapResources[i3].idName.c_str());
 				if(pWindowInfo->type==WNDTYPE_MODALDLG||
 					pWindowInfo->type==WNDTYPE_MODELESSDLG){
@@ -617,9 +617,14 @@
 				SendDlgItemMessage(hwnd,IDC_ICONRES,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_ICONDEFAULT);
 
-				for(i3=0,i4=0;i3<projectInfo.res.NumberOfIconRes;i3++){
-					SendDlgItemMessage(hwnd,IDC_ICONRES,CB_ADDSTRING,0,(long)projectInfo.res.pIconResInfo[i3].IdName);
-
-					if(lstrcmp(pWindowInfo->IconResName,projectInfo.res.pIconResInfo[i3].IdName)==0)
-						i4=i3+1;
+				for(i3=0,i4=0;i3<projectInfo.resourceManager.iconResources.size();i3++){
+					SendDlgItemMessage(hwnd,IDC_ICONRES,CB_ADDSTRING,0,(long)projectInfo.resourceManager.iconResources[i3].idName.c_str());
+
+					if( pWindowInfo->IconResName )
+					{
+						if( projectInfo.resourceManager.iconResources[i3].idName == pWindowInfo->IconResName )
+						{
+							i4=i3+1;
+						}
+					}
 				}
 				if(i4==0&&pWindowInfo->IconResName){
@@ -2727,11 +2732,11 @@
 						if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_ICON){
 							//アイコンリソースをコンボボックスに挿入
-							for(i3=0;i3<projectInfo.res.NumberOfIconRes;i3++)
-								SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.res.pIconResInfo[i3].IdName);
+							for(i3=0;i3<projectInfo.resourceManager.iconResources.size();i3++)
+								SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.iconResources[i3].idName.c_str());
 						}
 						else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_BITMAP){
 							//ビットマップリソースをコンボボックスに挿入
-							for(i3=0;i3<projectInfo.res.NumberOfBitmapRes;i3++)
-								SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.res.pBitmapResInfo[i3].IdName);
+							for(i3=0;i3<projectInfo.resourceManager.bitmapResources.size();i3++)
+								SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.bitmapResources[i3].idName.c_str());
 						}
 
@@ -2816,18 +2821,22 @@
 									if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_ICON){
 										//アイコンリソースをコンボボックスに挿入
-										for(i3=0;i3<projectInfo.res.NumberOfIconRes;i3++){
-											SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.res.pIconResInfo[i3].IdName);
-
-											if(lstrcmp(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path,projectInfo.res.pIconResInfo[i3].IdName)==0)
+										for(i3=0;i3<projectInfo.resourceManager.iconResources.size();i3++){
+											SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.iconResources[i3].idName.c_str());
+
+											if( projectInfo.resourceManager.iconResources[i3].idName == pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path )
+											{
 												SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_SETCURSEL,i3,0);
+											}
 										}
 									}
 									else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_BITMAP){
 										//ビットマップリソースをコンボボックスに挿入
-										for(i3=0;i3<projectInfo.res.NumberOfBitmapRes;i3++){
-											SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.res.pBitmapResInfo[i3].IdName);
-
-											if(lstrcmp(pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path,projectInfo.res.pBitmapResInfo[i3].IdName)==0)
+										for(i3=0;i3<projectInfo.resourceManager.bitmapResources.size();i3++){
+											SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.bitmapResources[i3].idName.c_str());
+
+											if( projectInfo.resourceManager.bitmapResources[i3].idName == pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->ImageCtrlInfo.path )
+											{
 												SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_SETCURSEL,i3,0);
+											}
 										}
 									}
@@ -2910,11 +2919,13 @@
 						if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_ICON){
 							//アイコンリソースをコンボボックスに挿入
-							for(i3=0;i3<projectInfo.res.NumberOfIconRes;i3++)
-								SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.res.pIconResInfo[i3].IdName);
+							for(i3=0;i3<projectInfo.resourceManager.iconResources.size();i3++)
+							{
+								SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.iconResources[i3].idName.c_str());
+							}
 						}
 						else if((pWindowInfo->childWindowInfos[MdiInfo[i].MdiRadInfo->SelectingItem[0]]->style&0x0000000F)==SS_BITMAP){
 							//ビットマップリソースをコンボボックスに挿入
-							for(i3=0;i3<projectInfo.res.NumberOfBitmapRes;i3++)
-								SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.res.pBitmapResInfo[i3].IdName);
+							for(i3=0;i3<projectInfo.resourceManager.bitmapResources.size();i3++)
+								SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_ADDSTRING,0,(long)projectInfo.resourceManager.bitmapResources[i3].idName.c_str());
 						}
 						break;
Index: trunk/ab5.0/abdev/abdev/Resource.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/Resource.cpp	(revision 622)
+++ trunk/ab5.0/abdev/abdev/Resource.cpp	(revision 623)
@@ -11,144 +11,35 @@
 #endif
 
-void GetResourceData(void){
-	extern HANDLE hHeap;
-	int i2,i3;
-	char *buffer,temporary[MAX_PATH],temp2[MAX_PATH],temp3[MAX_PATH];
-	HANDLE hFile;
-
-	hFile=CreateFile( projectInfo.GetResourceFileFullPath().c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
-	if(hFile==INVALID_HANDLE_VALUE) return;
-	i2=GetFileSize(hFile,NULL);
-	buffer=(char *)HeapAlloc(hHeap,0,i2+i2+1);
-	ReadFile(hFile,buffer,i2,(DWORD *)&i3,NULL);
-	CloseHandle(hFile);
-	buffer[i3]=0;
-	ChangeReturnCode(buffer);
-
-	i2=0;
-	while(1){
-		//ID
-		while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
-		for(i3=0;;i2++,i3++){
-			if(!IsVariableChar(buffer[i2])){
-				temp3[i3]=0;
+
+void Project_CursorResInsert(void){
+	extern HANDLE hHeap;
+	extern LPSTR CursorFileFilter;
+	int i3;
+	char temporary[MAX_PATH];
+
+	//"カーソル ファイルを指定してください"
+	if(!GetFilePathDialog(hOwner,temporary,CursorFileFilter,STRING_FILEOPENTITLE_CURSOR,TRUE)) return;
+
+	ActiveBasic::Common::ResourceItem item;
+	item.filepath = projectInfo.GetWorkDir().GetRelationalPath( temporary );
+
+	for(i3=1;;i3++){
+		sprintf(temporary,"IDC_CURSOR%d",i3);
+		bool isDuplicate = false;
+		BOOST_FOREACH( const ActiveBasic::Common::ResourceItem &resourceItem, projectInfo.resourceManager.cursorResources )
+		{
+			if( resourceItem.idName == temporary )
+			{
+				isDuplicate = true;
 				break;
 			}
-			temp3[i3]=buffer[i2];
-		}
-		if(temp3[0]=='\0') break;
-
-		//Type
-		while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
-		for(i3=0;;i2++,i3++){
-			if(!IsVariableChar(buffer[i2])){
-				temporary[i3]=0;
-				break;
-			}
-			temporary[i3]=buffer[i2];
-		}
-
-		//FileName
-		while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
-		if(buffer[i2]!='\"'){
-			//エラー
-			return;
-		}
-		for(i2++,i3=0;;i2++,i3++){
-			if(buffer[i2]=='\"'){
-				temp2[i3]=0;
-				break;
-			}
-			temp2[i3]=buffer[i2];
-		}
-
-		if(lstrcmpi(temporary,"CURSOR")==0){
-			projectInfo.res.pCursorResInfo=(RESITEMINFO *)HeapReAlloc(hHeap,0,projectInfo.res.pCursorResInfo,(projectInfo.res.NumberOfCursorRes+1)*sizeof(RESITEMINFO));
-
-			projectInfo.res.pCursorResInfo[projectInfo.res.NumberOfCursorRes].IdName=
-				(char *)HeapAlloc(hHeap,0,lstrlen(temp3)+1);
-			lstrcpy(projectInfo.res.pCursorResInfo[projectInfo.res.NumberOfCursorRes].IdName,temp3);
-
-			projectInfo.res.pCursorResInfo[projectInfo.res.NumberOfCursorRes].path=
-				(char *)HeapAlloc(hHeap,0,lstrlen(temp2)+1);
-			lstrcpy(projectInfo.res.pCursorResInfo[projectInfo.res.NumberOfCursorRes].path,temp2);
-
-			projectInfo.res.NumberOfCursorRes++;
-		}
-		else if(lstrcmpi(temporary,"BITMAP")==0){
-			projectInfo.res.pBitmapResInfo=(RESITEMINFO *)HeapReAlloc(hHeap,0,projectInfo.res.pBitmapResInfo,(projectInfo.res.NumberOfBitmapRes+1)*sizeof(RESITEMINFO));
-
-			projectInfo.res.pBitmapResInfo[projectInfo.res.NumberOfBitmapRes].IdName=
-				(char *)HeapAlloc(hHeap,0,lstrlen(temp3)+1);
-			lstrcpy(projectInfo.res.pBitmapResInfo[projectInfo.res.NumberOfBitmapRes].IdName,temp3);
-
-			projectInfo.res.pBitmapResInfo[projectInfo.res.NumberOfBitmapRes].path=
-				(char *)HeapAlloc(hHeap,0,lstrlen(temp2)+1);
-			lstrcpy(projectInfo.res.pBitmapResInfo[projectInfo.res.NumberOfBitmapRes].path,temp2);
-
-			projectInfo.res.NumberOfBitmapRes++;
-		}
-		else if(lstrcmpi(temporary,"ICON")==0){
-			projectInfo.res.pIconResInfo=(RESITEMINFO *)HeapReAlloc(hHeap,0,projectInfo.res.pIconResInfo,(projectInfo.res.NumberOfIconRes+1)*sizeof(RESITEMINFO));
-
-			projectInfo.res.pIconResInfo[projectInfo.res.NumberOfIconRes].IdName=
-				(char *)HeapAlloc(hHeap,0,lstrlen(temp3)+1);
-			lstrcpy(projectInfo.res.pIconResInfo[projectInfo.res.NumberOfIconRes].IdName,temp3);
-
-			projectInfo.res.pIconResInfo[projectInfo.res.NumberOfIconRes].path=
-				(char *)HeapAlloc(hHeap,0,lstrlen(temp2)+1);
-			lstrcpy(projectInfo.res.pIconResInfo[projectInfo.res.NumberOfIconRes].path,temp2);
-
-			projectInfo.res.NumberOfIconRes++;
-		}
-		else if(lstrcmpi(temporary,"RT_MANIFEST")==0){
-			//無視
-		}
-		else{
-			//エラー
-			return;
-		}
-
-		i2++;
-		while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
-		if(buffer[i2]=='\0') break;
-		else if(buffer[i2]!='\n'){
-			//エラー
-			return;
-		}
-		i2++;
-	}
-
-	HeapDefaultFree(buffer);
-}
-
-void Project_CursorResInsert(void){
-	extern HANDLE hHeap;
-	extern LPSTR CursorFileFilter;
-	int i2,i3;
-	char temporary[MAX_PATH];
-
-	//"カーソル ファイルを指定してください"
-	if(!GetFilePathDialog(hOwner,temporary,CursorFileFilter,STRING_FILEOPENTITLE_CURSOR,TRUE)) return;
-
-	lstrcpy( temporary, projectInfo.GetWorkDir().GetRelationalPath( temporary ).c_str() );
-
-	projectInfo.res.pCursorResInfo=(RESITEMINFO *)HeapReAlloc(hHeap,0,projectInfo.res.pCursorResInfo,(projectInfo.res.NumberOfCursorRes+1)*sizeof(RESITEMINFO));
-
-	projectInfo.res.pCursorResInfo[projectInfo.res.NumberOfCursorRes].path=
-		(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-	lstrcpy(projectInfo.res.pCursorResInfo[projectInfo.res.NumberOfCursorRes].path,temporary);
-
-	for(i3=1;;i3++){
-		sprintf(temporary,"IDC_CURSOR%d",i3);
-		for(i2=0;i2<projectInfo.res.NumberOfCursorRes;i2++){
-			if(lstrcmp(temporary,projectInfo.res.pCursorResInfo[i2].IdName)==0) break;
-		}
-		if(i2==projectInfo.res.NumberOfCursorRes) break;
-	}
-
-	projectInfo.res.pCursorResInfo[projectInfo.res.NumberOfCursorRes].IdName=
-		(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-	lstrcpy(projectInfo.res.pCursorResInfo[projectInfo.res.NumberOfCursorRes].IdName,temporary);
+		}
+
+		if( !isDuplicate )
+		{
+			break;
+		}
+	}
+	item.idName = temporary;
 
 	//ツリービューに追加
@@ -159,28 +50,22 @@
 	tv.item.iImage=6;
 	tv.item.iSelectedImage=6;
-	tv.hParent=projectInfo.res.hCursorTreeItem;
+	tv.hParent = hCursorTreeItemForProjectView;
 	tv.item.pszText=temporary;
 
-	projectInfo.res.pCursorResInfo[projectInfo.res.NumberOfCursorRes].hTreeItem=
-		TreeView_InsertItem(hMaterialTreeView,&tv);
-
-	TreeView_SelectItem(hMaterialTreeView,projectInfo.res.pCursorResInfo[projectInfo.res.NumberOfCursorRes].hTreeItem);
-
-	projectInfo.res.NumberOfCursorRes++;
+	item.hTreeItem = TreeView_InsertItem(hMaterialTreeView,&tv);
+
+	TreeView_SelectItem( hMaterialTreeView, item.hTreeItem );
+
+	projectInfo.resourceManager.cursorResources.push_back( item );
+
 	projectInfo.ModifuOfResource=1;
 }
 void Project_Cursor_Delete(int CursorInfoNum){
-	int i;
-
 	//ツリービューから削除
 	extern HWND hMaterialTreeView;
-	TreeView_DeleteItem(hMaterialTreeView,projectInfo.res.pCursorResInfo[CursorInfoNum].hTreeItem);
+	TreeView_DeleteItem(hMaterialTreeView,projectInfo.resourceManager.cursorResources[CursorInfoNum].hTreeItem);
 
 	//projectInfo.pCursorInfo構造体から削除
-	HeapDefaultFree(projectInfo.res.pCursorResInfo[CursorInfoNum].IdName);
-	HeapDefaultFree(projectInfo.res.pCursorResInfo[CursorInfoNum].path);
-	projectInfo.res.NumberOfCursorRes--;
-	for(i=CursorInfoNum;i<projectInfo.res.NumberOfCursorRes;i++)
-		projectInfo.res.pCursorResInfo[i]=projectInfo.res.pCursorResInfo[i+1];
+	Jenga::Common::EraseVectorItem<ActiveBasic::Common::ResourceItems>( projectInfo.resourceManager.cursorResources, CursorInfoNum );
 
 	projectInfo.ModifuOfResource=1;
@@ -194,10 +79,11 @@
 	TVITEM tvItem;
 
-	if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,(DLGPROC)DlgProject_ResourceID_Input,(long)projectInfo.res.pCursorResInfo[CursorInfoNum].IdName)) return;
+	if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,(DLGPROC)DlgProject_ResourceID_Input,(long)projectInfo.resourceManager.cursorResources[CursorInfoNum].idName.c_str())) return;
 
 	//重複チェック
-	for(i2=0;i2<projectInfo.res.NumberOfCursorRes;i2++){
+	for(i2=0;i2<projectInfo.resourceManager.cursorResources.size();i2++){
 		if(i2==CursorInfoNum) continue;
-		if(lstrcmp(NewIdName,projectInfo.res.pCursorResInfo[i2].IdName)==0){
+		if( projectInfo.resourceManager.cursorResources[i2].idName == NewIdName )
+		{
 			//"ID \"%s\" は既にプロジェクト内に存在します。"
 			sprintf(temporary,STRING_DUPLICATIONERROR_ID_IN_PROJECT,NewIdName);
@@ -207,12 +93,11 @@
 	}
 
-	HeapDefaultFree(projectInfo.res.pCursorResInfo[CursorInfoNum].IdName);
-	projectInfo.res.pCursorResInfo[CursorInfoNum].IdName=(char *)HeapAlloc(hHeap,0,lstrlen(NewIdName)+1);
-	lstrcpy(projectInfo.res.pCursorResInfo[CursorInfoNum].IdName,NewIdName);
-
-	tvItem.hItem=projectInfo.res.pCursorResInfo[CursorInfoNum].hTreeItem;
+	projectInfo.resourceManager.cursorResources[CursorInfoNum].idName = NewIdName;
+
+	tvItem.hItem=projectInfo.resourceManager.cursorResources[CursorInfoNum].hTreeItem;
 	tvItem.mask=TVIF_TEXT;
-	tvItem.pszText=projectInfo.res.pCursorResInfo[CursorInfoNum].IdName;
-	tvItem.cchTextMax=lstrlen(projectInfo.res.pCursorResInfo[CursorInfoNum].IdName)+1;
+	lstrcpy( temporary, projectInfo.resourceManager.cursorResources[CursorInfoNum].idName.c_str() );
+	tvItem.pszText=temporary;
+	tvItem.cchTextMax=lstrlen(temporary)+1;
 	TreeView_SetItem(hMaterialTreeView,&tvItem);
 
@@ -220,5 +105,5 @@
 
 	TreeView_SortChildren(hMaterialTreeView,
-		TreeView_GetParent(hMaterialTreeView,projectInfo.res.pCursorResInfo[CursorInfoNum].hTreeItem),
+		TreeView_GetParent(hMaterialTreeView,projectInfo.resourceManager.cursorResources[CursorInfoNum].hTreeItem),
 		0);
 }
@@ -233,23 +118,25 @@
 	if(!GetFilePathDialog(hOwner,temporary,BitmapFileFilter,STRING_FILEOPENTITLE_BITMAP,TRUE)) return;
 
-	lstrcpy( temporary, projectInfo.GetWorkDir().GetRelationalPath( temporary ).c_str() );
-
-	projectInfo.res.pBitmapResInfo=(RESITEMINFO *)HeapReAlloc(hHeap,0,projectInfo.res.pBitmapResInfo,(projectInfo.res.NumberOfBitmapRes+1)*sizeof(RESITEMINFO));
-
-	projectInfo.res.pBitmapResInfo[projectInfo.res.NumberOfBitmapRes].path=
-		(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-	lstrcpy(projectInfo.res.pBitmapResInfo[projectInfo.res.NumberOfBitmapRes].path,temporary);
+	ActiveBasic::Common::ResourceItem item;
+	item.filepath = projectInfo.GetWorkDir().GetRelationalPath( temporary );
 
 	for(i3=1;;i3++){
 		sprintf(temporary,"IDB_BITMAP%d",i3);
-		for(i2=0;i2<projectInfo.res.NumberOfBitmapRes;i2++){
-			if(lstrcmp(temporary,projectInfo.res.pBitmapResInfo[i2].IdName)==0) break;
-		}
-		if(i2==projectInfo.res.NumberOfBitmapRes) break;
-	}
-
-	projectInfo.res.pBitmapResInfo[projectInfo.res.NumberOfBitmapRes].IdName=
-		(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-	lstrcpy(projectInfo.res.pBitmapResInfo[projectInfo.res.NumberOfBitmapRes].IdName,temporary);
+		bool isDuplicate = false;
+		BOOST_FOREACH( const ActiveBasic::Common::ResourceItem &resourceItem, projectInfo.resourceManager.bitmapResources )
+		{
+			if( resourceItem.idName == temporary )
+			{
+				isDuplicate = true;
+				break;
+			}
+		}
+
+		if( !isDuplicate )
+		{
+			break;
+		}
+	}
+	item.idName = temporary;
 
 	//ツリービューに追加
@@ -260,13 +147,13 @@
 	tv.item.iImage=5;
 	tv.item.iSelectedImage=5;
-	tv.hParent=projectInfo.res.hBitmapTreeItem;
+	tv.hParent = hBitmapTreeItemForProjectView;
 	tv.item.pszText=temporary;
 
-	projectInfo.res.pBitmapResInfo[projectInfo.res.NumberOfBitmapRes].hTreeItem=
-		TreeView_InsertItem(hMaterialTreeView,&tv);
-
-	TreeView_SelectItem(hMaterialTreeView,projectInfo.res.pBitmapResInfo[projectInfo.res.NumberOfBitmapRes].hTreeItem);
-
-	projectInfo.res.NumberOfBitmapRes++;
+	item.hTreeItem = TreeView_InsertItem(hMaterialTreeView,&tv);
+
+	TreeView_SelectItem(hMaterialTreeView,item.hTreeItem);
+
+	projectInfo.resourceManager.bitmapResources.push_back( item );
+
 	projectInfo.ModifuOfResource=1;
 
@@ -283,16 +170,10 @@
 }
 void Project_Bitmap_Delete(int BitmapInfoNum){
-	int i;
-
 	//ツリービューから削除
 	extern HWND hMaterialTreeView;
-	TreeView_DeleteItem(hMaterialTreeView,projectInfo.res.pBitmapResInfo[BitmapInfoNum].hTreeItem);
+	TreeView_DeleteItem(hMaterialTreeView,projectInfo.resourceManager.bitmapResources[BitmapInfoNum].hTreeItem);
 
 	//projectInfo.pBitmapInfo構造体から削除
-	HeapDefaultFree(projectInfo.res.pBitmapResInfo[BitmapInfoNum].IdName);
-	HeapDefaultFree(projectInfo.res.pBitmapResInfo[BitmapInfoNum].path);
-	projectInfo.res.NumberOfBitmapRes--;
-	for(i=BitmapInfoNum;i<projectInfo.res.NumberOfBitmapRes;i++)
-		projectInfo.res.pBitmapResInfo[i]=projectInfo.res.pBitmapResInfo[i+1];
+	Jenga::Common::EraseVectorItem<ActiveBasic::Common::ResourceItems>( projectInfo.resourceManager.bitmapResources, BitmapInfoNum );
 
 	projectInfo.ModifuOfResource=1;
@@ -306,10 +187,11 @@
 	TVITEM tvItem;
 
-	if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,(DLGPROC)DlgProject_ResourceID_Input,(long)projectInfo.res.pBitmapResInfo[BitmapInfoNum].IdName)) return;
+	if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,(DLGPROC)DlgProject_ResourceID_Input,(long)projectInfo.resourceManager.bitmapResources[BitmapInfoNum].idName.c_str())) return;
 
 	//重複チェック
-	for(i2=0;i2<projectInfo.res.NumberOfBitmapRes;i2++){
+	for(i2=0;i2<projectInfo.resourceManager.bitmapResources.size();i2++){
 		if(i2==BitmapInfoNum) continue;
-		if(lstrcmp(NewIdName,projectInfo.res.pBitmapResInfo[i2].IdName)==0){
+		if( projectInfo.resourceManager.bitmapResources[i2].idName == NewIdName )
+		{
 			//"ID \"%s\" は既にプロジェクト内に存在します。"
 			sprintf(temporary,STRING_DUPLICATIONERROR_ID_IN_PROJECT,NewIdName);
@@ -319,12 +201,11 @@
 	}
 
-	HeapDefaultFree(projectInfo.res.pBitmapResInfo[BitmapInfoNum].IdName);
-	projectInfo.res.pBitmapResInfo[BitmapInfoNum].IdName=(char *)HeapAlloc(hHeap,0,lstrlen(NewIdName)+1);
-	lstrcpy(projectInfo.res.pBitmapResInfo[BitmapInfoNum].IdName,NewIdName);
-
-	tvItem.hItem=projectInfo.res.pBitmapResInfo[BitmapInfoNum].hTreeItem;
+	projectInfo.resourceManager.bitmapResources[BitmapInfoNum].idName = NewIdName;
+
+	tvItem.hItem=projectInfo.resourceManager.bitmapResources[BitmapInfoNum].hTreeItem;
 	tvItem.mask=TVIF_TEXT;
-	tvItem.pszText=projectInfo.res.pBitmapResInfo[BitmapInfoNum].IdName;
-	tvItem.cchTextMax=lstrlen(projectInfo.res.pBitmapResInfo[BitmapInfoNum].IdName)+1;
+	lstrcpy( temporary, projectInfo.resourceManager.bitmapResources[BitmapInfoNum].idName.c_str() );
+	tvItem.pszText = temporary;
+	tvItem.cchTextMax=lstrlen(temporary)+1;
 	TreeView_SetItem(hMaterialTreeView,&tvItem);
 
@@ -332,5 +213,5 @@
 
 	TreeView_SortChildren(hMaterialTreeView,
-		TreeView_GetParent(hMaterialTreeView,projectInfo.res.pBitmapResInfo[BitmapInfoNum].hTreeItem),
+		TreeView_GetParent(hMaterialTreeView,projectInfo.resourceManager.bitmapResources[BitmapInfoNum].hTreeItem),
 		0);
 }
@@ -344,23 +225,25 @@
 	if(!GetFilePathDialog(hOwner,temporary,IconFileFilter,STRING_FILEOPENTITLE_ICON,TRUE)) return;
 
-	lstrcpy( temporary, projectInfo.GetWorkDir().GetRelationalPath( temporary ).c_str() );
-
-	projectInfo.res.pIconResInfo=(RESITEMINFO *)HeapReAlloc(hHeap,0,projectInfo.res.pIconResInfo,(projectInfo.res.NumberOfIconRes+1)*sizeof(RESITEMINFO));
-
-	projectInfo.res.pIconResInfo[projectInfo.res.NumberOfIconRes].path=
-		(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-	lstrcpy(projectInfo.res.pIconResInfo[projectInfo.res.NumberOfIconRes].path,temporary);
+	ActiveBasic::Common::ResourceItem item;
+	item.filepath = projectInfo.GetWorkDir().GetRelationalPath( temporary );
 
 	for(i3=1;;i3++){
 		sprintf(temporary,"IDI_ICON%d",i3);
-		for(i2=0;i2<projectInfo.res.NumberOfIconRes;i2++){
-			if(lstrcmp(temporary,projectInfo.res.pIconResInfo[i2].IdName)==0) break;
-		}
-		if(i2==projectInfo.res.NumberOfIconRes) break;
-	}
-
-	projectInfo.res.pIconResInfo[projectInfo.res.NumberOfIconRes].IdName=
-		(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-	lstrcpy(projectInfo.res.pIconResInfo[projectInfo.res.NumberOfIconRes].IdName,temporary);
+		bool isDuplicate = false;
+		BOOST_FOREACH( const ActiveBasic::Common::ResourceItem &resourceItem, projectInfo.resourceManager.iconResources )
+		{
+			if( resourceItem.idName == temporary )
+			{
+				isDuplicate = true;
+				break;
+			}
+		}
+
+		if( !isDuplicate )
+		{
+			break;
+		}
+	}
+	item.idName = temporary;
 
 	//ツリービューに追加
@@ -371,14 +254,15 @@
 	tv.item.iImage=4;
 	tv.item.iSelectedImage=4;
-	tv.hParent=projectInfo.res.hIconTreeItem;
-	if(projectInfo.res.NumberOfIconRes==0) lstrcat(temporary," (Main)");
+	tv.hParent = hIconTreeItemForProjectView;
+	if(projectInfo.resourceManager.iconResources.size()==0) lstrcat(temporary," (Main)");
 	tv.item.pszText=temporary;
 
-	projectInfo.res.pIconResInfo[projectInfo.res.NumberOfIconRes].hTreeItem=
+	item.hTreeItem=
 		TreeView_InsertItem(hMaterialTreeView,&tv);
 
-	TreeView_SelectItem(hMaterialTreeView,projectInfo.res.pIconResInfo[projectInfo.res.NumberOfIconRes].hTreeItem);
-
-	projectInfo.res.NumberOfIconRes++;
+	TreeView_SelectItem(hMaterialTreeView,item.hTreeItem);
+
+	projectInfo.resourceManager.iconResources.push_back( item );
+
 	projectInfo.ModifuOfResource=1;
 
@@ -401,17 +285,14 @@
 	//ツリービューから削除
 	extern HWND hMaterialTreeView;
-	TreeView_DeleteItem(hMaterialTreeView,projectInfo.res.pIconResInfo[IconInfoNum].hTreeItem);
+	TreeView_DeleteItem(hMaterialTreeView,projectInfo.resourceManager.iconResources[IconInfoNum].hTreeItem);
 
 	//projectInfo.pIconInfo構造体から削除
-	HeapDefaultFree(projectInfo.res.pIconResInfo[IconInfoNum].IdName);
-	HeapDefaultFree(projectInfo.res.pIconResInfo[IconInfoNum].path);
-	projectInfo.res.NumberOfIconRes--;
-	for(i2=IconInfoNum;i2<projectInfo.res.NumberOfIconRes;i2++) projectInfo.res.pIconResInfo[i2]=projectInfo.res.pIconResInfo[i2+1];
-
-	if(IconInfoNum==0&&projectInfo.res.NumberOfIconRes){
+	Jenga::Common::EraseVectorItem<ActiveBasic::Common::ResourceItems>( projectInfo.resourceManager.iconResources, IconInfoNum );
+
+	if(IconInfoNum==0&&projectInfo.resourceManager.iconResources.size()){
 		tv.mask=TVIF_TEXT|TVIF_HANDLE;
 		tv.pszText=temporary;
 		tv.cchTextMax=MAX_PATH;
-		tv.hItem=projectInfo.res.pIconResInfo[0].hTreeItem;
+		tv.hItem=projectInfo.resourceManager.iconResources[0].hTreeItem;
 		TreeView_GetItem(hMaterialTreeView,&tv);
 		lstrcat(tv.pszText," (Main)");
@@ -439,10 +320,11 @@
 	TVITEM tvItem;
 
-	if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,(DLGPROC)DlgProject_ResourceID_Input,(long)projectInfo.res.pIconResInfo[IconInfoNum].IdName)) return;
+	if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,(DLGPROC)DlgProject_ResourceID_Input,(long)projectInfo.resourceManager.iconResources[IconInfoNum].idName.c_str())) return;
 
 	//重複チェック
-	for(i2=0;i2<projectInfo.res.NumberOfIconRes;i2++){
+	for(i2=0;i2<projectInfo.resourceManager.iconResources.size();i2++){
 		if(i2==IconInfoNum) continue;
-		if(lstrcmp(NewIdName,projectInfo.res.pIconResInfo[i2].IdName)==0){
+		if( projectInfo.resourceManager.iconResources[i2].idName == NewIdName )
+		{
 			//"ID \"%s\" は既にプロジェクト内に存在します。"
 			sprintf(temporary,STRING_DUPLICATIONERROR_ID_IN_PROJECT,NewIdName);
@@ -452,16 +334,17 @@
 	}
 
-	HeapDefaultFree(projectInfo.res.pIconResInfo[IconInfoNum].IdName);
-	projectInfo.res.pIconResInfo[IconInfoNum].IdName=(char *)HeapAlloc(hHeap,0,lstrlen(NewIdName)+1);
-	lstrcpy(projectInfo.res.pIconResInfo[IconInfoNum].IdName,NewIdName);
-
-	tvItem.hItem=projectInfo.res.pIconResInfo[IconInfoNum].hTreeItem;
+	projectInfo.resourceManager.iconResources[IconInfoNum].idName = NewIdName;
+
+	tvItem.hItem=projectInfo.resourceManager.iconResources[IconInfoNum].hTreeItem;
 	tvItem.mask=TVIF_TEXT;
 	if(IconInfoNum==0){
-		sprintf(temporary,"%s (Main)",projectInfo.res.pIconResInfo[IconInfoNum].IdName);
-		tvItem.pszText=temporary;
-	}
-	else tvItem.pszText=projectInfo.res.pIconResInfo[IconInfoNum].IdName;
-	tvItem.cchTextMax=lstrlen(projectInfo.res.pIconResInfo[IconInfoNum].IdName)+1;
+		sprintf(temporary,"%s (Main)",projectInfo.resourceManager.iconResources[IconInfoNum].idName.c_str());
+	}
+	else
+	{
+		sprintf(temporary,"%s",projectInfo.resourceManager.iconResources[IconInfoNum].idName.c_str());
+	}
+	tvItem.pszText=temporary;
+	tvItem.cchTextMax=lstrlen(temporary)+1;
 	TreeView_SetItem(hMaterialTreeView,&tvItem);
 
@@ -469,5 +352,5 @@
 
 	TreeView_SortChildren(hMaterialTreeView,
-		TreeView_GetParent(hMaterialTreeView,projectInfo.res.pIconResInfo[IconInfoNum].hTreeItem),
+		TreeView_GetParent(hMaterialTreeView,projectInfo.resourceManager.iconResources[IconInfoNum].hTreeItem),
 		0);
 }
Index: trunk/ab5.0/abdev/abdev/WindowControl.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/WindowControl.cpp	(revision 622)
+++ trunk/ab5.0/abdev/abdev/WindowControl.cpp	(revision 623)
@@ -1097,5 +1097,5 @@
 				sprintf(buffer+i2,"_RadSys_hBackBrush%d=CreatePatternBrush(LoadImage(GetModuleHandle(0),%s,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE or LR_SHARED))\r\n",
 					i,
-					projectInfo.res.pBitmapResInfo[pWindowInfo->bgColor-0x1000].IdName);
+					projectInfo.resourceManager.bitmapResources[pWindowInfo->bgColor-0x1000].idName.c_str());
 				i2+=lstrlen(buffer+i2);
 		}
Index: trunk/ab5.0/abdev/abdev/abdev.h
===================================================================
--- trunk/ab5.0/abdev/abdev/abdev.h	(revision 622)
+++ trunk/ab5.0/abdev/abdev/abdev.h	(revision 623)
@@ -75,4 +75,9 @@
 HWND hProjectView_ToolWindow;
 
+// リソース関連
+HTREEITEM hCursorTreeItemForProjectView;
+HTREEITEM hBitmapTreeItemForProjectView;
+HTREEITEM hIconTreeItemForProjectView;
+
 //コンパイラビュー情報
 HWND hCompileView;
Index: trunk/ab5.0/abdev/abdev/include/ProjectManager/ProjectManager.h
===================================================================
--- trunk/ab5.0/abdev/abdev/include/ProjectManager/ProjectManager.h	(revision 622)
+++ trunk/ab5.0/abdev/abdev/include/ProjectManager/ProjectManager.h	(revision 623)
@@ -53,6 +53,4 @@
 	HTREEITEM hWindowTreeItem;
 
-	RESOURCEINFO res;
-
 	DWORD dwOption;
 	char lpszOutput_Release[MAX_PATH];
@@ -77,4 +75,7 @@
 	Jenga::Common::Directory workDir;
 	ActiveBasic::Common::TargetModuleType::EnumType moduleType;
+
+public:
+	ActiveBasic::Common::ResourceManager resourceManager;
 };
 
Index: trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp	(revision 622)
+++ trunk/ab5.0/abdev/abdev/src/ProjectManager/ProjectManager.cpp	(revision 623)
@@ -25,13 +25,4 @@
 	lstrcpy(pobj_nv->DefSaveDir,this->GetWorkDir().GetPath().c_str());
 
-
-	//////////////////////////////////////////
-	// リソースデータ用領域を確保
-	this->res.pCursorResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1);
-	this->res.NumberOfCursorRes=0;
-	this->res.pBitmapResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1);
-	this->res.NumberOfBitmapRes=0;
-	this->res.pIconResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1);
-	this->res.NumberOfIconRes=0;
 
 
@@ -242,8 +233,8 @@
 
 	// リソースを読み込む
-	Jenga::Common::Path resourcePath( projectInfo.GetResourceFileFullPath() );
+	Jenga::Common::Path resourcePath( this->GetResourceFileFullPath() );
 	if( resourcePath.IsExistFile() )
 	{
-		GetResourceData();
+		this->resourceManager.Load( this->GetResourceFileFullPath() );
 	}
 
@@ -302,6 +293,6 @@
 		if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
 			if(MdiInfo[WndNum].MdiIconEditInfo->bModify){
-				for(i=0;i<this->res.NumberOfIconRes;i++){
-					lstrcpy(temporary,this->res.pIconResInfo[i].path);
+				for(i=0;i<this->resourceManager.iconResources.size();i++){
+					lstrcpy(temporary,this->resourceManager.iconResources[i].filepath.c_str());
 					lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() );
 					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
@@ -366,19 +357,19 @@
 		i2=0;
 		i3=101;
-		for(i=0;i<this->res.NumberOfCursorRes;i++,i3++){
+		for(i=0;i<this->resourceManager.cursorResources.size();i++,i3++){
 			sprintf(buffer+i2,"Const %s=%d\r\n",
-				this->res.pCursorResInfo[i].IdName,
+				this->resourceManager.cursorResources[i].idName.c_str(),
 				i3);
 			i2+=lstrlen(buffer+i2);
 		}
-		for(i=0;i<this->res.NumberOfBitmapRes;i++,i3++){
+		for(i=0;i<this->resourceManager.bitmapResources.size();i++,i3++){
 			sprintf(buffer+i2,"Const %s=%d\r\n",
-				this->res.pBitmapResInfo[i].IdName,
+				this->resourceManager.bitmapResources[i].idName.c_str(),
 				i3);
 			i2+=lstrlen(buffer+i2);
 		}
-		for(i=0;i<this->res.NumberOfIconRes;i++,i3++){
+		for(i=0;i<this->resourceManager.iconResources.size();i++,i3++){
 			sprintf(buffer+i2,"Const %s=%d\r\n",
-				this->res.pIconResInfo[i].IdName,
+				this->resourceManager.iconResources[i].idName.c_str(),
 				i3);
 			i2+=lstrlen(buffer+i2);
@@ -389,20 +380,20 @@
 
 		i2=0;
-		for(i=0;i<this->res.NumberOfCursorRes;i++){
+		for(i=0;i<this->resourceManager.cursorResources.size();i++){
 			sprintf(buffer+i2,"%s CURSOR \"%s\"\r\n",
-				this->res.pCursorResInfo[i].IdName,
-				this->res.pCursorResInfo[i].path);
-			i2+=lstrlen(buffer+i2);
-		}
-		for(i=0;i<this->res.NumberOfBitmapRes;i++){
+				this->resourceManager.cursorResources[i].idName.c_str(),
+				this->resourceManager.cursorResources[i].filepath.c_str());
+			i2+=lstrlen(buffer+i2);
+		}
+		for(i=0;i<this->resourceManager.bitmapResources.size();i++){
 			sprintf(buffer+i2,"%s BITMAP \"%s\"\r\n",
-				this->res.pBitmapResInfo[i].IdName,
-				this->res.pBitmapResInfo[i].path);
-			i2+=lstrlen(buffer+i2);
-		}
-		for(i=0;i<this->res.NumberOfIconRes;i++){
+				this->resourceManager.bitmapResources[i].idName.c_str(),
+				this->resourceManager.bitmapResources[i].filepath.c_str());
+			i2+=lstrlen(buffer+i2);
+		}
+		for(i=0;i<this->resourceManager.iconResources.size();i++){
 			sprintf(buffer+i2,"%s ICON \"%s\"\r\n",
-				this->res.pIconResInfo[i].IdName,
-				this->res.pIconResInfo[i].path);
+				this->resourceManager.iconResources[i].idName.c_str(),
+				this->resourceManager.iconResources[i].filepath.c_str());
 			i2+=lstrlen(buffer+i2);
 		}
@@ -578,6 +569,6 @@
 		}
 		else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
-			for(i=0;this->res.NumberOfIconRes;i++){
-				lstrcpy(temporary,this->res.pIconResInfo[i].path);
+			for(i=0;this->resourceManager.iconResources.size();i++){
+				lstrcpy(temporary,this->resourceManager.iconResources[i].filepath.c_str());
 				lstrcpy( temporary, this->GetWorkDir().GetFullPath( temporary ).c_str() );
 				if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
@@ -627,19 +618,5 @@
 
 	//リソースのメモリを解放
-	for(i=0;i<this->res.NumberOfCursorRes;i++){
-		HeapDefaultFree(this->res.pCursorResInfo[i].IdName);
-		HeapDefaultFree(this->res.pCursorResInfo[i].path);
-	}
-	HeapDefaultFree(this->res.pCursorResInfo);
-	for(i=0;i<this->res.NumberOfBitmapRes;i++){
-		HeapDefaultFree(this->res.pBitmapResInfo[i].IdName);
-		HeapDefaultFree(this->res.pBitmapResInfo[i].path);
-	}
-	HeapDefaultFree(this->res.pBitmapResInfo);
-	for(i=0;i<this->res.NumberOfIconRes;i++){
-		HeapDefaultFree(this->res.pIconResInfo[i].IdName);
-		HeapDefaultFree(this->res.pIconResInfo[i].path);
-	}
-	HeapDefaultFree(this->res.pIconResInfo);
+	this->resourceManager.Clear();
 
 	//プロジェクト ビューを非表示にする
