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);
 }
