Index: trunk/ab5.0/abdev/abdev/MenuProc.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/MenuProc.cpp	(revision 624)
+++ trunk/ab5.0/abdev/abdev/MenuProc.cpp	(revision 625)
@@ -11,8 +11,8 @@
 #endif
 
-int GetMenuInfoNum(const char *name){
+int GetMenuInfoNum(const std::string &name){
 	int i;
 	for(i=0;i<projectInfo.NumberOfMenu;i++){
-		if(lstrcmpi(name,projectInfo.pMenuInfo[i].IdName)==0) return i;
+		if(lstrcmpi(name.c_str(),projectInfo.pMenuInfo[i].IdName)==0) return i;
 	}
 	return -1;
@@ -68,5 +68,4 @@
 void Project_Menu_Insert(void){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	extern char NewIdName[MAX_PATH];
 	int i;
@@ -121,5 +120,5 @@
 	////////////////////////////////
 	// ウィンドウ プロパティを更新
-	for(i=0;i<MAX_WNDNUM;i++){
+	for(i=0;i<MdiInfo.size();i++){
 		if(MdiInfo[i].hwnd&&MdiInfo[i].DocType==WNDTYPE_RAD){
 			if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
@@ -132,10 +131,9 @@
 void Project_Menu_Delete(int MenuInfoNum){
 	extern HANDLE hHeap;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 
 	//ウィンドウが開かれている場合は閉じる
-	for(i=0;i<MAX_WNDNUM;i++){
-		if(MdiInfo[i].hwnd&&lstrcmpi(projectInfo.pMenuInfo[MenuInfoNum].IdName,MdiInfo[i].path)==0){
+	for(i=0;i<MdiInfo.size();i++){
+		if(MdiInfo[i].hwnd&&lstrcmpi(projectInfo.pMenuInfo[MenuInfoNum].IdName,MdiInfo[i].path.c_str())==0){
 			SendMessage(MdiInfo[i].hwnd,WM_CLOSE,0,0);
 			break;
@@ -166,8 +164,8 @@
 	////////////////////////////////
 	// ウィンドウ プロパティを更新
-	for(i=0;i<MAX_WNDNUM;i++){
+	for(i=0;i<MdiInfo.size();i++){
 		if(MdiInfo[i].hwnd&&MdiInfo[i].DocType==WNDTYPE_RAD){
 			if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
-				ChangePropertyWindow(i,GetWndInfoNum(MdiInfo[i].path));
+				ChangePropertyWindow(i,GetWndInfoNum(MdiInfo[i].path.c_str()));
 		}
 	}
@@ -192,5 +190,4 @@
 	extern HINSTANCE hInst;
 	extern HWND hDocCombo;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	HWND hChild,hListWnd,hMenuEdit;
@@ -203,5 +200,5 @@
 		i=GetWndNum(hChild);
 		if(MdiInfo[i].DocType==WNDTYPE_MENU){
-			if(lstrcmpi(MdiInfo[i].path,pMenuInfo->IdName)==0) break;
+			if(lstrcmpi(MdiInfo[i].path.c_str(),pMenuInfo->IdName)==0) break;
 		}
 		hChild=GetNextWindow(hChild,GW_HWNDNEXT);
@@ -249,40 +246,38 @@
 		hChild,NULL,hInst,NULL);
 
+
 	//ウィンドウのID登録
-	for(i=0;i<MAX_WNDNUM;i++){
-		if(MdiInfo[i].hwnd==0){
-			MdiInfo[i].hwnd=hChild;
-			MdiInfo[i].DocType=WNDTYPE_MENU;
-			MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(pMenuInfo->IdName)+1);
-			lstrcpy(MdiInfo[i].title,pMenuInfo->IdName);
-			MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(pMenuInfo->IdName)+1);
-			lstrcpy(MdiInfo[i].path,pMenuInfo->IdName);
-
-
-			/////////////////////
-			//MENU ウィンドウ情報
-
-			MdiInfo[i].MdiMenuInfo=(MDIMENUINFO *)GlobalAlloc(GPTR,sizeof(MDIMENUINFO));
-
-			MdiInfo[i].MdiMenuInfo->hList=hListWnd;
-
-			MdiInfo[i].MdiMenuInfo->hMenuEdit=hMenuEdit;
-			MdiInfo[i].MdiMenuInfo->hEdit_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_PROJECT_MENUEDIT),hMenuEdit,(DLGPROC)MenuEditDlg);
-
-			SCROLLINFO ScrollInfo;
-			ScrollInfo.cbSize=sizeof(SCROLLINFO);
-			ScrollInfo.fMask=SIF_POS;
-			ScrollInfo.nPos=0;
-			SetScrollInfo(MdiInfo[i].MdiMenuInfo->hMenuEdit,SB_VERT,&ScrollInfo,1);
-
-			SendMessage(hListWnd,LB_RESETCONTENT,0,0);
-			SetMenuDataList(hListWnd,pMenuInfo,0);
-			if(pMenuInfo->NumberOfMenu){
-				SendMessage(hListWnd,LB_SETCURSEL,0,0);
-				SendMessage(hChild,WM_COMMAND,MAKELONG(0,LBN_SELCHANGE),(long)hListWnd);
-			}
-			break;
-		}
-	}
+	MdiInfo.push_back( MDIINFO() );
+	i = MdiInfo.size()-1;
+	MdiInfo[i].hwnd=hChild;
+	MdiInfo[i].DocType=WNDTYPE_MENU;
+	MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(pMenuInfo->IdName)+1);
+	lstrcpy(MdiInfo[i].title,pMenuInfo->IdName);
+	MdiInfo[i].path = pMenuInfo->IdName;
+
+
+	/////////////////////
+	//MENU ウィンドウ情報
+
+	MdiInfo[i].MdiMenuInfo=(MDIMENUINFO *)GlobalAlloc(GPTR,sizeof(MDIMENUINFO));
+
+	MdiInfo[i].MdiMenuInfo->hList=hListWnd;
+
+	MdiInfo[i].MdiMenuInfo->hMenuEdit=hMenuEdit;
+	MdiInfo[i].MdiMenuInfo->hEdit_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_PROJECT_MENUEDIT),hMenuEdit,(DLGPROC)MenuEditDlg);
+
+	SCROLLINFO ScrollInfo;
+	ScrollInfo.cbSize=sizeof(SCROLLINFO);
+	ScrollInfo.fMask=SIF_POS;
+	ScrollInfo.nPos=0;
+	SetScrollInfo(MdiInfo[i].MdiMenuInfo->hMenuEdit,SB_VERT,&ScrollInfo,1);
+
+	SendMessage(hListWnd,LB_RESETCONTENT,0,0);
+	SetMenuDataList(hListWnd,pMenuInfo,0);
+	if(pMenuInfo->NumberOfMenu){
+		SendMessage(hListWnd,LB_SETCURSEL,0,0);
+		SendMessage(hChild,WM_COMMAND,MAKELONG(0,LBN_SELCHANGE),(long)hListWnd);
+	}
+
 
 	//ウィンドウ位置を初期化
@@ -332,5 +327,4 @@
 	extern HANDLE hHeap;
 	extern HWND hClient,hOwner;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	char temporary[MAX_PATH];
@@ -744,5 +738,4 @@
 LRESULT CALLBACK MenuEditWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HINSTANCE hInst;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
 	RECT rect;
@@ -797,5 +790,4 @@
 LRESULT CALLBACK MDIClientWindow_Menu(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HWND hDocCombo;
-	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i,i2,i3,WndNum,MenuInfoNum;
 	MENU_INFO *pMenuInfo;
