Index: trunk/ab5.0/abdev/abdev/Rad_UndoRedo.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/Rad_UndoRedo.cpp	(revision 618)
+++ trunk/ab5.0/abdev/abdev/Rad_UndoRedo.cpp	(revision 624)
@@ -20,5 +20,5 @@
 	pUndoState->NowPos=i;
 
-	WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[WndNum].path);
+	ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[WndNum].path);
 	int WndInfoNum = GetWndInfoNum(MdiInfo[WndNum].path);
 	switch(pUndoState->Command[pUndoState->NowPos]){
@@ -28,7 +28,7 @@
 			break;
 		case RAD_UNDO_DELETEITEM:
-			CHILDINFO *pChildInfo;
+			ActiveBasic::PM::ChildWindowInfo *pChildInfo;
 			RECT rect;
-			pChildInfo=(CHILDINFO *)pUndoState->lpdwData[pUndoState->NowPos];
+			pChildInfo=(ActiveBasic::PM::ChildWindowInfo *)pUndoState->lpdwData[pUndoState->NowPos];
 			rect.left=pChildInfo->pos.x;
 			rect.top=pChildInfo->pos.y;
@@ -37,5 +37,5 @@
 			InsertDlgItem(WndNum,WndInfoNum,pUndoState->SelectItemNum[pUndoState->NowPos],
 				&pChildInfo->pos,&pChildInfo->size,
-				pChildInfo->IdName,pChildInfo->caption,pChildInfo->style,pChildInfo->ExStyle,pChildInfo->Control,pChildInfo->ImageCtrlInfo.type,pChildInfo->ImageCtrlInfo.path,0);
+				pChildInfo->GetName().c_str(),pChildInfo->GetCaption().c_str(),pChildInfo->GetStyle(),pChildInfo->GetExStyle(),pChildInfo->Control,pChildInfo->image.type,pChildInfo->image.path.c_str(),0);
 			break;
 		case RAD_UNDO_NAME:
@@ -60,7 +60,8 @@
 			}
 			else{
-				temporary=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->IdName;
-				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->IdName=(char *)pUndoState->lpdwData[pUndoState->NowPos];
-				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
+				std::string tempStr = pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->GetName();
+				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->SetName( *(std::string *)pUndoState->lpdwData[pUndoState->NowPos] );
+				delete (std::string *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)( new std::string( tempStr ) );
 			}
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
@@ -69,12 +70,14 @@
 		case RAD_UNDO_CAPTION:
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
-				temporary=pWindowInfo->caption;
-				pWindowInfo->caption=(char *)pUndoState->lpdwData[pUndoState->NowPos];
-				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
-			}
-			else{
-				temporary=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->caption;
-				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->caption=(char *)pUndoState->lpdwData[pUndoState->NowPos];
-				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
+				std::string tempStr = pWindowInfo->GetCaption();
+				pWindowInfo->SetCaption( *(std::string *)pUndoState->lpdwData[pUndoState->NowPos] );
+				delete (std::string *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)( new std::string( tempStr ) );
+			}
+			else{
+				std::string tempStr = pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->GetCaption();
+				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->SetCaption( *(std::string *)pUndoState->lpdwData[pUndoState->NowPos] );
+				delete (std::string *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)( new std::string( tempStr ) );
 			}
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
@@ -93,22 +96,34 @@
 			break;
 		case RAD_UNDO_BGCOLOR:
-			dw=pWindowInfo->bgColor;
-			pWindowInfo->bgColor=pUndoState->lpdwData[pUndoState->NowPos];
-			pUndoState->lpdwData[pUndoState->NowPos]=dw;
-			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
-				ChangePropertyWindow(WndNum,WndInfoNum);
-			DrawRadWindow(WndNum,pWindowInfo);
-			break;
+			{
+				int tempBgColor = pWindowInfo->GetBackgroundColor();
+				pWindowInfo->SetBackgroundColor( static_cast<int>(pUndoState->lpdwData[pUndoState->NowPos]) );
+				pUndoState->lpdwData[pUndoState->NowPos] = static_cast<DWORD>(tempBgColor);
+
+				if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+					ChangePropertyWindow(WndNum,WndInfoNum);
+				DrawRadWindow(WndNum,pWindowInfo);
+				break;
+			}
 		case RAD_UNDO_WINDOWMENU:
-			temporary=pWindowInfo->MenuID;
-			pWindowInfo->MenuID=(char *)pUndoState->lpdwData[pUndoState->NowPos];
-			pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
-			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
-				ChangePropertyWindow(WndNum,WndInfoNum);
-			break;
+			{
+				std::string tempMenuIdName = pWindowInfo->GetMenuIdName();
+				pWindowInfo->SetMenuIdName( *(std::string *)pUndoState->lpdwData[pUndoState->NowPos] );
+				delete (std::string *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos] = (DWORD)( new std::string( tempMenuIdName ) );
+				if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+				{
+					ChangePropertyWindow(WndNum,WndInfoNum);
+				}
+				DrawRadWindow(WndNum,pWindowInfo);
+				break;
+			}
 		case RAD_UNDO_ICONRES:
-			temporary=pWindowInfo->IconResName;
-			pWindowInfo->IconResName=(char *)pUndoState->lpdwData[pUndoState->NowPos];
-			pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
+			{
+				std::string tempStr = pWindowInfo->GetIconResourceName();
+				pWindowInfo->SetIconResourceName( *(std::string *)pUndoState->lpdwData[pUndoState->NowPos] );
+				delete (std::string *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)( new std::string( tempStr ) );
+			}
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
 				ChangePropertyWindow(WndNum,WndInfoNum);
@@ -116,11 +131,11 @@
 		case RAD_UNDO_STYLE:
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
-				dw=pWindowInfo->style;
-				pWindowInfo->style=pUndoState->lpdwData[pUndoState->NowPos];
-				pUndoState->lpdwData[pUndoState->NowPos]=dw;
-			}
-			else{
-				dw=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->style;
-				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->style=pUndoState->lpdwData[pUndoState->NowPos];
+				dw=pWindowInfo->GetStyle();
+				pWindowInfo->SetStyle( pUndoState->lpdwData[pUndoState->NowPos] );
+				pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			}
+			else{
+				dw=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->GetStyle();
+				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->SetStyle( pUndoState->lpdwData[pUndoState->NowPos] );
 				pUndoState->lpdwData[pUndoState->NowPos]=dw;
 			}
@@ -131,11 +146,11 @@
 		case RAD_UNDO_EXSTYLE:
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
-				dw=pWindowInfo->ExStyle;
-				pWindowInfo->ExStyle=pUndoState->lpdwData[pUndoState->NowPos];
-				pUndoState->lpdwData[pUndoState->NowPos]=dw;
-			}
-			else{
-				dw=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->ExStyle;
-				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->ExStyle=pUndoState->lpdwData[pUndoState->NowPos];
+				dw=pWindowInfo->GetExStyle();
+				pWindowInfo->SetExStyle( pUndoState->lpdwData[pUndoState->NowPos] );
+				pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			}
+			else{
+				dw=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->GetExStyle();
+				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->SetExStyle( pUndoState->lpdwData[pUndoState->NowPos] );
 				pUndoState->lpdwData[pUndoState->NowPos]=dw;
 			}
@@ -163,18 +178,19 @@
 			break;
 		case RAD_UNDO_IMAGESTATE:
-			IMAGECTRLINFO *pImageCtrlInfo;
-			pImageCtrlInfo=(IMAGECTRLINFO *)pUndoState->lpdwData[pUndoState->NowPos];
-
-			dw=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->ImageCtrlInfo.type;
-			pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->ImageCtrlInfo.type=pImageCtrlInfo->type;
-			pImageCtrlInfo->type=dw;
-
-			dw=(DWORD)pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->ImageCtrlInfo.path;
-			pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->ImageCtrlInfo.path=pImageCtrlInfo->path;
-			pImageCtrlInfo->path=(char *)dw;
-
-			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
-				ChangePropertyWindow(WndNum,WndInfoNum);
-			DrawRadWindow(WndNum,pWindowInfo);
+			{
+				ActiveBasic::PM::ImageControlInfo *pImageCtrlInfo = (ActiveBasic::PM::ImageControlInfo *)pUndoState->lpdwData[pUndoState->NowPos];
+
+				ActiveBasic::PM::ImageReferenceType::EnumType tempType = pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->image.type;
+				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->image.type = pImageCtrlInfo->type;
+				pImageCtrlInfo->type = tempType;
+
+				std::string tempPath = pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->image.path;
+				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->image.path = pImageCtrlInfo->path;
+				pImageCtrlInfo->path = tempPath;
+
+				if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+					ChangePropertyWindow(WndNum,WndInfoNum);
+				DrawRadWindow(WndNum,pWindowInfo);
+			}
 			break;
 		case RAD_UNDO_TYPE:
@@ -197,5 +213,5 @@
 	char *temporary;
 	RAD_UNDOSTATE *pUndoState;
-	CHILDINFO *pChildInfo;
+	ActiveBasic::PM::ChildWindowInfo *pChildInfo;
 	RECT rect;
 
@@ -206,9 +222,9 @@
 	}
 
-	WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[WndNum].path);
+	ActiveBasic::PM::WindowInfo *pWindowInfo = GetWndInfo(MdiInfo[WndNum].path);
 	int WndInfoNum = GetWndInfoNum(MdiInfo[WndNum].path);
 	switch(pUndoState->Command[pUndoState->NowPos]){
 		case RAD_UNDO_INSERTITEM:
-			pChildInfo=(CHILDINFO *)pUndoState->lpdwData[pUndoState->NowPos];
+			pChildInfo=(ActiveBasic::PM::ChildWindowInfo *)pUndoState->lpdwData[pUndoState->NowPos];
 			rect.left=pChildInfo->pos.x;
 			rect.top=pChildInfo->pos.y;
@@ -217,5 +233,5 @@
 			InsertDlgItem(WndNum,WndInfoNum,pUndoState->SelectItemNum[pUndoState->NowPos],
 				&pChildInfo->pos,&pChildInfo->size,
-				pChildInfo->IdName,pChildInfo->caption,pChildInfo->style,pChildInfo->ExStyle,pChildInfo->Control,pChildInfo->ImageCtrlInfo.type,pChildInfo->ImageCtrlInfo.path,0);
+				pChildInfo->GetName().c_str(),pChildInfo->GetCaption().c_str(),pChildInfo->GetStyle(),pChildInfo->GetExStyle(),pChildInfo->Control,pChildInfo->image.type,pChildInfo->image.path.c_str(),0);
 			break;
 		case RAD_UNDO_DELETEITEM:
@@ -244,7 +260,8 @@
 			}
 			else{
-				temporary=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->IdName;
-				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->IdName=(char *)pUndoState->lpdwData[pUndoState->NowPos];
-				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
+				std::string tempStr = pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->GetName();
+				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->SetName( *(std::string *)pUndoState->lpdwData[pUndoState->NowPos] );
+				delete (std::string *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)( new std::string( tempStr ) );
 			}
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
@@ -253,12 +270,14 @@
 		case RAD_UNDO_CAPTION:
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
-				temporary=pWindowInfo->caption;
-				pWindowInfo->caption=(char *)pUndoState->lpdwData[pUndoState->NowPos];
-				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
-			}
-			else{
-				temporary=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->caption;
-				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->caption=(char *)pUndoState->lpdwData[pUndoState->NowPos];
-				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
+				std::string tempStr = pWindowInfo->GetCaption();
+				pWindowInfo->SetCaption( *(std::string *)pUndoState->lpdwData[pUndoState->NowPos] );
+				delete (std::string *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)( new std::string( tempStr ) );
+			}
+			else{
+				std::string tempStr = pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->GetCaption();
+				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->SetCaption( *(std::string *)pUndoState->lpdwData[pUndoState->NowPos] );
+				delete (std::string *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)( new std::string( tempStr ) );
 			}
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
@@ -277,7 +296,9 @@
 			break;
 		case RAD_UNDO_BGCOLOR:
-			dw=pWindowInfo->bgColor;
-			pWindowInfo->bgColor=pUndoState->lpdwData[pUndoState->NowPos];
-			pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			{
+				int tempBgColor = pWindowInfo->GetBackgroundColor();
+				pWindowInfo->SetBackgroundColor( static_cast<int>(pUndoState->lpdwData[pUndoState->NowPos]) );
+				pUndoState->lpdwData[pUndoState->NowPos] = static_cast<DWORD>(tempBgColor);
+			}
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
 				ChangePropertyWindow(WndNum,WndInfoNum);
@@ -285,14 +306,23 @@
 			break;
 		case RAD_UNDO_WINDOWMENU:
-			temporary=pWindowInfo->MenuID;
-			pWindowInfo->MenuID=(char *)pUndoState->lpdwData[pUndoState->NowPos];
-			pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
-			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
-				ChangePropertyWindow(WndNum,WndInfoNum);
-			break;
+			{
+				std::string tempMenuIdName = pWindowInfo->GetMenuIdName();
+				pWindowInfo->SetMenuIdName( *(std::string *)pUndoState->lpdwData[pUndoState->NowPos] );
+				delete (std::string *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos] = (DWORD)( new std::string( tempMenuIdName ) );
+				if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+				{
+					ChangePropertyWindow(WndNum,WndInfoNum);
+				}
+				DrawRadWindow(WndNum,pWindowInfo);
+				break;
+			}
 		case RAD_UNDO_ICONRES:
-			temporary=pWindowInfo->IconResName;
-			pWindowInfo->IconResName=(char *)pUndoState->lpdwData[pUndoState->NowPos];
-			pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
+			{
+				std::string tempStr = pWindowInfo->GetIconResourceName();
+				pWindowInfo->SetIconResourceName( *(std::string *)pUndoState->lpdwData[pUndoState->NowPos] );
+				delete (std::string *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)( new std::string( tempStr ) );
+			}
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
 				ChangePropertyWindow(WndNum,WndInfoNum);
@@ -300,11 +330,11 @@
 		case RAD_UNDO_STYLE:
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
-				dw=pWindowInfo->style;
-				pWindowInfo->style=pUndoState->lpdwData[pUndoState->NowPos];
-				pUndoState->lpdwData[pUndoState->NowPos]=dw;
-			}
-			else{
-				dw=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->style;
-				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->style=pUndoState->lpdwData[pUndoState->NowPos];
+				dw=pWindowInfo->GetStyle();
+				pWindowInfo->SetStyle( pUndoState->lpdwData[pUndoState->NowPos] );
+				pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			}
+			else{
+				dw=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->GetStyle();
+				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->SetStyle( pUndoState->lpdwData[pUndoState->NowPos] );
 				pUndoState->lpdwData[pUndoState->NowPos]=dw;
 			}
@@ -315,11 +345,11 @@
 		case RAD_UNDO_EXSTYLE:
 			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
-				dw=pWindowInfo->ExStyle;
-				pWindowInfo->ExStyle=pUndoState->lpdwData[pUndoState->NowPos];
-				pUndoState->lpdwData[pUndoState->NowPos]=dw;
-			}
-			else{
-				dw=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->ExStyle;
-				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->ExStyle=pUndoState->lpdwData[pUndoState->NowPos];
+				dw=pWindowInfo->GetExStyle();
+				pWindowInfo->SetExStyle( pUndoState->lpdwData[pUndoState->NowPos] );
+				pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			}
+			else{
+				dw=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->GetExStyle();
+				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->SetExStyle( pUndoState->lpdwData[pUndoState->NowPos] );
 				pUndoState->lpdwData[pUndoState->NowPos]=dw;
 			}
@@ -347,19 +377,20 @@
 			break;
 		case RAD_UNDO_IMAGESTATE:
-			IMAGECTRLINFO *pImageCtrlInfo;
-			pImageCtrlInfo=(IMAGECTRLINFO *)pUndoState->lpdwData[pUndoState->NowPos];
-
-			dw=pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->ImageCtrlInfo.type;
-			pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->ImageCtrlInfo.type=pImageCtrlInfo->type;
-			pImageCtrlInfo->type=dw;
-
-			dw=(DWORD)pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->ImageCtrlInfo.path;
-			pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->ImageCtrlInfo.path=pImageCtrlInfo->path;
-			pImageCtrlInfo->path=(char *)dw;
-
-			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
-				ChangePropertyWindow(WndNum,WndInfoNum);
-			DrawRadWindow(WndNum,pWindowInfo);
-			break;
+			{
+				ActiveBasic::PM::ImageControlInfo *pImageCtrlInfo = (ActiveBasic::PM::ImageControlInfo *)pUndoState->lpdwData[pUndoState->NowPos];
+
+				ActiveBasic::PM::ImageReferenceType::EnumType tempType = pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->image.type;
+				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->image.type = pImageCtrlInfo->type;
+				pImageCtrlInfo->type = tempType;
+
+				std::string tempPath = pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->image.path;
+				pWindowInfo->childWindowInfos[pUndoState->SelectItemNum[pUndoState->NowPos]]->image.path = pImageCtrlInfo->path;
+				pImageCtrlInfo->path = tempPath;
+
+				if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+					ChangePropertyWindow(WndNum,WndInfoNum);
+				DrawRadWindow(WndNum,pWindowInfo);
+				break;
+			}
 		case RAD_UNDO_TYPE:
 			dw=pWindowInfo->type;
@@ -387,13 +418,7 @@
 		case RAD_UNDO_INSERTITEM:
 		case RAD_UNDO_DELETEITEM:
-			CHILDINFO *pChildInfo;
-			pChildInfo=(CHILDINFO *)pUndoState->lpdwData[pos];
-			HeapDefaultFree(pChildInfo->IdName);
-			HeapDefaultFree(pChildInfo->caption);
-			if(pChildInfo->Control==CT_IMAGEBOX){
-				//イメージ ボックスの場合
-				HeapDefaultFree(pChildInfo->ImageCtrlInfo.path);
-			}
-			HeapDefaultFree(pChildInfo);
+			ActiveBasic::PM::ChildWindowInfo *pChildInfo;
+			pChildInfo=(ActiveBasic::PM::ChildWindowInfo *)pUndoState->lpdwData[pos];
+			delete pChildInfo;
 			break;
 		case RAD_UNDO_NAME:
@@ -403,8 +428,15 @@
 				delete names;
 			}
-			else HeapDefaultFree((void *)pUndoState->lpdwData[pos]);
+			else
+			{
+				std::string *pTempStr = (std::string *)pUndoState->lpdwData[pos];
+				delete pTempStr;
+			}
 			break;
 		case RAD_UNDO_CAPTION:
-			HeapDefaultFree((void *)pUndoState->lpdwData[pos]);
+			{
+				std::string *pTempStr = (std::string *)pUndoState->lpdwData[pos];
+				delete pTempStr;
+			}
 			break;
 		case RAD_UNDO_FONT:
@@ -412,10 +444,14 @@
 			break;
 		case RAD_UNDO_WINDOWMENU:
-			if(pUndoState->lpdwData[pos])
-				HeapDefaultFree((void *)pUndoState->lpdwData[pos]);
+			{
+				std::string *pTempMenuId = (std::string *)pUndoState->lpdwData[pos];
+				delete pTempMenuId;
+			}
 			break;
 		case RAD_UNDO_ICONRES:
-			if(pUndoState->lpdwData[pos])
-				HeapDefaultFree((void *)pUndoState->lpdwData[pos]);
+			{
+				std::string *pTempStr = (std::string *)pUndoState->lpdwData[pos];
+				delete pTempStr;
+			}
 			break;
 		case RAD_UNDO_POSITION:
@@ -423,9 +459,11 @@
 			break;
 		case RAD_UNDO_IMAGESTATE:
-			IMAGECTRLINFO *pImageCtrlInfo;
-			pImageCtrlInfo=(IMAGECTRLINFO *)pUndoState->lpdwData[pos];
-			HeapDefaultFree(pImageCtrlInfo->path);
-			HeapDefaultFree(pImageCtrlInfo);
-			break;
+			{
+				ActiveBasic::PM::ImageControlInfo *pImageCtrlInfo = (ActiveBasic::PM::ImageControlInfo *)pUndoState->lpdwData[pUndoState->NowPos];
+
+				delete pImageCtrlInfo;
+
+				break;
+			}
 	}
 	pUndoState->Command[pos]=0;
@@ -435,5 +473,4 @@
 	extern MDIINFO MdiInfo[MAX_WNDNUM];
 	int i;
-	char *temporary,*temp2;
 	RAD_UNDOSTATE *pUndoState;
 
@@ -452,21 +489,17 @@
 		case RAD_UNDO_INSERTITEM:
 		case RAD_UNDO_DELETEITEM:
-			CHILDINFO *pChildInfo,*pSaveChildInfo;
-			pChildInfo=(CHILDINFO *)dwData;
-			pSaveChildInfo=(CHILDINFO *)HeapAlloc(hHeap,0,sizeof(CHILDINFO));
-			pSaveChildInfo->IdName=(char *)HeapAlloc(hHeap,0,lstrlen(pChildInfo->IdName)+1);
-			lstrcpy(pSaveChildInfo->IdName,pChildInfo->IdName);
+			ActiveBasic::PM::ChildWindowInfo *pChildInfo,*pSaveChildInfo;
+			pChildInfo=(ActiveBasic::PM::ChildWindowInfo *)dwData;
+			pSaveChildInfo = new ActiveBasic::PM::ChildWindowInfo();
+			pSaveChildInfo->SetName( pChildInfo->GetName() );
 			pSaveChildInfo->pos=pChildInfo->pos;
 			pSaveChildInfo->size=pChildInfo->size;
-			pSaveChildInfo->caption=(char *)HeapAlloc(hHeap,0,lstrlen(pChildInfo->caption)+1);
-			lstrcpy(pSaveChildInfo->caption,pChildInfo->caption);
-			pSaveChildInfo->style=pChildInfo->style;
-			pSaveChildInfo->ExStyle=pChildInfo->ExStyle;
+			pSaveChildInfo->SetCaption( pChildInfo->GetCaption() );
+			pSaveChildInfo->SetStyle( pChildInfo->GetStyle() );
+			pSaveChildInfo->SetExStyle( pChildInfo->GetExStyle() );
 			pSaveChildInfo->Control=pChildInfo->Control;
 			if(pChildInfo->Control==CT_IMAGEBOX){
 				//イメージ ボックスの場合
-				pSaveChildInfo->ImageCtrlInfo.type=pChildInfo->ImageCtrlInfo.type;
-				pSaveChildInfo->ImageCtrlInfo.path=(char *)HeapAlloc(hHeap,0,lstrlen(pChildInfo->ImageCtrlInfo.path)+1);
-				lstrcpy(pSaveChildInfo->ImageCtrlInfo.path,pChildInfo->ImageCtrlInfo.path);
+				pSaveChildInfo->image = pChildInfo->image;
 			}
 			pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)pSaveChildInfo;
@@ -483,15 +516,13 @@
 			}
 			else{
-				temporary=(char *)dwData;
-				temp2=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-				lstrcpy(temp2,temporary);
-				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temp2;
+				std::string *pTempStr = new std::string( *(std::string *)dwData );
+				pUndoState->lpdwData[pUndoState->NowPos] = (DWORD)pTempStr;
 			}
 			break;
 		case RAD_UNDO_CAPTION:
-			temporary=(char *)dwData;
-			temp2=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-			lstrcpy(temp2,temporary);
-			pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temp2;
+			{
+				std::string *pTempStr = new std::string( *(std::string *)dwData );
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)pTempStr;
+			}
 			break;
 		case RAD_UNDO_FONT:
@@ -506,11 +537,13 @@
 			break;
 		case RAD_UNDO_WINDOWMENU:
+			{
+				std::string *pTempStr = new std::string( *(std::string *)dwData );
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)pTempStr;
+			}
+			break;
 		case RAD_UNDO_ICONRES:
-			if(!dwData) pUndoState->lpdwData[pUndoState->NowPos]=0;
-			else{
-				temporary=(char *)dwData;
-				temp2=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
-				lstrcpy(temp2,temporary);
-				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temp2;
+			{
+				std::string *pTempStr = new std::string( *(std::string *)dwData );
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)pTempStr;
 			}
 			break;
@@ -528,12 +561,10 @@
 			break;
 		case RAD_UNDO_IMAGESTATE:
-			IMAGECTRLINFO *pImageCtrlInfo,*pSaveImageCtrlInfo;
-			pImageCtrlInfo=(IMAGECTRLINFO *)dwData;
-			pSaveImageCtrlInfo=(IMAGECTRLINFO *)HeapAlloc(hHeap,0,sizeof(IMAGECTRLINFO));
-			pSaveImageCtrlInfo->type=pImageCtrlInfo->type;
-			pSaveImageCtrlInfo->path=(char *)HeapAlloc(hHeap,0,lstrlen(pImageCtrlInfo->path)+1);
-			lstrcpy(pSaveImageCtrlInfo->path,pImageCtrlInfo->path);
-			pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)pSaveImageCtrlInfo;
-			break;
+			{
+				ActiveBasic::PM::ImageControlInfo *pImageCtrlInfo = (ActiveBasic::PM::ImageControlInfo *)dwData;
+				ActiveBasic::PM::ImageControlInfo *pSaveImageCtrlInfo = new ActiveBasic::PM::ImageControlInfo( *pImageCtrlInfo );
+				pUndoState->lpdwData[pUndoState->NowPos] = (DWORD)( new ActiveBasic::PM::ImageControlInfo( *pImageCtrlInfo ) );
+				break;
+			}
 		case RAD_UNDO_TYPE:
 			pUndoState->lpdwData[pUndoState->NowPos]=dwData;
