Index: tag/abdev(2007.06.20)/BasicCompiler32/BasicCompiler.rc
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/BasicCompiler.rc	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/BasicCompiler.rc	(revision 178)
@@ -0,0 +1,412 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// 日本語 resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
+#ifdef _WIN32
+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
+#pragma code_page(932)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+#if defined(APSTUDIO_INVOKED) || defined(JPN)
+#if defined(APSTUDIO_INVOKED)
+IDD_MAIN$(JPN) DIALOG DISCARDABLE  0, 0, 205, 229
+#else
+IDD_MAIN DIALOG DISCARDABLE  0, 0, 205, 229
+#endif
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "ActiveBasic Compiler&Debugger"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "コンパイル",IDOK,148,208,50,14
+    LTEXT           "出力先:",IDC_STATIC,7,10,23,8
+    EDITTEXT        IDC_EXEPATH,34,7,164,14,ES_AUTOHSCROLL
+    CONTROL         "Progress1",IDC_PROGRESS,"msctls_progress32",0x0,13,56,
+                    179,14
+    GROUPBOX        "進行状況",IDC_STATIC,7,31,191,45
+    LTEXT           "準備中...",IDC_MESSAGE,13,44,161,8
+    GROUPBOX        "メッセージ リスト",IDC_STATIC,7,83,191,117
+    EDITTEXT        IDC_ERRORLIST,13,113,179,80,ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_AUTOHSCROLL | WS_DISABLED | 
+                    WS_VSCROLL | WS_HSCROLL
+    CONTROL         "エラー",IDC_SHOWERROR,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,13,97,35,10
+    CONTROL         "デバッグ",IDC_SHOWDEBUG,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,50,97,35,10
+    EDITTEXT        IDC_DEBUGLIST,13,113,179,80,ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_AUTOHSCROLL | NOT WS_VISIBLE | 
+                    WS_DISABLED | WS_VSCROLL | WS_HSCROLL
+    LTEXT           "Version",IDC_STATIC_VERSION,7,214,140,8
+END
+#endif
+
+#if defined(APSTUDIO_INVOKED) || defined(JPN)
+#if defined(APSTUDIO_INVOKED)
+IDD_VARLIST$(JPN) DIALOG DISCARDABLE  0, 0, 215, 199
+#else
+IDD_VARLIST DIALOG DISCARDABLE  0, 0, 215, 199
+#endif
+STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
+CAPTION "ブレーク ポイント"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    PUSHBUTTON      "閉じる",IDCANCEL,165,6,50,14
+    LTEXT           "対象領域:",IDC_STATIC,2,9,30,8
+    LTEXT           "対象スレッド:",IDC_STATIC,2,26,38,8
+    COMBOBOX        IDC_THREADCOMBO,43,24,69,100,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "Tree1",IDC_VARTREE,"SysTreeView32",TVS_HASBUTTONS | 
+                    TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP,
+                    0,88,215,111
+    CONTROL         "グローバル",IDC_GLOBAL,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,43,6,47,14
+    CONTROL         "ローカル",IDC_LOCAL,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,92,6,47,14
+    LTEXT           "プロシージャ:",IDC_STATIC,2,43,39,8
+    COMBOBOX        IDC_PROCCOMBO,43,40,69,116,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    CONTROL         "システム変数を表示しない",IDC_HIDESYSVAR,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,117,44,93,10
+    PUSHBUTTON      "ステップ(IN)",IDC_STEPIN,4,64,50,14
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,59,215,1
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,81,215,1
+    PUSHBUTTON      "ステップ(OVER)",IDC_STEPOVER,57,64,50,14
+END
+#endif
+
+#if defined(APSTUDIO_INVOKED) || defined(JPN)
+#if defined(APSTUDIO_INVOKED)
+IDD_CLIPMAIN$(JPN) DIALOGEX 0, 0, 332, 88
+#else
+IDD_CLIPMAIN DIALOGEX 0, 0, 332, 88
+#endif
+STYLE WS_CHILD
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    PUSHBUTTON      "コンパイル",IDOK,0,0,37,13
+    EDITTEXT        IDC_EXEPATH,285,57,24,12,ES_AUTOHSCROLL | ES_READONLY | 
+                    NOT WS_VISIBLE
+    EDITTEXT        IDC_ERRORLIST,38,14,129,74,ES_MULTILINE | ES_AUTOVSCROLL | 
+                    ES_AUTOHSCROLL | WS_DISABLED | WS_VSCROLL | WS_HSCROLL
+    CONTROL         "ビルド",IDC_SHOWERROR,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,0,20,37,12
+    CONTROL         "デバッグ",IDC_SHOWDEBUG,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,0,34,37,12
+    EDITTEXT        IDC_DEBUGLIST,38,15,179,73,ES_MULTILINE | ES_AUTOVSCROLL | 
+                    ES_AUTOHSCROLL | NOT WS_VISIBLE | WS_DISABLED | 
+                    WS_VSCROLL | WS_HSCROLL
+    CONTROL         "Progress1",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH,
+                    38,1,293,12
+    LTEXT           "準備中...",IDC_MESSAGE,286,47,24,8,NOT WS_VISIBLE,
+                    WS_EX_TRANSPARENT
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,16,39,1
+END
+#endif
+
+#if defined(APSTUDIO_INVOKED) || defined(ENG)
+#if defined(APSTUDIO_INVOKED)
+IDD_CLIPMAIN$(ENG) DIALOGEX 0, 0, 332, 88
+#else
+IDD_CLIPMAIN DIALOGEX 0, 0, 332, 88
+#endif
+STYLE WS_CHILD
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    PUSHBUTTON      "Compile",IDOK,0,0,37,11
+    EDITTEXT        IDC_EXEPATH,285,57,24,12,ES_AUTOHSCROLL | ES_READONLY | 
+                    NOT WS_VISIBLE
+    EDITTEXT        IDC_ERRORLIST,38,13,129,75,ES_MULTILINE | ES_AUTOVSCROLL | 
+                    ES_AUTOHSCROLL | WS_DISABLED | WS_VSCROLL | WS_HSCROLL
+    CONTROL         "Error",IDC_SHOWERROR,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,0,17,37,10
+    CONTROL         "Debug",IDC_SHOWDEBUG,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,0,28,37,10
+    EDITTEXT        IDC_DEBUGLIST,38,14,179,74,ES_MULTILINE | ES_AUTOVSCROLL | 
+                    ES_AUTOHSCROLL | NOT WS_VISIBLE | WS_DISABLED | 
+                    WS_VSCROLL | WS_HSCROLL
+    CONTROL         "Progress1",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH,
+                    38,0,293,12
+    LTEXT           "Waiting...",IDC_MESSAGE,286,47,24,8,NOT WS_VISIBLE,
+                    WS_EX_TRANSPARENT
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,13,39,1
+END
+#endif
+
+#if defined(APSTUDIO_INVOKED) || defined(ENG)
+#if defined(APSTUDIO_INVOKED)
+IDD_MAIN$(ENG) DIALOG DISCARDABLE  0, 0, 205, 229
+#else
+IDD_MAIN DIALOG DISCARDABLE  0, 0, 205, 229
+#endif
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "ActiveBasic Compiler&Debugger"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "Compile",IDOK,148,208,50,14
+    LTEXT           "Output:",IDC_STATIC,7,10,22,8
+    EDITTEXT        IDC_EXEPATH,34,7,164,14,ES_AUTOHSCROLL
+    CONTROL         "Progress1",IDC_PROGRESS,"msctls_progress32",0x0,13,56,
+                    179,14
+    GROUPBOX        "Advance situation",IDC_STATIC,7,31,191,45
+    LTEXT           "ready...",IDC_MESSAGE,13,44,161,8
+    GROUPBOX        "Message list",IDC_STATIC,7,83,191,117
+    EDITTEXT        IDC_ERRORLIST,13,113,179,80,ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_AUTOHSCROLL | WS_DISABLED | 
+                    WS_VSCROLL | WS_HSCROLL
+    CONTROL         "Error",IDC_SHOWERROR,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,13,97,30,10
+    CONTROL         "Debug",IDC_SHOWDEBUG,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,50,97,35,10
+    EDITTEXT        IDC_DEBUGLIST,13,113,179,80,ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_AUTOHSCROLL | NOT WS_VISIBLE | 
+                    WS_DISABLED | WS_VSCROLL | WS_HSCROLL
+    LTEXT           "Version 4.00 Global Edition beta1",IDC_STATIC,7,214,98,
+                    8
+END
+#endif
+
+#if defined(APSTUDIO_INVOKED) || defined(ENG)
+#if defined(APSTUDIO_INVOKED)
+IDD_VARLIST$(ENG) DIALOG DISCARDABLE  0, 0, 215, 199
+#else
+IDD_VARLIST DIALOG DISCARDABLE  0, 0, 215, 199
+#endif
+STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
+CAPTION "Breakpoint"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    PUSHBUTTON      "Close",IDCANCEL,165,6,50,14
+    LTEXT           "Level:",IDC_STATIC,2,9,18,8
+    LTEXT           "Thread:",IDC_STATIC,2,26,22,8
+    COMBOBOX        IDC_THREADCOMBO,43,24,69,100,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "Tree1",IDC_VARTREE,"SysTreeView32",TVS_HASBUTTONS | 
+                    TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP,
+                    0,88,215,111
+    CONTROL         "Global",IDC_GLOBAL,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,43,6,47,14
+    CONTROL         "Local",IDC_LOCAL,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,92,6,47,14
+    LTEXT           "Procedure:",IDC_STATIC,2,43,31,8
+    COMBOBOX        IDC_PROCCOMBO,43,40,69,116,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    CONTROL         "Hide system variables",IDC_HIDESYSVAR,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,117,44,81,10
+    PUSHBUTTON      "Step In",IDC_STEPIN,4,64,50,14
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,59,215,1
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,81,215,1
+    PUSHBUTTON      "Step Over",IDC_STEPOVER,57,64,50,14
+END
+#endif
+
+#if defined(APSTUDIO_INVOKED) || defined(JPN)
+#if defined(APSTUDIO_INVOKED)
+IDD_DEBUGGER$(JPN) DIALOGEX 0, 0, 291, 148
+#else
+IDD_DEBUGGER DIALOGEX 0, 0, 291, 148
+#endif
+STYLE WS_CHILD
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    LTEXT           "対象スレッド:",IDC_STATIC,5,21,38,8
+    COMBOBOX        IDC_THREADCOMBO,5,30,69,100,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "プロシージャ:",IDC_STATIC,5,49,39,8
+    COMBOBOX        IDC_PROCCOMBO,5,58,69,116,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,15,99,1
+    LTEXT           "dummy",IDC_VARPOS,98,0,35,41,NOT WS_VISIBLE,
+                    WS_EX_STATICEDGE
+    CONTROL         "List2",IDC_WATCHLIST,"SysListView32",LVS_REPORT | 
+                    LVS_EDITLABELS | WS_BORDER | WS_TABSTOP,171,9,60,50,
+                    WS_EX_ACCEPTFILES
+    LTEXT           "コマンド",IDC_STATIC,3,3,23,8
+END
+#endif
+
+IDD_DEBUGGER_TOOLBARBASE DIALOG DISCARDABLE  0, 0, 62, 15
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+END
+
+#if defined(APSTUDIO_INVOKED) || defined(ENG)
+#if defined(APSTUDIO_INVOKED)
+IDD_DEBUGGER$(ENG) DIALOGEX 0, 0, 291, 148
+#else
+IDD_DEBUGGER DIALOGEX 0, 0, 291, 148
+#endif
+STYLE WS_CHILD
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    LTEXT           "Thread:",IDC_STATIC,5,21,22,8
+    COMBOBOX        IDC_THREADCOMBO,5,30,69,100,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Procedure:",IDC_STATIC,5,49,31,8
+    COMBOBOX        IDC_PROCCOMBO,5,58,69,116,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,15,99,1
+    LTEXT           "dummy",IDC_VARPOS,98,0,35,41,NOT WS_VISIBLE,
+                    WS_EX_STATICEDGE
+    CONTROL         "List2",IDC_WATCHLIST,"SysListView32",LVS_REPORT | 
+                    LVS_EDITLABELS | WS_BORDER | WS_TABSTOP,171,9,60,50,
+                    WS_EX_ACCEPTFILES
+    LTEXT           "コマンド",IDC_STATIC,3,3,23,8
+END
+#endif
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    "IDD_MAIN$(JPN)", DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 198
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 222
+    END
+
+    "IDD_VARLIST$(JPN)", DIALOG
+    BEGIN
+        BOTTOMMARGIN, 161
+    END
+
+    "IDD_MAIN$(ENG)", DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 198
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 222
+    END
+
+    "IDD_VARLIST$(ENG)", DIALOG
+    BEGIN
+        BOTTOMMARGIN, 161
+    END
+
+    IDD_DEBUGGER_TOOLBARBASE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 55
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 8
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_MAIN                ICON    DISCARDABLE     "icon1.ico"
+IDI_VARSTRUCT           ICON    DISCARDABLE     "VarStruct.ico"
+IDI_VARDATA             ICON    DISCARDABLE     "VarData.ico"
+IDI_VARSTR              ICON    DISCARDABLE     "VarStr.ico"
+IDI_VARARRAY            ICON    DISCARDABLE     "VarArray.ico"
+IDI_VARPTRSTRUCT        ICON    DISCARDABLE     "VarPtrStruct.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Toolbar
+//
+
+IDR_DEBUGGERTOOLBAR TOOLBAR DISCARDABLE  16, 15
+BEGIN
+    BUTTON      IDC_DEBUG_START
+    BUTTON      IDC_DEBUG_STEPOVER
+    BUTTON      IDC_DEBUG_STEPIN
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDR_DEBUGGERTOOLBAR     BITMAP  DISCARDABLE     "toolbar_debugger.bmp"
+IDR_DEBUGGERTOOLBAR_DISABLED BITMAP  DISCARDABLE     "toolbar_debugger_disable.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_DEBUGGER_VARLIST_MENU MENU DISCARDABLE 
+BEGIN
+    POPUP "dummy"
+    BEGIN
+        MENUITEM "一般システム変数を表示する",  IDM_SHOW_DEFAULTSYSTEM_VAR
+        MENUITEM "RADシステム変数を表示する",   IDM_SHOW_RAD_VAR
+        MENUITEM "GUID変数を表示する",          IDM_SHOW_GUID_VAR
+    END
+END
+
+#endif    // 日本語 resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
Index: tag/abdev(2007.06.20)/BasicCompiler32/BasicCompiler.vcproj
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/BasicCompiler.vcproj	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/BasicCompiler.vcproj	(revision 178)
@@ -0,0 +1,1592 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="BasicCompiler32"
+	ProjectGUID="{11F0E9AB-EAEC-4616-A9DD-838073342CBB}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory=".\Debug"
+			IntermediateDirectory=".\Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/BasicCompiler.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\;..\..\cpplibs\boost;..\BasicCompiler_Common\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;JPN"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\Debug/BasicCompiler.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG,JPN"
+				Culture="1041"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="comctl32.lib psapi.lib commond.lib"
+				OutputFile="../ActiveBasic/BasicCompiler32.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="..\..\jenga\lib\x86"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/BasicCompiler32.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				AdditionalManifestFiles="manifest.xml"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Debug/BasicCompiler.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory=".\Release"
+			IntermediateDirectory=".\Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Release/BasicCompiler.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="2"
+				FavorSizeOrSpeed="1"
+				AdditionalIncludeDirectories="..\..\;..\..\cpplibs\boost;..\BasicCompiler_Common\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				RuntimeTypeInfo="true"
+				PrecompiledHeaderFile=".\Release/BasicCompiler.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				BrowseInformation="0"
+				BrowseInformationFile=".\Release/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="NDEBUG,JPN"
+				Culture="1041"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="comctl32.lib psapi.lib common.lib"
+				OutputFile="../ActiveBasic/BasicCompiler32.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="..\..\jenga\lib\x86"
+				ProgramDatabaseFile=".\Release/BasicCompiler32.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				AdditionalManifestFiles="manifest.xml"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\Release/BasicCompiler.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="BasicCompiler.rc"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<Filter
+				Name="32及び64共通"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\BasicCompiler.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\calculation.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\Compile.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\Diagnose.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\error.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\gc.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\hash.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\MakeExe.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\NumOpe_GetType.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\Object.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\OldStatement.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\Overload.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\RSrcSection.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\StrOperation.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<Filter
+					Name="Intermediate"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\CommandFormat.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Intermediate_Step1.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Intermediate_Step2.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Resource.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="Parts"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\DataTable.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\LoopRefCheck.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\NonVolatile.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="Debug（共通）"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\BreakPoint.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\BreakPoint.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\CDebugThreadInfo.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Debug.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\debug.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\DebugMiddleFile.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\DebugSection.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\VarList.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\WatchList.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								ObjectFile="$(IntDir)\$(InputName)1.obj"
+								XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								ObjectFile="$(IntDir)\$(InputName)1.obj"
+								XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="Type"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\Class.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Class.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Enum.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Enum.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Schedule"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\PESchedule.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\PESchedule.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="LexicalScoping"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\LexicalScoping.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\LexicalScoping.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Constant"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\Const.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Const.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Variable"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\VariableOpe.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\VariableOpe.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Procedure"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\ParamImpl.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Subroutine.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="Compile"
+				>
+				<File
+					RelativePath="Compile_Statement.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="Compile_Var.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="MakePeHdr.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<Filter
+					Name="Calculation"
+					>
+					<File
+						RelativePath="Compile_Calc.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="Compile_Calc_PushVar.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="Compile_Set_Var.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="increment.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="NumOpe.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="NumOpe_Arithmetic.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="NumOpe_Logical.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="NumOpe_Relation.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="NumOpe_TypeOperation.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="Object"
+					>
+					<File
+						RelativePath="Compile_Object.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="Opcode"
+					>
+					<File
+						RelativePath="op32_main.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="Procedure"
+					>
+					<File
+						RelativePath="Compile_CallProc.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="Compile_Func.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="Compile_ProcOp.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="CParameter.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="OperatorProc.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="Common Classes"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\src\Smoothie.cpp"
+					>
+				</File>
+				<Filter
+					Name="Meta Parts"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Member.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Method.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Namespace.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Procedure.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Prototype.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Symbol.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Type.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\TypeDef.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Variable.cpp"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Lexical Parts"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Source.cpp"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Operation Statements"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Exception.cpp"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Application Classes"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Program.cpp"
+						>
+					</File>
+				</Filter>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\BasicCompiler_Common\BasicCompiler.h"
+				>
+			</File>
+			<File
+				RelativePath="..\BasicCompiler_Common\BasicFixed.h"
+				>
+			</File>
+			<File
+				RelativePath="CommandValue.h"
+				>
+			</File>
+			<File
+				RelativePath="..\BasicCompiler_Common\common.h"
+				>
+			</File>
+			<File
+				RelativePath="Opcode.h"
+				>
+			</File>
+			<Filter
+				Name="言語対応文字列"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\common_msg_eng.h"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\common_msg_jpn.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="Parts_h"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\NonVolatile.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="Application Classes"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\include\Program.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="Common Classes"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\include\option.h"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\include\Smoothie.h"
+					>
+				</File>
+				<Filter
+					Name="Meta Parts"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\include\Namespace.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Parameter.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Procedure.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\include\Symbol.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Type.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\TypeDef.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Variable.h"
+						>
+					</File>
+					<Filter
+						Name="Prototype"
+						>
+						<File
+							RelativePath="..\BasicCompiler_Common\include\Member.h"
+							>
+						</File>
+						<File
+							RelativePath="..\BasicCompiler_Common\include\Method.h"
+							>
+						</File>
+						<File
+							RelativePath="..\BasicCompiler_Common\include\Prototype.h"
+							>
+						</File>
+					</Filter>
+				</Filter>
+				<Filter
+					Name="Lexical Parts"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\include\Source.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Operation Statements"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\include\Exception.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Module"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\include\ObjectModule.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+			<File
+				RelativePath="icon1.ico"
+				>
+			</File>
+			<File
+				RelativePath="toolbar_debugger.bmp"
+				>
+			</File>
+			<File
+				RelativePath="toolbar_debugger_disable.bmp"
+				>
+			</File>
+			<File
+				RelativePath="VarArray.ico"
+				>
+			</File>
+			<File
+				RelativePath="VarData.ico"
+				>
+			</File>
+			<File
+				RelativePath="VarPtrStruct.ico"
+				>
+			</File>
+			<File
+				RelativePath="VarStr.ico"
+				>
+			</File>
+			<File
+				RelativePath="VarStruct.ico"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: tag/abdev(2007.06.20)/BasicCompiler32/BasicCompiler32.sln
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/BasicCompiler32.sln	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/BasicCompiler32.sln	(revision 178)
@@ -0,0 +1,23 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicCompiler32", "BasicCompiler.vcproj", "{11F0E9AB-EAEC-4616-A9DD-838073342CBB}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		English_Rel|Win32 = English_Rel|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{11F0E9AB-EAEC-4616-A9DD-838073342CBB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{11F0E9AB-EAEC-4616-A9DD-838073342CBB}.Debug|Win32.Build.0 = Debug|Win32
+		{11F0E9AB-EAEC-4616-A9DD-838073342CBB}.English_Rel|Win32.ActiveCfg = English_Rel|Win32
+		{11F0E9AB-EAEC-4616-A9DD-838073342CBB}.English_Rel|Win32.Build.0 = English_Rel|Win32
+		{11F0E9AB-EAEC-4616-A9DD-838073342CBB}.Release|Win32.ActiveCfg = Release|Win32
+		{11F0E9AB-EAEC-4616-A9DD-838073342CBB}.Release|Win32.Build.0 = Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: tag/abdev(2007.06.20)/BasicCompiler32/CParameter.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/CParameter.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/CParameter.cpp	(revision 178)
@@ -0,0 +1,390 @@
+#include "../BasicCompiler_Common/common.h"
+#include "opcode.h"
+
+int ParamImpl::NewTempParameters( const string &procName, const Parameters &params, int SecondParmNum ){
+	if( SecondParmNum == -1 ) SecondParmNum = (int)params.size();
+
+	///////////////////////////////////////////////////////
+	// 一時オブジェクトをあらかじめスタックに積んでおく
+	///////////////////////////////////////////////////////
+
+	useTempObject = false;
+
+	//一時参照の数
+	nCountOfTempObjects = 0;
+
+	BOOL bEllipse;
+	if(params.size()){
+		if(params[params.size()-1]->GetBasicType()==DEF_ELLIPSE) bEllipse=1;
+		else bEllipse=0;
+	}
+	else bEllipse=0;
+
+	for(int i2=ParmsNum-1;i2>=0;i2--){
+		useTempParameters[i2] = false;
+
+		if(bEllipse&&i2<=(int)params.size()-2) bEllipse=0;
+
+		if(i2==0){
+			if( params[i2]->GetVarName() == "_System_LocalThis" ){
+				//オブジェクトメンバの第一パラメータのThisポインタ
+				continue;
+			}
+		}
+		if( i2==0||i2==1 ){
+			if( params[i2]->GetVarName() == procName ){
+				//オブジェクトメンバの第一または第二パラメータの戻り値用オブジェクト
+				continue;
+			}
+		}
+
+		Type dummyType;
+		BOOL bByVal;
+		if(bEllipse){
+			NumOpe_GetType( Parms[i2], Type(), dummyType );
+			bByVal=1;
+		}
+		else{
+			dummyType = *params[i2];
+			bByVal = ( params[i2]->IsRef() == false ) ? TRUE:FALSE;
+		}
+
+
+		if( !bByVal ){
+			//ポインタ参照
+			if(Parms[i2][0]==1&&Parms[i2][1]==ESC_BYVAL){
+				//ポインタ指定
+				continue;
+			}
+
+			if( !GetVarType( Parms[i2], Type(), FALSE ) ){
+				//変数ではないとき
+				Type calcType;
+				NumOpe( Parms[i2], dummyType, calcType );
+				//↑ここでスタックに積む
+
+				nCountOfTempObjects++;
+
+				if( !calcType.IsStruct() ){
+					//一時参照を作成
+
+					//push esp
+					op_push( REG_ESP );
+
+					nCountOfTempObjects++;
+				}
+
+				bool result = CheckDifferentType(
+					dummyType,
+					calcType,
+					procName.c_str(),
+					i2);
+
+				if( result ){
+					useTempParameters[i2] = true;
+					useTempObject = true;
+
+					types[i2] = calcType;
+				}
+			}
+		}
+	}
+
+	return nCountOfTempObjects * PTR_SIZE;
+}
+
+void ParamImpl::DeleteTempParameters(){
+	///////////////////////////////////////////////////////
+	// 一時オブジェクトを破棄
+	///////////////////////////////////////////////////////
+	if( !useTempObject ) return;
+
+	for(int i2=ParmsNum-1;i2>=0;i2--){
+		if( useTempParameters[i2] ){
+			if( types[i2].IsStruct() ){
+				// 構造体の一時メモリ
+
+				//メモリを解放する
+
+				//call free
+				extern UserProc *pSub_free;
+				op_call(pSub_free);
+			}
+			else{
+				if( types[i2].Is64() ){
+					//pop ... 参照を消す
+					//pop ... 上位32ビット
+					//pop ... 下位32ビット
+					op_add_esp( PTR_SIZE * 3 );
+				}
+				else{
+					//pop ... 参照を消す
+					//pop ... 値を消す
+					op_add_esp( PTR_SIZE * 2 );
+				}
+			}
+		}
+	}
+}
+
+void ParamImpl::SetStructParameter( const Type &baseType, const char *expression ){
+	int object_size = baseType.GetClass().GetSize();
+
+	//push object_size
+	op_push_V(object_size);
+
+	//call calloc
+	extern UserProc *pSub_calloc;
+	op_call(pSub_calloc);
+
+	//push eax（ここでプッシュされた値が実際にパラメータとして引き渡される）
+	op_push(REG_EAX);
+
+	//push eax
+	op_push(REG_EAX);
+
+	Type calcType;
+	BOOL bUseHeap;
+	NumOpe( expression,
+		baseType,
+		calcType,
+		&bUseHeap );
+
+	// ※スタックにある二つのデータ（コピー先、コピー元）の値を必要とする
+	SetStructVariable( baseType, calcType, bUseHeap );
+}
+
+int ParamImpl::SetParameter( const string &procName, const Parameters &params, int SecondParmNum ){
+	if( SecondParmNum == -1 ) SecondParmNum = (int)params.size();
+
+	///////////////////////////////////////////////////////////
+	// パラメータをレジスタ及びスタックフレームにセット
+	///////////////////////////////////////////////////////////
+	int i2,i3;
+
+	BOOL bEllipse;
+	if( params.size() ){
+		if(params[params.size()-1]->GetBasicType()==DEF_ELLIPSE) bEllipse=1;
+		else bEllipse=0;
+	}
+	else bEllipse=0;
+
+	BOOL bHas_System_LocalThis=0;
+	if(ParmsNum>=1){
+		if( params[0]->GetVarName() == "_System_LocalThis" ){
+			bHas_System_LocalThis=1;
+		}
+	}
+
+	//戻り値用の変数名を取得
+	const char *lpszVarNameToReturn = (procName[0]==1&&procName[1]==ESC_OPERATOR)?"_System_ReturnValue":procName.c_str();
+
+	//パラメータをレジスタとスタックに格納
+	int ParmSize=0;
+	RELATIVE_VAR RelativeVar;
+	int nCountOfNowTempObjects = 0;
+	for(i2=ParmsNum-1;i2>=0;i2--){
+		if(bEllipse&&i2<=(int)params.size()-2) bEllipse=0;
+
+		if(i2==0){
+			if( params[i2]->GetVarName() == "_System_LocalThis" ){
+				//オブジェクトメンバの第一パラメータのThisポインタ
+				continue;
+			}
+		}
+		if(i2==0||i2==1){
+			if( params[i2]->GetVarName() == lpszVarNameToReturn ){
+				//オブジェクトメンバの第一または第二パラメータの戻り値用オブジェクト
+				continue;
+			}
+		}
+
+		Type dummyType;
+		BOOL bByVal;
+		if(bEllipse){
+			NumOpe_GetType( Parms[i2], Type(), dummyType );
+			bByVal=1;
+		}
+		else{
+			dummyType = *params[i2];
+			bByVal = ( params[i2]->IsRef() == false ) ? TRUE:FALSE;
+		}
+
+		if(bByVal==1){
+			//値参照
+
+			if(Parms[i2][0]==1&&Parms[i2][1]==ESC_BYVAL){
+				char temp2[255];
+				sprintf(temp2,"%s関数の第%dパラメータ",procName,i2+1);
+				SetError(19,temp2,cp);
+				continue;
+			}
+
+			if( dummyType.IsStruct() ){
+				SetStructParameter( dummyType, Parms[i2] );
+				goto next;
+			}
+
+			extern LONG_PTR ProcPtr_BaseIndex;
+			LONG_PTR back_ProcPtr_BaseIndex = ProcPtr_BaseIndex;
+			if( dummyType.IsProcPtr() ){
+				ProcPtr_BaseIndex = dummyType.GetIndex();
+			}
+			else{
+				ProcPtr_BaseIndex=-1;
+			}
+
+			BOOL bCalcUseHeap;
+			Type calcType;
+			if( !NumOpe( Parms[i2], dummyType, calcType, &bCalcUseHeap ) ){
+				break;
+			}
+
+			ProcPtr_BaseIndex=back_ProcPtr_BaseIndex;
+
+			if( calcType.IsObject() ){
+				if( !dummyType.IsObject()
+					||
+					dummyType.IsObject() &&
+					!dummyType.GetClass().IsEqualsOrSubClass( &calcType.GetClass() ) ){
+						//キャスト演算子のオーバーロードに対応する
+						CallCastOperatorProc( calcType, bCalcUseHeap,dummyType );
+				}
+			}
+
+			if(!bEllipse){
+				//型チェック
+				// TODO: _System_ReturnValueが考慮されていない？
+				if(bHas_System_LocalThis) i3=i2-1;
+				else i3=i2;
+				CheckDifferentType(
+					dummyType,
+					calcType,
+					procName.c_str(),
+					i3);
+			}
+
+			if( dummyType.IsDouble() ){
+				ChangeTypeToDouble( calcType.GetBasicType() );
+				ParmSize+=sizeof(long)*2;
+			}
+			else if( dummyType.IsSingle() ){
+				ChangeTypeToSingle( calcType.GetBasicType() );
+				ParmSize+=sizeof(long);
+			}
+			else if( dummyType.Is64() ){
+				ChangeTypeToInt64( calcType.GetBasicType() );
+				ParmSize+=sizeof(long)*2;
+			}
+			else if( dummyType.IsLong() || dummyType.IsDWord()
+				|| dummyType.IsPointer()
+				|| dummyType.IsObject() || dummyType.IsStruct() ){
+					ChangeTypeToLong( calcType.GetBasicType() );
+					ParmSize+=sizeof(long);
+			}
+			else if( dummyType.IsInteger() || dummyType.IsWord() ){
+				ChangeTypeToInteger( calcType.GetBasicType() );
+				ParmSize+=sizeof(long);
+			}
+			else if( dummyType.IsSByte() || dummyType.IsByte() || dummyType.IsBoolean() ){
+				ChangeTypeToByte( calcType.GetBasicType() );
+				ParmSize+=sizeof(long);
+			}
+			else{
+				SetError(300,NULL,cp);
+			}
+		}
+		else{
+			//ポインタ参照
+			if(Parms[i2][0]==1&&Parms[i2][1]==ESC_BYVAL){
+				//ポインタ指定
+
+				Type calcType;
+				if( !NumOpe( Parms[i2]+2, dummyType, calcType) ){
+					break;
+				}
+
+				ChangeTypeToLong( calcType.GetBasicType() );
+
+				dummyType.PtrLevelUp();
+
+				//型チェック
+				if(bHas_System_LocalThis) i3=i2-1;
+				else i3=i2;
+				CheckDifferentType(
+					dummyType,
+					calcType,
+					procName.c_str(),
+					i3);
+			}
+			else{
+				if( useTempParameters[i2] ){
+					//一時オブジェクトをコピー
+
+					if( !types[i2].IsStruct() ){
+						// 一時参照のための領域を考慮する
+						nCountOfNowTempObjects++;
+					}
+
+					nCountOfNowTempObjects++;
+
+					//mov eax, dword ptr[esp+offset]
+					op_mov_RM(
+						sizeof(long),
+						REG_EAX,
+						REG_ESP,
+						( ( ParmsNum - i2 - 1 ) + ( nCountOfTempObjects - nCountOfNowTempObjects ) ) * PTR_SIZE,
+						MOD_BASE_DISP32 );
+
+					//push eax
+					op_push(REG_EAX);
+				}
+				else{
+					//変数のアドレスを取得
+					Type varType;
+					if(GetVarOffset(
+						false,
+						false,
+						Parms[i2],
+						&RelativeVar,
+						varType)){
+							if( !dummyType.IsAny() ){
+								//型チェックを行う
+								if( dummyType.GetBasicType() == varType.GetBasicType() ){
+									if( dummyType.IsObject() ){
+										if( !dummyType.GetClass().IsEqualsOrSubClass( &varType.GetClass() ) ){
+											SetError(11,Parms[i2],cp);
+										}
+									}
+									else if( dummyType.IsStruct() ){
+										if( !dummyType.GetClass().IsEquals( &varType.GetClass() ) ){
+											SetError(11,Parms[i2],cp);
+										}
+									}
+								}
+								else if( (varType.GetBasicType()&FLAG_PTR)
+									&&((varType.GetBasicType()^FLAG_PTR)==dummyType.GetBasicType())){
+									//仮引数がポインタ参照で、実引数が配列の先頭ポインタのとき
+								}
+								else{
+									SetError(11,Parms[i2],cp);
+								}
+							}
+
+							//変数アドレスをレジスタにセット
+							SetVarPtrToEax(&RelativeVar);
+
+							//push eax
+							op_push(REG_EAX);
+					}
+				}
+			}
+
+			ParmSize+=PTR_SIZE;
+		}
+
+next:;
+	}
+
+	return ParmSize;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/Compile_Calc.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/Compile_Calc.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/Compile_Calc.cpp	(revision 178)
@@ -0,0 +1,656 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void ChangeTypeToDouble_ToFpuReg(int OldType){
+	//現在のスタックの内容を実数レジスタに保存する
+	//NumOpeの直後専用
+	if(OldType==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//add esp,8
+		op_add_esp(8);
+	}
+	else if(OldType==DEF_SINGLE){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//add esp,4
+		op_add_esp(4);
+	}
+	else if(OldType==DEF_LONG){
+		//fild dword ptr[esp]
+		op_fld_ptr_esp(DEF_LONG);
+
+		//add esp,4
+		op_add_esp(4);
+	}
+	else if(OldType==DEF_DWORD){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//push 0
+		op_push_V(0);
+
+		//push eax
+		op_push(REG_EAX);
+
+		//fild qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0x2C;
+		OpBuffer[obp++]=(char)0x24;
+
+		//add esp,8
+		op_add_esp(8);
+	}
+}
+void ChangeTypeToDouble(int OldType){
+	//現在のスタックの内容をdouble型に変換する
+	//NumOpeの直後専用
+	if(OldType==DEF_DOUBLE) return;
+	else if(OldType==DEF_SINGLE){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//fstp qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDD;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(OldType==DEF_INT64||OldType==DEF_QWORD){
+		//64ビット整数型
+
+		//fild qword ptr[esp]
+		op_fld_ptr_esp(DEF_INT64);
+
+		//fstp qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDD;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(IsWholeNumberType(OldType)){
+		//その他整数型
+
+		if(IsSignedType(OldType)){
+			//符号あり
+
+			if(OldType==DEF_INTEGER || (isUnicode&&OldType==DEF_CHAR)){
+				//pop eax
+				op_pop(REG_EAX);
+
+				//movsx eax,ax
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0xBF;
+				OpBuffer[obp++]=(char)0xC0;
+
+				//push eax
+				op_push(REG_EAX);
+			}
+			else if(OldType==DEF_SBYTE || (isUnicode==false&&OldType==DEF_CHAR)){
+				//pop eax
+				op_pop(REG_EAX);
+
+				//movsx eax,al
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0xBE;
+				OpBuffer[obp++]=(char)0xC0;
+
+				//push eax
+				op_push(REG_EAX);
+			}
+
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+
+			//sub esp,4
+			op_sub_esp(4);
+		}
+		else{
+			//符号なし
+
+			//pop eax
+			op_pop(REG_EAX);
+
+			//push 0
+			op_push_V(0);
+
+			//push eax
+			op_push(REG_EAX);
+
+			//fild qword ptr[esp]
+			OpBuffer[obp++]=(char)0xDF;
+			OpBuffer[obp++]=(char)0x2C;
+			OpBuffer[obp++]=(char)0x24;
+		}
+
+		//fstp qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDD;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else SetError(9,NULL,cp);
+}
+void ChangeTypeToSingle(int OldType){
+	//現在のスタックの内容をfloat型に変換する
+	//NumOpeの直後専用
+	if(OldType==DEF_SINGLE) return;
+	else if(OldType==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//add esp,4
+		op_add_esp(4);
+
+		//fstp dword ptr[esp]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(OldType==DEF_INT64||OldType==DEF_QWORD){
+		//64ビット整数型
+
+		//fild qword ptr[esp]
+		op_fld_ptr_esp(DEF_INT64);
+
+		//add esp,4
+		op_add_esp(4);
+
+		//fstp dword ptr[esp]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(IsWholeNumberType(OldType)){
+		//その他整数型
+
+		if(IsSignedType(OldType)){
+			//符号あり
+
+			if(OldType==DEF_INTEGER || (isUnicode&&OldType==DEF_CHAR)){
+				//pop eax
+				op_pop(REG_EAX);
+
+				//movsx eax,ax
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0xBF;
+				OpBuffer[obp++]=(char)0xC0;
+
+				//push eax
+				op_push(REG_EAX);
+			}
+			else if(OldType==DEF_SBYTE || (isUnicode==false&&OldType==DEF_CHAR)){
+				//pop eax
+				op_pop(REG_EAX);
+
+				//movsx eax,al
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0xBE;
+				OpBuffer[obp++]=(char)0xC0;
+
+				//push eax
+				op_push(REG_EAX);
+			}
+
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+		}
+		else{
+			//符号なし
+
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+		}
+
+		//fstp dword ptr[esp]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else SetError(9,NULL,cp);
+}
+
+void ChangeTypeToInt64(int OldType){
+	//現在のスタックの内容をInt64型に変換する
+	//NumOpeの直後専用
+	if(Is64Type(OldType)) return;
+
+	else if(OldType==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//fistp qword ptr[esp]
+		op_fistp_ptr_esp( sizeof(_int64) );
+	}
+	else if(OldType==DEF_SINGLE){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//fistp qword ptr[esp]
+		op_fistp_ptr_esp( sizeof(_int64) );
+	}
+	else if(IsWholeNumberType(OldType)){
+		//その他整数
+
+		if(IsSignedType(OldType)){
+			//符号あり
+
+			//pop eax
+			op_pop(REG_EAX);
+
+			//cdq
+			op_cdq();
+
+			//push edx
+			op_push(REG_EDX);
+
+			//push eax
+			op_push(REG_EAX);
+		}
+		else{
+			//符号なし
+
+			//pop eax
+			op_pop(REG_EAX);
+
+			//push 0
+			op_push_V(0);
+
+			//push eax
+			op_push(REG_EAX);
+		}
+	}
+	else SetError(9,NULL,cp);
+}
+void ChangeTypeToLong(int OldType){
+	//現在のスタックの内容をLong型に変換する
+	//NumOpeの直後専用
+	if(OldType==DEF_DOUBLE){
+
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//add esp,4
+		op_add_esp(4);
+
+		//fistp dword ptr[esp]
+		op_fistp_ptr_esp( sizeof(long) );
+	}
+	else if(OldType==DEF_SINGLE){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//fistp dword ptr[esp]
+		op_fistp_ptr_esp( sizeof(long) );
+	}
+	else if(OldType==DEF_INT64||OldType==DEF_QWORD){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//add esp,4
+		op_add_esp(4);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+}
+void ChangeTypeToInteger(int OldType){
+	//現在のスタックの内容をInteger型に変換する
+	if(OldType==DEF_BOOLEAN||
+		OldType==DEF_BYTE||
+		OldType==DEF_WORD||OldType==DEF_INTEGER || (isUnicode&&OldType==DEF_CHAR)) return;
+	else if(OldType==DEF_SBYTE || (isUnicode==false&&OldType==DEF_CHAR)){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//movsx eax,al
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0xBE;
+		OpBuffer[obp++]=(char)0xC0;
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else{
+		ChangeTypeToLong(OldType);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//and eax,0000FFFFh
+		OpBuffer[obp++]=(char)0x25;
+		*((long *)(OpBuffer+obp))=0x0000FFFF;
+		obp+=sizeof(long);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+}
+void ChangeTypeToByte(int OldType){
+	//現在のスタックの内容をbyte型に変換する
+	if(OldType==DEF_BYTE||OldType==DEF_SBYTE || (isUnicode==false&&OldType==DEF_CHAR)) return;
+
+	ChangeTypeToLong(OldType);
+
+	//pop eax
+	op_pop(REG_EAX);
+
+	//and eax,000000FFh
+	OpBuffer[obp++]=(char)0x25;
+	*((long *)(OpBuffer+obp))=0x000000FF;
+	obp+=sizeof(long);
+
+	//push eax
+	op_push(REG_EAX);
+}
+
+
+
+
+
+
+
+
+
+void RestoreDefaultRegisterFromStackMemory( int type ){
+	//現在のスタックの内容を実数レジスタに保存する
+	//NumOpeの直後専用
+	if(type==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//add esp,8
+		op_add_esp(8);
+	}
+	else if(type==DEF_SINGLE){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//add esp,4
+		op_add_esp(4);
+	}
+	else if( Is64Type( type ) ){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//pop edx
+		op_pop(REG_EDX);
+	}
+	else{
+		//pop eax
+		op_pop(REG_EAX);
+	}
+}
+
+void SetVariableFromEax(int VarType,int CalcType,RELATIVE_VAR *pRelativeVar){
+	/////////////////////////////////////////////////
+	// eaxの内容を変数にコピーするコードを抽出
+	/////////////////////////////////////////////////
+
+	if(VarType==DEF_BOOLEAN){
+		//bool
+		SetBooleanVariable(CalcType,pRelativeVar);
+	}
+	else if( IsRealNumberType( VarType ) ){
+		// Double/Single型変数へレジスタの値を代入
+		SetRealVariable(VarType, CalcType, pRelativeVar);
+	}
+	else if( IsWholeNumberType( VarType ) || VarType == DEF_OBJECT ){
+		int typeSize = GetTypeSize( VarType, -1 );
+
+		//整数変数へraxの値を格納する
+		SetWholeVariable( typeSize, CalcType, pRelativeVar );
+	}
+	else{
+		SetError(300,NULL,cp);
+	}
+}
+
+void OpcodeCalc( const char *Command ){
+	int i,i2,i3;
+	char variable[VN_SIZE];
+
+
+
+	//////////////////////////////////////
+	// インクリメント・デクリメント
+	//////////////////////////////////////
+
+	for(i=0;;i++){
+		if(Command[i]=='\"'){
+			//ダブルクォートは不正なのでエラー扱い
+			variable[i]=0;
+			SetError(3,variable,cp);
+			return;
+		}
+
+		if(Command[i]=='('){
+			i2=GetStringInPare(variable+i,Command+i);
+			i+=i2-1;
+			continue;
+		}
+		if(Command[i]=='['){
+			i2=GetStringInBracket(variable+i,Command+i);
+			i+=i2-1;
+			continue;
+		}
+		if(Command[i]=='\0'){
+
+			///////////////////////////////////
+			// インクリメント・デクリメント
+			///////////////////////////////////
+
+			if(i>2){
+				if(Command[i-2]=='+'&&Command[i-1]=='+'){
+					//インクリメント
+					variable[i-2]=0;
+					IncDec(CALC_ADDITION,variable,"1");
+					return;
+				}
+				else if(Command[i-2]=='-'&&Command[i-1]=='-'){
+					//デクリメント
+					variable[i-2]=0;
+					IncDec(CALC_SUBTRACTION,variable,"1");
+					return;
+				}
+			}
+
+
+			//先端部分の識別子をエラーキーワードにする
+			for(i=0;;i++){
+				if(!IsVariableChar(Command[i])){
+					variable[i]=0;
+					break;
+				}
+				variable[i]=Command[i];
+			}
+
+			if(GetVarType(variable,Type(),0)){
+				//変数リストに該当したとき
+				SetError(1,NULL,cp);
+			}
+			else{
+				if(GetConstHash(variable)){
+					//定数リストに該当したとき
+					SetError(1,NULL,cp);
+				}
+				else{
+					//変数リスト、定数リストに該当しないとき
+					SetError(3,variable,cp);
+				}
+			}
+			return;
+		}
+
+		i2=GetCalcId(Command+i,&i3);
+		if(i2){
+			variable[i]=0;
+
+			if(Command[i]=='=') break;
+
+			if(Command[i+1+i3]=='='){
+				IncDec(i2,variable,Command+i+1+i3+1);
+				return;
+			}
+		}
+
+		variable[i]=Command[i];
+	}
+
+	if(Command[i+1]=='\0'){
+		SetError(1,NULL,cp);
+		return;
+	}
+
+
+
+	///////////////////////////////////////////////////////////////
+	// インデクサのsetアクセサ（[]=演算子のオーバーロードに対応）
+	///////////////////////////////////////////////////////////////
+
+	char ObjName[VN_SIZE],array_element[VN_SIZE];
+	GetArrayElement(variable,ObjName,array_element);
+	if(array_element[0]){
+		Type varType;
+		if( GetVarType(ObjName,varType,0) && varType.IsObject() ){
+			char temporary[VN_SIZE];
+			sprintf(temporary,"%s.%c%c%c",ObjName,1,ESC_OPERATOR,CALC_ARRAY_SET);
+
+			char temp2[VN_SIZE];
+			sprintf(temp2,"%s,%s",array_element,Command+i+1);
+
+			int idProc;
+			void *pProc;
+			idProc=GetProc(temporary,(void **)&pProc);
+			if(idProc){
+				CallProc(idProc,pProc,temporary,temp2,Type());
+				return;
+			}
+		}
+	}
+
+
+	if( lstrcmpi( variable, "This" ) == 0 ){
+		SetError(133,NULL,cp);
+		return;
+	}
+
+
+	////////////////////////////////////////
+	// 変数のタイプ型を識別して、演算を行う
+	////////////////////////////////////////
+
+	Type varType;
+
+	//型を識別
+	if( !GetVarType(variable,varType,false) ){
+
+		// プロパティ用のメソッドを呼び出す
+		if(!CallPropertyMethod( variable, Command+i+1, Type() )){
+			//エラーを表示
+			GetVarType(variable,varType,true);
+		}
+
+		return;
+	}
+
+	extern LONG_PTR ProcPtr_BaseIndex;
+	if(varType.IsProcPtr()) ProcPtr_BaseIndex=varType.GetIndex();
+	else ProcPtr_BaseIndex=-1;
+
+	RELATIVE_VAR VarRelativeVar;
+	if( varType.IsStruct() ){
+		//代入コピーに備える
+
+		//変数アドレスを取得
+		if(!GetVarOffsetReadWrite(
+			variable,
+			&VarRelativeVar,
+			varType)) return;
+
+		SetVarPtrToEax(&VarRelativeVar);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+
+
+	//NumOpe...（スタックに答えが格納される）
+	BOOL bCalcUseHeap;
+	Type calcType;
+	if( !NumOpe(Command+i+1,varType,calcType,&bCalcUseHeap) ){
+		return;
+	}
+
+	//変数アドレスを取得
+	if(!GetVarOffsetReadWrite(
+		variable,
+		&VarRelativeVar,
+		varType)) return;
+
+	if(varType.GetBasicType()&FLAG_PTR){
+		SetError(14,variable,cp);
+		return;
+	}
+
+	if( varType.IsStruct() ){
+		//構造体インスタンスへの代入
+		SetStructVariable(varType,calcType,bCalcUseHeap);
+		return;
+	}
+
+	if( calcType.IsObject() && !calcType.Equals( varType ) ){
+		bool isUpCast = false;
+		if( varType.IsObject() ){
+			if( varType.GetClass().IsEqualsOrSubClass( &calcType.GetClass() ) ){
+				isUpCast = true;
+			}
+		}
+		if( !isUpCast ){
+			//キャスト演算子のオーバーロードに対応する
+			CallCastOperatorProc(calcType,bCalcUseHeap,varType);
+		}
+	}
+
+
+	if( varType.IsObject() && Smoothie::meta.blittableTypes.IsExist( calcType ) ){
+		// Blittable型をオブジェクトとして扱う
+		vector<UserProc *> userProcs;
+		Smoothie::meta.blittableTypes.GetClass( calcType ).GetStaticMethods().Enum( "_Create", userProcs );
+		if( userProcs.size() != 1 ){
+			SetError();
+			return;
+		}
+		UserProc *pUserProc = userProcs[0];
+
+		// call System.[TypeClass]._Create
+		op_call( pUserProc );
+
+		// push eax
+		op_push( REG_EAX );
+
+		calcType = pUserProc->ReturnType();
+	}
+
+
+	/////////////////////////////////
+	// 右辺、左辺の型チェックを行う
+	/////////////////////////////////
+
+	CheckDifferentType(varType,calcType,0,0);
+
+
+	/////////////////////////////////////////////////
+	// スタックの内容を変数にコピーするコードを抽出
+	/////////////////////////////////////////////////
+
+	//eax、edx:eax、またはst(0)にスタック上のデータを取り出す
+	RestoreDefaultRegisterFromStackMemory( calcType.GetBasicType() );
+
+	SetVariableFromEax(varType.GetBasicType(),calcType.GetBasicType(),&VarRelativeVar);
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/Compile_Calc_PushVar.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/Compile_Calc_PushVar.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/Compile_Calc_PushVar.cpp	(revision 178)
@@ -0,0 +1,735 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void SetReg_RealVariable(int type,RELATIVE_VAR *pRelativeVar){
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//fld ptr[ecx+offset]
+			op_fld_base_offset(type,REG_ECX,(int)pRelativeVar->offset);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov ecx,offset
+			op_mov_RV(REG_ECX,(int)pRelativeVar->offset);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+
+			//fld ptr[ecx]
+			op_fld_basereg(type,REG_ECX);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFGLOBAL){
+		SetError(300,NULL,cp);
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//fld ptr[ebp+ecx+offset]
+			op_fld_base_offset_ex(type,REG_EBP,REG_ECX,(int)pRelativeVar->offset,USE_OFFSET);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//fld ptr[ebp+offset]
+			op_fld_base_offset(type,REG_EBP,(int)pRelativeVar->offset);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFLOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add ecx,qword ptr[ebp+offset]
+			op_add_RM(sizeof(long),REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov ecx,qword ptr[ebp+offset]
+			op_mov_RM(sizeof(long),REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+
+		goto directmem;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+directmem:
+		//fld ptr[ecx]
+		op_fld_basereg(type,REG_ECX);
+	}
+}
+void SetReg_WholeVariable(int type,RELATIVE_VAR *pRelativeVar,int reg, bool is64Head){
+	int varSize;
+
+	varSize=GetTypeSize(type,-1);
+
+	if(varSize==sizeof(_int64)){
+		//64ビットの場合はedx:eaxにロード
+		if(reg!=REG_EAX){
+			SetError(300,NULL,cp);
+			return;
+		}
+
+		//下位32ビットをeaxにロード
+		SetReg_WholeVariable(DEF_LONG,pRelativeVar,REG_EAX);
+
+		//上位32ビットをedxにロード
+		SetReg_WholeVariable(DEF_LONG,pRelativeVar,REG_EDX, true);
+
+		return;
+	}
+
+	int offsetOf64Head = 0;
+	if( is64Head ){
+		offsetOf64Head = sizeof(long);
+	}
+
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//mov reg, ptr[ecx+offset]
+			op_mov_RM(varSize,reg,REG_ECX,(int)pRelativeVar->offset + offsetOf64Head,MOD_BASE_DISP32);
+		}
+		else{
+			//mov reg, ptr[offset]
+			op_mov_RM(varSize,reg,0,(int)pRelativeVar->offset + offsetOf64Head,MOD_DISP32);
+		}
+		obp-=sizeof(long);
+		pobj_GlobalVarSchedule->add();
+		obp+=sizeof(long);
+	}
+	else if(pRelativeVar->dwKind==VAR_REFGLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add ecx,qword ptr[offset]
+			op_add_RM(varSize,REG_ECX,REG_NON,(int)pRelativeVar->offset,MOD_DISP32);
+		}
+		else{
+			//mov ecx,qword ptr[offset]
+			op_mov_RM(varSize,REG_ECX,REG_NON,(int)pRelativeVar->offset,MOD_DISP32);
+		}
+		obp-=sizeof(long);
+		pobj_GlobalVarSchedule->add();
+		obp+=sizeof(long);
+
+		goto directmem;
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//mov reg, ptr[ebp+ecx+offset]
+			op_mov_RM_ex(varSize,reg,REG_EBP,REG_ECX,(int)pRelativeVar->offset + offsetOf64Head,USE_OFFSET);
+		}
+		else{
+			//mov reg, ptr[ebp+offset]
+			op_mov_RM(varSize,reg,REG_EBP,(int)pRelativeVar->offset + offsetOf64Head,MOD_BASE_DISP32);
+		}
+		obp-=sizeof(long);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+	}
+	else if(pRelativeVar->dwKind==VAR_REFLOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add ecx,qword ptr[ebp+offset]
+			op_add_RM(varSize,REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+		}
+		else{
+			//mov ecx,qword ptr[ebp+offset]
+			op_mov_RM(varSize,REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+		}
+		obp-=sizeof(long);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+
+		goto directmem;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+directmem:
+		if( is64Head ){
+			//mov reg, ptr[ecx]
+			op_mov_RM(varSize,reg,REG_ECX,offsetOf64Head,MOD_BASE_DISP8);
+		}
+		else{
+			//mov reg, ptr[ecx]
+			op_mov_RM(varSize,reg,REG_ECX,0,MOD_BASE);
+		}
+	}
+}
+
+
+
+
+
+void PushDoubleVariable(RELATIVE_VAR *pRelativeVar){
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//push dword ptr[ecx+offset+sizeof(long)]
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0xB1;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset+sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+
+			//push dword ptr[ecx+offset]
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0xB1;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//push dword ptr[offset+sizeof(long)]
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0x35;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset+sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+
+			//push dword ptr[offset]
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0x35;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFGLOBAL){
+		SetError(300,NULL,cp);
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add ecx,offset+sizeof(long)
+			OpBuffer[obp++]=(char)0x81;
+			OpBuffer[obp++]=(char)0xC1;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset+sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//push dword ptr[ebp+ecx]
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0x74;
+			OpBuffer[obp++]=(char)0x0D;
+			OpBuffer[obp++]=(char)0x00;
+
+			//sub ecx,sizeof(long)
+			OpBuffer[obp++]=(char)0x83;
+			OpBuffer[obp++]=(char)0xE9;
+			OpBuffer[obp++]=(char)0x04;
+
+			//push dword ptr[ebp+ecx]
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0x74;
+			OpBuffer[obp++]=(char)0x0D;
+			OpBuffer[obp++]=(char)0x00;
+		}
+		else{
+			//push dword ptr[ebp+offset+sizeof(long)]
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0xB5;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset+sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//push dword ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0xB5;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFLOCAL){
+		//mov eax,dword ptr[ebp+offset]
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x85;
+		*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+
+		if(pRelativeVar->bOffsetOffset){
+			//add eax,ecx
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0xC1;
+		}
+
+		//push dword ptr[eax+sizeof(long)]
+		OpBuffer[obp++]=(char)0xFF;
+		OpBuffer[obp++]=(char)0x70;
+		OpBuffer[obp++]=(char)0x04;
+
+		//push dword ptr[eax]
+		OpBuffer[obp++]=(char)0xFF;
+		OpBuffer[obp++]=(char)0x30;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+		//push dword ptr[ecx+sizeof(long)]
+		OpBuffer[obp++]=(char)0xFF;
+		OpBuffer[obp++]=(char)0xB1;
+		*((long *)(OpBuffer+obp))=sizeof(long);
+		obp+=sizeof(long);
+
+		//push dword ptr[ecx]
+		OpBuffer[obp++]=(char)0xFF;
+		OpBuffer[obp++]=(char)0x31;
+	}
+}
+void PushLongVariable(RELATIVE_VAR *pRelativeVar){
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//push dword ptr[ecx+offset]
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0xB1;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//push dword ptr[offset]
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0x35;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFGLOBAL){
+		//mov eax,dword ptr[offset]
+		op_mov_RM( sizeof(long), REG_EAX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 );
+		obp-=sizeof(long);
+		pobj_GlobalVarSchedule->add();
+		obp+=sizeof(long);
+
+		if(pRelativeVar->bOffsetOffset){
+			//add eax,ecx
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0xC1;
+		}
+
+		//push dword ptr[eax]
+		OpBuffer[obp++]=(char)0xFF;
+		OpBuffer[obp++]=(char)0x30;
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add ecx,offset
+			OpBuffer[obp++]=(char)0x81;
+			OpBuffer[obp++]=(char)0xC1;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//push dword ptr[ebp+ecx]
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0x74;
+			OpBuffer[obp++]=(char)0x0D;
+			OpBuffer[obp++]=(char)0x00;
+		}
+		else{
+			//push dword ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0xB5;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFLOCAL){
+		//mov eax,dword ptr[ebp+offset]
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x85;
+		*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+
+		if(pRelativeVar->bOffsetOffset){
+			//add eax,ecx
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0xC1;
+		}
+
+		//push dword ptr[eax]
+		OpBuffer[obp++]=(char)0xFF;
+		OpBuffer[obp++]=(char)0x30;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+		//push dword ptr[ecx]
+		OpBuffer[obp++]=(char)0xFF;
+		OpBuffer[obp++]=(char)0x31;
+	}
+}
+void PushIntegerVariable(RELATIVE_VAR *pRelativeVar){
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//movsx eax,word ptr[ecx+offset]
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0xBF;
+			OpBuffer[obp++]=(char)0x81;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//movsx eax,word ptr[offset]
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0xBF;
+			OpBuffer[obp++]=(char)0x05;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFGLOBAL){
+		//mov ebx,dword ptr[offset]
+		op_mov_RM( sizeof(long), REG_EBX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 );
+		obp-=sizeof(long);
+		pobj_GlobalVarSchedule->add();
+		obp+=sizeof(long);
+
+		if(pRelativeVar->bOffsetOffset){
+			//add ebx,ecx
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0xD9;
+		}
+
+		//movsx eax,word ptr[ebx]
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0xBF;
+		OpBuffer[obp++]=(char)0x03;
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add ecx,offset
+			OpBuffer[obp++]=(char)0x81;
+			OpBuffer[obp++]=(char)0xC1;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//movsx eax,word ptr[ebp+ecx]
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0xBF;
+			OpBuffer[obp++]=(char)0x44;
+			OpBuffer[obp++]=(char)0x0D;
+			OpBuffer[obp++]=(char)0x00;
+		}
+		else{
+			//movsx eax,word ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0xBF;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFLOCAL){
+		//mov ebx,dword ptr[ebp+offset]
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x9D;
+		*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+
+		if(pRelativeVar->bOffsetOffset){
+			//add ebx,ecx
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0xD9;
+		}
+
+		//movsx eax,word ptr[ebx]
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0xBF;
+		OpBuffer[obp++]=(char)0x03;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+		//movsx eax,word ptr[ecx]
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0xBF;
+		OpBuffer[obp++]=(char)0x01;
+	}
+
+	//push eax
+	op_push(REG_EAX);
+}
+void PushWordVariable(RELATIVE_VAR *pRelativeVar){
+	//xor eax,eax（eaxを0に初期化する）
+	op_zero_reg(REG_EAX);
+
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//mov ax,word ptr[ecx+offset]
+			OpBuffer[obp++]=(char)0x66;
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0x81;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov ax,word ptr[offset]
+			OpBuffer[obp++]=(char)0x66;
+			OpBuffer[obp++]=(char)0xA1;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFGLOBAL){
+		//mov ebx,dword ptr[offset]
+		op_mov_RM( sizeof(long), REG_EBX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 );
+		obp-=sizeof(long);
+		pobj_GlobalVarSchedule->add();
+		obp+=sizeof(long);
+
+		if(pRelativeVar->bOffsetOffset){
+			//add ebx,ecx
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0xD9;
+		}
+
+		//mov ax,word ptr[ebx]
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x03;
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add ecx,offset
+			OpBuffer[obp++]=(char)0x81;
+			OpBuffer[obp++]=(char)0xC1;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//mov ax,word ptr[ebp+ecx]
+			OpBuffer[obp++]=(char)0x66;
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0x44;
+			OpBuffer[obp++]=(char)0x0D;
+			OpBuffer[obp++]=(char)0x00;
+		}
+		else{
+			//mov ax,word ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0x66;
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFLOCAL){
+		//mov ebx,dword ptr[ebp+offset]
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x9D;
+		*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+
+		if(pRelativeVar->bOffsetOffset){
+			//add ebx,ecx
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0xD9;
+		}
+
+		//mov ax,word ptr[ebx]
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x03;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+		//mov ax,word ptr[ecx]
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x01;
+	}
+
+	//push eax
+	op_push(REG_EAX);
+}
+void PushCharVariable(RELATIVE_VAR *pRelativeVar){
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//movsx eax,byte ptr[ecx+offset]
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0xBE;
+			OpBuffer[obp++]=(char)0x81;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//movsx eax,byte ptr[offset]
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0xBE;
+			OpBuffer[obp++]=(char)0x05;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFGLOBAL){
+		//mov ebx,dword ptr[offset]
+		op_mov_RM( sizeof(long), REG_EBX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 );
+		obp-=sizeof(long);
+		pobj_GlobalVarSchedule->add();
+		obp+=sizeof(long);
+
+		if(pRelativeVar->bOffsetOffset){
+			//add ebx,ecx
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0xD9;
+		}
+
+		//movsx eax,byte ptr[ebx]
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0xBE;
+		OpBuffer[obp++]=(char)0x03;
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add ecx,offset
+			OpBuffer[obp++]=(char)0x81;
+			OpBuffer[obp++]=(char)0xC1;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//movsx eax,byte ptr[ebp+ecx]
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0xBE;
+			OpBuffer[obp++]=(char)0x44;
+			OpBuffer[obp++]=(char)0x0D;
+			OpBuffer[obp++]=(char)0x00;
+		}
+		else{
+			//movsx eax,byte ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0xBE;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFLOCAL){
+		//mov ebx,dword ptr[ebp+offset]
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x9D;
+		*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+
+		if(pRelativeVar->bOffsetOffset){
+			//add ebx,ecx
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0xD9;
+		}
+
+		//movsx eax,byte ptr[ebx]
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0xBE;
+		OpBuffer[obp++]=(char)0x03;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+		//movsx eax,byte ptr[ecx]
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0xBE;
+		OpBuffer[obp++]=(char)0x01;
+	}
+
+	//push eax
+	op_push(REG_EAX);
+}
+void PushByteVariable(RELATIVE_VAR *pRelativeVar){
+	//xor eax,eax（eaxを0に初期化する）
+	op_zero_reg(REG_EAX);
+
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//mov al,byte ptr[ecx+offset]
+			OpBuffer[obp++]=(char)0x8A;
+			OpBuffer[obp++]=(char)0x81;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov al,byte ptr[offset]
+			OpBuffer[obp++]=(char)0xA0;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFGLOBAL){
+		//mov ebx,dword ptr[offset]
+		op_mov_RM( sizeof(long), REG_EBX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 );
+		obp-=sizeof(long);
+		pobj_GlobalVarSchedule->add();
+		obp+=sizeof(long);
+
+		if(pRelativeVar->bOffsetOffset){
+			//add ebx,ecx
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0xD9;
+		}
+
+		//mov al,byte ptr[ebx]
+		OpBuffer[obp++]=(char)0x8A;
+		OpBuffer[obp++]=(char)0x03;
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add ecx,offset
+			OpBuffer[obp++]=(char)0x81;
+			OpBuffer[obp++]=(char)0xC1;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//mov al,byte ptr[ebp+ecx]
+			OpBuffer[obp++]=(char)0x8A;
+			OpBuffer[obp++]=(char)0x44;
+			OpBuffer[obp++]=(char)0x0D;
+			OpBuffer[obp++]=(char)0x00;
+		}
+		else{
+			//mov al,byte ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0x8A;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFLOCAL){
+		//mov ebx,dword ptr[ebp+offset]
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x9D;
+		*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+
+		if(pRelativeVar->bOffsetOffset){
+			//add ebx,ecx
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0xD9;
+		}
+
+		//mov al,byte ptr[ebx]
+		OpBuffer[obp++]=(char)0x8A;
+		OpBuffer[obp++]=(char)0x03;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+		//mov al,byte ptr[ecx]
+		OpBuffer[obp++]=(char)0x8A;
+		OpBuffer[obp++]=(char)0x01;
+	}
+
+	//push eax
+	op_push(REG_EAX);
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/Compile_CallProc.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/Compile_CallProc.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/Compile_CallProc.cpp	(revision 178)
@@ -0,0 +1,414 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+//ローカル変数アドレススケジュール
+DWORD *pLocalVarAddrSchedule;
+int LocalVarAddrScheduleNum;
+
+void Call_DebugSys_SaveContext(){
+	//call _System_GetEip
+	extern UserProc *pSub_System_GetEip;
+	op_call(pSub_System_GetEip);
+
+	//push eax
+	op_push(REG_EAX);
+
+	//push ebp
+	op_push(REG_EBP);
+
+	//call _DebugSys_SaveContext
+	extern UserProc *pSub_DebugSys_SaveContext;
+	op_call(pSub_DebugSys_SaveContext);
+}
+
+void AddLocalVarAddrSchedule(){
+	extern HANDLE hHeap;
+
+	//ローカル変数アドレススケジュールに追加する
+	pLocalVarAddrSchedule=(DWORD *)HeapReAlloc(hHeap,0,pLocalVarAddrSchedule,(LocalVarAddrScheduleNum+1)*sizeof(DWORD));
+	pLocalVarAddrSchedule[LocalVarAddrScheduleNum]=obp;
+	LocalVarAddrScheduleNum++;
+}
+
+
+bool Opcode_CallProcPtr( const char *variable, const char *lpszParms,ProcPointer *pProcPointer){
+
+	extern BOOL bDebugCompile;
+	extern BOOL bDebugSupportProc;
+	if(bDebugCompile&&bDebugSupportProc==0)
+		Call_DebugSys_SaveContext();
+
+
+	////////////////////////
+	// パラメータのセット
+	////////////////////////
+
+	//パラメータオブジェクトを生成
+	ParamImpl *pobj_parameter=0;
+	pobj_parameter=new ParamImpl(lpszParms);
+
+	// デフォルト引数を適用
+	pobj_parameter->ApplyDefaultParameters( pProcPointer->Params() );
+
+	//エラーチェック
+	if( !pobj_parameter->ErrorCheck(variable,pProcPointer->Params() ) ){
+		//パラメータにエラーがあるときは処理を終える
+		return false;
+	}
+
+	//一時オブジェクトを生成
+	pobj_parameter->NewTempParameters( variable,pProcPointer->Params() );
+
+	//レジスタ、スタックフレームにセット
+	pobj_parameter->SetParameter(variable,pProcPointer->Params() );
+
+
+
+	////////////////////////
+	// call
+	////////////////////////
+	RELATIVE_VAR RelativeVar;
+	GetVarOffsetReadOnly(variable,&RelativeVar,Type());
+	SetVarPtrToEax(&RelativeVar);
+
+	//mov eax,dword ptr[eax]
+	OpBuffer[obp++]=(char)0x8B;
+	OpBuffer[obp++]=(char)0x00;
+
+	//call eax
+	OpBuffer[obp++]=(char)0xFF;
+	OpBuffer[obp++]=(char)0xD0;
+
+
+
+	//一時オブジェクトを破棄
+	pobj_parameter->DeleteTempParameters();
+
+	//パラメータオブジェクトを破棄
+	delete pobj_parameter;
+
+	return true;
+}
+
+bool Opcode_CallProc(const char *Parameter,UserProc *pUserProc,DWORD dwFlags,const char *ObjectName,int RefType){
+	int i2;
+
+	if( pUserProc->IsMacro() ){
+		if( lstrcmpi( pUserProc->GetName().c_str(), "Print" ) == 0 ){
+			Opcode_Print(Parameter,0);
+			return true;
+		}
+		if( lstrcmpi( pUserProc->GetName().c_str(), "Input" ) == 0 ){
+			Opcode_Input(Parameter);
+			return true;
+		}
+		if( lstrcmpi( pUserProc->GetName().c_str(), "Write" ) == 0 ){
+			Opcode_Print(Parameter,1);
+			return true;
+		}
+	}
+
+	pUserProc->Using();
+
+	bool isStatic = false;
+	const CClass *pobj_c = NULL;
+	const CMethod *pMethod = NULL;
+	if( pUserProc->GetParentClassPtr() ){
+		//クラスのメンバ関数を呼び出す場合はアクセスチェックを行う
+		if(ObjectName[0] && (dwFlags&PROCFLAG_NEW)==0){
+			if(lstrcmpi(ObjectName,"Super")==0){
+				//クラスメンバ関数内から基底クラスの呼び出し
+				pobj_c=pobj_CompilingClass;
+			}
+			else{
+				//"->"によってオブジェクトを指定する通常のメンバ関数呼び出し
+				Type varType;
+				GetVarType( ObjectName, varType, false );
+				pobj_c = &varType.GetClass();
+				if( NATURAL_TYPE( varType.GetBasicType() ) != DEF_OBJECT ){
+					pobj_c=pobj_DBClass->Find(ObjectName);
+					if( pobj_c ){
+						isStatic = true;
+					}
+					else{
+						SetError(300,NULL,cp);
+					}
+				}
+			}
+		}
+		else{
+			if(dwFlags&PROCFLAG_NEW){
+				//New演算子によるコンストラクタ呼び出し
+				pobj_c=pUserProc->GetParentClassPtr();
+			}
+			else{
+				//クラスメンバ関数内から同一クラスのメンバ関数の呼び出し
+				pobj_c=pobj_CompilingClass;
+			}
+		}
+
+
+		/////////////////////////////////
+		// メソッド情報を取得
+		/////////////////////////////////
+		pMethod = NULL;
+		if( ! isStatic ) pMethod = pobj_c->GetMethods().GetMethodPtr( pUserProc );
+		if( ! pMethod ){
+			//動的メソッドが取得できなかったときは静的メソッドを当たる
+			pMethod = pobj_c->GetStaticMethods().GetMethodPtr( pUserProc );
+			if( !pMethod ){
+				SetError(300,NULL,cp);
+				return false;
+			}
+
+			//静的メンバ
+			isStatic = true;
+		}
+
+
+		//////////////////////////////
+		// アクセスエラーチェック
+		//////////////////////////////
+
+		if(ObjectName[0]){
+			//外部からの呼び出し
+			if(pobj_c==pobj_CompilingClass){
+				//同一クラスオブジェクトの場合はプライベートアクセスを容認する
+				if( pMethod->IsNoneAccess() ){
+					SetError(109,pUserProc->GetName(),cp);
+					return false;
+				}
+			}
+			else{
+				if( pMethod->IsPrivate()
+					|| pMethod->IsNoneAccess() ){
+					SetError(109,pUserProc->GetName(),cp);
+					return false;
+				}
+				if( pMethod->IsProtected() ){
+					SetError(110,pUserProc->GetName(),cp);
+					return false;
+				}
+			}
+		}
+		else{
+			//クラス内部からの呼び出し（継承によるACCESS_NONのみをエラーとする）
+			if( pMethod->IsNoneAccess() ){
+				SetError(109,pUserProc->GetName(),cp);
+				return false;
+			}
+		}
+	}
+
+
+	///////////////////////////////////////////////////////////////
+	// _System_LocalThisのダミーをセット
+	///////////////////////////////////////////////////////////////
+
+	char temporary[VN_SIZE]={0};
+	if( pUserProc->GetParentClassPtr() && isStatic == false ){
+		//_System_LocalThis（第一パラメータ）のダミーを作成
+		lstrcpy(temporary,"0,");
+	}
+
+	if(Parameter[0]=='\0'&&temporary[0])
+		temporary[lstrlen(temporary)-1]=0;
+	else lstrcat(temporary,Parameter);
+
+
+	////////////////////////
+	// パラメータをセット
+	////////////////////////
+
+	//パラメータオブジェクトを生成
+	ParamImpl *pobj_parameter=0;
+	pobj_parameter=new ParamImpl(temporary);
+
+	// デフォルト引数を適用
+	pobj_parameter->ApplyDefaultParameters( pUserProc->RealParams() );
+
+	//エラーチェック
+	if( !pobj_parameter->ErrorCheck(pUserProc->GetName(),pUserProc->RealParams(),pUserProc->GetSecondParmNum() ) ){
+		//パラメータにエラーがあるときは処理を終える
+		return false;
+	}
+
+	if(pUserProc->IsMacro()){
+		//マクロ関数の場合は、パラメータ省略を考慮する
+		pobj_parameter->MacroParameterSupport( pUserProc->RealParams() );
+	}
+
+	//一時オブジェクトを生成
+	int tempSize = pobj_parameter->NewTempParameters( pUserProc->GetName(),pUserProc->RealParams(),pUserProc->GetRealSecondParmNum() );
+
+	//レジスタ、スタックフレームにセット
+	int ParmSize = pobj_parameter->SetParameter(pUserProc->GetName(),pUserProc->RealParams(),pUserProc->GetRealSecondParmNum() );
+
+	if(pUserProc->ReturnType().IsStruct() ){
+		//////////////////////////////////////////////////////
+		// 戻り値に構造体インスタンスを持つ場合
+		// ※ByRef _System_ReturnValue パラメータをセット
+		//////////////////////////////////////////////////////
+
+		int object_size = pUserProc->ReturnType().GetClass().GetSize();
+
+		//push object_size
+		op_push_V(object_size);
+
+		//call calloc
+		extern UserProc *pSub_calloc;
+		op_call(pSub_calloc);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+
+
+	if( pUserProc->GetParentClassPtr() && isStatic == false ){
+		//////////////////////////////////////////////////////
+		// メンバ関数の場合
+		// ※_System_LocalThis パラメータをセット
+		//////////////////////////////////////////////////////
+
+		if(ObjectName[0] && (dwFlags&PROCFLAG_NEW)==0){
+			if(lstrcmpi(ObjectName,"Super")==0) goto InClassMember;
+			else{
+				RELATIVE_VAR RelativeVar;
+				if( pMethod->IsConst() ){
+					//Constアクセスが可能なメソッドの場合
+					if( !GetVarOffsetReadOnly( ObjectName, &RelativeVar, Type() ) ){
+						return false;
+					}
+				}
+				else{
+					//Constアクセスが不可能なメソッドの場合
+					if( !GetVarOffsetReadWrite( ObjectName, &RelativeVar, Type() ) ){
+						return false;
+					}
+				}
+
+				SetVarPtrToEax(&RelativeVar);
+
+				// 参照を実体ポインタにする
+				op_mov_RM( sizeof(long), REG_ECX, REG_EAX, 0, MOD_BASE );
+			}
+		}
+		else{
+InClassMember:
+			if(dwFlags&PROCFLAG_NEW){
+				//New演算子によるコンストラクタ呼び出しの場合
+
+				//mov ecx,dword ptr[esp+ParmSize]
+				op_mov_RM( sizeof(long), REG_ECX, REG_ESP, ParmSize + tempSize, MOD_BASE_DISP32 );
+			}
+			else{
+				//Thisポインタをecxにコピー
+				SetThisPtrToReg(REG_ECX);
+			}
+		}
+
+		//push ecx
+		op_push(REG_ECX);
+	}
+
+	if( pUserProc->IsVirtual() ){
+		//仮想関数（オブジェクトメソッド）呼び出し
+		//pObj->func_table->func1
+		//                ->func2
+		//                ->func3
+
+		//mov edx,dword ptr[ecx]
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x11;
+
+		i2 = pobj_c->GetFuncNumInVtbl( pUserProc );
+
+		//call dword ptr[edx+func_index]
+		if(i2*PTR_SIZE<=0x7F){
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0x52;
+			OpBuffer[obp++]=(char)(i2*PTR_SIZE);
+		}
+		else{
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0x92;
+			*((long *)(OpBuffer+obp))=i2*PTR_SIZE;
+			obp+=sizeof(long);
+		}
+	}
+	else{
+		//通常呼び出し
+
+		//call ProcAddr
+		op_call(pUserProc);
+	}
+
+	if(pUserProc->IsCdecl()){
+		//add esp,ParmSize
+		op_add_esp(ParmSize);
+	}
+
+	//一時オブジェクトを破棄
+	pobj_parameter->DeleteTempParameters();
+
+	//パラメータオブジェクトを破棄
+	delete pobj_parameter;
+
+	return true;
+}
+
+bool Opcode_CallDllProc( const char *lpszParms, DllProc *pDllProc ){
+
+	extern BOOL bDebugCompile;
+	extern BOOL bDebugSupportProc;
+	if(bDebugCompile&&bDebugSupportProc==0&& pDllProc->IsEqualSymbol( "DebugBreak" ) ){
+		Call_DebugSys_SaveContext();
+	}
+
+
+	////////////////////////
+	// パラメータのセット
+	////////////////////////
+
+	//パラメータオブジェクトを生成
+	ParamImpl *pobj_parameter=0;
+	pobj_parameter=new ParamImpl(lpszParms);
+
+	// デフォルト引数を適用
+	pobj_parameter->ApplyDefaultParameters( pDllProc->Params() );
+
+	//エラーチェック
+	if( !pobj_parameter->ErrorCheck( pDllProc->GetName(), pDllProc->Params() ) ){
+		//パラメータにエラーがあるときは処理を終える
+		return false;
+	}
+
+	//一時オブジェクトを生成
+	pobj_parameter->NewTempParameters( pDllProc->GetName(), pDllProc->Params() );
+
+	//レジスタ、スタックフレームにセット
+	int ParmSize = pobj_parameter->SetParameter(pDllProc->GetName(), pDllProc->Params() );
+
+
+	//動的リンクされたプロシージャの呼び出し
+
+	//call dword ptr[LookupTable]
+	pDllProc->Using();
+	OpBuffer[obp++]=(char)0xFF;
+	OpBuffer[obp++]=(char)0x15;
+	pobj_ImportAddrSchedule->add(pDllProc);
+	obp+=sizeof(long);
+
+	if(pDllProc->IsCdecl()){
+		//add esp,ParmSize
+		op_add_esp(ParmSize);
+	}
+
+	//一時オブジェクトを破棄
+	pobj_parameter->DeleteTempParameters();
+
+	//パラメータオブジェクトを破棄
+	delete pobj_parameter;
+
+	return true;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/Compile_Func.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/Compile_Func.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/Compile_Func.cpp	(revision 178)
@@ -0,0 +1,520 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+int GetFunctionFromName(char *FuncName){
+	if(lstrcmpi(FuncName,"CUDbl")==0)		return FUNC_CUDBL;
+	if(lstrcmpi(FuncName,"Fix")==0)			return FUNC_FIX;
+	if(lstrcmpi(FuncName,"Len")==0)			return FUNC_LEN;
+	if(lstrcmpi(FuncName,"AddressOf")==0)	return FUNC_ADDRESSOF;
+	if(lstrcmpi(FuncName,"SizeOf")==0)		return FUNC_SIZEOF;
+	if(lstrcmpi(FuncName,"VarPtr")==0)		return FUNC_VARPTR;
+	if(lstrcmpi(FuncName,"ObjPtr")==0)		return FUNC_OBJPTR;
+	if(lstrcmpi(FuncName,"GetDouble")==0)	return FUNC_GETDOUBLE;
+	if(lstrcmpi(FuncName,"GetSingle")==0)	return FUNC_GETSINGLE;
+	if(lstrcmpi(FuncName,"GetQWord")==0)	return FUNC_GETQWORD;
+	if(lstrcmpi(FuncName,"GetDWord")==0)	return FUNC_GETDWORD;
+	if(lstrcmpi(FuncName,"GetWord")==0)		return FUNC_GETWORD;
+	if(lstrcmpi(FuncName,"GetByte")==0)		return FUNC_GETBYTE;
+	return 0;
+}
+
+void Opcode_Func_Fix(const char *lpszParms){
+	Type resultType;
+	if( !NumOpe( lpszParms, Type(), resultType ) ){
+		return;
+	}
+
+	if( resultType.IsDouble() ){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//fnstcw word ptr[esp]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x3C;
+		OpBuffer[obp++]=(char)0x24;
+
+		//mov ax,word ptr[esp]
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+
+		//or ah,0Ch
+		OpBuffer[obp++]=(char)0x80;
+		OpBuffer[obp++]=(char)0xCC;
+		OpBuffer[obp++]=(char)0x0C;
+
+		//mov word ptr[esp-2],ax
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x44;
+		OpBuffer[obp++]=(char)0x24;
+		OpBuffer[obp++]=(char)0xFE;
+
+		//fldcw word ptr[esp-2]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x6C;
+		OpBuffer[obp++]=(char)0x24;
+		OpBuffer[obp++]=(char)0xFE;
+
+		//fistp dword ptr[esp+4]
+		OpBuffer[obp++]=(char)0xDB;
+		OpBuffer[obp++]=(char)0x5C;
+		OpBuffer[obp++]=(char)0x24;
+		OpBuffer[obp++]=(char)0x04;
+
+		//fldcw word ptr[esp]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x2C;
+		OpBuffer[obp++]=(char)0x24;
+
+		//add esp,4
+		op_add_esp(4);
+	}
+	else if( resultType.IsSingle() ){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//fnstcw word ptr[esp]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x3C;
+		OpBuffer[obp++]=(char)0x24;
+
+		//mov ax,word ptr[esp]
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+
+		//or ah,0Ch
+		OpBuffer[obp++]=(char)0x80;
+		OpBuffer[obp++]=(char)0xCC;
+		OpBuffer[obp++]=(char)0x0C;
+
+		//mov word ptr[esp-2],ax
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x44;
+		OpBuffer[obp++]=(char)0x24;
+		OpBuffer[obp++]=(char)0xFE;
+
+		//fldcw word ptr[esp-2]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x6C;
+		OpBuffer[obp++]=(char)0x24;
+		OpBuffer[obp++]=(char)0xFE;
+
+		//fistp dword ptr[esp+4]
+		OpBuffer[obp++]=(char)0xDB;
+		OpBuffer[obp++]=(char)0x5C;
+		OpBuffer[obp++]=(char)0x24;
+		OpBuffer[obp++]=(char)0x04;
+
+		//fldcw word ptr[esp]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x2C;
+		OpBuffer[obp++]=(char)0x24;
+
+		//add esp,4
+		op_add_esp(4);
+	}
+	else if( resultType.Is64() ){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//add esp,4
+		op_add_esp(4);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+
+	//pop eax
+	op_pop(REG_EAX);
+}
+
+void Opcode_Func_CUDbl(const char *Parameter){
+	Type resultType;
+	if( !NumOpe(Parameter,Type(),resultType) ){
+		return;
+	}
+	ChangeTypeToLong(resultType.GetBasicType());
+
+	//pop eax
+	op_pop(REG_EAX);
+
+	//push 0
+	OpBuffer[obp++]=(char)0x6A;
+	OpBuffer[obp++]=(char)0x00;
+
+	//push eax
+	op_push(REG_EAX);
+
+	//fild qword ptr[esp]
+	OpBuffer[obp++]=(char)0xDF;
+	OpBuffer[obp++]=(char)0x2C;
+	OpBuffer[obp++]=(char)0x24;
+
+	//add esp,8
+	op_add_esp(8);
+}
+void Opcode_Func_Len(const char *Parameter){
+	BOOL bArrayHead;
+
+	const char *tempParm=Parameter;
+	char temporary[VN_SIZE];
+	char temp2[32];
+	Type type;
+	if( !GetVarType(Parameter,type,0) ){
+		sprintf(temporary,"_System_DummyStr2=%s",Parameter);
+		OpcodeCalc(temporary);
+
+		lstrcpy(temp2,"_System_DummyStr2");
+		tempParm=temp2;
+
+		type.SetType( DEF_OBJECT, pobj_DBClass->GetStringClassPtr() );
+	}
+
+	if( type.IsStringClass() ){
+		//Stringオブジェクトの場合
+		sprintf(temporary,"%s.Length",tempParm);
+
+		int reg=REG_RAX;
+		NumOpe(temporary,Type(),Type());
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		return;
+	}
+
+	int SubScripts[MAX_ARRAYDIM];
+	RELATIVE_VAR RelativeVar;
+	if(!GetVarOffsetReadOnly(tempParm,&RelativeVar,type,SubScripts)) return;
+
+	if(type.GetBasicType()&FLAG_PTR){
+		type.SetBasicType( type.GetBasicType() & ( ~FLAG_PTR ) );
+
+		bArrayHead=1;
+	}
+	else bArrayHead=0;
+
+	int typeSize = type.GetSize();
+
+	if(bArrayHead) typeSize*=JumpSubScripts(SubScripts);
+
+	//mov eax,TypeSize
+	OpBuffer[obp++]=(char)0xB8;
+	*((long *)(OpBuffer+obp))=typeSize;
+	obp+=sizeof(long);
+}
+void Opcode_Func_AddressOf( const char *name ){
+	extern int cp;
+	UserProc *pUserProc;
+
+	extern LONG_PTR ProcPtr_BaseIndex;
+	if(ProcPtr_BaseIndex!=-1){
+		//左辺の型にのっとり、オーバーロードを解決
+
+		std::vector<UserProc *> subs;
+		GetOverloadSubHash( name, subs );
+		if( subs.size() == 0 ){
+			SetError(27,name,cp);
+			return;
+		}
+
+		//オーバーロードを解決
+		pUserProc=OverloadSolution(name,subs,Smoothie::meta.procPointers[ProcPtr_BaseIndex]->Params(), Type() );
+
+		if(!pUserProc){
+			SetError(27,name,cp);
+			return;
+		}
+	}
+	else{
+		pUserProc=GetSubHash(name);
+		if(!pUserProc){
+			SetError(27,name,cp);
+			return;
+		}
+	}
+
+	if( pUserProc->IsVirtual() ){
+		///////////////////////////////
+		// 仮想関数の場合
+		// thisポインタをrcxにコピー
+		///////////////////////////////
+
+		const CClass *pobj_c;
+
+		char ObjectName[VN_SIZE];
+		int RefType;
+		SplitObjectName(name,ObjectName,&RefType);
+
+		if(ObjectName[0]){
+			if(lstrcmpi(ObjectName,"Super")==0) goto InClassMember;
+			else{
+				RELATIVE_VAR RelativeVar;
+				Type type;
+				if(!GetVarOffsetReadOnly(ObjectName,&RelativeVar,type)) return;
+				SetVarPtrToEax(&RelativeVar);
+
+				//mov ecx,eax
+				op_mov_RR(REG_ECX,REG_EAX);
+
+				//参照タイプが整合しているかをチェック
+				if(type.GetBasicType()!=RefType) SetError(104,ObjectName,cp);
+
+				if(type.IsObjectPtr()){
+					//mov ecx,dword ptr[ecx]
+					op_mov_RM(sizeof(long),REG_ECX,REG_ECX,0,MOD_BASE);
+				}
+			}
+		}
+		else{
+InClassMember:
+			//自身のオブジェクトのThisポインタをrcxにコピー
+			SetThisPtrToReg(REG_RCX);
+
+			pobj_c=pobj_CompilingClass;
+		}
+
+
+		//仮想関数（オブジェクトメソッド）
+		//pObj->func_table->func1
+		//                ->func2
+		//                ->func3
+
+		//mov edx,dword ptr[ecx]
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x11;
+
+		int i2 = pobj_c->GetFuncNumInVtbl( pUserProc );
+
+		//mov eax,dword ptr[edx+func_index]
+		if(i2*PTR_SIZE<=0x7F){
+			op_mov_RM(sizeof(long),REG_EAX,REG_EDX,i2*PTR_SIZE,MOD_BASE_DISP8);
+		}
+		else{
+			op_mov_RM(sizeof(long),REG_EAX,REG_EDX,i2*PTR_SIZE,MOD_BASE_DISP32);
+		}
+	}
+	else{
+		//一般の関数
+
+		//mov eax,ProcAddr
+		OpBuffer[obp++]=(char)0xB8;
+		pobj_SubAddrSchedule->add(pUserProc,0);
+		obp+=sizeof(long);
+	}
+
+	pUserProc->Using();
+}
+void Opcode_Func_SizeOf( const string &typeName ){
+	Type tempType;
+	if( !Type::StringToType( typeName, tempType ) ){
+		SetError(3,typeName,cp);
+		return;
+	}
+
+	int typeSize = ( tempType.IsObject() ) ?
+		tempType.GetClass().GetSize() : tempType.GetSize();
+
+	//mov eax,size
+	op_mov_RV( REG_EAX, typeSize );
+}
+void Opcode_Func_VarPtr( const char *Parameter, Type &resultType, bool isCallOn ){
+	if( isCallOn == false ){
+		// 戻り値の型を取得するだけ
+
+		//変数のアドレスを取得
+		if(!GetVarType( Parameter, resultType, true )) return;
+
+		resultType.PtrLevelUp();
+
+		return;
+	}
+
+	RELATIVE_VAR RelativeVar;
+
+	//変数のアドレスを取得
+	if(!GetVarOffsetReadOnly( Parameter, &RelativeVar, resultType )) return;
+
+	int beforeType = resultType.GetBasicType();
+
+	resultType.PtrLevelUp();
+
+	SetVarPtrToEax(&RelativeVar);
+
+	// TODO: 取り除く（この動きはObjPtrに託す）
+	/*
+	if( beforeType == DEF_OBJECT && lstrcmpi( Parameter, "This" ) != 0 ){
+		//参照をオブジェクトポインタに変更
+
+		//mov eax,dword ptr[eax]
+		op_mov_RM( sizeof(long), REG_EAX, REG_EAX, 0, MOD_BASE );
+
+		SetError(-120,NULL,cp);
+	}*/
+}
+void Opcode_Func_ObjPtr( const char *Parameter, Type &resultType, bool isCallOn ){
+	if( isCallOn == false ){
+		// 戻り値の型を取得するだけ
+
+		//変数のアドレスを取得
+		if(!GetVarType( Parameter, resultType, true )) return;
+
+		resultType.PtrLevelUp();
+
+		return;
+	}
+
+	RELATIVE_VAR RelativeVar;
+
+	//変数のアドレスを取得
+	if(!GetVarOffsetReadOnly( Parameter, &RelativeVar, resultType )) return;
+
+	int beforeType = resultType.GetBasicType();
+
+	resultType.PtrLevelUp();
+
+	SetVarPtrToEax(&RelativeVar);
+
+	if( lstrcmpi( Parameter, "This" )==0 ){
+		// Thisの場合は特別にオブジェクトポインタが返ってくるので、何もせずに抜ける
+	}
+	else if( beforeType == DEF_OBJECT ){
+		//参照をオブジェクトポインタに変更
+
+		//mov eax,dword ptr[eax]
+		op_mov_RM( sizeof(long), REG_EAX, REG_EAX, 0, MOD_BASE );
+	}
+	else{
+		SetError(134,NULL,cp );
+	}
+}
+void Opcode_Func_GetPtrData(const char *Parameter,const int type){
+	Type tempType;
+	if( !NumOpe(Parameter,Type(),tempType) ){
+		return;
+	}
+	if(!tempType.IsWhole()){
+		SetError(11,Parameter,cp);
+		return;
+	}
+	ChangeTypeToLong(tempType.GetBasicType());
+
+	if(type==DEF_DOUBLE){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//fld qword ptr[eax]
+		OpBuffer[obp++]=(char)0xDD;
+		OpBuffer[obp++]=(char)0x00;
+	}
+	else if(type==DEF_SINGLE||type==DEF_DWORD){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//mov eax,dword ptr[eax]
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x00;
+	}
+	else if(type==DEF_QWORD){
+		//pop ecx
+		op_pop(REG_ECX);
+
+		//mov eax,dword ptr[ecx]
+		op_mov_RM(sizeof(long),REG_EAX,REG_ECX,0,MOD_BASE);
+
+		//mov edx,dword ptr[ecx+sizeof(long)]
+		op_mov_RM(sizeof(long),REG_EDX,REG_ECX,sizeof(long),MOD_BASE_DISP8);
+	}
+	else if(type==DEF_WORD){
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//xor eax,eax
+		OpBuffer[obp++]=(char)0x33;
+		OpBuffer[obp++]=(char)0xC0;
+
+		//mov ax,word ptr[ebx]
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x03;
+	}
+	else if(type==DEF_BYTE){
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//xor eax,eax
+		OpBuffer[obp++]=(char)0x33;
+		OpBuffer[obp++]=(char)0xC0;
+
+		//mov al,byte ptr[ebx]
+		OpBuffer[obp++]=(char)0x8A;
+		OpBuffer[obp++]=(char)0x03;
+	}
+}
+
+bool Opcode_CallFunc( const char *Parameter, const int FuncNum, Type &resultType, bool isCallOn ){
+	switch(FuncNum){
+		case FUNC_FIX:
+			if( isCallOn ) Opcode_Func_Fix(Parameter);
+			resultType.SetBasicType( DEF_LONG );
+			break;
+		case FUNC_CUDBL:
+			if( isCallOn ) Opcode_Func_CUDbl(Parameter);
+			resultType.SetBasicType( DEF_DOUBLE );
+			break;
+		case FUNC_LEN:
+			if( isCallOn ) Opcode_Func_Len(Parameter);
+			resultType.SetBasicType( DEF_LONG );
+			break;
+		case FUNC_ADDRESSOF:
+			if( isCallOn ) Opcode_Func_AddressOf(Parameter);
+			resultType.SetBasicType( DEF_PTR_VOID );
+			break;
+		case FUNC_SIZEOF:
+			if( isCallOn ) Opcode_Func_SizeOf(Parameter);
+			resultType.SetBasicType( DEF_LONG );
+			break;
+		case FUNC_VARPTR:
+			Opcode_Func_VarPtr( Parameter, resultType, isCallOn );
+			break;
+		case FUNC_OBJPTR:
+			Opcode_Func_ObjPtr( Parameter, resultType, isCallOn );
+			break;
+
+		case FUNC_GETDOUBLE:
+			if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_DOUBLE);
+			resultType.SetBasicType( DEF_DOUBLE );
+			break;
+		case FUNC_GETSINGLE:
+			if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_SINGLE);
+			resultType.SetBasicType( DEF_SINGLE );
+			break;
+		case FUNC_GETQWORD:
+			if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_QWORD);
+			resultType.SetBasicType( DEF_QWORD );
+			break;
+		case FUNC_GETDWORD:
+			if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_DWORD);
+			resultType.SetBasicType( DEF_DWORD );
+			break;
+		case FUNC_GETWORD:
+			if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_WORD);
+			resultType.SetBasicType( DEF_WORD );
+			break;
+		case FUNC_GETBYTE:
+			if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_BYTE);
+			resultType.SetBasicType( DEF_BYTE );
+			break;
+		default:
+			return false;
+	}
+	return true;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/Compile_Object.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/Compile_Object.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/Compile_Object.cpp	(revision 178)
@@ -0,0 +1,361 @@
+#include "../BasicCompiler_Common/common.h"
+#include "opcode.h"
+
+void _call_constructor( const CClass *pobj_c, const char *CreateParameter,int ObjectSize,BOOL bSomeObjects){
+	////////////////////////////
+	// コンストラクタの呼び出し
+	////////////////////////////
+	
+	//この関数を使用する場合は、
+	//・ebxにオブジェクトの個数
+	//・eaxに先頭ポインタ
+	//をセットしておかなければならない
+
+	int jnz_back;
+
+
+	//jnzの番地
+	jnz_back=obp;
+
+	if(bSomeObjects){
+		SetError();
+
+		//push ebx
+		op_push(REG_EBX);
+	}
+
+	// ※ここでプッシュされた値はコンストラクタのthisポインタとなる
+	//push eax
+	op_push(REG_EAX);
+
+
+
+	////////////////////////
+	// オーバーロードを解決
+	////////////////////////
+
+	std::vector<UserProc *> subs;
+	pobj_c->GetMethods().Enum( pobj_c->GetName().c_str(), subs );
+
+	UserProc *pUserProc;
+	if( subs.size() > 0 ){
+		//オーバーロードを解決
+		pUserProc=OverloadSolutionWithStrParam(pobj_c->GetName().c_str(),
+			subs,CreateParameter,"");
+
+		if(!pUserProc) return;
+	}
+
+	//コンストラクタを呼び出す
+	Opcode_CallProc(CreateParameter,
+		pUserProc,
+		PROCFLAG_NEW,"",0);
+
+	{
+		// 動的型情報をセットする
+		// obj._System_SetType( _System_TypeBase.Search( strNamespace, name ) )
+		subs.clear();
+		pobj_c->GetMethods().Enum( "_System_SetType", subs );
+		if( subs.size() == 1 ){
+			char temporary[VN_SIZE];
+			sprintf( temporary, "ActiveBasic.Core._System_TypeBase.Search(\"\",\"%s\"))", pobj_c->GetName().c_str() );
+
+			Opcode_CallProc(temporary,
+				subs[0],
+				PROCFLAG_NEW,"",0);
+		}
+		else{
+			SetError();
+		}
+	}
+
+
+
+	//pop eax
+	op_pop(REG_EAX);
+
+	if(bSomeObjects){
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//add eax,TypeSize
+		OpBuffer[obp++]=(char)0x05;
+		*((long *)(OpBuffer+obp))=ObjectSize;
+		obp+=sizeof(long);
+
+		//sub ebx,1
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xEB;
+		OpBuffer[obp++]=(char)0x01;
+
+		//jnz ↑
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x85;
+		*((long *)(OpBuffer+obp))=jnz_back-(obp+sizeof(long));
+		obp+=sizeof(long);
+	}
+}
+void Operator_New( const CClass &classObj, const char *objectSizeStr, const char *parameter, const Type &baseType ){
+	int typeSize = classObj.GetSize();
+
+	if(classObj.IsAbstract()){
+		//抽象クラスだったとき
+		SetError(125,classObj.GetName(),cp);
+	}
+
+	BOOL bSomeObjects=0;
+	if(objectSizeStr[0]){
+		bSomeObjects=1;
+
+		Type tempType;
+		NumOpe(objectSizeStr,Type(),tempType);
+		if( !tempType.IsWhole() ) SetError(49,NULL,cp);
+		ChangeTypeToLong(tempType.GetBasicType());
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//※添え字上限値であることを考慮
+		//add eax,1
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xC0;
+		OpBuffer[obp++]=(char)0x01;
+
+		//オブジェクトの個数をebxに一時保持
+		//※ebxは関数が呼ばれても不変
+		//mov ebx,eax
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0xD8;
+
+		//imul eax,size
+		OpBuffer[obp++]=(char)0x69;
+		OpBuffer[obp++]=(char)0xC0;
+		*((long *)(OpBuffer+obp))=typeSize;
+		obp+=sizeof(long);
+
+		//add eax,OBJECT_HEAD_SIZE
+		OpBuffer[obp++]=(char)0x05;
+		*((long *)(OpBuffer+obp))=OBJECT_HEAD_SIZE;
+		obp+=sizeof(long);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else{
+		//オブジェクトの個数をebxに一時保持
+		//※ebxは関数が呼ばれても不変
+		//mov ebx,1
+		OpBuffer[obp++]=(char)0xBB;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//push size + OBJECT_HEAD_SIZE
+		OpBuffer[obp++]=(char)0x68;
+		*((long *)(OpBuffer+obp))=typeSize + OBJECT_HEAD_SIZE;
+		obp+=sizeof(long);
+	}
+
+	if( baseType.IsObject() ){
+		// オブジェクト インスタンス
+		// ※DeleteはGCで処理
+
+		//call _System_GC_malloc_ForObject
+		extern UserProc *pSub_System_GC_malloc_ForObject;
+		op_call(pSub_System_GC_malloc_ForObject);
+	}
+	else{
+		// オブジェクトポインタ
+		// ※明示的なDeleteが必要
+
+		//call _System_GC_malloc_ForObjectPtr
+		extern UserProc *pSub_System_GC_malloc_ForObjectPtr;
+		op_call(pSub_System_GC_malloc_ForObjectPtr);
+	}
+
+
+	/*
+	確保されたヒープ領域のポインタ（callocの戻り値eax）をpPtrとすると、
+	pPtr[0]=オブジェクトの個数
+	pPtr[1]=オブジェクトのサイズ
+	pPtr[2]=デストラクタの関数ポインタ
+	pPtr[3]=reserve
+	*/
+
+
+	//mov dword ptr[eax],ebx（オブジェクトの個数）
+	OpBuffer[obp++]=(char)0x89;
+	OpBuffer[obp++]=(char)0x18;
+
+	//add eax,sizeof(DWORD)
+	OpBuffer[obp++]=(char)0x05;
+	*((long *)(OpBuffer+obp))=sizeof(DWORD);
+	obp+=sizeof(long);
+
+
+	//mov ecx,TypeSize
+	OpBuffer[obp++]=(char)0xB9;
+	*((long *)(OpBuffer+obp))=typeSize;
+	obp+=sizeof(long);
+
+	//mov dword ptr[eax],ecx（オブジェクトのサイズ）
+	OpBuffer[obp++]=(char)0x89;
+	OpBuffer[obp++]=(char)0x08;
+
+	//add eax,sizeof(DWORD)
+	OpBuffer[obp++]=(char)0x05;
+	*((long *)(OpBuffer+obp))=sizeof(DWORD);
+	obp+=sizeof(long);
+
+
+	const CMethod *method = classObj.GetDestructorMethod();
+	if( method == NULL ) return;
+
+	//mov ecx,DestructorProcAddr
+	OpBuffer[obp++]=(char)0xB9;
+	pobj_SubAddrSchedule->add(method->pUserProc,0);
+	method->pUserProc->Using();
+	obp+=sizeof(long);
+
+	//mov dword ptr[eax],ecx（デストラクタの関数ポインタ）
+	OpBuffer[obp++]=(char)0x89;
+	OpBuffer[obp++]=(char)0x08;
+
+	//add eax,sizeof(DWORD)
+	OpBuffer[obp++]=(char)0x05;
+	*((long *)(OpBuffer+obp))=sizeof(DWORD);
+	obp+=sizeof(long);
+
+
+	// リザーブ領域
+	//add eax,sizeof(DWORD)
+	OpBuffer[obp++]=(char)0x05;
+	*((long *)(OpBuffer+obp))=sizeof(DWORD);
+	obp+=sizeof(long);
+
+
+	// ※ここでプッシュされた値はNew演算子の戻り値となる
+	//push eax
+	op_push(REG_EAX);
+
+
+	/////////////////////////////////////////////////////////////////////
+
+	////////////////////////////
+	// コンストラクタの呼び出し
+	////////////////////////////
+
+	_call_constructor(&classObj,parameter,typeSize,bSomeObjects);
+}
+void OpcodeDelete(const char *Parameter, bool isSweeping){
+	Type tempType;
+	if( !NumOpe(Parameter,Type(),tempType) ){
+		return;
+	}
+	if(!( tempType.IsObjectPtr() || tempType.IsVoidPtr() )) SetError(122,NULL,cp);
+
+	//pop eax
+	op_pop(REG_EAX);
+
+	//sub eax,sizeof(DWORD)*3
+	op_sub_RV8( REG_EAX, OBJECT_HEAD_SIZE );
+
+	//push eax
+	op_push(REG_EAX);
+
+
+	//mov ebx,dword ptr[eax]（オブジェクトの個数）
+	OpBuffer[obp++]=(char)0x8B;
+	OpBuffer[obp++]=(char)0x18;
+
+	//add eax,sizeof(DWORD)
+	OpBuffer[obp++]=(char)0x05;
+	*((long *)(OpBuffer+obp))=sizeof(DWORD);
+	obp+=sizeof(long);
+
+
+	//mov esi,dword ptr[eax]（オブジェクトのサイズ）
+	OpBuffer[obp++]=(char)0x8B;
+	OpBuffer[obp++]=(char)0x30;
+
+	//add eax,sizeof(DWORD)
+	OpBuffer[obp++]=(char)0x05;
+	*((long *)(OpBuffer+obp))=sizeof(DWORD);
+	obp+=sizeof(long);
+
+
+	//mov edx,dword ptr[eax]（デストラクタの関数ポインタ）
+	OpBuffer[obp++]=(char)0x8B;
+	OpBuffer[obp++]=(char)0x10;
+
+	//add eax,sizeof(DWORD)
+	OpBuffer[obp++]=(char)0x05;
+	*((long *)(OpBuffer+obp))=sizeof(DWORD);
+	obp+=sizeof(long);
+
+
+	// リザーブ領域
+	//add eax,sizeof(DWORD)
+	OpBuffer[obp++]=(char)0x05;
+	*((long *)(OpBuffer+obp))=sizeof(DWORD);
+	obp+=sizeof(long);
+
+
+	//mov ecx,eax
+	OpBuffer[obp++]=(char)0x8B;
+	OpBuffer[obp++]=(char)0xC8;
+
+
+	//jnzの番地
+	int jnz_back;
+	jnz_back=obp;
+
+	//push ecx
+	op_push(REG_ECX);
+
+	//push edx
+	op_push(REG_EDX);
+
+	//push ecx（Thisポインタ   ※隠れた第一パラメータ）
+	op_push(REG_ECX);
+
+	//call edx
+	OpBuffer[obp++]=(char)0xFF;
+	OpBuffer[obp++]=(char)0xD2;
+
+	//pop edx
+	op_pop(REG_EDX);
+
+	//pop ecx
+	op_pop(REG_ECX);
+
+	//add ecx,esi
+	OpBuffer[obp++]=(char)0x03;
+	OpBuffer[obp++]=(char)0xCE;
+
+	//sub ebx,1
+	OpBuffer[obp++]=(char)0x83;
+	OpBuffer[obp++]=(char)0xEB;
+	OpBuffer[obp++]=(char)0x01;
+
+	//jnz ↑
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x85;
+	*((long *)(OpBuffer+obp))=jnz_back-(obp+sizeof(long));
+	obp+=sizeof(long);
+
+
+	//////////////////////////////////////////
+	// オブジェクトメンバ変数用のメモリを解放
+	//////////////////////////////////////////
+
+	if( isSweeping ){
+		//call _System_GC_free_for_SweepingDelete
+		extern UserProc *pSub_System_GC_free_for_SweepingDelete;
+		op_call(pSub_System_GC_free_for_SweepingDelete);
+	}
+	else{
+		//call free
+		extern UserProc *pSub_free;
+		op_call(pSub_free);
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/Compile_ProcOp.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/Compile_ProcOp.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/Compile_ProcOp.cpp	(revision 178)
@@ -0,0 +1,882 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+
+void SystemProc( const UserProc &userProc ){
+	if( userProc.GetName() == "_System_GetEip" ){
+		//mov eax,dword ptr[esp]
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+
+		//ret
+		op_ret();
+	}
+	else if( userProc.GetName() == "_System_InitDllGlobalVariables" ){
+		////////////////////////////////////////
+		// DLLのグローバル領域をコンパイル
+		////////////////////////////////////////
+
+		extern BOOL bDll;
+		if(!bDll){
+			//ret
+			op_ret();
+
+			return;
+		}
+
+		UserProc *pBackUserProc;
+		pBackUserProc = &UserProc::CompilingUserProc();
+		UserProc::CompileStartForGlobalArea();
+
+		int BackCp;
+		BackCp=cp;
+		cp=-1;
+
+		extern BOOL bDebugCompile;
+		if(bDebugCompile){
+			//デバッグ用の変数を定義
+			DebugVariable();
+		}
+
+		//GC用の変数を定義
+		InitGCVariables();
+
+		//_System_StartupProgramの呼び出し
+		extern UserProc *pSub_System_StartupProgram;
+		op_call(pSub_System_StartupProgram);
+
+		//クラスに属する静的メンバを定義
+		CMember::InitStaticMember();
+
+		GetGlobalDataForDll();
+
+		UserProc::CompileStartForUserProc( pBackUserProc );
+		cp=BackCp;
+
+		//ret
+		op_ret();
+	}
+	else if( userProc.GetName() == "_System_InitStaticLocalVariables" ){
+		//静的ローカルオブジェクトのコンストラクタ呼び出し
+
+		foreach( Variable *pVar, globalVars ){
+			if(memicmp(pVar->GetName().c_str(),"Static%",7)==0){
+				//コンストラクタ呼び出し
+				if( pVar->IsObject() ){
+
+					//エラー用
+					cp=pVar->source_code_address;
+
+					CallConstructor(
+						pVar->GetName().c_str(),
+						pVar->GetSubScriptsPtr(),
+						*pVar,
+						pVar->paramStrForConstructor.c_str());
+				}
+			}
+		}
+
+		//ret
+		op_ret();
+	}
+	else if( userProc.GetName() == "_System_Call_Destructor_of_GlobalObject" ){
+
+		UserProc *pBackUserProc;
+		pBackUserProc = &UserProc::CompilingUserProc();
+		UserProc::CompileStartForGlobalArea();
+
+		obj_LexScopes.CallDestructorsOfScopeEnd();
+
+		UserProc::CompileStartForUserProc( pBackUserProc );
+
+
+		//ret
+		op_ret();
+	}
+	else if( userProc.GetName() == "_System_GetSp" ){
+		//mov eax,esp
+		op_mov_RR(REG_EAX,REG_ESP);
+
+		//add eax,PTR_SIZE
+		op_add_RV8(REG_EAX,PTR_SIZE);
+
+		//ret
+		op_ret();
+	}
+	else if( userProc.GetName() == "_allrem" ){
+		//乗除演算用の特殊関数（64ビット整数対応）
+		BYTE Buffer_allrem[]={
+			0x53,0x57,0x33,0xFF,0x8B,0x44,0x24,0x10,0x0B,0xC0,0x7D,0x14,0x47,0x8B,0x54,0x24,0x0C,0xF7,0xD8,0xF7,0xDA,0x83,0xD8,0x00,0x89,0x44,0x24,0x10,0x89,0x54,0x24,0x0C,0x8B,0x44,0x24,0x18,0x0B,0xC0,0x7D,0x13,0x8B,0x54,0x24,0x14,0xF7,0xD8,0xF7,0xDA,0x83,0xD8,0x00,0x89,0x44,0x24,0x18,0x89,0x54,0x24,0x14,0x0B,0xC0,0x75,0x1B,0x8B,0x4C,0x24,0x14,0x8B,0x44,0x24,0x10,0x33,0xD2,0xF7,0xF1,0x8B,0x44,0x24,0x0C,0xF7,0xF1,0x8B,0xC2,0x33,0xD2,0x4F,0x79,0x4E,0xEB,0x53,0x8B,0xD8,0x8B,0x4C,0x24,0x14,0x8B,0x54,0x24,0x10,0x8B,0x44,0x24,0x0C,0xD1,0xEB,0xD1,0xD9,0xD1,0xEA,0xD1,0xD8,0x0B,0xDB,0x75,0xF4,0xF7,0xF1,0x8B,0xC8,0xF7,0x64,0x24,0x18,0x91,0xF7,0x64,0x24,0x14,0x03,0xD1,0x72,0x0E,0x3B,0x54,0x24,0x10,0x77,0x08,0x72,0x0E,0x3B,0x44,0x24,0x0C,0x76,0x08,0x2B,0x44,0x24,0x14,0x1B,0x54,0x24,0x18,0x2B,0x44,0x24,0x0C,0x1B,0x54,0x24,0x10,0x4F,0x79,0x07,0xF7,0xDA,0xF7,0xD8,0x83,0xDA,0x00,0x5F,0x5B,0xC2,0x10,0x00
+		};
+
+		memcpy(OpBuffer+obp,Buffer_allrem,178);
+		obp+=178;
+	}
+	else if( userProc.GetName() == "_aullrem" ){
+		//乗除演算用の特殊関数（64ビット整数対応）
+		BYTE Buffer_aullrem[]={
+			0x53,0x8B,0x44,0x24,0x14,0x0B,0xC0,0x75,0x18,0x8B,0x4C,0x24,0x10,0x8B,
+			0x44,0x24,0x0C,0x33,0xD2,0xF7,0xF1,0x8B,0x44,0x24,0x08,0xF7,0xF1,0x8B,
+			0xC2,0x33,0xD2,0xEB,0x50,0x8B,0xC8,0x8B,0x5C,0x24,0x10,0x8B,0x54,0x24,
+			0x0C,0x8B,0x44,0x24,0x08,0xD1,0xE9,0xD1,0xDB,0xD1,0xEA,0xD1,0xD8,0x0B,
+			0xC9,0x75,0xF4,0xF7,0xF3,0x8B,0xC8,0xF7,0x64,0x24,0x14,0x91,0xF7,0x64,
+			0x24,0x10,0x03,0xD1,0x72,0x0E,0x3B,0x54,0x24,0x0C,0x77,0x08,0x72,0x0E,
+			0x3B,0x44,0x24,0x08,0x76,0x08,0x2B,0x44,0x24,0x10,0x1B,0x54,0x24,0x14,
+			0x2B,0x44,0x24,0x08,0x1B,0x54,0x24,0x0C,0xF7,0xDA,0xF7,0xD8,0x83,0xDA,
+			0x00,0x5B,0xC2,0x10,0x00
+		};
+
+		memcpy(OpBuffer+obp,Buffer_aullrem,117);
+		obp+=117;
+	}
+	else if( userProc.GetName() == "_allmul" ){
+		//乗算用の特殊関数（64ビット整数対応）
+		BYTE Buffer_allmul[]={
+			0x8B,0x44,0x24,0x08,0x8B,0x4C,0x24,0x10,0x0B,0xC8,0x8B,0x4C,0x24,0x0C,0x75,0x09,0x8B,0x44,0x24,0x04,0xF7,0xE1,0xC2,0x10,0x00,0x53,0xF7,0xE1,0x8B,0xD8,0x8B,0x44,0x24,0x08,0xF7,0x64,0x24,0x14,0x03,0xD8,0x8B,0x44,0x24,0x08,0xF7,0xE1,0x03,0xD3,0x5B,0xC2,0x10,0x00
+		};
+
+		memcpy(OpBuffer+obp,Buffer_allmul,52);
+		obp+=52;
+	}
+	else if( userProc.GetName() == "_alldiv" ){
+		//除算用の特殊関数（64ビット整数対応）
+		BYTE Buffer_alldiv[]={
+			0x57,0x56,0x53,0x33,0xFF,0x8B,0x44,0x24,0x14,0x0B,0xC0,0x7D,0x14,0x47,0x8B,0x54,0x24,0x10,0xF7,0xD8,0xF7,0xDA,0x83,0xD8,0x00,0x89,0x44,0x24,0x14,0x89,0x54,0x24,0x10,0x8B,0x44,0x24,0x1C,0x0B,0xC0,0x7D,0x14,0x47,0x8B,0x54,0x24,0x18,0xF7,0xD8,0xF7,0xDA,0x83,0xD8,0x00,0x89,0x44,0x24,0x1C,0x89,0x54,0x24,0x18,0x0B,0xC0,0x75,0x18,0x8B,0x4C,0x24,0x18,0x8B,0x44,0x24,0x14,0x33,0xD2,0xF7,0xF1,0x8B,0xD8,0x8B,0x44,0x24,0x10,0xF7,0xF1,0x8B,0xD3,0xEB,0x41,0x8B,0xD8,0x8B,0x4C,0x24,0x18,0x8B,0x54,0x24,0x14,0x8B,0x44,0x24,0x10,0xD1,0xEB,0xD1,0xD9,0xD1,0xEA,0xD1,0xD8,0x0B,0xDB,0x75,0xF4,0xF7,0xF1,0x8B,0xF0,0xF7,0x64,0x24,0x1C,0x8B,0xC8,0x8B,0x44,0x24,0x18,0xF7,0xE6,0x03,0xD1,0x72,0x0E,0x3B,0x54,0x24,0x14,0x77,0x08,0x72,0x07,0x3B,0x44,0x24,0x10,0x76,0x01,0x4E,0x33,0xD2,0x8B,0xC6,0x4F,0x75,0x07,0xF7,0xDA,0xF7,0xD8,0x83,0xDA,0x00,0x5B,0x5E,0x5F,0xC2,0x10,0x00
+		};
+
+		memcpy(OpBuffer+obp,Buffer_alldiv,170);
+		obp+=170;
+	}
+	else if( userProc.GetName() == "_aulldiv" ){
+		//整数除算用の特殊関数（64ビット整数対応）
+		BYTE Buffer_aulldiv[]={
+			0x53,0x56,0x8B,0x44,0x24,0x18,0x0B,0xC0,0x75,0x18,0x8B,0x4C,0x24,0x14,
+			0x8B,0x44,0x24,0x10,0x33,0xD2,0xF7,0xF1,0x8B,0xD8,0x8B,0x44,0x24,0x0C,
+			0xF7,0xF1,0x8B,0xD3,0xEB,0x41,0x8B,0xC8,0x8B,0x5C,0x24,0x14,0x8B,0x54,
+			0x24,0x10,0x8B,0x44,0x24,0x0C,0xD1,0xE9,0xD1,0xDB,0xD1,0xEA,0xD1,0xD8,
+			0x0B,0xC9,0x75,0xF4,0xF7,0xF3,0x8B,0xF0,0xF7,0x64,0x24,0x18,0x8B,0xC8,
+			0x8B,0x44,0x24,0x14,0xF7,0xE6,0x03,0xD1,0x72,0x0E,0x3B,0x54,0x24,0x10,
+			0x77,0x08,0x72,0x07,0x3B,0x44,0x24,0x0C,0x76,0x01,0x4E,0x33,0xD2,0x8B,
+			0xC6,0x5E,0x5B,0xC2,0x10,0x00
+		};
+
+		memcpy(OpBuffer+obp,Buffer_aulldiv,104);
+		obp+=104;
+	}
+	else if( userProc.GetName() == "_allshl" ){
+		//符号あり左ビットシフト用の特殊関数（64ビット整数対応）
+		BYTE Buffer_allshl[]={
+			0x80,0xF9,0x40,0x73,0x15,0x80,0xF9,0x20,0x73,0x06,0x0F,0xA5,0xC2,0xD3,0xE0,0xC3,0x8B,0xD0,0x33,0xC0,0x80,0xE1,0x1F,0xD3,0xE2,0xC3,0x33,0xC0,0x33,0xD2,0xC3
+		};
+
+		memcpy(OpBuffer+obp,Buffer_allshl,31);
+		obp+=31;
+	}
+	else if( userProc.GetName() == "_allshr" ){
+		//符号あり右ビットシフト用の特殊関数（64ビット整数対応）
+		BYTE Buffer_allshr[]={
+			0x80,0xF9,0x40,0x73,0x16,0x80,0xF9,0x20,0x73,0x06,0x0F,0xAD,0xD0,0xD3,0xFA,0xC3,0x8B,0xC2,0xC1,0xFA,0x1F,0x80,0xE1,0x1F,0xD3,0xF8,0xC3,0xC1,0xFA,0x1F,0x8B,0xC2,0xC3
+		};
+
+		memcpy(OpBuffer+obp,Buffer_allshr,33);
+		obp+=33;
+	}
+	else if( userProc.GetName() == "_aullshr" ){
+		//符号なし右ビットシフト用の特殊関数（64ビット整数対応）
+		BYTE Buffer_aullshr[]={
+			0x80,0xF9,0x40,         //cmp         cl,40h
+			0x73,0x15,              //jae         RETZERO (0040d71a)
+			0x80,0xF9,0x20,         //cmp         cl,20h
+			0x73,0x06,              //jae         MORE32 (0040d710)
+			0x0F,0xAD,0xD0,         //shrd        eax,edx,cl
+			0xD3,0xEA,              //shr         edx,cl
+			0xC3,                   //ret
+			//MORE32:
+			0x8B,0xC2,              //mov         eax,edx
+			0x33,0xD2,              //xor         edx,edx
+			0x80,0xE1,0x1F,         //and         cl,1Fh
+			0xD3,0xE8,              //shr         eax,cl
+			0xC3,                   //ret
+			//RETZERO:
+			0x33,0xC0,              //xor         eax,eax
+			0x33,0xD2,              //xor         edx,edx
+			0xC3                    //ret
+		};
+
+		memcpy(OpBuffer+obp,Buffer_aullshr,31);
+		obp+=31;
+	}
+	else{
+		SetError();
+	}
+}
+void AutoGeneration(UserProc &userProc){
+	if( userProc.GetName() == "InitializeUserTypes"
+		&& userProc.HasParentClass()
+		&& userProc.GetParentClass().GetName() == "_System_TypeBase" ){
+
+			pobj_DBClass->Compile_System_InitializeUserTypes();
+	}
+	else if( userProc.GetName() == "RegisterGlobalRoots"
+		&& userProc.HasParentClass()
+		&& userProc.GetParentClass().GetName() == "_System_CGarbageCollection" ){
+
+			Compile_AddGlobalRootsForGc();
+	}
+	else{
+		SetError();
+	}
+}
+
+void _compile_proc(UserProc *pUserProc){
+	extern char *basbuf;
+	extern HANDLE hHeap;
+	extern GlobalProc **ppSubHash;
+	extern BOOL bDebugCompile;
+	int i3,i4,LocalVarSchedule,EspOffsetSchedule,BaseOffset;
+	char temporary[VN_SIZE];
+
+	if( pUserProc->IsUsing() == false || pUserProc->IsCompiled() ) return;
+
+	if( pUserProc->localVars.size() ){
+		SetError();
+		return;
+	}
+
+	pUserProc->CompleteCompile();
+
+	extern BOOL bSystemProc;
+	if(memcmp(pUserProc->GetName().c_str(),"_System_",8)==0) bSystemProc=1;
+	else bSystemProc=0;
+
+	extern BOOL bDebugSupportProc;
+	if(memcmp(pUserProc->GetName().c_str(),"_DebugSys_",10)==0){
+		if(!bDebugCompile){
+			return;
+		}
+		bDebugSupportProc=1;
+	}
+	else bDebugSupportProc=0;
+
+	pUserProc->beginOpAddress=obp;
+
+	//コンパイル中の関数が属するクラス
+	pobj_CompilingClass=pUserProc->GetParentClassPtr();
+
+	//コンパイルスタートをクラス管理クラスに追加
+	pobj_DBClass->StartCompile( pUserProc );
+
+	//コンパイル中の関数
+	UserProc::CompileStartForUserProc( pUserProc );
+
+	// コンパイル中の関数が属する名前空間
+	Smoothie::Lexical::liveingNamespaceScopes = pUserProc->GetNamespaceScopes();
+
+	// コンパイル中の関数でImportsされている名前空間
+	Smoothie::Temp::importedNamespaces = pUserProc->GetImportedNamespaces();
+
+	if(pUserProc->IsSystem()){
+		////////////////////
+		// 特殊関数
+		////////////////////
+
+		extern int AllLocalVarSize;
+		AllLocalVarSize=0;
+
+		SystemProc(*pUserProc);
+
+		pUserProc->endOpAddress=obp;
+		return;
+	}
+
+	cp=pUserProc->GetCodePos();
+	for(;;cp++){
+		if(IsCommandDelimitation(basbuf[cp])) break;
+	}
+	cp--;
+
+	//ローカル変数に関する情報
+	extern int AllLocalVarSize;
+	AllLocalVarSize=0;
+
+	//ローカル変数アドレススケジュール
+	extern DWORD *pLocalVarAddrSchedule;
+	extern int LocalVarAddrScheduleNum;
+	pLocalVarAddrSchedule=(DWORD *)HeapAlloc(hHeap,0,1);
+	LocalVarAddrScheduleNum=0;
+
+	//パラメータ用の変数データを考慮
+	for(i3=(int)pUserProc->RealParams().size()-1;i3>=0;i3--){
+		Parameter &param = *pUserProc->RealParams()[i3];
+
+		Variable *pVar = new Variable( param.GetVarName(), param, false, param.IsRef() );
+
+		if( param.IsArray() ){
+			pVar->SetArray( param.GetSubScriptsPtr() );
+		}
+
+		int varSize;
+		if( param.IsRef() == false && param.IsStruct() ){
+			//構造体のByValパラメータ
+			pVar->ThisIsParameter();
+			varSize=PTR_SIZE;
+		}
+		else{
+			if( param.IsArray() == false ){
+				varSize = pVar->GetMemorySize();
+			}
+			else{
+				varSize=PTR_SIZE;
+			}
+		}
+		AllLocalVarSize+=varSize;
+		pVar->offset=AllLocalVarSize;
+
+		//レキシカルスコープ情報
+		pVar->ScopeLevel=obj_LexScopes.GetNowLevel();
+		pVar->ScopeStartAddress=obj_LexScopes.GetStartAddress();
+		pVar->bLiving=TRUE;
+
+		pUserProc->localVars.push_back( pVar );
+	}
+
+	//Thisポインタを示すローカルオフセット値をセット
+	extern int LocalVar_ThisPtrOffset;
+	LocalVar_ThisPtrOffset=AllLocalVarSize;
+
+	BaseOffset=AllLocalVarSize;
+
+	//ret用のアドレスを考慮
+	AllLocalVarSize+=sizeof(long);
+
+
+	///////////////////////
+	// ここからコード生成
+
+	//sub esp,AllLocalVarSize（スケジュール）
+	op_sub_esp(0xFFFFFFFF);
+	LocalVarSchedule=obp-sizeof(long);
+
+	//push ebp
+	op_push(REG_EBP);
+
+	//mov ebp,esp
+	OpBuffer[obp++]=(char)0x8B;
+	OpBuffer[obp++]=(char)0xEC;
+
+	//push ebx
+	op_push(REG_EBX);
+
+	//push esi
+	OpBuffer[obp++]=(char)0x56;
+
+	//push edi
+	OpBuffer[obp++]=(char)0x57;
+
+	if( !pUserProc->ReturnType().IsNull() ){
+		//戻り値が存在するとき
+
+		const char *temp = pUserProc->GetName().c_str();
+		if( temp[0]==1&&temp[1]==ESC_OPERATOR ){
+			temp = "_System_ReturnValue";
+		}
+
+		if( pUserProc->ReturnType().IsStruct() ){
+			//戻り値用の構造体（値型）はパラメータで引き渡される
+		}
+		else{
+			if( pUserProc->ReturnType().IsObject() ){
+				sprintf(temporary,"%s=Nothing%c%c%s",temp,1,ESC_AS, pUserProc->ReturnType().ToString().c_str() );
+			}
+			else{
+				//戻り値用の変数の定義
+				sprintf(temporary,"%s%c%c%s",temp,1,ESC_AS, pUserProc->ReturnType().ToString().c_str() );
+			}
+
+			OpcodeDim(temporary,0);
+		}
+	}
+
+	//プロシージャ抜け出しスケジュール（Exit Sub/Function）
+	extern DWORD *pExitSubSchedule;
+	extern int ExitSubScheduleNum;
+	pExitSubSchedule=(DWORD *)HeapAlloc(hHeap,0,1);
+	ExitSubScheduleNum=0;
+
+	//ラベル用のメモリを確保
+	extern LABEL *pLabelNames;
+	extern int MaxLabelNum;
+	pLabelNames=(LABEL *)HeapAlloc(hHeap,0,1);
+	MaxLabelNum=0;
+
+	//Gotoラベルスケジュール
+	extern GOTOLABELSCHEDULE *pGotoLabelSchedule;
+	extern int GotoLabelScheduleNum;
+	pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapAlloc(hHeap,0,1);
+	GotoLabelScheduleNum=0;
+
+	//With情報のメモリを確保
+	extern WITHINFO WithInfo;
+	WithInfo.ppName=(char **)HeapAlloc(hHeap,0,1);
+	WithInfo.pWithCp=(int *)HeapAlloc(hHeap,0,1);
+	WithInfo.num=0;
+
+	//重複エラー情報管理のメモリを確保
+	extern char **SynonymErrorWords;
+	extern int SynonymErrorNum;
+	SynonymErrorNum=0;
+	SynonymErrorWords=(char **)HeapAlloc(hHeap,0,1);
+
+	//Continueアドレスを初期化
+	extern DWORD dwContinueAddress;
+	dwContinueAddress=-1;
+
+	if(bDebugCompile&&bDebugSupportProc==0){
+		//push dword ptr[ebp+(AllLocalVarSize-BaseOffset)]（スケジュール）
+		OpBuffer[obp++]=(char)0xFF;
+		OpBuffer[obp++]=(char)0xB5;
+		EspOffsetSchedule=obp;
+		obp+=sizeof(long);	
+
+		//push dword ptr[ebp]（以前のebp）
+		OpBuffer[obp++]=(char)0xFF;
+		OpBuffer[obp++]=(char)0x75;
+		OpBuffer[obp++]=(char)0x00;
+
+		//call _DebugSys_StartProc
+		extern UserProc *pSub_DebugSys_StartProc;
+		op_call(pSub_DebugSys_StartProc);
+	}
+
+	if(pobj_CompilingClass){
+		if( pUserProc->GetName() == pobj_CompilingClass->GetName() ){
+			////////////////////////////////////
+			// コンストラクタをコンパイルするとき
+			////////////////////////////////////
+
+			//コンストラクタのコンパイル開始を通知
+			pobj_CompilingClass->NotifyStartConstructorCompile();
+
+			//基底クラスかどうかの識別
+			//（継承元がインターフェイスの場合も基底クラスと見なす）
+			BOOL bThisIsSuperClass;
+			if(pobj_CompilingClass->pobj_InheritsClass==0) bThisIsSuperClass=1;
+			else if( pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod() == NULL ){
+				//インターフェイスを継承したときはコンストラクタを持たない
+				bThisIsSuperClass=1;
+			}
+			else bThisIsSuperClass=0;
+
+			if(!bThisIsSuperClass){
+				/* サブクラスコンストラクタをコンパイルしているときは、
+					基底クラスのコンストラクタを呼び出す */
+
+				i3=cp+1;
+				while(IsCommandDelimitation(basbuf[i3])) i3++;
+				for(i4=0;;i3++,i4++){
+					if(!IsVariableChar(basbuf[i3])){
+						temporary[i4]=0;
+						break;
+					}
+					temporary[i4]=basbuf[i3];
+				}
+				if( pobj_CompilingClass->pobj_InheritsClass->GetName() == temporary ){
+					//基底クラスのコンストラクタを呼び出す
+					cp=i3;
+					for(i4=0;;cp++,i4++){
+						if(IsCommandDelimitation(basbuf[cp])){
+							temporary[i4]=0;
+							break;
+						}
+						temporary[i4]=basbuf[cp];
+					}
+					if(!(temporary[0]=='('&&temporary[lstrlen(temporary)-1]==')')){
+						SetError(1,NULL,cp);
+					}
+					RemoveStringPare(temporary);
+
+					Type dummyType;
+					CallProc( PROC_DEFAULT
+						, pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc
+						, pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc->GetName().c_str()
+						, temporary
+						, dummyType );
+				}
+				else{
+					//基底クラスのコンストラクタを暗黙的に呼び出す
+					Opcode_CallProc("",
+						pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc,
+						0,
+						"",
+						0);
+				}
+			}
+
+			//仮想関数テーブルを初期化
+			if( pobj_CompilingClass->IsExistVirtualFunctions()
+				&& !pobj_CompilingClass->IsAbstract() ){
+					//関数テーブルに値をセット
+					int offset = (int)pobj_CompilingClass->GetVtblGlobalOffset();
+
+					//mov eax,offset
+					OpBuffer[obp++]=(char)0xB8;
+					*((long *)(OpBuffer+obp))=offset;
+					pobj_DataTableSchedule->add();
+					obp+=sizeof(long);
+
+					//Thisポインタをecxにコピー
+					SetThisPtrToReg(REG_ECX);
+
+					//mov dword ptr[ecx],eax
+					OpBuffer[obp++]=(char)0x89;
+					OpBuffer[obp++]=(char)0x01;
+			}
+		}
+		else if( pUserProc->IsDestructor() ){
+			//デストラクタをコンパイルしたとき
+
+			//デストラクタのコンパイル開始を通知
+			pobj_CompilingClass->NotifyStartDestructorCompile();
+		}
+	}
+
+	//////////////////////////////////////////
+	//////////////////////////////////////////
+	////// プロシージャ内をコンパイル ////////
+	if( pUserProc->IsAutoGeneration() ){
+		AutoGeneration( *pUserProc );
+	}
+	else{
+		if(pUserProc->IsMacro()){
+			CompileBuffer(ESC_ENDMACRO,0);
+		}
+		else{
+			if(pUserProc->IsSub()){
+				CompileBuffer(ESC_ENDSUB,0);
+			}
+			else if(pUserProc->IsFunction()){
+				CompileBuffer(ESC_ENDFUNCTION,0);
+			}
+		}
+	}
+	//////////////////////////////////////////
+	//////////////////////////////////////////
+
+	if( pobj_CompilingClass ){
+
+		if( pobj_CompilingClass->IsCompilingConstructor() ){
+			// コンストラクタをコンパイルしていたとき
+
+			// コンストラクタのコンパイルが完了したことを通知
+			pobj_CompilingClass->NotifyFinishConstructorCompile();
+		}
+		else if( pUserProc->IsDestructor() ){
+			////////////////////////////////////
+			//デストラクタをコンパイルしたとき
+			////////////////////////////////////
+
+			// デストラクタのコンパイルが完了したことを通知
+			pobj_CompilingClass->NotifyFinishDestructorCompile();
+
+			if(pobj_CompilingClass->pobj_InheritsClass){
+				/* サブクラスのデストラクタをコンパイルしているときは、
+					基底クラスのデストラクタを呼び出す */
+
+				const CMethod *method = pobj_CompilingClass->pobj_InheritsClass->GetDestructorMethod();
+				if( method ){
+					Opcode_CallProc("",
+						method->pUserProc,
+						0,
+						"",
+						0);
+				}
+			}
+		}
+	}
+
+	//ラベル用のメモリを解放
+	for(i3=0;i3<MaxLabelNum;i3++){
+		if(pLabelNames[i3].pName) HeapDefaultFree(pLabelNames[i3].pName);
+	}
+	HeapDefaultFree(pLabelNames);
+
+	//Goto未知ラベルスケジュールを解放
+	for(i3=0;i3<GotoLabelScheduleNum;i3++){
+		if(pGotoLabelSchedule[i3].pName){
+			SetError(6,pGotoLabelSchedule[i3].pName,pGotoLabelSchedule[i3].now_cp);
+			HeapDefaultFree(pGotoLabelSchedule[i3].pName);
+		}
+		else{
+			sprintf(temporary,"%d",pGotoLabelSchedule[i3].line);
+			SetError(6,temporary,pGotoLabelSchedule[i3].now_cp);
+		}
+	}
+	HeapDefaultFree(pGotoLabelSchedule);
+
+	//With情報のメモリを解放
+	for(i3=0;i3<WithInfo.num;i3++){
+		SetError(22,"With",WithInfo.pWithCp[i3]);
+		HeapDefaultFree(WithInfo.ppName[i3]);
+	}
+	HeapDefaultFree(WithInfo.ppName);
+	HeapDefaultFree(WithInfo.pWithCp);
+
+	//push ebp
+	AllLocalVarSize+=sizeof(long);
+
+	//ローカルオブジェクトの解放処理
+	obj_LexScopes.CallDestructorsOfScopeEnd();
+
+	//プロシージャ抜け出しスケジュール（Exit Sub/Function）
+	for(i3=0;i3<ExitSubScheduleNum;i3++){
+		*((long *)(OpBuffer+pExitSubSchedule[i3]))=obp-(pExitSubSchedule[i3]+sizeof(long));
+	}
+	HeapDefaultFree(pExitSubSchedule);
+
+	if(bDebugCompile&&bDebugSupportProc==0){
+		*((long *)(OpBuffer+EspOffsetSchedule))=AllLocalVarSize-BaseOffset-sizeof(long);
+
+		//call _DebugSys_EndProc
+		extern UserProc *pSub_DebugSys_EndProc;
+		op_call(pSub_DebugSys_EndProc);
+	}
+
+	if( !pUserProc->ReturnType().IsNull() ){
+		//戻り値をeax、edxに設定
+		RELATIVE_VAR RelativeVar;
+
+		const char *temp = pUserProc->GetName().c_str();
+		if( temp[0]==1 && temp[1]==ESC_OPERATOR ){
+			temp="_System_ReturnValue";
+		}
+		GetVarOffsetReadWrite(temp,&RelativeVar,Type());
+
+		i3=pUserProc->ReturnType().GetBasicType();
+
+		if(i3==DEF_OBJECT || i3==DEF_STRUCT){
+			SetVarPtrToEax(&RelativeVar);
+			if( i3==DEF_OBJECT ){
+				//mov eax,dword ptr[eax]
+				op_mov_RM( sizeof(long), REG_EAX, REG_EAX, 0, MOD_BASE );
+			}
+		}
+		else if(i3==DEF_DOUBLE){
+			//fld qword ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0xDD;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=RelativeVar.offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else if(i3==DEF_SINGLE){
+			//fld dword ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0xD9;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=RelativeVar.offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else if(i3==DEF_INT64||i3==DEF_QWORD){
+			//mov eax,dword ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=RelativeVar.offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//mov edx,dword ptr[ebp+offset+sizeof(long)]
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0x95;
+			*((long *)(OpBuffer+obp))=RelativeVar.offset+sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else if(i3==DEF_LONG||i3==DEF_DWORD||
+			IsPtrType(i3)){
+			//mov eax,dword ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=RelativeVar.offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else if(i3==DEF_INTEGER||i3==DEF_WORD || (isUnicode&&i3==DEF_CHAR)){
+			//xor eax,eax（eaxを0に初期化する）
+			op_zero_reg(REG_EAX);
+
+			//mov ax,word ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0x66;
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=RelativeVar.offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else if(i3==DEF_SBYTE||i3==DEF_BYTE||i3==DEF_BOOLEAN || (isUnicode==false&&i3==DEF_CHAR)){
+			//xor eax,eax（eaxを0に初期化する）
+			op_zero_reg(REG_EAX);
+
+			//mov al,byte ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0x8A;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=RelativeVar.offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+
+	//ローカル変数アドレススケジュール
+	for(i3=0;i3<LocalVarAddrScheduleNum;i3++){
+		*((long *)(OpBuffer+pLocalVarAddrSchedule[i3]))+=AllLocalVarSize;
+	}
+	HeapDefaultFree(pLocalVarAddrSchedule);
+	foreach( Variable *pVar, pUserProc->localVars ){
+		//後にデバッグで利用する
+		pVar->offset = AllLocalVarSize - pVar->offset;
+	}
+
+	//push ebp、ret用のアドレスを考慮
+	AllLocalVarSize-=sizeof(long)*2;
+
+	//ローカル変数用メモリを確保するためのスケジュール（subコマンド）
+	*((long *)(OpBuffer+LocalVarSchedule))=AllLocalVarSize-BaseOffset;
+
+	//pop edi
+	OpBuffer[obp++]=(char)0x5F;
+
+	//pop esi
+	OpBuffer[obp++]=(char)0x5E;
+
+	//pop ebx
+	op_pop(REG_EBX);
+
+	if(bDebugCompile){
+		//cmp esp,ebp
+		op_cmp_RR( REG_ESP, REG_EBP );
+
+		//jz 6（次のcallとbreakpointを飛び越す）
+		OpBuffer[obp++]=(char)0x74;
+		OpBuffer[obp++]=(char)0x06;
+
+		//call _esp_error
+		extern UserProc *pSub_esp_error;
+		op_call( pSub_esp_error );
+
+		breakpoint;
+	}
+
+	//mov esp,ebp
+	OpBuffer[obp++]=(char)0x8B;
+	OpBuffer[obp++]=(char)0xE5;
+
+	//pop ebp
+	op_pop(REG_EBP);
+
+	//add esp AllLocalVarSize
+	op_add_esp(AllLocalVarSize-BaseOffset);
+
+	if( BaseOffset==0 || pUserProc->IsCdecl() ){
+		//ret
+		op_ret();
+	}
+	else{
+		//ret BaseOffset（パラメータ分のスタック領域を解放）
+		OpBuffer[obp++]=(char)0xC2;
+		*((_int16 *)(OpBuffer+obp))=(_int16)BaseOffset;
+		obp+=sizeof(_int16);
+	}
+
+
+	pUserProc->endOpAddress=obp;
+
+
+	//重複エラー情報管理のメモリを解放
+	for(i3=0;i3<SynonymErrorNum;i3++) HeapDefaultFree(SynonymErrorWords[i3]);
+	HeapDefaultFree(SynonymErrorWords);
+	SynonymErrorWords=0;
+
+
+	//ローカル変数のネーム情報は後に解放する
+}
+
+void CompileBufferInProcedure( UserProc &userProc ){
+	if( userProc.IsUsing() == false || userProc.IsCompiled() ) return;
+
+	_compile_proc( &userProc );
+/*
+	// ログを履く
+	char temporary[8192];
+	temporary[0]=0;
+	lstrcat( temporary, "------------------------------------------------------------------\n" );
+	sprintf( temporary + lstrlen(temporary), "【 %s のコード情報】\n", userProc.GetFullName().c_str() );
+	sprintf( temporary + lstrlen(temporary), "code size: %d bytes\n", userProc.GetCodeSize() );
+	lstrcat( temporary, "------------------------------------------------------------------\n" );
+	lstrcat( temporary, "\n" );
+	Smoothie::Logger::Put( temporary );*/
+}
+void CompileLocal(){
+	extern GlobalProc **ppSubHash;
+	int i2;
+
+	extern BOOL bDll;
+	if(bDll){
+		//DLLの場合はグローバル変数を初期化するための関数を一番初めにコンパイルする
+		UserProc *pUserProc=GetSubHash("_System_InitDllGlobalVariables");
+		if(pUserProc){
+			CompileBufferInProcedure( *pUserProc );
+		}
+		else SetError(300,NULL,cp);
+	}
+
+	//_System_TypeBase_InitializeUserTypesは一番最後にコンパイル
+	extern UserProc *pSubStaticMethod_System_TypeBase_InitializeUserTypes;
+	pSubStaticMethod_System_TypeBase_InitializeUserTypes->CompleteCompile();
+
+	//_System_InitStaticLocalVariablesは一番最後にコンパイル
+	//※一般関数内の静的変数オブジェクトをすべて収集しなければならない
+	extern UserProc *pSub_System_InitStaticLocalVariables;
+	pSub_System_InitStaticLocalVariables->CompleteCompile();
+
+	//_System_Call_Destructor_of_GlobalObjectは一番最後にコンパイル
+	extern UserProc *pSub_System_Call_Destructor_of_GlobalObject;
+	pSub_System_Call_Destructor_of_GlobalObject->CompleteCompile();
+
+repeat:
+	GlobalProc *pGlobalProc;
+	for(i2=0;i2<MAX_HASH;i2++){
+		pGlobalProc=ppSubHash[i2];
+		while(pGlobalProc){
+			CompileBufferInProcedure( *pGlobalProc );
+			pGlobalProc=pGlobalProc->pNextData;
+		}
+	}
+
+	if( IsNeedProcCompile() ){
+		//プロシージャコンパイルによって、プロシージャコンパイルが必要になる場合
+		goto repeat;
+	}
+
+	//_System_TypeBase_InitializeUserTypesは最後のほうでコンパイル
+	pSubStaticMethod_System_TypeBase_InitializeUserTypes->KillCompileStatus();
+	CompileBufferInProcedure( *pSubStaticMethod_System_TypeBase_InitializeUserTypes );
+
+	if( IsNeedProcCompile() ){
+		//プロシージャコンパイルによって、プロシージャコンパイルが必要になる場合
+		for(i2=0;i2<MAX_HASH;i2++){
+			pGlobalProc=ppSubHash[i2];
+			while(pGlobalProc){
+				CompileBufferInProcedure( *pGlobalProc );
+				pGlobalProc=pGlobalProc->pNextData;
+			}
+		}
+	}
+
+	//_System_InitStaticLocalVariablesは一番最後にコンパイル
+	pSub_System_InitStaticLocalVariables->KillCompileStatus();
+	CompileBufferInProcedure( *pSub_System_InitStaticLocalVariables );
+
+	//_System_Call_Destructor_of_GlobalObjectは一番最後にコンパイル
+	pSub_System_Call_Destructor_of_GlobalObject->KillCompileStatus();
+	CompileBufferInProcedure( *pSub_System_Call_Destructor_of_GlobalObject );
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/Compile_Set_Var.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/Compile_Set_Var.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/Compile_Set_Var.cpp	(revision 178)
@@ -0,0 +1,386 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+BOOL IsUse_ecx(RELATIVE_VAR *pRelativeVar){
+	if(pRelativeVar->bOffsetOffset||pRelativeVar->dwKind==VAR_DIRECTMEM) return 1;
+	return 0;
+}
+
+void SetStructVariable( const Type &varType, const Type &calcType, BOOL bUseHeap){
+	if( calcType.IsStruct() ){
+		if( varType.GetClass().IsEquals( &calcType.GetClass() ) ){			//等しい
+
+				//双方のオブジェクト型が一致、または派生・継承関係にあるとき
+				//※コピーを行う
+
+				int object_size = varType.GetClass().GetSize();
+
+				//mov ecx,object_size
+				op_mov_RV(REG_ECX,object_size);
+
+				//pop esi
+				op_pop(REG_ESI);
+
+				//pop edi
+				op_pop(REG_EDI);
+
+				if(bUseHeap){
+					//mov eax,esi
+					op_mov_RR(REG_EAX,REG_ESI);
+				}
+
+				//rep movs byte ptr[edi],byte ptr[esi]
+				op_rep_movs(sizeof(BYTE));
+
+				if(bUseHeap){
+					//push eax
+					op_push(REG_EAX);
+
+					//call free
+					extern UserProc *pSub_free;
+					op_call(pSub_free);
+				}
+
+				return;
+		}
+	}
+
+	SetError(1,NULL,cp);
+}
+
+
+void SetRealVariable(int VarType,int CalcType,RELATIVE_VAR *pRelativeVar){
+	if( !IsRealNumberType( CalcType ) ){
+		// 実数へ変換
+		// 64bit edx:eax -> st(0)
+		// 32bit     eax -> st(0)
+
+		if( Is64Type( CalcType ) ){
+			//64ビット整数型
+
+			//push edx
+			op_push( REG_EDX );
+
+			//push eax
+			op_push( REG_EAX );
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//pop
+			op_pop( REG_NON );
+
+			//pop
+			op_pop( REG_NON );
+		}
+		else{
+			//push eax
+			op_push( REG_EAX );
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+
+			//pop
+			op_pop( REG_NON );
+		}
+	}
+
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//fstp ptr[ecx+offset]
+			op_fstp_base_offset(VarType,REG_ECX,(int)pRelativeVar->offset);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov ecx,offset
+			op_mov_RV(REG_ECX,(int)pRelativeVar->offset);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+
+			//fstp ptr[ecx]
+			op_fstp_basereg(VarType,REG_ECX);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFGLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add ecx,qword ptr[offset]
+			op_add_RM(sizeof(long),REG_ECX,REG_NON,(int)pRelativeVar->offset,MOD_DISP32);
+		}
+		else{
+			//mov ecx,qword ptr[offset]
+			op_mov_RM(sizeof(long),REG_ECX,REG_NON,(int)pRelativeVar->offset,MOD_DISP32);
+		}
+		obp-=sizeof(long);
+		pobj_GlobalVarSchedule->add();
+		obp+=sizeof(long);
+
+		goto directmem;
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//fstp ptr[ebp+ecx+offset]
+			op_fstp_base_offset_ex(VarType,REG_EBP,REG_ECX,(int)pRelativeVar->offset,USE_OFFSET);
+		}
+		else{
+			//fstp ptr[ebp+offset]
+			op_fstp_base_offset(VarType,REG_EBP,(int)pRelativeVar->offset);
+		}
+		obp-=sizeof(long);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+	}
+	else if(pRelativeVar->dwKind==VAR_REFLOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add ecx,qword ptr[ebp+offset]
+			op_add_RM(sizeof(long),REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+		}
+		else{
+			//mov ecx,qword ptr[ebp+offset]
+			op_mov_RM(sizeof(long),REG_ECX,REG_EBP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+		}
+		obp-=sizeof(long);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+
+		goto directmem;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+directmem:
+		//fstp ptr[ecx]
+		op_fstp_basereg(VarType,REG_ECX);
+	}
+}
+
+void SetBooleanVariable(int type,RELATIVE_VAR *pRelative){
+	if(type==DEF_DOUBLE){
+		// TODO: 実装
+		SetError();
+	}
+	else if(type==DEF_SINGLE){
+		// TODO: 実装
+		SetError();
+	}
+	else if(type==DEF_INT64||type==DEF_QWORD){
+		//cmp eax,0
+		op_cmp_value(GetTypeSize(type,-1),REG_EAX,0);
+
+		//setne al
+		op_setne( REG_EAX );
+
+		//cmp edx,0
+		op_cmp_value(GetTypeSize(type,-1),REG_EDX,0);
+
+		//setne cl
+		op_setne( REG_ECX );
+
+		//or al,cl
+		op_or_RR( sizeof( _int8 ), REG_EAX, REG_ECX );
+	}
+	else{
+		if(!IsWholeNumberType(type)){
+			//不正な型の場合
+			SetError(9,NULL,cp);
+			return;
+		}
+	}
+
+	//cmp eax,0
+	op_cmp_value(GetTypeSize(type,-1),REG_EAX,0);
+
+	//setne al
+	op_setne( REG_EAX );
+
+	SetWholeVariable( sizeof(char), DEF_BYTE, pRelative );
+}
+
+void ExtendTypeTo32(int type,int reg);
+void ExtendTypeTo64(int type){
+	if(Is64Type(type)) return;
+
+	ExtendTypeTo32(type,REG_EAX);
+
+	if(IsSignedType(type)){
+		//cdq
+		op_cdq();
+	}
+	else{
+		//xor edx,edx
+		op_zero_reg(REG_EDX);
+	}
+}
+void ExtendTypeTo32(int type,int reg){
+	if(type==DEF_INTEGER || (isUnicode&&type==DEF_CHAR)){
+		//movsx reg32,reg16
+		op_movsx_R32R16(reg,reg);
+	}
+	else if(type==DEF_WORD){
+		//and reg,0000FFFFh
+		op_and_RV(reg,(int)0x0000FFFF);
+	}
+	else if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){
+		//movsx reg32,reg8
+		op_movsx_R32R8(reg,reg);
+	}
+	else if(type==DEF_BYTE||type==DEF_BOOLEAN){
+		//and reg,000000FFh
+		op_and_RV(reg,(int)0xFF);
+	}
+}
+void ExtendTypeTo16(int type,int reg){
+	if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){
+		//movsx reg16,reg8
+		op_movsx_R16R8(reg,reg);
+	}
+	else if(type==DEF_BYTE||type==DEF_BOOLEAN){
+		//and reg,000000FFh
+		op_and_RV(reg,(int)0xFF);
+	}
+}
+
+void SetWholeVariable(int varSize,int calcType,RELATIVE_VAR *pRelative){
+	if( IsRealNumberType( calcType ) ){
+		// 実数型から整数型へ変換する
+
+		if( varSize == sizeof(_int64) ){
+			// 64bitへ
+			// st(0) -> edx:eax
+			breakpoint;
+
+			//push
+			//push
+			op_sub_esp( PTR_SIZE * 2 );
+
+			//fistp qword ptr[esp]
+			op_fistp_ptr_esp( sizeof(_int64) );
+
+			//pop eax
+			op_pop( REG_EAX );
+
+			//pop edx
+			op_pop( REG_EDX );
+		}
+		else{
+			// 32bit
+			// st(0) -> eax
+
+			//push
+			op_push( REG_NON );
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+
+			//pop eax
+			op_pop( REG_EAX );
+		}
+	}
+	else{
+		//その他の整数
+
+		if(varSize==sizeof(_int64)){
+			//eaxの値を64ビット（edx:eax）に拡張する
+			ExtendTypeTo64(calcType);
+		}
+		else if(varSize==sizeof(long)){
+			//レジスタの値を32ビット（eax）に拡張する
+			ExtendTypeTo32(calcType,REG_EAX);
+		}
+		else if(varSize==sizeof(short)){
+			//レジスタの値を16ビット（ax）に拡張する
+			ExtendTypeTo16(calcType,REG_EAX);
+		}
+		//8ビットは拡張なし
+	}
+
+	if(varSize==sizeof(_int64)){
+		//下位32ビット
+		SetWholeVariable(sizeof(long),DEF_LONG,pRelative);
+
+		//上位32ビット
+
+		//直接参照に切り替え
+		SetVarPtrToEax(pRelative);
+		pRelative->dwKind=VAR_DIRECTMEM;
+
+		//mov ecx,eax
+		op_mov_RR( REG_ECX, REG_EAX );
+
+		//add ecx,sizeof(long)
+		op_add_RV8( REG_ECX, sizeof(long) );
+
+		//mov eax,edx
+		op_mov_RR( REG_EAX, REG_EDX );
+
+		SetWholeVariable(sizeof(long),DEF_LONG,pRelative);
+
+		return;
+	}
+
+	if(pRelative->dwKind==VAR_GLOBAL){
+		if(pRelative->bOffsetOffset){
+			//mov ptr[ecx+offset],eax/ax/al
+			op_mov_MR(varSize,REG_EAX,REG_ECX,(int)pRelative->offset,MOD_BASE_DISP32);
+		}
+		else{
+			//mov ptr[offset],eax/ax/al
+			op_mov_MR(varSize,REG_EAX,0,(int)pRelative->offset,MOD_DISP32);
+		}
+		obp-=sizeof(long);
+		pobj_GlobalVarSchedule->add();
+		obp+=sizeof(long);
+	}
+	else if(pRelative->dwKind==VAR_REFGLOBAL){
+		// 今は使われていない
+		SetError();
+
+		if(pRelative->bOffsetOffset){
+			//add ecx,qword ptr[offset]
+			op_add_RM(varSize,REG_ECX,REG_NON,(int)pRelative->offset,MOD_DISP32);
+		}
+		else{
+			//mov ecx,qword ptr[offset]
+			op_mov_RM(varSize,REG_ECX,REG_NON,(int)pRelative->offset,MOD_DISP32);
+		}
+		obp-=sizeof(long);
+		pobj_GlobalVarSchedule->add();
+		obp+=sizeof(long);
+
+		goto directmem;
+	}
+	else if(pRelative->dwKind==VAR_LOCAL){
+		if(pRelative->bOffsetOffset){
+			//mov ptr[ebp+ecx+offset],eax/ax/al
+			op_mov_MR_ex(varSize,REG_EAX,REG_EBP,REG_ECX,(int)pRelative->offset,USE_OFFSET);
+		}
+		else{
+			//mov ptr[ebp+offset],eax/ax/al
+			op_mov_MR(varSize,REG_EAX,REG_EBP,(int)pRelative->offset,MOD_BASE_DISP32);
+		}
+		obp-=sizeof(long);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+	}
+	else if(pRelative->dwKind==VAR_REFLOCAL){
+		if(pRelative->bOffsetOffset){
+			//add ecx,ptr[ebp+offset]
+			op_add_RM(PTR_SIZE,REG_ECX,REG_EBP,(int)pRelative->offset,MOD_BASE_DISP32);
+		}
+		else{
+			//mov ecx,ptr[ebp+offset]
+			op_mov_RM(PTR_SIZE,REG_ECX,REG_EBP,(int)pRelative->offset,MOD_BASE_DISP32);
+		}
+		obp-=sizeof(long);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+
+		goto directmem;
+	}
+	else if(pRelative->dwKind==VAR_DIRECTMEM){
+directmem:
+
+		//mov ptr[ecx],eax/ax/al
+		op_mov_MR(varSize,REG_EAX,REG_ECX,0,MOD_BASE);
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/Compile_Statement.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/Compile_Statement.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/Compile_Statement.cpp	(revision 178)
@@ -0,0 +1,1475 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void OpcodeOthers( const char *Command ){
+	int i,i2;
+	UserProc *pUserProc;
+
+	char leftTerm[8192];
+	int lastParePos = 0;
+	for(i=0;;i++){
+		if(Command[i]=='\"'){
+			//ダブルクォートは不正なのでエラー扱い
+			leftTerm[i]=0;
+			SetError(3,leftTerm,cp);
+			return;
+		}
+
+		if(Command[i]=='('){
+			lastParePos = i;
+			i2=GetStringInPare(leftTerm+i,Command+i);
+			i+=i2-1;
+			continue;
+		}
+		if(Command[i]=='['){
+			i2=GetStringInBracket(leftTerm+i,Command+i);
+			i+=i2-1;
+			continue;
+		}
+		if(Command[i]=='\0'){
+			leftTerm[i] = 0;
+			break;
+		}
+
+		if( IsNumCalcMark( Command, i ) ){
+			leftTerm[i] = 0;
+			break;
+		}
+
+		leftTerm[i]=Command[i];
+	}
+	if(!(
+		IsVariableTopChar(leftTerm[0])||
+		leftTerm[0]=='.'||
+		(leftTerm[0]==1&&leftTerm[1]==ESC_PSMEM)
+		)){
+		SetError(1,NULL,cp);
+		return;
+	}
+
+
+	if(Command[i]=='\0' && lastParePos == 0){
+		//////////////////////////////
+		// パラメータ無しのマクロ検索
+		//////////////////////////////
+
+		pUserProc=GetSubHash(Command);
+
+		//GetSubHash内でエラー提示が行われた場合
+		if(pUserProc==(UserProc *)-1) return;
+
+		if(pUserProc==0){
+			char temporary[VN_SIZE];
+			lstrcpy(temporary,Command);
+
+			CharUpper(temporary);
+			pUserProc=GetSubHash(temporary);
+
+			//GetSubHash内でエラー提示が行われた場合
+			if(pUserProc==(UserProc *)-1) return;
+		}
+
+		if(pUserProc){
+			if( !pUserProc->IsMacro() ){
+				SetError(10,Command,cp);
+			}
+
+			Opcode_CallProc("",pUserProc,0,"",0);
+
+			return;
+		}
+	}
+	else if(IsNumCalcMark(Command,i)){
+		//代入演算
+		OpcodeCalc(Command);
+		return;
+	}
+
+
+	Type resultType;
+	bool isLiteral;
+	BOOL bUseHeap;
+	bool result = TermOpe( leftTerm, Type(), resultType, isLiteral, &bUseHeap, false, NULL, true );
+	if( result ){
+
+		/////////////////////
+		// 戻り値の処理
+		/////////////////////
+
+		if( resultType.IsReal() ){
+			//fstp st(0)
+			OpBuffer[obp++]=(char)0xDD;
+			OpBuffer[obp++]=(char)0xD8;
+		}
+		else if( resultType.IsStruct() ){
+			//mov ebx,eax
+			op_mov_RR(REG_EBX,REG_EAX);
+
+			FreeTempObject(REG_EBX,&resultType.GetClass());
+		}
+
+		//成功
+		return;
+	}
+
+	// 失敗
+	SetError(1, NULL,cp);
+}
+
+void OpcodeIf(char *Parameter){
+	int i,i2,i3,i4;
+	Type tempType;
+
+	for(i=0;;i++){
+		if(Parameter[i]=='\0'){
+			SetError(21,NULL,cp);
+			return;
+		}
+		if(Parameter[i]==1&&Parameter[i+1]==ESC_THEN){
+			Parameter[i]=0;
+			break;
+		}
+	}
+
+	if( !NumOpe(Parameter,Type(),tempType) ){
+		//NumOpe内でエラー
+		i3=-1;	//ダミー
+	}
+	else if( tempType.IsDouble() ){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//push 0
+		op_push_V(0);
+
+		//fild dword ptr[esp]
+		op_fld_ptr_esp(DEF_LONG);
+
+		//add esp,sizeof(double)+sizeof(long)
+		op_add_esp(sizeof(double)+sizeof(long));
+
+		//fcompp
+		OpBuffer[obp++]=(char)0xDE;
+		OpBuffer[obp++]=(char)0xD9;
+
+		//fnstsw ax
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0xE0;
+
+		//test ah,40
+		OpBuffer[obp++]=(char)0xF6;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)0x40;
+
+		//jne (endif、または else まで)
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x85;
+		obp+=sizeof(long);
+
+		//jneの番地
+		i3=obp;
+	}
+	else if( tempType.IsSingle() ){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//push 0
+		op_push_V(0);
+
+		//fild dword ptr[esp]
+		op_fld_ptr_esp(DEF_LONG);
+
+		//add esp,sizeof(float)+sizeof(long)
+		op_add_esp(sizeof(float)+sizeof(long));
+
+		//fcompp
+		OpBuffer[obp++]=(char)0xDE;
+		OpBuffer[obp++]=(char)0xD9;
+
+		//fnstsw ax
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0xE0;
+
+		//test ah,40
+		OpBuffer[obp++]=(char)0xF6;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)0x40;
+
+		//jne (endif、または else まで)
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x85;
+		obp+=sizeof(long);
+
+		//jneの番地
+		i3=obp;
+	}
+	else if( tempType.Is64() ){
+		//64ビット型
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//cmp eax,0
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xF8;
+		OpBuffer[obp++]=(char)0x00;
+
+		//jne
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x85;
+		obp+=sizeof(long);
+		i3=obp;
+
+
+		//cmp ebx,0
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xFB;
+		OpBuffer[obp++]=(char)0x00;
+
+		//jne
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x85;
+		obp+=sizeof(long);
+		i4=obp;
+
+
+
+		//jmp (endif、または else までジャンプ)
+		OpBuffer[obp++]=(char)0xE9;
+		obp+=sizeof(long);
+
+		*((long *)(OpBuffer+i3-sizeof(long)))=obp-i3;
+		*((long *)(OpBuffer+i4-sizeof(long)))=obp-i4;
+
+		//jmpの番地
+		i3=obp;
+	}
+	else{
+		//32ビット型
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//cmp eax,0
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xF8;
+		OpBuffer[obp++]=(char)0x00;
+
+		//je (endif、または else まで条件ジャンプ)
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x84;
+		obp+=sizeof(long);
+
+		//jeの番地
+		i3=obp;
+	}
+
+
+	/////////////////////////
+	// If内をコード化
+	/////////////////////////
+
+	//レキシカルスコープをレベルアップ
+	obj_LexScopes.Start( obp, SCOPE_TYPE_IF );
+
+	i2=CompileBuffer(ESC_ENDIF,0);
+
+	//レキシカルスコープをレベルダウン
+	obj_LexScopes.End();
+
+
+	if(i3==-1) return;
+
+	if(i2==ESC_ELSE){
+		//jmp (endifまで)
+		OpBuffer[obp++]=(char)0xE9;
+		obp+=sizeof(long);
+
+		*((long *)(OpBuffer+i3-sizeof(long)))=obp-i3;	//ifからelseへのジャンプ先のオフセット値
+
+		i3=obp;
+
+
+		/////////////////////////
+		// Else内をコード化
+		/////////////////////////
+
+		//レキシカルスコープをレベルアップ
+		obj_LexScopes.Start( obp, SCOPE_TYPE_IF );
+
+		CompileBuffer(ESC_ENDIF,0);
+
+		//レキシカルスコープをレベルダウン
+		obj_LexScopes.End();
+
+
+		*((long *)(OpBuffer+i3-sizeof(long)))=obp-i3;	//jmpジャンプ先のオフセット値
+	}
+	else{
+		*((long *)(OpBuffer+i3-sizeof(long)))=obp-i3;	//jeジャンプ先のオフセット値
+	}
+}
+
+int GetLabelAddress(char *LabelName,int LineNum){
+	extern int MaxLabelNum;
+	extern LABEL *pLabelNames;
+	int i;
+
+	if(LabelName){
+		for(i=0;i<MaxLabelNum;i++){
+			if(pLabelNames[i].pName){
+				if(lstrcmp(LabelName,pLabelNames[i].pName)==0) return pLabelNames[i].address;
+			}
+		}
+	}
+	else{
+		for(i=0;i<MaxLabelNum;i++){
+			if(pLabelNames[i].pName==0){
+				if(LineNum==pLabelNames[i].line) return pLabelNames[i].address;
+			}
+		}
+	}
+	return -1;
+}
+void OpcodeGoto(char *Parameter){
+	extern HANDLE hHeap;
+	extern GOTOLABELSCHEDULE *pGotoLabelSchedule;
+	extern int GotoLabelScheduleNum;
+	int i,LineNum;
+
+	if(Parameter[0]=='*'){
+		i=GetLabelAddress(Parameter+1,0);
+
+		//jmp ...
+		OpBuffer[obp++]=(char)0xE9;
+		if(i==-1){
+			pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapReAlloc(hHeap,0,pGotoLabelSchedule,(GotoLabelScheduleNum+1)*sizeof(GOTOLABELSCHEDULE));
+			pGotoLabelSchedule[GotoLabelScheduleNum].pName=(char *)HeapAlloc(hHeap,0,lstrlen(Parameter+1)+1);
+			lstrcpy(pGotoLabelSchedule[GotoLabelScheduleNum].pName,Parameter+1);
+			pGotoLabelSchedule[GotoLabelScheduleNum].pos=obp;
+			pGotoLabelSchedule[GotoLabelScheduleNum].now_cp=cp;
+			GotoLabelScheduleNum++;
+		}
+		*((long *)(OpBuffer+obp))=i-(obp+sizeof(long));
+		obp+=sizeof(long);
+	}
+	else{
+		LineNum=atoi(Parameter);
+		i=GetLabelAddress(0,LineNum);
+
+		//jmp ...
+		OpBuffer[obp++]=(char)0xE9;
+		if(i==-1){
+			pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapReAlloc(hHeap,0,pGotoLabelSchedule,(GotoLabelScheduleNum+1)*sizeof(GOTOLABELSCHEDULE));
+			pGotoLabelSchedule[GotoLabelScheduleNum].pName=0;
+			pGotoLabelSchedule[GotoLabelScheduleNum].line=LineNum;
+			pGotoLabelSchedule[GotoLabelScheduleNum].pos=obp;
+			pGotoLabelSchedule[GotoLabelScheduleNum].now_cp=cp;
+			GotoLabelScheduleNum++;
+		}
+		*((long *)(OpBuffer+obp))=i-(obp+sizeof(long));
+		obp+=sizeof(long);
+	}
+}
+void OpcodeWhile(char *Parameter){
+	extern HANDLE hHeap;
+	int i2,i3 = 0;
+
+	//Continueアドレスのバックアップとセット
+	extern DWORD dwContinueAddress;
+	DWORD dwTempContinue;
+	dwTempContinue=dwContinueAddress;
+	dwContinueAddress=obp;
+
+	if(!Parameter[0]) SetError(10,"While",cp);
+
+	int je_schedule;
+	Type tempType;
+	if( !NumOpe(Parameter,Type(),tempType) ){
+		//ダミー
+		i3=-1;
+	}
+	else if( tempType.IsDouble() ){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//push 0
+		op_push_V(0);
+
+		//fild dword ptr[esp]
+		op_fld_ptr_esp(DEF_LONG);
+
+		//add esp,sizeof(double)+sizeof(long)
+		op_add_esp(sizeof(double)+sizeof(long));
+
+		//fcompp
+		OpBuffer[obp++]=(char)0xDE;
+		OpBuffer[obp++]=(char)0xD9;
+
+		//fnstsw ax
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0xE0;
+
+		//test ah,40
+		OpBuffer[obp++]=(char)0xF6;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)0x40;
+
+		//jne (Wend まで)
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x85;
+		obp+=sizeof(long);
+
+		//jeの番地
+		je_schedule=obp;
+	}
+	else if( tempType.IsSingle() ){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//push 0
+		op_push_V(0);
+
+		//fild dword ptr[esp]
+		op_fld_ptr_esp(DEF_LONG);
+
+		//add esp,sizeof(float)+sizeof(long)
+		op_add_esp(sizeof(float)+sizeof(long));
+
+		//fcompp
+		OpBuffer[obp++]=(char)0xDE;
+		OpBuffer[obp++]=(char)0xD9;
+
+		//fnstsw ax
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0xE0;
+
+		//test ah,40
+		OpBuffer[obp++]=(char)0xF6;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)0x40;
+
+		//jne (Wend まで)
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x85;
+		obp+=sizeof(long);
+
+		//jeの番地
+		je_schedule=obp;
+	}
+	else if( tempType.Is64() ){
+		//64ビット型
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//cmp eax,0
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xF8;
+		OpBuffer[obp++]=(char)0x00;
+
+		//jne
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x85;
+		obp+=sizeof(long);
+		i2=obp;
+
+
+		//cmp ebx,0
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xFB;
+		OpBuffer[obp++]=(char)0x00;
+
+		//jne
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x85;
+		obp+=sizeof(long);
+		i3=obp;
+
+
+		//jmp (endif、または else までジャンプ)
+		OpBuffer[obp++]=(char)0xE9;
+		obp+=sizeof(long);
+
+		*((long *)(OpBuffer+i2-sizeof(long)))=obp-i2;
+		*((long *)(OpBuffer+i3-sizeof(long)))=obp-i3;
+
+		//jmpの番地
+		je_schedule=obp;
+	}
+	else{
+		//その他整数型
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//cmp eax,0
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xF8;
+		OpBuffer[obp++]=(char)0x00;
+
+		//je (Wend まで)
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x84;
+		obp+=sizeof(long);
+
+		//実行中の番地
+		je_schedule=obp;
+	}
+
+	//レキシカルスコープをレベルアップ
+	obj_LexScopes.Start( obp, SCOPE_TYPE_WHILE );
+
+	//While内をコンパイル
+	CompileBuffer(0,COM_WEND);
+
+	obj_LexScopes.CallDestructorsOfScopeEnd();
+
+	if( i3 == -1 ){
+		return;
+	}
+
+	//jmp ...
+	OpBuffer[obp++]=(char)0xE9;
+	*((long *)(OpBuffer+obp))=dwContinueAddress-(obp+sizeof(long));
+	obp+=sizeof(long);
+
+	//レキシカルスコープをレベルダウン
+	obj_LexScopes.End();
+
+	*((long *)(OpBuffer+je_schedule-sizeof(long)))=obp-je_schedule;	//jeジャンプ先のオフセット値
+
+	//Continueアドレスを復元
+	dwContinueAddress=dwTempContinue;
+}
+
+char szNextVariable[VN_SIZE];
+void OpcodeFor(char *Parameter){
+	extern HANDLE hHeap;
+	int i,i2,i3;
+	char temporary[VN_SIZE],variable[VN_SIZE],JudgeNum[VN_SIZE],StepNum[VN_SIZE];
+
+	//第１パラメータを取得
+	i=GetOneParameter(Parameter,0,temporary);
+	if(!Parameter[i]){
+		SetError(12,"For",cp);
+		goto ErrorStep;
+	}
+
+	for(i2=0;;i2++){
+		if(temporary[i2]=='='){
+			variable[i2]=0;
+
+			//カウンタ初期化
+			OpcodeCalc(temporary);
+			break;
+		}
+		if(temporary[i2]=='\0'){
+			SetError(12,"For",cp);
+			goto ErrorStep;
+		}
+		variable[i2]=temporary[i2];
+	}
+
+	//jmp ...
+	OpBuffer[obp++]=(char)0xE9;
+	i2=obp;
+	obp+=sizeof(long);
+
+	//Continueアドレスのバックアップとセット
+	extern DWORD dwContinueAddress;
+	DWORD dwTempContinue;
+	dwTempContinue=dwContinueAddress;
+	dwContinueAddress=obp;
+
+	//第２パラメータを取得（to～）
+	i=GetOneParameter(Parameter,i,JudgeNum);
+
+	//第３パラメータを取得（step～）
+	if(Parameter[i]){
+		i=GetOneParameter(Parameter,i,StepNum);
+		if(Parameter[i]) SetError(12,"For",cp);
+	}
+	else lstrcpy(StepNum,"1");
+
+	//カウンタを増加させる
+	sprintf(temporary,"%s=(%s)+(%s)",variable,variable,StepNum);
+	OpcodeCalc(temporary);
+
+	*((long *)(OpBuffer+i2))=obp-(i2+sizeof(long));
+
+	//増加か減少かを区別する
+	sprintf(temporary,"(%s)>=0",StepNum);
+	NumOpe(temporary,Type(),Type());
+
+	//pop eax
+	op_pop(REG_EAX);
+
+	//cmp eax,0
+	OpBuffer[obp++]=(char)0x83;
+	OpBuffer[obp++]=(char)0xF8;
+	OpBuffer[obp++]=(char)0x00;
+
+	//je [カウンタ減少の場合の判定]
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x84;
+	i2=obp;
+	obp+=sizeof(long);
+
+	//判定（カウンタ増加の場合）
+	sprintf(temporary,"%s<=(%s)",variable,JudgeNum);
+	NumOpe(temporary,Type(),Type());
+
+	//pop eax
+	op_pop(REG_EAX);
+
+	//jmp [カウンタ減少の場合の判定を飛び越す]
+	OpBuffer[obp++]=(char)0xE9;
+	i3=obp;
+	obp+=sizeof(long);
+
+	*((long *)(OpBuffer+i2))=obp-(i2+sizeof(long)); //jeジャンプ先のオフセット値
+
+	//判定（カウンタ減少の場合）
+	sprintf(temporary,"%s>=(%s)",variable,JudgeNum);
+	NumOpe(temporary,Type(),Type());
+
+	//pop eax
+	op_pop(REG_EAX);
+
+	*((long *)(OpBuffer+i3))=obp-(i3+sizeof(long)); //jmpジャンプ先のオフセット値
+
+	//cmp eax,0
+	OpBuffer[obp++]=(char)0x83;
+	OpBuffer[obp++]=(char)0xF8;
+	OpBuffer[obp++]=(char)0x00;
+
+ErrorStep:
+
+	//je ...
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x84;
+	int je_schedule=obp;
+	obp+=sizeof(long);
+
+	//レキシカルスコープをレベルアップ
+	obj_LexScopes.Start( obp, SCOPE_TYPE_FOR );
+
+	//For内をコンパイル
+	CompileBuffer(0,COM_NEXT);
+
+	obj_LexScopes.CallDestructorsOfScopeEnd();
+
+	if(szNextVariable[0]){
+		if(lstrcmp(szNextVariable,variable)!=0){
+			SetError(55,szNextVariable,cp);
+		}
+	}
+
+	//jmp ...
+	OpBuffer[obp++]=(char)0xE9;
+	*((long *)(OpBuffer+obp))=dwContinueAddress-(obp+sizeof(long));
+	obp+=sizeof(long);
+
+	//レキシカルスコープをレベルダウン
+	obj_LexScopes.End();
+
+	*((long *)(OpBuffer+je_schedule))=obp-(je_schedule+sizeof(long)); //jeジャンプ先のオフセット値
+
+	//Continueアドレスを復元
+	dwContinueAddress=dwTempContinue;
+}
+
+void OpcodeDo(char *Parameter){
+	extern HANDLE hHeap;
+	int i,i2,i3,i4;
+
+	if(Parameter[0]) SetError(10,"Do",cp);
+
+	//Continueアドレスのバックアップとセット
+	extern DWORD dwContinueAddress;
+	DWORD dwTempContinue;
+	dwTempContinue=dwContinueAddress;
+	dwContinueAddress=obp;
+
+	//レキシカルスコープをレベルアップ
+	obj_LexScopes.Start( obp, SCOPE_TYPE_DO );
+
+	//Do内をコンパイル
+	CompileBuffer(0,COM_LOOP);
+
+	obj_LexScopes.CallDestructorsOfScopeEnd();
+
+	extern char *basbuf;
+	char temporary[VN_SIZE];
+	for(i=cp-1;;i--){
+		if(IsCommandDelimitation(basbuf[i])){
+			i+=3;
+			if(!(basbuf[i]=='0'||basbuf[i]=='1')){
+				//無条件ループ
+				break;
+			}
+			i3=i;
+
+			for(i+=2,i2=0;;i++,i2++){
+				if(IsCommandDelimitation(basbuf[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+			}
+
+			Type tempType;
+			NumOpe(temporary,Type(),tempType);
+
+			if( tempType.IsDouble() ){
+				//fld qword ptr[esp]
+				op_fld_ptr_esp(DEF_DOUBLE);
+
+				//push 0
+				op_push_V(0);
+
+				//fild dword ptr[esp]
+				op_fld_ptr_esp(DEF_LONG);
+
+				//add esp,sizeof(double)+sizeof(long)
+				op_add_esp(sizeof(double)+sizeof(long));
+
+				//fcompp
+				OpBuffer[obp++]=(char)0xDE;
+				OpBuffer[obp++]=(char)0xD9;
+
+				//fnstsw ax
+				OpBuffer[obp++]=(char)0xDF;
+				OpBuffer[obp++]=(char)0xE0;
+
+				//test ah,40
+				OpBuffer[obp++]=(char)0xF6;
+				OpBuffer[obp++]=(char)0xC4;
+				OpBuffer[obp++]=(char)0x40;
+
+				if(basbuf[i3]=='0'){
+					//While
+
+					//jne 5（ループ終了）
+					OpBuffer[obp++]=(char)0x75;
+					OpBuffer[obp++]=(char)0x05;
+				}
+				else if(basbuf[i3]=='1'){
+					//Until
+
+					//je 5（ループ終了）
+					OpBuffer[obp++]=(char)0x74;
+					OpBuffer[obp++]=(char)0x05;
+				}
+			}
+			else if( tempType.IsSingle() ){
+				//fld dword ptr[esp]
+				op_fld_ptr_esp(DEF_SINGLE);
+
+				//push 0
+				op_push_V(0);
+
+				//fild dword ptr[esp]
+				op_fld_ptr_esp(DEF_LONG);
+
+				//add esp,sizeof(float)+sizeof(long)
+				op_add_esp(sizeof(float)+sizeof(long));
+
+				//fcompp
+				OpBuffer[obp++]=(char)0xDE;
+				OpBuffer[obp++]=(char)0xD9;
+
+				//fnstsw ax
+				OpBuffer[obp++]=(char)0xDF;
+				OpBuffer[obp++]=(char)0xE0;
+
+				//test ah,40
+				OpBuffer[obp++]=(char)0xF6;
+				OpBuffer[obp++]=(char)0xC4;
+				OpBuffer[obp++]=(char)0x40;
+
+				if(basbuf[i3]=='0'){
+					//While
+
+					//jne 5（ループ終了）
+					OpBuffer[obp++]=(char)0x75;
+					OpBuffer[obp++]=(char)0x05;
+				}
+				else if(basbuf[i3]=='1'){
+					//Until
+
+					//je 5（ループ終了）
+					OpBuffer[obp++]=(char)0x74;
+					OpBuffer[obp++]=(char)0x05;
+				}
+			}
+			else if( tempType.Is64() ){
+				//64ビット型
+
+				//pop eax
+				op_pop(REG_EAX);
+
+				//pop ebx
+				op_pop(REG_EBX);
+
+				//cmp eax,0
+				OpBuffer[obp++]=(char)0x83;
+				OpBuffer[obp++]=(char)0xF8;
+				OpBuffer[obp++]=(char)0x00;
+
+				//jne
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0x85;
+				obp+=sizeof(long);
+				i2=obp;
+
+
+				//cmp ebx,0
+				OpBuffer[obp++]=(char)0x83;
+				OpBuffer[obp++]=(char)0xFB;
+				OpBuffer[obp++]=(char)0x00;
+
+				//jne
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0x85;
+				obp+=sizeof(long);
+				i4=obp;
+
+
+				if(basbuf[i3]=='0'){
+					//While
+
+					//jmp 5（ループ終了）
+					OpBuffer[obp++]=(char)0xEB;
+					OpBuffer[obp++]=(char)0x05;
+
+					*((long *)(OpBuffer+i2-sizeof(long)))=obp-i2;
+					*((long *)(OpBuffer+i4-sizeof(long)))=obp-i4;
+				}
+				else if(basbuf[i3]=='1'){
+					//Until
+
+					//jmp 2（ループを続ける）
+					OpBuffer[obp++]=(char)0xEB;
+					OpBuffer[obp++]=(char)0x02;
+
+					*((long *)(OpBuffer+i2-sizeof(long)))=obp-i2;
+					*((long *)(OpBuffer+i4-sizeof(long)))=obp-i4;
+
+					//jmp 5（ループ終了）
+					OpBuffer[obp++]=(char)0xEB;
+					OpBuffer[obp++]=(char)0x05;
+				}
+			}
+			else{
+				//pop eax
+				op_pop(REG_EAX);
+
+				//cmp eax,0
+				OpBuffer[obp++]=(char)0x83;
+				OpBuffer[obp++]=(char)0xF8;
+				OpBuffer[obp++]=(char)0x00;
+
+				if(basbuf[i3]=='0'){
+					//While
+
+					//je 5（ループ終了）
+					OpBuffer[obp++]=(char)0x74;
+					OpBuffer[obp++]=(char)0x05;
+				}
+				else if(basbuf[i3]=='1'){
+					//Until
+
+					//jne 5（ループ終了）
+					OpBuffer[obp++]=(char)0x75;
+					OpBuffer[obp++]=(char)0x05;
+				}
+			}
+			break;
+		}
+	}
+
+	//jmp ...
+	OpBuffer[obp++]=(char)0xE9;
+	*((long *)(OpBuffer+obp))=dwContinueAddress-(obp+sizeof(long));
+	obp+=sizeof(long);
+
+	//jmp ...
+	OpBuffer[obp++]=(char)0xE9;
+	int je_schedule=obp;
+	obp+=sizeof(long);
+
+	//レキシカルスコープをレベルダウン
+	obj_LexScopes.End();
+
+	*((long *)(OpBuffer+je_schedule))=obp-(je_schedule+sizeof(long)); //jmpジャンプ先のオフセット値
+
+
+	//Continueアドレスを復元
+	dwContinueAddress=dwTempContinue;
+}
+void OpcodeContinue(void){
+	extern DWORD dwContinueAddress;
+
+	if(dwContinueAddress==-1){
+		SetError(12,"Continue",cp);
+		return;
+	}
+
+	//jmp ...(Continue addr)
+	OpBuffer[obp++]=(char)0xE9;
+
+	*((long *)(OpBuffer+obp))=dwContinueAddress-(obp+sizeof(long));
+	obp+=sizeof(long);
+}
+
+void OpcodeExitSub(void){
+	extern DWORD *pExitSubSchedule;
+	extern int ExitSubScheduleNum;
+	extern HANDLE hHeap;
+
+	if( UserProc::IsGlobalAreaCompiling() ){
+		SetError(12,"Exit Sub/Function",cp);
+		return;
+	}
+
+	//未解放のローカルオブジェクトのデストラクタを呼び出す
+	obj_LexScopes.CallDestructorsOfReturn();
+
+	//jmp ...(End Sub/Function)
+	OpBuffer[obp++]=(char)0xE9;
+
+	pExitSubSchedule=(DWORD *)HeapReAlloc(hHeap,0,pExitSubSchedule,(ExitSubScheduleNum+1)*sizeof(DWORD));
+	pExitSubSchedule[ExitSubScheduleNum]=obp;
+	ExitSubScheduleNum++;
+
+	obp+=sizeof(long);
+}
+
+void AddCaseSchedule(void){
+	extern DWORD *pCaseSchedule;
+	extern int CaseScheduleNum;
+	extern HANDLE hHeap;
+
+	pCaseSchedule=(DWORD *)HeapReAlloc(hHeap,0,pCaseSchedule,(CaseScheduleNum+1)*sizeof(DWORD));
+	pCaseSchedule[CaseScheduleNum]=obp;
+	CaseScheduleNum++;
+}
+
+int CaseTypeSize;
+void OpcodeSelect(const char *lpszParms){
+	extern DWORD *pCaseSchedule;
+	extern int CaseScheduleNum;
+	extern int NowCaseSchedule;
+	extern int CaseTypeSize;
+	extern HANDLE hHeap;
+	extern char *basbuf;
+	int i,i2,i3,sw,NowCaseCp;
+	char temporary[VN_SIZE];
+
+	DWORD *temp_pCaseSchedule;
+	int temp_CaseScheduleNum;
+	int temp_NowCaseSchedule;
+	int temp_CaseTypeSize;
+
+	temp_pCaseSchedule=pCaseSchedule;
+	temp_CaseScheduleNum=CaseScheduleNum;
+	temp_NowCaseSchedule=NowCaseSchedule;
+	temp_CaseTypeSize=CaseTypeSize;
+	pCaseSchedule=(DWORD *)HeapAlloc(hHeap,0,1);
+	CaseScheduleNum=0;
+	NowCaseSchedule=0;
+
+	Type type1;
+	if( !NumOpe(lpszParms,Type(), type1 ) ){
+		return;
+	}
+
+	CaseTypeSize = type1.GetSize();
+	if( CaseTypeSize < sizeof(long) ){
+		CaseTypeSize=sizeof(long);
+	}
+
+	for(i=cp,sw=0;;i++){
+		if(basbuf[i]=='\0'){
+			HeapDefaultFree(pCaseSchedule);
+			pCaseSchedule=temp_pCaseSchedule;
+			CaseScheduleNum=temp_CaseScheduleNum;
+			NowCaseSchedule=temp_NowCaseSchedule;
+			CaseTypeSize=temp_CaseTypeSize;
+			SetError(22,"Select",cp);
+			return;
+		}
+		if(basbuf[i]==1&&basbuf[i+1]==ESC_SELECTCASE){
+			for(i2=0;;i++){
+				if(basbuf[i]==1&&basbuf[i+1]==ESC_SELECTCASE) i2++;
+				if(basbuf[i]==1&&basbuf[i+1]==ESC_ENDSELECT){
+					i2--;
+					if(i2==0) break;
+				}
+			}
+			continue;
+		}
+		if(basbuf[i]==1&&basbuf[i+1]==ESC_ENDSELECT){
+			if(sw==0){
+				//add esp,CaseTypeSize
+				op_add_esp(CaseTypeSize);
+			}
+			break;
+		}
+		if(basbuf[i]==1&&basbuf[i+1]==ESC_CASE){
+			NowCaseCp=i;
+
+			i++;
+			while(1){
+				for(i++,i2=0;;i++,i2++){
+					if(basbuf[i]=='\"'){
+						i3=GetStringInQuotation(temporary+i2,basbuf+i);
+						i+=i3-1;
+						i2+=i3-1;
+						continue;
+					}
+					if(basbuf[i]=='('){
+						i3=GetStringInPare(temporary+i2,basbuf+i);
+						i+=i3-1;
+						i2+=i3-1;
+						continue;
+					}
+					if(basbuf[i]=='['){
+						i3=GetStringInBracket(temporary+i2,basbuf+i);
+						i+=i3-1;
+						i2+=i3-1;
+						continue;
+					}
+
+					if(IsCommandDelimitation(basbuf[i])){
+						temporary[i2]=0;
+						break;
+					}
+					if(basbuf[i]==','){
+						temporary[i2]=0;
+						break;
+					}
+
+					temporary[i2]=basbuf[i];
+				}
+
+				//エラー用
+				i2=cp;
+				cp=NowCaseCp;
+
+				Type type2;
+				if( !NumOpe(temporary,type1,type2) ){
+					return;
+				}
+
+				cp=i2;
+
+				if(type1.IsObject()){
+					std::vector<UserProc *> subs;
+					type1.GetClass().GetMethods().Enum( CALC_EQUAL, subs );
+					if( subs.size() == 0 ){
+						return;
+					}
+
+					Parameters params;
+					params.push_back( new Parameter( "", Type( type2 ) ) );
+
+					//オーバーロードを解決
+					UserProc *pUserProc;
+					pUserProc=OverloadSolution("==",subs, params, NULL);
+
+					delete params[0];
+
+					if(!pUserProc){
+						//エラー
+						return;
+					}
+
+
+					//pop edx
+					op_pop(REG_EDX);
+
+					//mov ecx,dword ptr[esp]
+					op_mov_RM(sizeof(long),REG_ECX,REG_ESP,0,MOD_BASE);
+
+					//push edx
+					op_push(REG_EDX);
+
+					//push ecx
+					op_push(REG_ECX);
+
+					//call operator_proc	※ ==演算子
+					op_call(pUserProc);
+
+					//test eax,eax
+					op_test(REG_EAX,REG_EAX);
+
+					//jne ...
+					OpBuffer[obp++]=(char)0x0F;
+					OpBuffer[obp++]=(char)0x85;
+					AddCaseSchedule();
+					obp+=sizeof(long);
+				}
+				else if(type1.IsDouble()){
+					ChangeTypeToDouble(type2.GetBasicType());
+
+					//fld qword ptr[esp]
+					op_fld_ptr_esp(DEF_DOUBLE);
+
+					//add esp,CaseTypeSize
+					op_add_esp(CaseTypeSize);
+
+					//fld qword ptr[esp]
+					op_fld_ptr_esp(DEF_DOUBLE);
+
+					//fcompp
+					OpBuffer[obp++]=(char)0xDE;
+					OpBuffer[obp++]=(char)0xD9;
+
+					//fnstsw ax
+					OpBuffer[obp++]=(char)0xDF;
+					OpBuffer[obp++]=(char)0xE0;
+
+					//test ah,40
+					OpBuffer[obp++]=(char)0xF6;
+					OpBuffer[obp++]=(char)0xC4;
+					OpBuffer[obp++]=(char)0x40;
+
+					//jne ...
+					OpBuffer[obp++]=(char)0x0F;
+					OpBuffer[obp++]=(char)0x85;
+					AddCaseSchedule();
+					obp+=sizeof(long);
+				}
+				else if(type1.IsSingle()){
+					ChangeTypeToSingle(type2.GetBasicType());
+
+					//fld dword ptr[esp]
+					op_fld_ptr_esp(DEF_SINGLE);
+
+					//add esp,CaseTypeSize
+					op_add_esp(CaseTypeSize);
+
+					//fld dword ptr[esp]
+					op_fld_ptr_esp(DEF_SINGLE);
+
+					//fcompp
+					OpBuffer[obp++]=(char)0xDE;
+					OpBuffer[obp++]=(char)0xD9;
+
+					//fnstsw ax
+					OpBuffer[obp++]=(char)0xDF;
+					OpBuffer[obp++]=(char)0xE0;
+
+					//test ah,40
+					OpBuffer[obp++]=(char)0xF6;
+					OpBuffer[obp++]=(char)0xC4;
+					OpBuffer[obp++]=(char)0x40;
+
+					//jne ...
+					OpBuffer[obp++]=(char)0x0F;
+					OpBuffer[obp++]=(char)0x85;
+					AddCaseSchedule();
+					obp+=sizeof(long);
+				}
+				else{
+					//その他整数型
+
+					//pop ebx
+					op_pop(REG_EBX);
+
+					//mov eax,dword ptr[esp]
+					OpBuffer[obp++]=(char)0x8B;
+					OpBuffer[obp++]=(char)0x04;
+					OpBuffer[obp++]=(char)0x24;
+
+					//cmp eax,ebx
+					OpBuffer[obp++]=(char)0x3B;
+					OpBuffer[obp++]=(char)0xC3;
+
+					//je ...
+					OpBuffer[obp++]=(char)0x0F;
+					OpBuffer[obp++]=(char)0x84;
+					AddCaseSchedule();
+					obp+=sizeof(long);
+				}
+
+				if(basbuf[i]!=',') break;
+			}
+		}
+		if(basbuf[i]==1&&basbuf[i+1]==ESC_CASEELSE){
+			sw=1;
+
+			//jmp ...
+			OpBuffer[obp++]=(char)0xE9;
+			AddCaseSchedule();
+			obp+=sizeof(long);
+		}
+	}
+
+	//レキシカルスコープをレベルアップ
+	obj_LexScopes.Start( obp, SCOPE_TYPE_SELECT );
+
+	//Select Case内をコンパイル
+	CompileBuffer(ESC_ENDSELECT,0);
+
+	//jmp EndSelect
+	OpBuffer[obp++]=(char)0xE9;
+	AddCaseSchedule();
+	obp+=sizeof(long);
+
+	//最終スケジュール
+	for(i=NowCaseSchedule;i<CaseScheduleNum;i++){
+		*(long *)(OpBuffer+pCaseSchedule[i])=obp-(pCaseSchedule[i]+sizeof(long));
+	}
+	HeapDefaultFree(pCaseSchedule);
+
+	//レキシカルスコープをレベルダウン
+	obj_LexScopes.End();
+
+	pCaseSchedule=temp_pCaseSchedule;
+	CaseScheduleNum=temp_CaseScheduleNum;
+	NowCaseSchedule=temp_NowCaseSchedule;
+	CaseTypeSize=temp_CaseTypeSize;
+}
+void OpcodeCase(char *Parameter){
+	extern DWORD *pCaseSchedule;
+	extern int NowCaseSchedule;
+	extern int CaseTypeSize;
+	int i;
+
+	if(!pCaseSchedule){
+		SetError(30,"Case",cp);
+		return;
+	}
+
+	//jmp EndSelect
+	OpBuffer[obp++]=(char)0xE9;
+	AddCaseSchedule();
+	obp+=sizeof(long);
+
+	i=0;
+	while(1){
+		//Caseスケジュール
+		*(long *)(OpBuffer+pCaseSchedule[NowCaseSchedule])=obp-(pCaseSchedule[NowCaseSchedule]+sizeof(long));
+		NowCaseSchedule++;
+
+		i=JumpOneParameter(Parameter,i);
+		if(Parameter[i]=='\0') break;
+	}
+
+	//add esp,CaseTypeSize
+	op_add_esp(CaseTypeSize);
+}
+
+void OpcodeGosub(char *Parameter){
+	extern HANDLE hHeap;
+	extern GOTOLABELSCHEDULE *pGotoLabelSchedule;
+	extern int GotoLabelScheduleNum;
+	int i,LineNum;
+
+	if(Parameter[0]=='*'){
+		i=GetLabelAddress(Parameter+1,0);
+
+		//call ...
+		OpBuffer[obp++]=(char)0xE8;
+		if(i==-1){
+			pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapReAlloc(hHeap,0,pGotoLabelSchedule,(GotoLabelScheduleNum+1)*sizeof(GOTOLABELSCHEDULE));
+			pGotoLabelSchedule[GotoLabelScheduleNum].pName=(char *)HeapAlloc(hHeap,0,lstrlen(Parameter+1)+1);
+			lstrcpy(pGotoLabelSchedule[GotoLabelScheduleNum].pName,Parameter+1);
+			pGotoLabelSchedule[GotoLabelScheduleNum].pos=obp;
+			pGotoLabelSchedule[GotoLabelScheduleNum].now_cp=cp;
+			GotoLabelScheduleNum++;
+		}
+		*((long *)(OpBuffer+obp))=i-(obp+sizeof(long));
+		obp+=sizeof(long);
+	}
+	else{
+		LineNum=atoi(Parameter);
+		i=GetLabelAddress(0,LineNum);
+
+		//call ...
+		OpBuffer[obp++]=(char)0xE8;
+		if(i==-1){
+			pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapReAlloc(hHeap,0,pGotoLabelSchedule,(GotoLabelScheduleNum+1)*sizeof(GOTOLABELSCHEDULE));
+			pGotoLabelSchedule[GotoLabelScheduleNum].pName=0;
+			pGotoLabelSchedule[GotoLabelScheduleNum].line=LineNum;
+			pGotoLabelSchedule[GotoLabelScheduleNum].pos=obp;
+			pGotoLabelSchedule[GotoLabelScheduleNum].now_cp=cp;
+			GotoLabelScheduleNum++;
+		}
+		*((long *)(OpBuffer+obp))=i-(obp+sizeof(long));
+		obp+=sizeof(long);
+	}
+}
+void OpcodeReturn(char *Parameter){
+	if( UserProc::IsGlobalAreaCompiling() ){
+		//Gosub～Returnとして扱う
+
+		//ret
+		op_ret();
+	}
+	else{
+		//戻り値をセット
+		if(Parameter[0]){
+			UserProc &proc = UserProc::CompilingUserProc();
+
+			const char *temp = "_System_ReturnValue";
+			if(proc.GetName()[0]==1&&proc.GetName()[1]==ESC_OPERATOR)
+			{
+			}
+			else{
+				temp=proc.GetName().c_str();
+			}
+
+			char temporary[VN_SIZE];
+			sprintf(temporary,"%s=%s",temp,Parameter);
+			OpcodeCalc(temporary);
+		}
+
+		//プロシージャを抜け出す（C言語のreturnと同様の処理を行う）
+		OpcodeExitSub();
+	}
+}
+
+
+////////////
+// ポインタ
+
+void OpcodeSetPtrData(char *Parameter,int type){
+	int i;
+	char temporary[VN_SIZE];
+
+	if(Parameter[0]=='('){
+		i=JumpStringInPare(Parameter,1);
+		if(Parameter[i+1]=='\0'){
+			for(i=0;;i++){
+				Parameter[i]=Parameter[i+1];
+				if(Parameter[i]=='\0') break;
+			}
+			Parameter[i-1]=0;
+		}
+	}
+
+	//第１パラメータを取得
+	i=GetOneParameter(Parameter,0,temporary);
+	if(!Parameter[i]){
+		SetError(1,NULL,cp);
+		return;
+	}
+
+	Type resultType;
+	if( !NumOpe(temporary,Type(),resultType) ){
+		return;
+	}
+	if(!resultType.IsWhole()){
+		SetError(11,Parameter,cp);
+		return;
+	}
+
+	ChangeTypeToLong( resultType.GetBasicType() );
+
+	//第２パラメータを取得
+	i=GetOneParameter(Parameter,i,temporary);
+	if(Parameter[i]){
+		SetError(1,NULL,cp);
+		return;
+	}
+
+	if( !NumOpe(temporary,Type(),resultType) ){
+		return;
+	}
+
+	if(type==DEF_DOUBLE){
+		ChangeTypeToDouble_ToFpuReg( resultType.GetBasicType() );
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//fstp qword ptr[eax]
+		OpBuffer[obp++]=(char)0xDD;
+		OpBuffer[obp++]=(char)0x18;
+	}
+	else if(type==DEF_SINGLE){
+		ChangeTypeToSingle( resultType.GetBasicType() );
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//mov dword ptr[eax],ebx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x18;
+	}
+	else if(type==DEF_QWORD){
+		ChangeTypeToInt64( resultType.GetBasicType() );
+
+		//pop ecx
+		op_pop(REG_ECX);
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//mov dword ptr[eax],ecx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x08;
+
+		//mov dword ptr[eax+sizeof(long)],ebx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x58;
+		OpBuffer[obp++]=(char)0x04;
+	}
+	else if(type==DEF_DWORD){
+		ChangeTypeToLong( resultType.GetBasicType() );
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//mov dword ptr[eax],ebx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x18;
+	}
+	else if(type==DEF_WORD){
+		ChangeTypeToLong( resultType.GetBasicType() );
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//mov word ptr[eax],bx
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x18;
+	}
+	else if(type==DEF_BYTE){
+		ChangeTypeToLong( resultType.GetBasicType() );
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//mov byte ptr[eax],bl
+		OpBuffer[obp++]=(char)0x88;
+		OpBuffer[obp++]=(char)0x18;
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/Compile_Var.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/Compile_Var.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/Compile_Var.cpp	(revision 178)
@@ -0,0 +1,1368 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+//変数
+Variables globalVars;
+int AllGlobalVarSize;
+int AllInitGlobalVarSize;
+
+int AllLocalVarSize;
+
+
+void SetRelativeOffset( Type &resultType, RELATIVE_VAR *pRelativeVar,const char *lpPtrOffset){
+	PushLongVariable(pRelativeVar);
+
+	Type type;
+	NumOpe( lpPtrOffset, Type(), type );
+	ChangeTypeToLong( type.GetBasicType() );
+
+	//pop ebx
+	op_pop(REG_EBX);
+
+	if( resultType.PtrLevel() ){
+		resultType.PtrLevelDown();
+
+		int typeSize = resultType.GetSize();
+		if(typeSize>=2){
+			//imul ebx,i2
+			op_imul_RV( REG_EBX, typeSize );
+		}
+	}
+	else{
+		//エラー
+		SetError(1,NULL,cp);
+		return;
+	}
+
+	//pop ecx
+	op_pop(REG_ECX);
+
+	//add ecx,ebx
+	OpBuffer[obp++]=(char)0x03;
+	OpBuffer[obp++]=(char)0xCB;
+}
+void SetRelativeOffset( RELATIVE_VAR &relativeVar ){
+	if(relativeVar.dwKind==VAR_DIRECTMEM){
+		//mov ecx,dword ptr[ecx]
+		op_mov_RM( sizeof(long), REG_ECX, REG_ECX, 0, MOD_BASE );
+	}
+	else{
+		//直接参照に切り替え
+		SetVarPtrToEax(&relativeVar);
+		relativeVar.dwKind=VAR_DIRECTMEM;
+
+		//mov ecx,dword ptr[eax]
+		op_mov_RM( sizeof(long), REG_ECX, REG_EAX, 0, MOD_BASE );
+	}
+}
+bool GetArrayOffset(const int *SubScripts,char *array, const Type &type){
+	extern HANDLE hHeap;
+	int i,i2,i3,i4;
+	char temporary[VN_SIZE],*pParm[MAX_PARMS];
+
+	for(i=0,i2=0,i3=0;;i++,i2++){
+		if(array[i]=='('){
+			i4=GetStringInPare(temporary+i2,array+i);
+			i+=i4-1;
+			i2+=i4-1;
+			continue;
+		}
+		if(array[i]=='['){
+			i4=GetStringInBracket(temporary+i2,array+i);
+			i+=i4-1;
+			i2+=i4-1;
+			continue;
+		}
+		if(array[i]==','||array[i]=='\0'){
+			if(SubScripts[i3]==-1){
+				for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]);
+				return 0;
+			}
+
+			temporary[i2]=0;
+
+			pParm[i3]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+			lstrcpy(pParm[i3],temporary);
+
+			i3++;
+
+			if(array[i]=='\0'){
+				if(SubScripts[i3]!=-1){
+					for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]);
+					return 0;
+				}
+				break;
+			}
+
+			i2=-1;
+			continue;
+		}
+		temporary[i2]=array[i];
+	}
+
+	//push ecx
+	op_push(REG_ECX);
+
+	//push 0
+	op_push_V(0);
+
+	for(i=i3-1;i>=0;i--){
+		Type tempType;
+		BOOL bUseHeap;
+		NumOpe( pParm[i], Type( DEF_LONG ), tempType, &bUseHeap );
+		if( tempType.IsObject() ){
+			//キャスト演算子のオーバーロードに対応する
+			CallCastOperatorProc(
+				tempType,
+				bUseHeap, Type(DEF_LONG) );
+			tempType.SetBasicType( DEF_LONG );
+		}
+		ChangeTypeToLong( tempType.GetBasicType() );
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		for(i2=i+1,i4=1;i2<i3;i2++) i4*=SubScripts[i2]+1;
+
+		//imul eax,i4
+		OpBuffer[obp++]=(char)0x69;
+		OpBuffer[obp++]=(char)0xC0;
+		*((long *)(OpBuffer+obp))=i4;
+		obp+=sizeof(long);
+
+		//add dword ptr[esp],eax
+		OpBuffer[obp++]=(char)0x01;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+
+		HeapDefaultFree(pParm[i]);
+	}
+
+	//pop eax
+	op_pop(REG_EAX);
+
+	//imul eax,TypeSize
+	OpBuffer[obp++]=(char)0x69;
+	OpBuffer[obp++]=(char)0xC0;
+	*((long *)(OpBuffer+obp)) = type.GetSize();
+	obp+=sizeof(long);
+
+	//pop ecx
+	op_pop(REG_ECX);
+
+	//add ecx,eax
+	OpBuffer[obp++]=(char)0x03;
+	OpBuffer[obp++]=(char)0xC8;
+
+	return 1;
+}
+bool _member_offset(bool isErrorEnabled, bool isWriteAccess, const CClass &objClass, const char *member, RELATIVE_VAR *pRelativeVar, Type &resultType, BOOL bPrivateAccess){
+
+	//////////////////////////////////////
+	// クラス、配列の構成要素を解析する
+	//////////////////////////////////////
+
+	char VarName[VN_SIZE];		//変数名
+	char array[VN_SIZE];		//第1次配列
+	char lpPtrOffset[VN_SIZE];	//第2次配列
+	char NestMember[VN_SIZE];	//入れ子メンバ
+	CClass::RefType refType;
+	lstrcpy(VarName,member);
+	if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,refType)) return false;
+
+
+	////////////////////////////
+	// メンバオフセットを取得
+	////////////////////////////
+
+	int memberIndex;
+	int offset = objClass.GetMemberOffset( VarName, &memberIndex );
+	if(memberIndex==objClass.GetDynamicMembers().size()){
+		if(isErrorEnabled) SetError(103,VarName,cp);
+		return false;
+	}
+
+	CMember *pMember=objClass.GetDynamicMembers()[memberIndex];
+
+
+	//アクセシビリティをチェック
+	if(&objClass==pobj_CompilingClass){
+		//同一クラスオブジェクトの場合はプライベートアクセスを容認する
+		if(pMember->IsNoneAccess()){
+			if(isErrorEnabled) SetError(107,VarName,cp);
+			return false;
+		}
+	}
+	else{
+		if((bPrivateAccess==0&&pMember->IsPrivate())||
+			pMember->IsNoneAccess()){
+			if(isErrorEnabled) SetError(107,VarName,cp);
+			return false;
+		}
+		else if(bPrivateAccess==0&&pMember->IsProtected()){
+			if(isErrorEnabled) SetError(108,VarName,cp);
+			return false;
+		}
+	}
+
+	//Const定義の場合は書き込みアクセスを制限する
+	//※コンストラクタをコンパイル中の場合は例外的に許可する
+	if( pMember->IsConst() &&		//定数メンバである
+		isWriteAccess &&							//書き込みアクセスを要求されている
+		objClass.IsCompilingConstructor() == false	//コンストラクタ コンパイル中を除く
+		){
+			//Const定義の変数に書き込みアクセスをしようとした場合
+			SetError(61,VarName,cp);
+	}
+
+	resultType = pMember->GetType();
+
+	//ポインタ変数の場合
+	if( resultType.IsPointer() ){
+		if(pMember->SubScripts[0]==-1){
+			lstrcpy(lpPtrOffset,array);
+			array[0]=0;
+		}
+	}
+	else{
+		if(lpPtrOffset[0]){
+			if(isErrorEnabled) SetError(16,member,cp);
+			return false;
+		}
+	}
+
+	if(offset){
+		//add ecx,offset
+		OpBuffer[obp++]=(char)0x81;
+		OpBuffer[obp++]=(char)0xC1;
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+
+	if(array[0]){
+		//配列オフセット
+		if(!GetArrayOffset(pMember->SubScripts,array,pMember->GetType())){
+			if(isErrorEnabled) SetError(14,member,cp);
+		}
+	}
+	else if(pMember->SubScripts[0]!=-1){
+		resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR );
+	}
+
+	if(NestMember[0]){
+		//入れ子構造の場合
+
+		if( resultType.IsObject() || resultType.IsStruct() ){
+			if( refType != CClass::Dot ){
+				if(isErrorEnabled) SetError(104,member,cp);
+				return false;
+			}
+
+			if( resultType.IsObject() ){
+				// 参照内容へのポインタを抽出
+				SetRelativeOffset( *pRelativeVar );
+			}
+		}
+		else if( resultType.IsObjectPtr() || resultType.IsStructPtr() ){
+			//構造体ポインタ型メンバ変数
+
+			if(lpPtrOffset[0]){
+				//pObj[n].member
+				if( ( resultType.IsObjectPtr() || resultType.IsStructPtr() )
+					&& refType != CClass::Dot ){
+						if(isErrorEnabled) SetError(104,member,cp);
+						return false;
+				}
+
+				//直接参照に切り替え
+				SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+				lpPtrOffset[0]=0;
+			}
+			else{
+				//pObj->member
+				if( ( resultType.IsObjectPtr() || resultType.IsStructPtr() )
+					&& refType != CClass::Pointer ){
+						if(isErrorEnabled) SetError(104,member,cp);
+						return false;
+				}
+
+				SetRelativeOffset( *pRelativeVar );
+			}
+		}
+		else if( resultType.GetBasicType() == MAKE_PTR_TYPE(DEF_OBJECT,2)
+			|| resultType.GetBasicType() == MAKE_PTR_TYPE(DEF_STRUCT,2)){
+			//構造体ポインタのポインタ型メンバ変数
+
+			if(lpPtrOffset[0]){
+				//ppObj[n]->member
+				if( refType != CClass::Pointer ){
+					if(isErrorEnabled) SetError(104,member,cp);
+					return false;
+				}
+
+				//直接参照に切り替え
+				SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+				lpPtrOffset[0]=0;
+
+				//mov ecx,dword ptr[ecx]
+				OpBuffer[obp++]=(char)0x8B;
+				OpBuffer[obp++]=(char)0x09;
+			}
+			else{
+				if(isErrorEnabled) SetError(104,member,cp);
+				return false;
+			}
+		}
+
+		if(!_member_offset(
+			isErrorEnabled,
+			isWriteAccess,
+			pMember->GetType().GetClass(),
+			NestMember,
+			pRelativeVar,
+			resultType,
+			0)) return false;
+	}
+
+	if(lpPtrOffset[0]){
+		SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+		pRelativeVar->dwKind=VAR_DIRECTMEM;
+	}
+
+	return true;
+}
+
+int LocalVar_ThisPtrOffset;
+void SetThisPtrToReg(int reg){
+	//自身のオブジェクトのThisポインタをregにコピー
+
+	RELATIVE_VAR RelativeVar;
+	RelativeVar.dwKind=VAR_LOCAL;
+	RelativeVar.bOffsetOffset=0;
+	RelativeVar.offset=-LocalVar_ThisPtrOffset;
+
+	SetReg_WholeVariable(DEF_PTR_VOID,&RelativeVar,reg);
+}
+
+bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss){
+	char variable[VN_SIZE];
+
+	if(NameBuffer[0]=='.'){
+		GetWithName(variable);
+		lstrcat(variable,NameBuffer);
+	}
+	else lstrcpy(variable,NameBuffer);
+
+	// 名前空間を分離
+	char namespaceStr[VN_SIZE]="", simpleName[VN_SIZE];
+	Smoothie::meta.namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName );
+
+	// 先頭オブジェクトまたはクラス名と入れ子メンバに分割
+	CClass::RefType refType;
+	char member[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE];
+	GetVarFormatString(simpleName,array,lpPtrOffset,member,refType);
+
+	// 名前空間を分離していた場合は結合
+	char VarName[VN_SIZE];
+	if( namespaceStr[0] ){
+		sprintf( VarName, "%s.%s", namespaceStr, simpleName );
+	}
+	else{
+		lstrcpy( VarName, simpleName );
+	}
+
+	const int *pSubScripts;
+	bool bConst = false;
+
+
+	if( UserProc::IsLocalAreaCompiling() ){
+		//////////////////
+		// ローカル変数
+		//////////////////
+
+		const Variable *pVar = UserProc::CompilingUserProc().localVars.BackSearch( Symbol( VarName ) );
+		if( pVar ){
+			//ポインタ変数の場合
+			if( pVar->IsPointer() ){
+				if( !pVar->IsArray() ){
+					lstrcpy(lpPtrOffset,array);
+					array[0]=0;
+				}
+			}
+			else{
+				if(lpPtrOffset[0]){
+					SetError(16,variable,cp);
+					pRelativeVar->dwKind=NON_VAR;
+					return false;
+				}
+			}
+
+			pRelativeVar->offset=-pVar->offset;
+			pRelativeVar->bOffsetOffset=0;
+			if( pVar->IsRef() ){
+				// 参照型
+				pRelativeVar->dwKind = VAR_REFLOCAL;
+			}
+			else pRelativeVar->dwKind=VAR_LOCAL;
+			resultType = *pVar;
+			pSubScripts=pVar->GetSubScriptsPtr();
+			bConst = pVar->IsConst();
+
+			goto ok;
+		}
+	}
+
+	if(pobj_CompilingClass){
+		//////////////////////
+		// クラスメンバの参照
+		//////////////////////
+
+		if(lstrcmpi(variable,"This")==0){
+			//Thisオブジェクト
+
+			//Thisポインタをecxにコピー
+			SetThisPtrToReg(REG_ECX);
+
+			pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+			resultType.SetType( DEF_OBJECT, pobj_CompilingClass );
+			return true;
+		}
+
+		if(memicmp(variable,"This.",5)==0){
+			//Thisオブジェクトのメンバを参照するとき
+			SlideString(variable+5,-5);
+			lstrcpy(VarName,variable);
+		}
+		else{
+			//クラス内メンバを参照するとき（通常）
+
+			bool isFound = false;
+			BOOST_FOREACH( CMember *pMember, pobj_CompilingClass->GetDynamicMembers() ){
+				if( pMember->GetName() == VarName ){
+					isFound = true;
+					break;
+				}
+			}
+			if( !isFound ) goto NonClassMember;
+		}
+
+		//Const修飾子のメソッド内でメンバ書き込みアクセスが発生したとき
+		//（コンストラクタ、デストラクタ内を除く）
+		const CMethod *pMethod = pobj_DBClass->GetNowCompilingMethodInfo();
+		if( isWriteAccess &&
+			pMethod->IsConst() &&
+			pobj_CompilingClass->IsCompilingConstructor() == false &&
+			pobj_CompilingClass->IsCompilingDestructor() == false
+			){
+				SetError(131, NULL, cp );
+		}
+
+		/////////////////////////////
+		// thisポインタをecxにセット
+
+		//Thisポインタをecxにコピー
+		SetThisPtrToReg(REG_ECX);
+
+		pRelativeVar->dwKind=VAR_DIRECTMEM;
+		if(!_member_offset(
+			isErrorEnabled,
+			isWriteAccess,
+			*pobj_CompilingClass,
+			variable,
+			pRelativeVar,
+			resultType,1)) return false;
+		return true;
+	}
+
+NonClassMember:
+
+	{
+		const Variable *pVar;
+
+		//////////////////////////
+		// 静的ローカル変数
+		// ※"Static.Object.Method.Variable"
+		//////////////////////////
+
+		char temporary[VN_SIZE];
+		if( UserProc::IsLocalAreaCompiling() ){
+			GetNowStaticVarFullName(VarName,temporary);
+
+			pVar = globalVars.Find( Symbol( temporary ) );
+			if( pVar ){
+				goto GlobalOk;
+			}
+		}
+
+
+		//////////////////////////
+		// クラスの静的メンバ
+		//////////////////////////
+
+		if(member[0]){
+			lstrcpy(temporary,member);
+
+			// TODO: 名前空間を考慮したコードになっていない
+
+			char tempMember[VN_SIZE];
+			char tempArray[VN_SIZE];
+			{
+				CClass::RefType refType;
+				GetVarFormatString(temporary,tempArray,lpPtrOffset,tempMember, refType );
+			}
+
+			int typeDefIndex = Smoothie::meta.typeDefs.GetIndex( VarName );
+			if( typeDefIndex != -1 ){
+				// TypeDef後の型名だったとき
+				lstrcpy( VarName, Smoothie::meta.typeDefs[typeDefIndex].GetBaseName().c_str() );
+			}
+
+			char temp2[VN_SIZE];
+			sprintf(temp2,"%s.%s",VarName,temporary);
+			pVar = globalVars.Find( Symbol( temp2 ) );
+			if( pVar ){
+				lstrcpy(member,tempMember);
+				lstrcpy(array,tempArray);
+				goto GlobalOk;
+			}
+		}
+
+		if(pobj_CompilingClass){
+			//自身のクラスから静的メンバを参照する場合
+			char temp2[VN_SIZE];
+			sprintf(temp2,"%s.%s",pobj_CompilingClass->GetName().c_str(),VarName);
+			pVar = globalVars.Find( Symbol( temp2 ) );
+			if( pVar ){
+				goto GlobalOk;
+			}
+		}
+
+		/////////////////////
+		// グローバル変数
+		/////////////////////
+
+		pVar = globalVars.BackSearch( Symbol( VarName ) );
+		if( pVar ){
+			goto GlobalOk;
+		}
+
+		if(isErrorEnabled) SetError(3,variable,cp);
+		pRelativeVar->dwKind=NON_VAR;
+		return false;
+
+
+
+GlobalOk:
+		//ポインタ変数の場合
+		if( pVar->IsPointer() ){
+			if( !pVar->IsArray() ){
+				lstrcpy(lpPtrOffset,array);
+				array[0]=0;
+			}
+		}
+		else{
+			if(lpPtrOffset[0]){
+				SetError(16,variable,cp);
+				pRelativeVar->dwKind=NON_VAR;
+				return false;
+			}
+		}
+
+		pRelativeVar->offset=pVar->offset;
+		pRelativeVar->bOffsetOffset=0;
+		if( pVar->IsRef() ){
+			// 参照型
+			pRelativeVar->dwKind = VAR_REFGLOBAL;
+		}
+		else pRelativeVar->dwKind=VAR_GLOBAL;
+		resultType = *pVar;
+		pSubScripts=pVar->GetSubScriptsPtr();
+		bConst = pVar->IsConst();
+	}
+
+
+
+ok:
+
+	if( bConst && isWriteAccess ){
+		//Const定義の変数に書き込みアクセスをしようとした場合
+		if( resultType.IsObject() ){
+			//オブジェクト定数
+			SetError(130, VarName, cp );
+		}
+		else{
+			//一般のConst変数
+			SetError(61,VarName,cp);
+		}
+	}
+
+	if(array[0]==0&&pSubScripts[0]!=-1){
+		//配列の先頭ポインタを示す場合
+		resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR );
+		if(pss) memcpy(pss,pSubScripts,MAX_ARRAYDIM);
+		return true;
+	}
+
+	if(array[0]||member[0]){
+		//xor ecx,ecx（ecxを0に初期化する）
+		//※ecxは変数ベースアドレスからの相対オフセットを示す
+		op_zero_reg(REG_ECX);
+
+		pRelativeVar->bOffsetOffset=1;
+	}
+	if(array[0]){
+		if(!GetArrayOffset(pSubScripts,array,resultType)){
+			SetError(14,variable,cp);
+			pRelativeVar->dwKind=NON_VAR;
+			return false;
+		}
+	}
+	if(member[0]){
+		if( resultType.IsObject() || resultType.IsStruct() ){
+			//実態オブジェクトのメンバを参照（obj.member）
+			if( refType != CClass::Dot ){
+				SetError(104,VarName,cp);
+				pRelativeVar->dwKind=NON_VAR;
+				return false;
+			}
+
+			if( resultType.IsObject() ){
+				// 参照内容へのポインタを抽出
+				SetRelativeOffset( *pRelativeVar );
+			}
+		}
+		else if( resultType.IsObjectPtr() || resultType.IsStructPtr() ){
+			//ポインタオブジェクトが示すメンバを参照
+			if(lpPtrOffset[0]){
+				//pObj[n].member
+				if( refType != CClass::Dot ){
+					SetError(104,VarName,cp);
+					pRelativeVar->dwKind=NON_VAR;
+					return false;
+				}
+				SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+			}
+			else{
+				//pObj->member
+				if( refType != CClass::Pointer ){
+					SetError(104,VarName,cp);
+					pRelativeVar->dwKind=NON_VAR;
+					return false;
+				}
+
+				SetVarPtrToEax(pRelativeVar);
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+				//mov ecx,dword ptr[eax]
+				OpBuffer[obp++]=(char)0x8B;
+				OpBuffer[obp++]=(char)0x08;
+			}
+		}
+		else if( resultType.GetBasicType()==MAKE_PTR_TYPE(DEF_OBJECT,2) || resultType.GetBasicType()==MAKE_PTR_TYPE(DEF_STRUCT,2)){
+			//ポインタオブジェクトが示すメンバを参照
+			if(lpPtrOffset[0]){
+				//ppObj[n]->member
+				if( refType != CClass::Pointer ){
+					SetError(104,VarName,cp);
+					pRelativeVar->dwKind=NON_VAR;
+					return false;
+				}
+
+				SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+
+				SetVarPtrToEax(pRelativeVar);
+
+				//mov ecx,dword ptr[eax]
+				OpBuffer[obp++]=(char)0x8B;
+				OpBuffer[obp++]=(char)0x08;
+			}
+			else{
+				SetError(104,VarName,cp);
+				pRelativeVar->dwKind=NON_VAR;
+				return false;
+			}
+		}
+		else{
+			SetError(102,VarName,cp);
+			pRelativeVar->dwKind=NON_VAR;
+			return false;
+		}
+
+		if(!_member_offset(
+			isErrorEnabled,
+			isWriteAccess,
+			resultType.GetClass(),
+			member,pRelativeVar,resultType,0)) return false;
+
+		return true;
+	}
+
+	if(lpPtrOffset[0]){
+		SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+		pRelativeVar->dwKind=VAR_DIRECTMEM;
+	}
+
+	return true;
+}
+
+bool SetInitGlobalData(int offset,const Type &type,const int *SubScripts,const char *lpszInitBuf){
+	extern BYTE *initGlobalBuf;
+	int i2,i3;
+	char temporary[VN_SIZE];
+	char InitBuf[VN_SIZE];
+	lstrcpy( InitBuf, lpszInitBuf );
+
+	if(InitBuf[0]=='['){
+		SlideString(InitBuf+1,-1);
+		InitBuf[lstrlen(InitBuf)-1]=0;
+
+		int typeSize = type.GetSize();
+
+		if(SubScripts[0]!=-1){
+			typeSize*=JumpSubScripts(SubScripts+1);
+			int i=0;
+			i2=0;
+			while(1){
+				if(SubScripts[0]<i2){
+					SetError(41,0,cp);
+					return 0;
+				}
+				i=GetOneParameter(InitBuf,i,temporary);
+				if(!SetInitGlobalData(
+					offset+i2*typeSize,
+					type,
+					SubScripts+1,
+					temporary)) return false;
+				i2++;
+				if(InitBuf[i]=='\0') break;
+			}
+			return true;
+		}
+
+		if(type.IsStruct()){
+			const CClass &objClass = type.GetClass();
+
+			int i = 0;
+			BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){
+				if(InitBuf[i]=='\0'){
+					SetError(41,0,cp);
+					return false;
+				}
+
+				i=GetOneParameter(InitBuf,i,temporary);
+
+				i3=objClass.GetMemberOffset( pMember->GetName().c_str(), NULL );
+
+				if(!SetInitGlobalData(offset+i3,
+					pMember->GetType(),
+					pMember->SubScripts,
+					temporary)) return false;
+			}
+			return true;
+		}
+
+		SetError(41,0,cp);
+		return false;
+	}
+
+
+	///////////////////////////////////////
+	// 単発式（[]で囲まれていない）
+	///////////////////////////////////////
+
+	if( type.IsObject() || type.IsStruct() ){
+		//オブジェクトまたは構造体の場合はありえない
+		SetError(300,NULL,cp);
+		return false;
+	}
+
+	if(SubScripts[0]!=-1){
+		SetError(41,0,cp);
+		return false;
+	}
+
+	double dbl;
+	_int64 i64data;
+	Type calcType;
+
+	if( !StaticCalculation(false, InitBuf,type.GetBasicType(),&i64data,calcType) ){
+		//動的データだった場合
+		return false;
+	}
+	if( calcType.IsReal() ){
+		memcpy(&dbl,&i64data,sizeof(double));
+		i64data=(_int64)dbl;
+	}
+	else dbl=(double)i64data;
+
+	//型チェック
+	CheckDifferentType(
+		type,
+		calcType,
+		0,0);
+
+	if( type.IsDouble() ){
+		*(double *)(initGlobalBuf+offset)=(double)dbl;
+	}
+	else if( type.IsSingle() ){
+		*(float *)(initGlobalBuf+offset)=(float)dbl;
+	}
+	else if( type.Is64() ){
+		*(_int64 *)(initGlobalBuf+offset)=i64data;
+	}
+	else if( type.IsLong() || type.IsDWord() || type.IsPointer() ){
+		if(type.GetBasicType()==typeOfPtrChar){
+			//文字列定数のとき
+
+			char *temp;
+			temp=(char *)i64data;
+			i2=dataTable.AddString(temp,lstrlen(temp));
+			HeapDefaultFree(temp);
+
+			//mov eax,DataPos
+			OpBuffer[obp++]=(char)0xB8;
+			*((long *)(OpBuffer+obp))=(long)i2;
+			pobj_DataTableSchedule->add();
+			obp+=sizeof(long);
+
+			//mov dword ptr[offset],eax
+			OpBuffer[obp++]=(char)0xA3;
+			*((long *)(OpBuffer+obp))=offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			*(DWORD *)(initGlobalBuf+offset)=(DWORD)i64data;
+		}
+	}
+	else if( type.IsWord() || type.IsInteger() ){
+		*(WORD *)(initGlobalBuf+offset)=(WORD)i64data;
+	}
+	else if( type.IsSByte() || type.IsByte() || type.IsBoolean() ){
+		*(BYTE *)(initGlobalBuf+offset)=(BYTE)i64data;
+	}
+
+	return true;
+}
+bool InitLocalVar(int offset,const Type &type,const int *SubScripts,const char *lpszInitBuf){
+	int i,i2,i3;
+	char temporary[VN_SIZE];
+	char InitBuf[VN_SIZE];
+	lstrcpy( InitBuf, lpszInitBuf );
+
+	if(InitBuf[0]=='['){
+		SlideString(InitBuf+1,-1);
+		InitBuf[lstrlen(InitBuf)-1]=0;
+
+		int typeSize = type.GetSize();
+
+		if(SubScripts[0]!=-1){
+			typeSize*=JumpSubScripts(SubScripts+1);
+			i=0;
+			i2=0;
+			while(1){
+				if(SubScripts[0]<i2){
+					SetError(41,0,cp);
+					return false;
+				}
+				i=GetOneParameter(InitBuf,i,temporary);
+				if(!InitLocalVar(
+					offset+i2*typeSize,
+					type,
+					SubScripts+1,
+					temporary)) return false;
+				i2++;
+				if(InitBuf[i]=='\0') break;
+			}
+			return true;
+		}
+
+		if(type.IsStruct()){
+			const CClass &objClass = type.GetClass();
+
+			int i = 0;
+			BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){
+				if(InitBuf[i]=='\0'){
+					SetError(41,0,cp);
+					return false;
+				}
+
+				i=GetOneParameter(InitBuf,i,temporary);
+
+				i3=objClass.GetMemberOffset( pMember->GetName().c_str(), NULL );
+
+				if(!InitLocalVar(offset+i3,
+					pMember->GetType(),
+					pMember->SubScripts,
+					temporary)) return false;
+
+				if(InitBuf[i]=='\0') break;
+			}
+			return true;
+		}
+
+		SetError(41,0,cp);
+		return false;
+	}
+
+
+	///////////////////////////////////////
+	// 単発式（[]で囲まれていない）
+	///////////////////////////////////////
+
+	if(SubScripts[0]!=-1){
+		SetError(41,0,cp);
+		return false;
+	}
+
+	double dbl;
+	_int64 i64data;
+	Type calcType;
+
+	if( !StaticCalculation(false, InitBuf,type.GetBasicType(),&i64data,calcType) ){
+		//動的データだった場合
+		return false;
+	}
+	if( calcType.IsReal() ){
+		memcpy(&dbl,&i64data,sizeof(double));
+		i64data=(_int64)dbl;
+	}
+	else dbl=(double)i64data;
+
+	//型チェック
+	CheckDifferentType(
+		type,
+		calcType,
+		0,0);
+
+	if( type.IsDouble() ){
+		//mov eax,HILONG(dbl)
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=(long)*(long *)(((char *)(&dbl))+4);
+		obp+=sizeof(long);
+
+		//mov dword ptr[ebp+offset+sizeof(long)],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x85;
+		*((long *)(OpBuffer+obp))=offset+sizeof(long);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+
+		//mov eax,LOLONG(dbl)
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=*(long *)(&dbl);
+		obp+=sizeof(long);
+
+		//mov dword ptr[ebp+offset],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x85;
+		*((long *)(OpBuffer+obp))=offset;
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+	}
+	else if( type.IsSingle() ){
+		float flt;
+		flt=(float)dbl;
+		//mov eax,InitValue
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=*(long *)&flt;
+		obp+=sizeof(long);
+
+		//mov dword ptr[ebp+offset],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x85;
+		*((long *)(OpBuffer+obp))=offset;
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+	}
+	else if( type.Is64() ){
+		//mov eax,HILONG(i64data)
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=(long)*(long *)(((char *)(&i64data))+4);
+		obp+=sizeof(long);
+
+		//mov dword ptr[ebp+offset+sizeof(long)],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x85;
+		*((long *)(OpBuffer+obp))=offset+sizeof(long);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+
+		//mov eax,LOLONG(i64data)
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=*(long *)(&i64data);
+		obp+=sizeof(long);
+
+		//mov dword ptr[ebp+offset],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x85;
+		*((long *)(OpBuffer+obp))=offset;
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+	}
+	else if( type.IsDWord() || type.IsLong() || type.IsPointer() ){
+		if(type.GetBasicType()==typeOfPtrChar){
+			//文字列定数のとき
+
+			char *temp;
+			temp=(char *)i64data;
+			i2=dataTable.AddString(temp,lstrlen(temp));
+			HeapDefaultFree(temp);
+
+			//mov eax,DataPos
+			OpBuffer[obp++]=(char)0xB8;
+			*((long *)(OpBuffer+obp))=(long)i2;
+			pobj_DataTableSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov eax,InitValue
+			OpBuffer[obp++]=(char)0xB8;
+			*((long *)(OpBuffer+obp))=(long)i64data;
+			obp+=sizeof(long);
+		}
+
+		//mov dword ptr[ebp+offset],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x85;
+		*((long *)(OpBuffer+obp))=offset;
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+	}
+	else if( type.IsWord() || type.IsInteger() ){
+		//mov ax,InitValue
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0xB8;
+		*((WORD *)(OpBuffer+obp))=(WORD)i64data;
+		obp+=sizeof(WORD);
+
+		//mov word ptr[ebp+offset],ax
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x85;
+		*((long *)(OpBuffer+obp))=offset;
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+	}
+	else if( type.IsSByte() || type.IsByte() || type.IsBoolean() ){
+		//mov byte ptr[ebp+offset],InitValue
+		OpBuffer[obp++]=(char)0xC6;
+		OpBuffer[obp++]=(char)0x85;
+		*((long *)(OpBuffer+obp))=offset;
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+		*((BYTE *)(OpBuffer+obp))=(BYTE)i64data;
+		obp+=sizeof(BYTE);
+	}
+
+	return true;
+}
+
+void dim( char *VarName,int *SubScripts,Type &type,const char *InitBuf,const char *ConstractParameter,DWORD dwFlags){
+	if( UserProc::IsGlobalAreaCompiling() ){
+		/////////////////////////
+		// グローバル変数
+		/////////////////////////
+
+		AddGlobalVariable(VarName,SubScripts,type,InitBuf,ConstractParameter,dwFlags);
+	}
+	else{
+		/////////////////
+		// ローカル変数
+		/////////////////
+
+		if( UserProc::CompilingUserProc().localVars.DuplicateCheck( Symbol( VarName ) ) ){
+			//２重定義のエラー
+			SetError(15,VarName,cp);
+			return;
+		}
+
+		bool isConst = ( dwFlags & DIMFLAG_CONST ) ? true:false;
+
+		Variable *pVar = new Variable( VarName, type, isConst );
+
+		if( SubScripts[0] != -1 ){
+			//配列あり
+			pVar->SetArray( SubScripts );
+		}
+
+		//コンストラクタ用パラメータ
+		pVar->paramStrForConstructor = ConstractParameter;
+
+		//レキシカルスコープ
+		pVar->ScopeLevel=obj_LexScopes.GetNowLevel();
+		pVar->ScopeStartAddress=obj_LexScopes.GetStartAddress();
+		pVar->bLiving=TRUE;
+
+		//エラー用
+		pVar->source_code_address=cp;
+
+		// 変数を追加
+		UserProc::CompilingUserProc().localVars.push_back( pVar );
+
+		//アラインメントを考慮
+		if( pVar->IsStruct() ){
+			int alignment = pVar->GetClass().iAlign;
+
+			if( alignment ){
+				if( AllLocalVarSize % alignment ){
+					AllLocalVarSize += alignment - (AllLocalVarSize % alignment);
+				}
+			}
+
+			if( alignment == PTR_SIZE*2 ){
+				// ポインタに要するサイズよりも一回り大きなアラインメントが指定されているとき
+				// （例:CONTEXT構造体など）
+				// 呼び出し側のオフセットズレを考慮する
+
+				if( 0 == ( UserProc::CompilingUserProc().RealParams().GetMemorySize() + PTR_SIZE/*ret分*/ ) % alignment ){
+					AllLocalVarSize += PTR_SIZE;
+				}
+			}
+		}
+
+		AllLocalVarSize += pVar->GetMemorySize();
+		pVar->offset = AllLocalVarSize;
+
+		//レキシカルスコープ
+		pVar->ScopeLevel=obj_LexScopes.GetNowLevel();
+		pVar->ScopeStartAddress=obj_LexScopes.GetStartAddress();
+		pVar->bLiving=TRUE;
+
+		if(InitBuf[0]){
+			//初期代入時のみ、書き込みアクセスを許可する
+			if( isConst ){
+				pVar->ConstOff();
+			}
+
+			int result = 0;
+			if( !pVar->IsObject() ){
+				result = InitLocalVar(-pVar->offset,
+					*pVar,
+					pVar->GetSubScriptsPtr(),
+					InitBuf);
+			}
+
+			if(!result){
+				//動的な式だった場合は代入演算を行う
+				char temporary[8192];
+				sprintf(temporary,"%s=%s",VarName,InitBuf);
+				OpcodeCalc(temporary);
+			}
+
+			if( isConst ){
+				pVar->ConstOn();
+			}
+		}
+		else{
+			//push 0
+			op_push_V(0);
+
+			//push VarSize
+			op_push_V( pVar->GetMemorySize() );
+
+			//mov eax,ebp
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0xC5;
+
+			//add eax,offset
+			OpBuffer[obp++]=(char)0x05;
+			*((long *)(OpBuffer+obp))=-pVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//push eax
+			op_push(REG_EAX);
+
+			//call FillMemory
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0x15;
+			DllProc *pDllProc = GetDeclareHash("FillMemory");
+			pDllProc->Using();
+			pobj_ImportAddrSchedule->add(pDllProc);
+			obp+=sizeof(long);
+		}
+	}
+
+	//New呼び出し
+	if( type.IsObject() &&(dwFlags&DIMFLAG_NONCALL_CONSTRACTOR)==0&&InitBuf[0]=='\0'){
+		char objectSize[255];
+		if( SubScripts[0] == -1 ){
+			objectSize[0] = 0;
+		}
+		else{
+			if( SubScripts[1] != -1 ){
+				SetError(300,NULL,cp);
+			}
+			sprintf( objectSize, "%d", SubScripts[0] );
+		}
+		Operator_New( type.GetClass(), objectSize, ConstractParameter, type );
+
+		//pop eax
+		op_pop( REG_EAX );
+
+		RELATIVE_VAR RelativeVar;
+		GetVarOffset( true, false, VarName, &RelativeVar, Type() );
+		if( RelativeVar.dwKind == VAR_DIRECTMEM ){
+			SetError();
+		}
+		SetVariableFromEax( DEF_OBJECT, DEF_OBJECT, &RelativeVar );
+	}
+}
+
+void SetVarPtrToEax(RELATIVE_VAR *pRelativeVar){
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//lea eax,dword ptr[ecx+offset]
+			OpBuffer[obp++]=(char)0x8D;
+			OpBuffer[obp++]=(char)0x81;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov eax,offset
+			OpBuffer[obp++]=(char)0xB8;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFGLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//mov eax,ecx
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0xC1;
+
+			//add eax,dword ptr[offset]
+			op_add_RM( sizeof(long), REG_EAX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 );
+		}
+		else{
+			//mov eax,dword ptr[offset]
+			op_mov_RM( sizeof(long), REG_EAX, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 );
+		}
+		obp-=sizeof(long);
+		pobj_GlobalVarSchedule->add();
+		obp+=sizeof(long);
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add ecx,offset
+			OpBuffer[obp++]=(char)0x81;
+			OpBuffer[obp++]=(char)0xC1;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//lea eax,dword ptr[ebp+ecx]
+			OpBuffer[obp++]=(char)0x8D;
+			OpBuffer[obp++]=(char)0x44;
+			OpBuffer[obp++]=(char)0x0D;
+			OpBuffer[obp++]=(char)0x00;
+		}
+		else{
+			//lea eax,dword ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0x8D;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_REFLOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//mov eax,ecx
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0xC1;
+
+			//add eax,dword ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov eax,dword ptr[ebp+offset]
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0x85;
+			*((long *)(OpBuffer+obp))=pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+		//mov eax,ecx
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0xC1;
+	}
+}
+void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar){
+	if( reg != REG_EAX ){
+		SetError();
+		//TODO: 未完成
+	}
+	SetVarPtrToEax( pRelativeVar );
+}
+
+bool Compile_AddGlobalRootsForGc(){
+	UserProc *pUserProc_AddGlobalRootPtr = GetClassMethod( "_System_CGarbageCollection", "AddGlobalRootPtr" );
+	if( !pUserProc_AddGlobalRootPtr ){
+		SetError(3, "_System_CGarbageCollection.AddGlobalRootPtr", -1 );
+		return false;
+	}
+
+	BOOST_FOREACH( const Variable *pVar, globalVars ){
+		if( pVar->IsObject() || pVar->IsPointer() || pVar->IsStruct() ){
+			// オブジェクトまたはポインタだったとき
+			// ※構造体も含む（暫定対応）
+
+			// 変数領域に要するLONG_PTR単位の個数を引き渡す
+			op_push_V( pVar->GetMemorySize()/PTR_SIZE );
+
+
+			/////////////////////////////
+			// ルートポインタを引き渡す
+
+			//mov eax,offset
+			op_mov_RV(REG_EAX,(int)pVar->offset);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+
+			//push eax
+			op_push( REG_EAX );
+
+			//
+			/////////////////////////////
+
+
+			/////////////////////////////
+			// Thisポインタを引き渡す
+
+			SetThisPtrToReg(REG_EAX);
+
+			//push eax
+			op_push( REG_EAX );
+
+			//
+			/////////////////////////////
+
+
+			// call AddGlobalRootPtr
+			op_call( pUserProc_AddGlobalRootPtr );
+
+			ReallocNativeCodeBuffer();
+		}
+	}
+
+	return true;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/FunctionValue.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/FunctionValue.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/FunctionValue.h	(revision 178)
@@ -0,0 +1,24 @@
+/* 関数定数 */
+
+//データ型変換
+#define FUNC_CUDBL	0x0210
+#define FUNC_FIX	0x0211
+
+//文字列
+#define FUNC_LEN	0x031D
+
+//メモリ操作
+#define FUNC_VARPTR		0x0591
+#define FUNC_OBJPTR		0x0592
+
+//その他
+#define FUNC_ADDRESSOF	0x0619
+#define FUNC_SIZEOF		0x0620
+
+//ポインタ
+#define FUNC_GETDOUBLE	0x0630
+#define FUNC_GETSINGLE	0x0631
+#define FUNC_GETQWORD	0x0632
+#define FUNC_GETDWORD	0x0633
+#define FUNC_GETWORD	0x0634
+#define FUNC_GETBYTE	0x0635
Index: tag/abdev(2007.06.20)/BasicCompiler32/LoopCheck.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/LoopCheck.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/LoopCheck.cpp	(revision 178)
@@ -0,0 +1,5 @@
+/////////////////////////////////////////////////////
+// 循環参照をチェックするためのクラスモジュール
+/////////////////////////////////////////////////////
+
+
Index: tag/abdev(2007.06.20)/BasicCompiler32/MakePeHdr.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/MakePeHdr.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/MakePeHdr.cpp	(revision 178)
@@ -0,0 +1,1717 @@
+#include <jenga/include/common/Environment.h>
+
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+extern int GlobalOpBufferSize;
+
+
+////////////////////////////
+// 特殊関数の構造体ポインタ
+////////////////////////////
+
+// グローバル関数、静的メソッド
+UserProc
+	*pSub_System_StartupProgram,
+	*pSub_DebugSys_StartProc,
+	*pSub_DebugSys_EndProc,
+	*pSub_DebugSys_SaveContext,
+	*pSub_System_GetEip,
+	*pSub_System_InitDllGlobalVariables,
+	*pSub_System_InitStaticLocalVariables,
+	*pSub_System_Call_Destructor_of_GlobalObject,
+	*pSub_System_End,
+	*pSub_System_GetSp,
+	*pSub_pow,
+	*pSub_calloc,
+	*pSub_realloc,
+	*pSub_free,
+	*pSub_System_GC_malloc_ForObject,
+	*pSub_System_GC_malloc_ForObjectPtr,
+	*pSub_System_GC_free_for_SweepingDelete,
+	*pSubStaticMethod_System_TypeBase_InitializeUserTypes,
+
+	*pSub_allrem,
+	*pSub_aullrem,
+	*pSub_allmul,
+	*pSub_alldiv,
+	*pSub_aulldiv,
+	*pSub_allshl,
+	*pSub_allshr,
+	*pSub_aullshr,
+	
+	*pSub_esp_error;
+
+// 動的メソッド
+UserProc
+	*pUserProc_System_CGarbageCollection_RegisterGlobalRoots;
+
+
+//////////////////////////////
+// 各セクションの位置とサイズ
+int FileSize_CodeSection,
+	FileSize_ExportSection,
+	FileSize_ImportSection,
+	FileSize_DataSection,
+	FileSize_RWSection,
+	FileSize_RSrcSection,
+	FileSize_RelocSection,
+	FileSize_DebugSection;
+int FilePos_CodeSection,
+	FilePos_ExportSection,
+	FilePos_ImportSection,
+	FilePos_DataSection,
+	FilePos_RWSection,
+	FilePos_RSrcSection,
+	FilePos_RelocSection,
+	FilePos_DebugSection;
+int MemSize_CodeSection,
+	MemSize_ExportSection,
+	MemSize_ImportSection,
+	MemSize_DataSection,
+	MemSize_RWSection,
+	MemSize_RSrcSection,
+	MemSize_RelocSection,
+	MemSize_DebugSection;
+int MemPos_CodeSection,
+	MemPos_ExportSection,
+	MemPos_ImportSection,
+	MemPos_DataSection,
+	MemPos_RWSection,
+	MemPos_RSrcSection,
+	MemPos_RelocSection,
+	MemPos_DebugSection;
+int bUse_CodeSection,
+	bUse_ExportSection,
+	bUse_ImportSection,
+	bUse_DataSection,
+	bUse_RWSection,
+	bUse_RSrcSection,
+	bUse_RelocSection,
+	bUse_DebugSection;
+
+
+void DebugVariable(void){
+	char temporary[255];
+	sprintf(temporary,"_DebugSys_dwThreadID[255]%c%cDWord",1,ESC_AS);
+	OpcodeDim(temporary,DIMFLAG_INITDEBUGVAR);
+	sprintf(temporary,"_DebugSys_ProcNum[255]%c%cDWord",1,ESC_AS);
+	OpcodeDim(temporary,DIMFLAG_INITDEBUGVAR);
+	sprintf(temporary,"_DebugSys_lplpObp[255]%c%c*ULONG_PTR",1,ESC_AS);
+	OpcodeDim(temporary,DIMFLAG_INITDEBUGVAR);
+	sprintf(temporary,"_DebugSys_lplpSpBase[255]%c%c*ULONG_PTR",1,ESC_AS);
+	OpcodeDim(temporary,DIMFLAG_INITDEBUGVAR);
+}
+
+void Compile(void){
+	extern HWND hMainDlg;
+	extern HWND hOwnerEditor;
+	extern HANDLE hHeap;
+	extern BOOL bDebugCompile;
+	extern BOOL bDll;
+	extern DWORD ImageBase;
+	extern int obp_AllocSize;
+	extern char *basbuf;
+	extern char OutputFileName[MAX_PATH];
+
+	int i,i2,i3,i4,i5;
+	char temporary[MAX_PATH],*temp2;
+	HANDLE hFile;
+
+
+	//コードセクションのメモリ上の位置
+	MemPos_CodeSection=		0x1000;
+
+	//データセクションのメモリ上の位置（仮定）
+	MemPos_DataSection=		0x10000000;
+
+
+	//エクスポート セクションを利用するかどうか
+	if(bDll) bUse_ExportSection=1;
+	else bUse_ExportSection=0;
+
+
+	//////////////////
+	// データテーブル
+	dataTable.Init();
+	if(bDebugCompile){
+		dataTable.Add( (long)0x00000002 );
+	}
+
+
+	//////////////////////
+	// コード生成前の準備
+	//////////////////////
+
+	//重複エラー情報管理のメモリを確保（グローバル領域コンパイル用）
+	extern char **SynonymErrorWords;
+	extern int SynonymErrorNum;
+	SynonymErrorNum=0;
+	SynonymErrorWords=(char **)HeapAlloc(hHeap,0,1);
+
+	//列挙体に関する情報の初期化
+	CEnumParent::InitEnum();
+
+	//列挙体からクラスコードを生成
+	char *temp;
+	temp=CEnumParent::GenerateCodes();
+	AddSourceCode(temp);
+	HeapDefaultFree(temp);
+
+	//関数ポインタ情報を初期化
+	Smoothie::meta.procPointers.clear();
+
+	// 名前空間情報を取得
+	NamespaceScopesCollection::CollectNamespaces(
+		Smoothie::Lexical::source.GetBuffer(),
+		Smoothie::meta.namespaceScopesCollection
+	);
+
+	//クラス名を取得（詳細情報はGetAllClassInfoで取得）
+	//   GetSubInfo関数の中で参照されるオブジェクト名を事前に取得する。
+	//     ※オブジェクトの内容までは取得しない
+	pobj_DBClass=new Classes();
+	pobj_DBClass->InitNames();
+
+	//TypeDef情報を初期化
+	Smoothie::meta.typeDefs.Init();
+
+	//定数情報を取得
+	GetConstInfo();
+
+	//サブルーチン（ユーザー定義、DLL関数）の識別子、アドレスを取得
+	pobj_CompilingClass=0;
+	GetSubInfo();
+
+	//クラス情報を取得（※注 - GetSubInfoの後に呼び出す）
+	pobj_DBClass->GetAllClassInfo();
+
+	//コードと行番号の関係
+	extern LINEINFO *pLineInfo;
+	extern int MaxLineInfoNum;
+	pLineInfo=(LINEINFO *)HeapAlloc(hHeap,0,1);
+	MaxLineInfoNum=0;
+
+
+	///////////////////////////
+	// 最低限必要な関数を取得
+	///////////////////////////
+	cp=-1;
+
+	if(pSub_System_StartupProgram=GetSubHash("_System_StartupProgram",1))
+		pSub_System_StartupProgram->Using();
+
+	if(pSub_DebugSys_StartProc=GetSubHash("_DebugSys_StartProc",1))
+		pSub_DebugSys_StartProc->Using();
+
+	if(pSub_DebugSys_EndProc=GetSubHash("_DebugSys_EndProc",1))
+		pSub_DebugSys_EndProc->Using();
+
+	if(pSub_DebugSys_SaveContext=GetSubHash("_DebugSys_SaveContext",1))
+		pSub_DebugSys_SaveContext->Using();
+
+	if(pSub_System_GetEip=GetSubHash("_System_GetEip",1)){
+		pSub_System_GetEip->Using();
+		pSub_System_GetEip->ThisIsSystemProc();
+	}
+
+	if(pSub_System_InitDllGlobalVariables=GetSubHash("_System_InitDllGlobalVariables",1)){
+		pSub_System_InitDllGlobalVariables->Using();
+		pSub_System_InitDllGlobalVariables->ThisIsSystemProc();
+	}
+
+	if(pSub_System_InitStaticLocalVariables=GetSubHash("_System_InitStaticLocalVariables",1)){
+		pSub_System_InitStaticLocalVariables->Using();
+		pSub_System_InitStaticLocalVariables->ThisIsSystemProc();
+	}
+
+	if(pSub_System_Call_Destructor_of_GlobalObject=GetSubHash("_System_Call_Destructor_of_GlobalObject",1)){
+		pSub_System_Call_Destructor_of_GlobalObject->Using();
+		pSub_System_Call_Destructor_of_GlobalObject->ThisIsSystemProc();
+	}
+
+	if(pSub_System_End=GetSubHash("_System_End",1)){
+		pSub_System_End->Using();
+	}
+
+	if(pSub_System_GetSp=GetSubHash("_System_GetSp",1)){
+		pSub_System_GetSp->Using();
+		pSub_System_GetSp->ThisIsSystemProc();
+	}
+
+	if(pSub_pow=GetSubHash("pow",1))
+		pSub_pow->Using();
+
+	if(pSub_calloc=GetSubHash("calloc",1))
+		pSub_calloc->Using();
+
+	if(pSub_realloc=GetSubHash("realloc",1))
+		pSub_realloc->Using();
+
+	if(pSub_free=GetSubHash("free",1))
+		pSub_free->Using();
+
+	if( pSub_System_GC_malloc_ForObject = GetSubHash( "_System_GC_malloc_ForObject",1 ) )
+		pSub_System_GC_malloc_ForObject->Using();
+
+	if( pSub_System_GC_malloc_ForObjectPtr = GetSubHash( "_System_GC_malloc_ForObjectPtr",1 ) )
+		pSub_System_GC_malloc_ForObjectPtr->Using();
+
+	if( pSub_System_GC_free_for_SweepingDelete = GetSubHash( "_System_GC_free_for_SweepingDelete",1 ) )
+		pSub_System_GC_free_for_SweepingDelete->Using();
+
+	if( pSubStaticMethod_System_TypeBase_InitializeUserTypes = GetSubHash( "ActiveBasic.Core._System_TypeBase.InitializeUserTypes",1 ) ){
+		pSubStaticMethod_System_TypeBase_InitializeUserTypes->Using();
+		pSubStaticMethod_System_TypeBase_InitializeUserTypes->ThisIsAutoGenerationProc();
+	}
+
+	if( pUserProc_System_CGarbageCollection_RegisterGlobalRoots = GetClassMethod( "_System_CGarbageCollection", "RegisterGlobalRoots" ) ){
+		pUserProc_System_CGarbageCollection_RegisterGlobalRoots->Using();
+		pUserProc_System_CGarbageCollection_RegisterGlobalRoots->ThisIsAutoGenerationProc();
+	}
+
+	pSub_allrem=GetSubHash("_allrem");
+	pSub_allrem->Using();
+	pSub_allrem->ThisIsSystemProc();
+
+	pSub_aullrem=GetSubHash("_aullrem");
+	pSub_aullrem->Using();
+	pSub_aullrem->ThisIsSystemProc();
+
+	pSub_allmul=GetSubHash("_allmul");
+	pSub_allmul->Using();
+	pSub_allmul->ThisIsSystemProc();
+
+	pSub_alldiv=GetSubHash("_alldiv");
+	pSub_alldiv->Using();
+	pSub_alldiv->ThisIsSystemProc();
+
+	pSub_aulldiv=GetSubHash("_aulldiv");
+	pSub_aulldiv->Using();
+	pSub_aulldiv->ThisIsSystemProc();
+
+	pSub_allshl=GetSubHash("_allshl");
+	pSub_allshl->Using();
+	pSub_allshl->ThisIsSystemProc();
+
+	pSub_allshr=GetSubHash("_allshr");
+	pSub_allshr->Using();
+	pSub_allshr->ThisIsSystemProc();
+
+	pSub_aullshr=GetSubHash("_aullshr");
+	pSub_aullshr->Using();
+	pSub_aullshr->ThisIsSystemProc();
+
+	pSub_esp_error=GetSubHash("_esp_error");
+	pSub_esp_error->Using();
+
+
+
+
+	//データテーブルスケジュール
+	pobj_DataTableSchedule=new CSchedule();
+	pobj_DataTableSchedule->SetFlag(SCHEDULE_FLAG_RELOC);
+
+	//インポートテーブルスケジュール
+	pobj_ImportAddrSchedule=new CImportAddrSchedule();
+	pobj_ImportAddrSchedule->SetFlag(SCHEDULE_FLAG_RELOC);
+
+	//プロシージャポインタスケジュール
+	pobj_SubAddrSchedule=new CSubAddrSchedule();
+
+	//グローバル変数アドレススケジュール
+	pobj_GlobalVarSchedule=new CSchedule();
+	pobj_GlobalVarSchedule->SetFlag(SCHEDULE_FLAG_RELOC);
+
+	//グローバル変数の初期バッファ
+	extern BYTE *initGlobalBuf;
+	initGlobalBuf=(BYTE *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+
+	//リロケーション情報
+	pobj_Reloc=new CReloc();
+
+	obp_AllocSize=8192*2;
+	OpBuffer=(char *)HeapAlloc(hHeap,0,obp_AllocSize);
+	obp=0;
+
+	//レキシカルスコープ情報を初期化
+	obj_LexScopes.Init(obp);
+
+
+	/////////////////////////////////////////////////////////////////
+	// デバッグコンパイル用のログを生成する
+	/////////////////////////////////////////////////////////////////
+#ifdef _DEBUG
+	{
+		ofstream ofs( ( Jenga::Common::Environment::GetAppDir() + "\\middle_code.txt" ).c_str() );
+		ofs << basbuf << endl;
+		ofs.close();
+	}
+#endif
+
+
+	//////////////////////
+	// グローバル実行領域
+	//////////////////////
+
+	cp=-1;
+	UserProc::CompileStartForGlobalArea();
+
+	if(!bDll){
+		// 名前空間が初期化されているかをチェック
+		if( Smoothie::Lexical::liveingNamespaceScopes.size() ){
+			SetError();
+		}
+
+		//ラベル用のメモリを確保
+		extern LABEL *pLabelNames;
+		extern int MaxLabelNum;
+		pLabelNames=(LABEL *)HeapAlloc(hHeap,0,1);
+		MaxLabelNum=0;
+
+		//Gotoラベルスケジュール
+		extern GOTOLABELSCHEDULE *pGotoLabelSchedule;
+		extern int GotoLabelScheduleNum;
+		pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapAlloc(hHeap,0,1);
+		GotoLabelScheduleNum=0;
+
+		//With情報のメモリを確保
+		extern WITHINFO WithInfo;
+		WithInfo.ppName=(char **)HeapAlloc(hHeap,0,1);
+		WithInfo.pWithCp=(int *)HeapAlloc(hHeap,0,1);
+		WithInfo.num=0;
+
+		//Continueアドレスを初期化
+		extern DWORD dwContinueAddress;
+		dwContinueAddress=-1;
+
+
+		//未完成
+		//OpBuffer[obp++]=(char)0xCC;
+
+		//push ebp
+		op_push(REG_EBP);
+
+		if(bDebugCompile){
+			//デバッグ用の変数を定義
+			DebugVariable();
+		}
+
+		//GC用の変数を定義
+		InitGCVariables();
+
+		//_System_StartupProgramの呼び出し
+		op_call(pSub_System_StartupProgram);
+
+		//クラスに属する静的メンバを定義
+		CMember::InitStaticMember();
+
+		//グローバル実行領域をコンパイル開始
+		CompileBuffer(0,0);
+
+		//ラベル用のメモリを解放
+		for(i=0;i<MaxLabelNum;i++){
+			if(pLabelNames[i].pName) HeapDefaultFree(pLabelNames[i].pName);
+		}
+		HeapDefaultFree(pLabelNames);
+
+		//Goto未知ラベルスケジュールを解放
+		for(i=0;i<GotoLabelScheduleNum;i++){
+			if(pGotoLabelSchedule[i].pName){
+				SetError(6,pGotoLabelSchedule[i].pName,pGotoLabelSchedule[i].now_cp);
+				HeapDefaultFree(pGotoLabelSchedule[i].pName);
+			}
+			else{
+				sprintf(temporary,"%d",pGotoLabelSchedule[i].line);
+				SetError(6,temporary,pGotoLabelSchedule[i].now_cp);
+			}
+		}
+		HeapDefaultFree(pGotoLabelSchedule);
+
+
+		///////////////////////////////////////
+		// グローバル文字列変数の解放処理
+		///////////////////////////////////////
+
+		//call _System_End
+		extern UserProc *pSub_System_End;
+		op_call(pSub_System_End);
+
+
+		//xor eax,eax（eaxを0に初期化する）
+		op_zero_reg(REG_EAX);
+
+		//pop ebp
+		op_pop(REG_EBP);
+
+		//ret
+		op_ret();
+
+		//グローバル実行領域のコードサイズ
+		GlobalOpBufferSize=obp;
+
+		//With情報のメモリを解放
+		for(i=0;i<WithInfo.num;i++){
+			SetError(22,"With",WithInfo.pWithCp[i]);
+			HeapDefaultFree(WithInfo.ppName[i]);
+		}
+		HeapDefaultFree(WithInfo.ppName);
+		HeapDefaultFree(WithInfo.pWithCp);
+
+		// 名前空間が正しく閉じられているかをチェック
+		if( Smoothie::Lexical::liveingNamespaceScopes.size() ){
+			SetError(63,NULL,-1);
+		}
+
+	}
+	else{
+		////////////////
+		// DLLの場合
+		////////////////
+
+	}
+
+	//重複エラー情報管理のメモリを解放（グローバル領域用）
+	for(i=0;i<SynonymErrorNum;i++) HeapDefaultFree(SynonymErrorWords[i]);
+	HeapDefaultFree(SynonymErrorWords);
+	SynonymErrorWords=0;
+
+
+	StepCompileProgress();
+
+
+	/////////////////////
+	// ローカル実行領域
+	/////////////////////
+
+	//プロシージャをコンパイル開始
+	cp=0;
+	CompileLocal();
+
+	// 終了
+	///////////////////////
+
+	StepCompileProgress();
+
+
+
+	////////////////////////////////
+	// ここで一旦ログを取る
+	////////////////////////////////
+	Diagnose();
+
+
+
+	////////////////////////////////
+	// 使用するDLL関数のチェック
+	////////////////////////////////
+	for(i=0;i<MAX_HASH;i++){
+		extern DllProc **ppDeclareHash;
+		const DllProc *pDllProc = ppDeclareHash[i];
+		while(pDllProc){
+			if( !pDllProc->IsUsing() ){
+				pDllProc=pDllProc->pNextData;
+				continue;
+			}
+
+			//エラーチェック
+			HINSTANCE hLib;
+			hLib=LoadLibrary( pDllProc->GetDllFileName().c_str() );
+			if(!hLib){
+				extern char OutputFileName[MAX_PATH];
+				char temp2[MAX_PATH],temp3[MAX_PATH];
+				_splitpath(OutputFileName,temp2,temp3,NULL,NULL);
+				lstrcat(temp2,temp3);
+				lstrcpy(temp3,pDllProc->GetDllFileName().c_str());
+				GetFullPath(temp3,temp2);
+				hLib=LoadLibrary(temp3);
+
+				if(!hLib){
+					SetError(-106,pDllProc->GetDllFileName().c_str(),pDllProc->GetCodePos());
+				}
+			}
+
+			if(hLib){
+				if(!GetProcAddress(hLib,pDllProc->GetAlias().c_str())){
+					FreeLibrary(hLib);
+					SetError(-107,pDllProc->GetAlias(),pDllProc->GetCodePos());
+				}
+				FreeLibrary(hLib);
+			}
+
+			pDllProc=pDllProc->pNextData;
+		}
+	}
+
+
+
+	/////////////////////////////
+	// リソースデータを読み込む
+	/////////////////////////////
+	extern char ResourceFileName[MAX_PATH];
+	GetResourceData(ResourceFileName);
+
+
+	//////////////////////////////
+	// エクスポート情報（DLLのみ）
+	//////////////////////////////
+	IMAGE_EXPORT_DIRECTORY ImageExportDirectory;
+	DWORD *lpdwExportAddressTable;
+	DWORD *lpdwExportNamePointerTable;
+	WORD *lpwExportOrdinalTable;
+	char lpExportNames[8192];
+	int ExportNamesLength;
+	int ExportNum;
+	int DllMain_EntryPoint;
+
+	DllMain_EntryPoint=-1;
+	ExportNum=0;
+	ExportNamesLength=0;
+	lpdwExportAddressTable=(DWORD *)HeapAlloc(hHeap,0,1);
+	lpdwExportNamePointerTable=(DWORD *)HeapAlloc(hHeap,0,1);
+	lpwExportOrdinalTable=(WORD *)HeapAlloc(hHeap,0,1);
+
+	if(bUse_ExportSection){
+		_splitpath(OutputFileName,NULL,NULL,lpExportNames,temporary);
+		lstrcat(lpExportNames,temporary);
+		ExportNamesLength=lstrlen(lpExportNames)+1;
+
+		extern GlobalProc **ppSubHash;
+		GlobalProc *pUserProc,*psi2;
+		while(1){
+			//辞書順にサーチ
+			temporary[0]=0;
+			for(i=0,psi2=0;i<MAX_HASH;i++){
+				pUserProc=ppSubHash[i];
+				while(pUserProc){
+					if(pUserProc->IsExport()){
+						if(temporary[0]=='\0'){
+							lstrcpy(temporary,pUserProc->GetName().c_str());
+							psi2=pUserProc;
+						}
+						else{
+							i3=lstrlen(temporary);
+							i4=(int)pUserProc->GetName().size();
+							if(i3<i4) i3=i4;
+							if(memcmp(temporary,pUserProc->GetName().c_str(),i3)>0){
+								lstrcpy(temporary,pUserProc->GetName().c_str());
+								psi2=pUserProc;
+							}
+						}
+					}
+					pUserProc=pUserProc->pNextData;
+				}
+			}
+			if(psi2==0) break;
+			pUserProc=psi2;
+
+			pUserProc->ExportOff();
+
+			if( pUserProc->GetName() == "DllMain" ){
+				DllMain_EntryPoint=pUserProc->beginOpAddress;
+			}
+
+			lpdwExportAddressTable=(DWORD *)HeapReAlloc(hHeap,0,lpdwExportAddressTable,(ExportNum+1)*sizeof(DWORD));
+			lpdwExportAddressTable[ExportNum]=pUserProc->beginOpAddress;
+
+			lpdwExportNamePointerTable=(DWORD *)HeapReAlloc(hHeap,0,lpdwExportNamePointerTable,(ExportNum+1)*sizeof(DWORD));
+			lpdwExportNamePointerTable[ExportNum]=ExportNamesLength;
+
+			lpwExportOrdinalTable=(WORD *)HeapReAlloc(hHeap,0,lpwExportOrdinalTable,(ExportNum+1)*sizeof(WORD));
+			lpwExportOrdinalTable[ExportNum]=ExportNum;
+
+			lstrcpy(lpExportNames+ExportNamesLength,pUserProc->GetName().c_str());
+			ExportNamesLength+=lstrlen(lpExportNames+ExportNamesLength)+1;
+
+			ExportNum++;
+		}
+		for(i=0;i<ExportNum;i++){
+			lpdwExportNamePointerTable[i]+=
+				sizeof(IMAGE_EXPORT_DIRECTORY)+	//エクスポートディレクトリテーブルを飛び越す
+				ExportNum*sizeof(DWORD)+		//エクスポート アドレス テーブルを飛び越す
+				ExportNum*sizeof(DWORD)+		//エクスポート名ポインタ テーブルを飛び越す
+				ExportNum*sizeof(WORD);			//エクスポート序数テーブルを飛び越す
+		}
+
+		ImageExportDirectory.Characteristics=0;
+		ImageExportDirectory.TimeDateStamp=(DWORD)time(NULL);
+		ImageExportDirectory.MajorVersion=0;
+		ImageExportDirectory.MinorVersion=0;
+		ImageExportDirectory.Name=sizeof(IMAGE_EXPORT_DIRECTORY)+
+			ExportNum*sizeof(DWORD)+	//エクスポート アドレス テーブルを飛び越す
+			ExportNum*sizeof(DWORD)+	//エクスポート名ポインタ テーブルを飛び越す
+			ExportNum*sizeof(WORD);		//エクスポート序数テーブルを飛び越す
+		ImageExportDirectory.Base=1;
+		ImageExportDirectory.NumberOfFunctions=ExportNum;
+		ImageExportDirectory.NumberOfNames=ExportNum;
+		ImageExportDirectory.AddressOfFunctions=sizeof(IMAGE_EXPORT_DIRECTORY);
+		ImageExportDirectory.AddressOfNames=ImageExportDirectory.AddressOfFunctions+ExportNum*sizeof(DWORD);
+		ImageExportDirectory.AddressOfNameOrdinals=ImageExportDirectory.AddressOfNames+ExportNum*sizeof(DWORD);
+	}
+
+
+	/////////////////////
+	//インポートDLL情報
+	/////////////////////
+	extern DllProc **ppDeclareHash;
+	char **ppDllNames;
+	int ImportDllNum;
+
+	/*
+	IMAGE_IMPORT_DESCRIPTOR1[size=0x14]	インポートヘッダ
+	IMAGE_IMPORT_DESCRIPTOR2[size=0x14]
+	IMAGE_IMPORT_DESCRIPTOR3[size=0x14]
+	...
+	Dll名1[size=0x10]
+	Dll名2[size=0x10]
+	Dll名3[size=0x10]
+	...
+	ルックアップ テーブル（ヒントを示すRVA）
+	ヒントテーブル
+	インポート アドレス テーブル（ルックアップと同じ内容だが、プログラム実行時に実行アドレスに書き換えられる）
+	*/
+
+	ppDllNames=(char **)HeapAlloc(hHeap,0,1);
+
+	ImportDllNum=0;
+	for(i=0;i<MAX_HASH;i++){
+		const DllProc *pDllProc=ppDeclareHash[i];
+		while(pDllProc){
+			if( !pDllProc->IsUsing() ){
+				pDllProc=pDllProc->pNextData;
+				continue;
+			}
+
+			if( pDllProc->GetDllFileName().size() > 16 ){
+				SetError(7,NULL,cp);
+				break;
+			}
+			for(i2=0;i2<ImportDllNum;i2++){
+				if( pDllProc->GetDllFileName() == ppDllNames[i2] ){
+					break;
+				}
+			}
+			if(i2==ImportDllNum){
+				ppDllNames=(char **)HeapReAlloc(hHeap,0,ppDllNames,(ImportDllNum+1)*sizeof(char **));
+				ppDllNames[ImportDllNum]=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,16);
+				lstrcpy(ppDllNames[ImportDllNum],pDllProc->GetDllFileName().c_str());
+				ImportDllNum++;
+			}
+
+			pDllProc=pDllProc->pNextData;
+		}
+	}
+
+	//インポート テーブル、及びルックアップ テーブル サイズの計算
+	IMAGE_IMPORT_DESCRIPTOR *pImportTable;
+	int LookupSize;
+	LookupSize=0;
+	pImportTable=(IMAGE_IMPORT_DESCRIPTOR *)HeapAlloc(hHeap,0,(ImportDllNum+1)*sizeof(IMAGE_IMPORT_DESCRIPTOR));
+	i3=(ImportDllNum+1)*sizeof(IMAGE_IMPORT_DESCRIPTOR);
+	for(i=0;i<ImportDllNum;i++){
+		//インポート テーブル（IMAGE_IMPORT_DESCRIPTOR）
+		pImportTable[i].OriginalFirstThunk=i3+(ImportDllNum*0x10)+LookupSize;
+		pImportTable[i].TimeDateStamp=0;
+		pImportTable[i].ForwarderChain=0;
+		pImportTable[i].Name=i3+i*0x10;
+		for(i2=0;i2<MAX_HASH;i2++){
+			const DllProc *pDllProc=ppDeclareHash[i2];
+			while(pDllProc){
+				if( !pDllProc->IsUsing() ){
+					pDllProc=pDllProc->pNextData;
+					continue;
+				}
+
+				if( pDllProc->GetDllFileName() == ppDllNames[i] ){
+					//ルックアップデータのサイズを追加
+					LookupSize+=sizeof(DWORD);
+				}
+
+				pDllProc=pDllProc->pNextData;
+			}
+		}
+		LookupSize+=sizeof(DWORD);	//NULL用
+	}
+	memset(&pImportTable[i],0,sizeof(IMAGE_IMPORT_DESCRIPTOR));
+
+	//ルックアップ テーブル、ヒント テーブル
+	DWORD *pLookupTable;
+	pLookupTable=(DWORD *)HeapAlloc(hHeap,0,LookupSize*sizeof(DWORD)+1);
+	char *pHintTable;
+	int HintSize,HintAllocSize;
+	HintSize=0;
+	HintAllocSize=128*2;
+	pHintTable=(char *)HeapAlloc(hHeap,0,HintAllocSize);
+	i3+=ImportDllNum*0x10;
+	for(i=0,i5=0;i<ImportDllNum;i++){
+		for(i2=0;i2<MAX_HASH;i2++){
+			DllProc *pDllProc=ppDeclareHash[i2];
+			while(pDllProc){
+				if( !pDllProc->IsUsing() ){
+					pDllProc=pDllProc->pNextData;
+					continue;
+				}
+
+				if( pDllProc->GetDllFileName() == ppDllNames[i] ){
+					//ルックアップの位置をセット（後にインポート アドレス テーブルにセットしなおされる）
+					pDllProc->SetLookupAddress( i3+(i5*sizeof(DWORD)) );
+
+					//ルックアップ テーブル
+					pLookupTable[i5++]=i3+LookupSize+HintSize;
+
+					//ヒント テーブル
+					pHintTable[HintSize++]=0;
+					pHintTable[HintSize++]=0;
+					lstrcpy(pHintTable+HintSize,pDllProc->GetAlias().c_str());
+					i4=(int)pDllProc->GetAlias().size();
+					HintSize+=i4+1;
+					if(i4%2==0) pHintTable[HintSize++]=0;
+
+					if(HintAllocSize<HintSize+128){
+						HintAllocSize+=128;
+						pHintTable=(char *)HeapReAlloc(hHeap,0,pHintTable,HintAllocSize);
+					}
+				}
+
+				pDllProc=pDllProc->pNextData;
+			}
+		}
+		pLookupTable[i5++]=0;
+	}
+
+
+	if(bDll){
+		//DLLの場合はリロケーション情報を仮生成
+		//※正式な生成は各セクションのメモリ上のサイズが決定してから再度行う。
+		pobj_Reloc->ResetRelocBuffer();
+	}
+
+
+
+	//グローバル変数情報を扱う構造体も初期バッファの有無による配置を行う
+	//（デバッグ情報で利用される）
+	extern int AllInitGlobalVarSize;
+	foreach( Variable *pVar, globalVars ){
+		if(pVar->offset&0x80000000){
+			pVar->offset=(pVar->offset&0x7FFFFFFF)+AllInitGlobalVarSize;
+		}
+	}
+
+
+
+	////////////////////////////////////
+	// デバッグセクションを生成
+	////////////////////////////////////
+
+	//機械語コードとBasicコードの関係を整理
+	extern LINEINFO *pLineInfo;
+	extern int MaxLineInfoNum;
+	int MinObp,MaxObp;
+	LINEINFO *pTempLineInfo;
+	pTempLineInfo=(LINEINFO *)HeapAlloc(hHeap,0,MaxLineInfoNum*sizeof(LINEINFO));
+	i2=0;
+	MaxObp=0;
+	while(1){
+		for(i3=0,MinObp=0x0FFFFFFF;i3<MaxLineInfoNum;i3++){
+			if(pLineInfo[i3].TopObp<MinObp&&MaxObp<pLineInfo[i3].TopObp){
+				MinObp=pLineInfo[i3].TopObp;
+				i4=i3;
+			}
+		}
+		if(MinObp==0x0FFFFFFF) break;
+		pTempLineInfo[i2]=pLineInfo[i4];
+		MaxObp=pTempLineInfo[i2].TopObp;
+		i2++;
+	}
+	HeapDefaultFree(pLineInfo);
+	pLineInfo=(LINEINFO *)HeapAlloc(hHeap,0,i2*sizeof(LINEINFO));
+	memcpy(pLineInfo,pTempLineInfo,i2*sizeof(LINEINFO));
+	MaxLineInfoNum=i2;
+	HeapDefaultFree(pTempLineInfo);
+
+	//デバッグセクションを生成
+	CDebugSection *pobj_DebugSection;
+	pobj_DebugSection=new CDebugSection();
+	extern BOOL bDebugCompile;
+	extern BOOL bError;
+	if(bDebugCompile&&bError==0){
+		pobj_DebugSection->make();
+	}
+
+
+
+	/////////////////////////////////////
+	// 各セクションの位置とサイズを計算
+	/////////////////////////////////////
+
+	//コードセッションのファイル上のサイズ
+	if(obp%FILE_ALIGNMENT) FileSize_CodeSection=obp+(FILE_ALIGNMENT-obp%FILE_ALIGNMENT);
+	else FileSize_CodeSection=obp;
+	if(FileSize_CodeSection) bUse_CodeSection=1;
+	else bUse_CodeSection=0;
+
+	//エクスポートセクションのファイル上のサイズ
+	i=	sizeof(IMAGE_EXPORT_DIRECTORY)+	//エクスポートディレクトリテーブルを飛び越す
+		ExportNum*sizeof(DWORD)+		//エクスポート アドレス テーブルを飛び越す
+		ExportNum*sizeof(DWORD)+		//エクスポート名ポインタ テーブルを飛び越す
+		ExportNum*sizeof(WORD)+			//エクスポート序数テーブルを飛び越す
+		ExportNamesLength;				//シンボル名バッファ
+	if(bUse_ExportSection){
+		if(i%FILE_ALIGNMENT) FileSize_ExportSection=i+(FILE_ALIGNMENT-i%FILE_ALIGNMENT);
+		else FileSize_ExportSection=i;
+	}
+	else FileSize_ExportSection=0;
+
+	//インポートセクションのファイル上のサイズ
+	i=(ImportDllNum+1)*sizeof(IMAGE_IMPORT_DESCRIPTOR)+
+		16*ImportDllNum+	//DLL名
+		LookupSize+			//ルックアップテーブル
+		HintSize+			//ヒント名（関数名）テーブル
+		LookupSize;			//インポート アドレス テーブル
+	if(i%FILE_ALIGNMENT) FileSize_ImportSection=i+(FILE_ALIGNMENT-i%FILE_ALIGNMENT);
+	else FileSize_ImportSection=i;
+	bUse_ImportSection=1;	//インポートセクションは必ず存在する
+
+	//データセクションのファイル上のサイズ
+	if(dataTable.GetSize()%FILE_ALIGNMENT) FileSize_DataSection=dataTable.GetSize()+(FILE_ALIGNMENT-dataTable.GetSize()%FILE_ALIGNMENT);
+	else FileSize_DataSection=dataTable.GetSize();
+	if(FileSize_DataSection) bUse_DataSection=1;
+	else bUse_DataSection=0;
+
+	//リライタブルセクションのファイル上のサイズ（グローバル変数の初期情報のみを格納）
+	if(AllInitGlobalVarSize%FILE_ALIGNMENT) FileSize_RWSection=AllInitGlobalVarSize+(FILE_ALIGNMENT-AllInitGlobalVarSize%FILE_ALIGNMENT);
+	else{
+		if(AllInitGlobalVarSize) FileSize_RWSection=AllInitGlobalVarSize;
+		else FileSize_RWSection=FILE_ALIGNMENT;
+	}
+	bUse_RWSection=1;
+
+	//リソースセクションのファイル上のサイズ
+	char *RSrcSectionBuffer;
+	int RSrcSectionSize;
+	RSrcSectionBuffer=GetRSrcSectionBuffer(&RSrcSectionSize);
+	if(RSrcSectionSize%FILE_ALIGNMENT) FileSize_RSrcSection=RSrcSectionSize+(FILE_ALIGNMENT-RSrcSectionSize%FILE_ALIGNMENT);
+	else FileSize_RSrcSection=RSrcSectionSize;
+	if(FileSize_RSrcSection) bUse_RSrcSection=1;
+	else bUse_RSrcSection=0;
+
+	//リロケーションセクションのファイル上のサイズ
+	if(pobj_Reloc->length%FILE_ALIGNMENT) FileSize_RelocSection=pobj_Reloc->length+(FILE_ALIGNMENT-pobj_Reloc->length%FILE_ALIGNMENT);
+	else FileSize_RelocSection=pobj_Reloc->length;
+	if(FileSize_RelocSection) bUse_RelocSection=1;
+	else bUse_RelocSection=0;
+
+	//デバッグセクションのファイル上のサイズ
+	if(pobj_DebugSection->length%FILE_ALIGNMENT) FileSize_DebugSection=pobj_DebugSection->length+(FILE_ALIGNMENT-pobj_DebugSection->length%FILE_ALIGNMENT);
+	else FileSize_DebugSection=pobj_DebugSection->length;
+	if(FileSize_DebugSection) bUse_DebugSection=1;
+	else bUse_DebugSection=0;
+
+
+	//各セッションのファイル上の位置
+	FilePos_CodeSection=	EXE_HEADER_SIZE;
+	FilePos_ExportSection=	FilePos_CodeSection+
+							FileSize_CodeSection;
+	FilePos_ImportSection=	FilePos_ExportSection+
+							FileSize_ExportSection;
+	FilePos_DataSection=	FilePos_ImportSection+
+							FileSize_ImportSection;
+	FilePos_RWSection=		FilePos_DataSection+
+							FileSize_DataSection;
+	FilePos_RSrcSection=	FilePos_RWSection+
+							FileSize_RWSection;
+	FilePos_RelocSection=	FilePos_RSrcSection+
+							FileSize_RSrcSection;
+	FilePos_DebugSection=	FilePos_RelocSection+
+							FileSize_RelocSection;
+
+
+	//コードセッションのメモリ上のサイズ
+	if(FileSize_CodeSection%MEM_ALIGNMENT) MemSize_CodeSection=FileSize_CodeSection+(MEM_ALIGNMENT-FileSize_CodeSection%MEM_ALIGNMENT);
+	else MemSize_CodeSection=FileSize_CodeSection;
+
+	//エクスポートセクションのメモリ上のサイズ
+	if(FileSize_ExportSection%MEM_ALIGNMENT) MemSize_ExportSection=FileSize_ExportSection+(MEM_ALIGNMENT-FileSize_ExportSection%MEM_ALIGNMENT);
+	else MemSize_ExportSection=FileSize_ExportSection;
+
+	//インポートセクションのメモリ上のサイズ
+	if(FileSize_ImportSection%MEM_ALIGNMENT) MemSize_ImportSection=FileSize_ImportSection+(MEM_ALIGNMENT-FileSize_ImportSection%MEM_ALIGNMENT);
+	else MemSize_ImportSection=FileSize_ImportSection;
+
+	//データセクションのメモリ上のサイズ
+	if(FileSize_DataSection%MEM_ALIGNMENT) MemSize_DataSection=FileSize_DataSection+(MEM_ALIGNMENT-FileSize_DataSection%MEM_ALIGNMENT);
+	else MemSize_DataSection=FileSize_DataSection;
+
+	//リライタブルセクションのメモリ上のサイズ
+	extern int AllGlobalVarSize;
+	i=AllInitGlobalVarSize+AllGlobalVarSize;
+	if(i%MEM_ALIGNMENT) MemSize_RWSection=i+(MEM_ALIGNMENT-i%MEM_ALIGNMENT);
+	else MemSize_RWSection=i;
+
+	//リソースセクションのメモリ上のサイズ
+	if(FileSize_RSrcSection%MEM_ALIGNMENT) MemSize_RSrcSection=FileSize_RSrcSection+(MEM_ALIGNMENT-FileSize_RSrcSection%MEM_ALIGNMENT);
+	else MemSize_RSrcSection=FileSize_RSrcSection;
+
+	//リロケーションセクションのメモリ上のサイズ
+	if(FileSize_RelocSection%MEM_ALIGNMENT) MemSize_RelocSection=FileSize_RelocSection+(MEM_ALIGNMENT-FileSize_RelocSection%MEM_ALIGNMENT);
+	else MemSize_RelocSection=FileSize_RelocSection;
+
+	//デバッグセクションのメモリ上のサイズ
+	if(FileSize_DebugSection%MEM_ALIGNMENT) MemSize_DebugSection=FileSize_DebugSection+(MEM_ALIGNMENT-FileSize_DebugSection%MEM_ALIGNMENT);
+	else MemSize_DebugSection=FileSize_DebugSection;
+
+
+	//各セッションのメモリ上の位置
+	if(bUse_ExportSection)	MemPos_ExportSection=	0x1000+
+													MemSize_CodeSection;
+	else					MemPos_ExportSection=0;
+	if(bUse_ImportSection)	MemPos_ImportSection=	0x1000+
+													MemSize_CodeSection+
+													MemSize_ExportSection;
+	else					MemPos_ImportSection=0;
+	if(bUse_DataSection)	MemPos_DataSection=		0x1000+
+													MemSize_CodeSection+
+													MemSize_ExportSection+
+													MemSize_ImportSection;
+	else					MemPos_DataSection=0;
+	if(bUse_RWSection)		MemPos_RWSection=		0x1000+
+													MemSize_CodeSection+
+													MemSize_ExportSection+
+													MemSize_ImportSection+
+													MemSize_DataSection;
+	else					MemPos_RWSection=0;
+	if(bUse_RSrcSection)	MemPos_RSrcSection=		0x1000+
+													MemSize_CodeSection+
+													MemSize_ExportSection+
+													MemSize_ImportSection+
+													MemSize_DataSection+
+													MemSize_RWSection;
+	else					MemPos_RSrcSection=0;
+	if(bUse_RelocSection)	MemPos_RelocSection=	0x1000+
+													MemSize_CodeSection+
+													MemSize_ExportSection+
+													MemSize_ImportSection+
+													MemSize_DataSection+
+													MemSize_RWSection+
+													MemSize_RSrcSection;
+	else					MemPos_RelocSection=0;
+	if(bUse_DebugSection)	MemPos_DebugSection=	0x1000+
+													MemSize_CodeSection+
+													MemSize_ExportSection+
+													MemSize_ImportSection+
+													MemSize_DataSection+
+													MemSize_RWSection+
+													MemSize_RSrcSection+
+													MemSize_RelocSection;
+	else					MemPos_DebugSection=0;
+
+
+
+	/////////////////////////////
+	// GC用の変数スケジュール
+	/////////////////////////////
+	PerformedGcVarSchedule();
+
+
+
+	////////////////////////////
+	// エクスポート情報の再配置
+	////////////////////////////
+	if(bUse_ExportSection){
+		for(i=0;i<ExportNum;i++){
+			lpdwExportAddressTable[i]+=MemPos_CodeSection;
+			lpdwExportNamePointerTable[i]+=MemPos_ExportSection;
+		}
+
+		ImageExportDirectory.Name+=						MemPos_ExportSection;
+		ImageExportDirectory.AddressOfFunctions+=		MemPos_ExportSection;
+		ImageExportDirectory.AddressOfNames+=			MemPos_ExportSection;
+		ImageExportDirectory.AddressOfNameOrdinals+=	MemPos_ExportSection;
+	}
+
+
+	////////////////////////////
+	// インポート情報の再配置
+	////////////////////////////
+	for(i=0,i5=0;i<ImportDllNum;i++){
+		//インポート テーブル（IMAGE_IMPORT_DESCRIPTOR）
+		pImportTable[i].OriginalFirstThunk+=MemPos_ImportSection;
+		pImportTable[i].Name+=MemPos_ImportSection;
+
+		//インポート アドレス テーブル（ルックアップとヒントを飛び越す）
+		pImportTable[i].FirstThunk=pImportTable[i].OriginalFirstThunk+
+			LookupSize+			//ルックアップテーブル
+			HintSize;			//ヒント名（関数名）テーブル
+
+		for(i2=0;i2<MAX_HASH;i2++){
+			const DllProc *pDllProc=ppDeclareHash[i2];
+			while(pDllProc){
+				if( !pDllProc->IsUsing() ){
+					pDllProc=pDllProc->pNextData;
+					continue;
+				}
+
+				if( pDllProc->GetDllFileName() == ppDllNames[i] ){
+					//ルックアップ テーブル
+					pLookupTable[i5++]+=MemPos_ImportSection;
+				}
+
+				pDllProc=pDllProc->pNextData;
+			}
+		}
+		i5++;
+	}
+
+
+	////////////////////////////////////////
+	//仮想関数データテーブルスケジュール
+	pobj_DBClass->ActionVtblSchedule(ImageBase,MemPos_CodeSection);
+
+
+	//////////////////////////////
+	// データテーブルスケジュール
+	for(i=0;i<pobj_DataTableSchedule->num;i++){
+		*((long *)(OpBuffer+pobj_DataTableSchedule->pObpValues[i]))+=ImageBase+MemPos_DataSection;
+	}
+	delete pobj_DataTableSchedule;
+
+
+	//////////////////////////////////
+	// インポートテーブルスケジュール（インポート アドレス テーブルを指し示させる）
+	for(i=0;i<pobj_ImportAddrSchedule->num;i++){
+		const DllProc *pDllProc=pobj_ImportAddrSchedule->ppdi[i];
+		*((long *)(OpBuffer+pobj_ImportAddrSchedule->pObpValues[i]))=
+			ImageBase+
+			MemPos_ImportSection+
+			LookupSize+			//ルックアップテーブル
+			HintSize+			//ヒント名（関数名）テーブル
+			pDllProc->GetLookupAddress();
+	}
+	delete pobj_ImportAddrSchedule;
+
+
+	////////////////////////////////////
+	// プロシージャポインタスケジュール
+	for(i=0;i<pobj_SubAddrSchedule->num;i++){
+		if(pobj_SubAddrSchedule->ppsi[i]->beginOpAddress==0
+			&&pobj_SubAddrSchedule->ppsi[i]->endOpAddress==0){
+			SetError(300,NULL,-1);
+		}
+
+		if(pobj_SubAddrSchedule->pbCall[i]){
+			*((long *)(OpBuffer+pobj_SubAddrSchedule->pObpValues[i]))=
+				pobj_SubAddrSchedule->ppsi[i]->beginOpAddress-(pobj_SubAddrSchedule->pObpValues[i]+sizeof(long));
+		}
+		else{
+			*((long *)(OpBuffer+pobj_SubAddrSchedule->pObpValues[i]))=
+				pobj_SubAddrSchedule->ppsi[i]->beginOpAddress+ImageBase+MemPos_CodeSection;
+		}
+	}
+	delete pobj_SubAddrSchedule;
+
+
+	if(bDll){
+		//DLLの場合はリロケーション情報を生成
+		pobj_Reloc->ResetRelocBuffer();
+	}
+
+
+
+	//////////////////////////////////////
+	// グローバル変数アドレススケジュール
+	//////////////////////////////////////
+
+	/*
+	GlobalArea1 - 初期バッファあり
+	GlobalArea2 - 初期バッファなし
+	*/
+	for(i=0;i<pobj_GlobalVarSchedule->num;i++){
+		if(*((long *)(OpBuffer+pobj_GlobalVarSchedule->pObpValues[i])) & 0x80000000){
+			//初期バッファなし
+			*((long *)(OpBuffer+pobj_GlobalVarSchedule->pObpValues[i]))=
+				AllInitGlobalVarSize+
+				(*((long *)(OpBuffer+pobj_GlobalVarSchedule->pObpValues[i])) & 0x7FFFFFFF)+
+				ImageBase+MemPos_RWSection;
+		}
+		else{
+			//初期バッファあり
+			*((long *)(OpBuffer+pobj_GlobalVarSchedule->pObpValues[i]))+=
+				ImageBase+MemPos_RWSection;
+		}
+	}
+	delete pobj_GlobalVarSchedule;
+
+
+
+	////////////////////////////////
+	// リソースアドレススケジュール
+	extern DWORD *lpdwRSrcAddrSchedule;
+	extern int RSrcAddrScheduleNum;
+	for(i=0;i<RSrcAddrScheduleNum;i++){
+		*(DWORD *)(RSrcSectionBuffer+lpdwRSrcAddrSchedule[i])+=MemPos_RSrcSection;
+	}
+	HeapDefaultFree(lpdwRSrcAddrSchedule);
+
+
+	//Dosスタブ
+	char *DosStubBuffer;
+	int DosStubSize;
+	hFile=CreateFile(
+		( Jenga::Common::Environment::GetAppDir() + "\\SubOperation\\dosstub.pgm" ).c_str(),
+		GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE){
+		MessageBox(hOwnerEditor,"dosstub.pgmの読み込みに失敗","error",MB_OK);
+		goto EndWriteOpcode;
+	}
+	DosStubSize=GetFileSize(hFile,NULL);
+	DosStubBuffer=(char *)HeapAlloc(hHeap,0,DosStubSize);
+	ReadFile(hFile,DosStubBuffer,DosStubSize,(DWORD *)&i2,NULL);
+	CloseHandle(hFile);
+
+
+	extern BOOL bError;
+	if(bError) goto EndWriteOpcode;
+
+
+	////////////////////////////
+	// EXEファイルのヘッダ情報
+	////////////////////////////
+
+	IMAGE_DOS_HEADER ImageDosHeader;
+	ImageDosHeader.e_magic=	0x5A4D;
+	ImageDosHeader.e_cblp=	0x0090;
+	ImageDosHeader.e_cp=	0x0003;
+	ImageDosHeader.e_crlc=	0;
+	ImageDosHeader.e_cparhdr=4;
+	ImageDosHeader.e_minalloc=0x0000;
+	ImageDosHeader.e_maxalloc=0xFFFF;
+	ImageDosHeader.e_ss=	0x0000;
+	ImageDosHeader.e_sp=	0x00B8;
+	ImageDosHeader.e_csum=	0x0000;
+	ImageDosHeader.e_ip=	0x0000;
+	ImageDosHeader.e_cs=	0x0000;
+	ImageDosHeader.e_lfarlc=0x0040;
+	ImageDosHeader.e_ovno=	0x0000;
+	ImageDosHeader.e_res[0]=0;
+	ImageDosHeader.e_res[1]=0;
+	ImageDosHeader.e_res[2]=0;
+	ImageDosHeader.e_res[3]=0;
+	ImageDosHeader.e_oemid=	0x0000;
+	ImageDosHeader.e_oeminfo=0x0000;
+	ImageDosHeader.e_res2[0]=0;
+	ImageDosHeader.e_res2[1]=0;
+	ImageDosHeader.e_res2[2]=0;
+	ImageDosHeader.e_res2[3]=0;
+	ImageDosHeader.e_res2[4]=0;
+	ImageDosHeader.e_res2[5]=0;
+	ImageDosHeader.e_res2[6]=0;
+	ImageDosHeader.e_res2[7]=0;
+	ImageDosHeader.e_res2[8]=0;
+	ImageDosHeader.e_res2[9]=0;
+	ImageDosHeader.e_lfanew=0x0100;	//PEヘッダの位置
+
+
+	/////////////////////////////////////////////
+	// PEヘッダ
+	/////////////////////////////////////////////
+
+	IMAGE_NT_HEADERS ImagePeHdr;
+	ImagePeHdr.Signature=IMAGE_NT_SIGNATURE;
+
+	//マシンタイプ
+	ImagePeHdr.FileHeader.Machine=			IMAGE_FILE_MACHINE_I386;
+
+	ImagePeHdr.FileHeader.NumberOfSections=		bUse_CodeSection+
+												bUse_ExportSection+
+												bUse_ImportSection+
+												bUse_DataSection+
+												bUse_RWSection+
+												bUse_RSrcSection+
+												bUse_RelocSection+
+												bUse_DebugSection;	//セクション数
+	ImagePeHdr.FileHeader.TimeDateStamp=		(DWORD)time(NULL);
+	ImagePeHdr.FileHeader.PointerToSymbolTable=	0x00000000;
+	ImagePeHdr.FileHeader.NumberOfSymbols=		0x00000000;
+	ImagePeHdr.FileHeader.SizeOfOptionalHeader=	IMAGE_SIZEOF_NT_OPTIONAL32_HEADER;
+	if(bDll){
+		ImagePeHdr.FileHeader.Characteristics=	IMAGE_FILE_EXECUTABLE_IMAGE|
+												IMAGE_FILE_32BIT_MACHINE|
+												IMAGE_FILE_LINE_NUMS_STRIPPED|
+												IMAGE_FILE_LOCAL_SYMS_STRIPPED|
+												IMAGE_FILE_DLL;
+	}
+	else{
+		ImagePeHdr.FileHeader.Characteristics=	IMAGE_FILE_EXECUTABLE_IMAGE|
+												IMAGE_FILE_32BIT_MACHINE|
+												IMAGE_FILE_LINE_NUMS_STRIPPED|
+												IMAGE_FILE_LOCAL_SYMS_STRIPPED;
+	}
+
+	ImagePeHdr.OptionalHeader.Magic=				0x010B;
+	ImagePeHdr.OptionalHeader.MajorLinkerVersion=	4;
+	ImagePeHdr.OptionalHeader.MinorLinkerVersion=	0;
+	ImagePeHdr.OptionalHeader.SizeOfCode=			FileSize_CodeSection;	//コードサイズ（.textのセッションサイズ）
+	ImagePeHdr.OptionalHeader.SizeOfInitializedData=FileSize_DataSection;	//データサイズ（.dataのセッションサイズ）
+	ImagePeHdr.OptionalHeader.SizeOfUninitializedData=0;					//未初期化データのサイズ（なし）
+	if(bDll){
+		if(DllMain_EntryPoint==-1)
+			ImagePeHdr.OptionalHeader.AddressOfEntryPoint=0;
+		else
+			ImagePeHdr.OptionalHeader.AddressOfEntryPoint=MemPos_CodeSection+DllMain_EntryPoint;
+	}
+	else ImagePeHdr.OptionalHeader.AddressOfEntryPoint=	MemPos_CodeSection;
+	ImagePeHdr.OptionalHeader.BaseOfCode=			MemPos_CodeSection;	//.textのアドレス
+	ImagePeHdr.OptionalHeader.BaseOfData=			MemPos_DataSection;	//.dataのアドレス
+
+	ImagePeHdr.OptionalHeader.ImageBase=			ImageBase;		//イメージベース
+	ImagePeHdr.OptionalHeader.SectionAlignment=		MEM_ALIGNMENT;		//セクションアラインメント
+	ImagePeHdr.OptionalHeader.FileAlignment=		FILE_ALIGNMENT;
+	ImagePeHdr.OptionalHeader.MajorOperatingSystemVersion=4;
+	ImagePeHdr.OptionalHeader.MinorOperatingSystemVersion=0;
+	ImagePeHdr.OptionalHeader.MajorImageVersion=	0;
+	ImagePeHdr.OptionalHeader.MinorImageVersion=	0;
+	ImagePeHdr.OptionalHeader.MajorSubsystemVersion=4;
+	ImagePeHdr.OptionalHeader.MinorSubsystemVersion=0;
+	ImagePeHdr.OptionalHeader.Win32VersionValue=	0;
+	ImagePeHdr.OptionalHeader.SizeOfImage=			EXE_HEADER_SIZE+
+													MemSize_CodeSection+
+													MemSize_ExportSection+
+													MemSize_ImportSection+
+													MemSize_DataSection+
+													MemSize_RWSection+
+													MemSize_RSrcSection+
+													MemSize_RelocSection+
+													MemSize_DebugSection;//すべてのイメージサイズ
+	ImagePeHdr.OptionalHeader.SizeOfHeaders=		EXE_HEADER_SIZE;//ヘッダサイズ
+	ImagePeHdr.OptionalHeader.CheckSum=				0;
+	extern unsigned short TypeOfSubSystem;
+	ImagePeHdr.OptionalHeader.Subsystem=			TypeOfSubSystem;
+	ImagePeHdr.OptionalHeader.DllCharacteristics=	0;
+	ImagePeHdr.OptionalHeader.SizeOfStackReserve=	0x00100000;
+	ImagePeHdr.OptionalHeader.SizeOfStackCommit=	0x00001000;
+	ImagePeHdr.OptionalHeader.SizeOfHeapReserve=	0x00100000;
+	ImagePeHdr.OptionalHeader.SizeOfHeapCommit=		0x00001000;
+	ImagePeHdr.OptionalHeader.LoaderFlags=			0;
+	ImagePeHdr.OptionalHeader.NumberOfRvaAndSizes=	IMAGE_NUMBEROF_DIRECTORY_ENTRIES;
+
+	//データ ディクショナリ
+	ImagePeHdr.OptionalHeader.DataDirectory[0].VirtualAddress=MemPos_ExportSection;
+	ImagePeHdr.OptionalHeader.DataDirectory[0].Size=FileSize_ExportSection;
+	ImagePeHdr.OptionalHeader.DataDirectory[1].VirtualAddress=MemPos_ImportSection;//インポートテーブル
+	ImagePeHdr.OptionalHeader.DataDirectory[1].Size=FileSize_ImportSection;
+	ImagePeHdr.OptionalHeader.DataDirectory[2].VirtualAddress=MemPos_RSrcSection;
+	ImagePeHdr.OptionalHeader.DataDirectory[2].Size=RSrcSectionSize;
+	ImagePeHdr.OptionalHeader.DataDirectory[3].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[3].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[4].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[4].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[5].VirtualAddress=MemPos_RelocSection;
+	ImagePeHdr.OptionalHeader.DataDirectory[5].Size=pobj_Reloc->length;
+	ImagePeHdr.OptionalHeader.DataDirectory[6].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[6].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[7].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[7].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[8].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[8].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[9].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[9].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[10].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[10].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[11].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[11].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[12].VirtualAddress=MemPos_ImportSection+
+		(ImportDllNum+1)*sizeof(IMAGE_IMPORT_DESCRIPTOR)+
+		16*ImportDllNum+	//DLL名
+		LookupSize+			//ルックアップテーブル
+		HintSize;			//ヒント名（関数名）テーブル
+	ImagePeHdr.OptionalHeader.DataDirectory[12].Size=LookupSize;
+	ImagePeHdr.OptionalHeader.DataDirectory[13].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[13].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[14].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[14].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[15].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[15].Size=0;
+
+
+	//コードセクションヘッダ
+	IMAGE_SECTION_HEADER CodeSectionHeader;
+	memset((char *)CodeSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)CodeSectionHeader.Name,".text");
+	CodeSectionHeader.Misc.VirtualSize=			MemSize_CodeSection;
+	CodeSectionHeader.VirtualAddress=			MemPos_CodeSection;	//開始アドレス
+	CodeSectionHeader.SizeOfRawData=			FileSize_CodeSection;
+	CodeSectionHeader.PointerToRawData=			FilePos_CodeSection;	//ファイル上の開始アドレス
+	CodeSectionHeader.PointerToRelocations=		0;
+	CodeSectionHeader.PointerToLinenumbers=		0;
+	CodeSectionHeader.NumberOfRelocations=		0;
+	CodeSectionHeader.NumberOfLinenumbers=		0;
+	CodeSectionHeader.Characteristics=			IMAGE_SCN_MEM_EXECUTE|
+												IMAGE_SCN_MEM_READ|
+												IMAGE_SCN_CNT_CODE;
+
+	//エクスポートセクションヘッダ
+	IMAGE_SECTION_HEADER ExportSectionHeader;
+	memset((char *)ExportSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)ExportSectionHeader.Name,".edata");
+	ExportSectionHeader.Misc.VirtualSize=		MemSize_ExportSection;
+	ExportSectionHeader.VirtualAddress=			MemPos_ExportSection;	//開始アドレス
+	ExportSectionHeader.SizeOfRawData=			FileSize_ExportSection;	//サイズ
+	ExportSectionHeader.PointerToRawData=		FilePos_ExportSection;	//ファイル上の開始アドレス
+	ExportSectionHeader.PointerToRelocations=	0;
+	ExportSectionHeader.PointerToLinenumbers=	0;
+	ExportSectionHeader.NumberOfRelocations=	0;
+	ExportSectionHeader.NumberOfLinenumbers=	0;
+	ExportSectionHeader.Characteristics=		IMAGE_SCN_CNT_INITIALIZED_DATA|
+												IMAGE_SCN_MEM_READ;
+
+	//インポートセクションヘッダ
+	IMAGE_SECTION_HEADER ImportSectionHeader;
+	memset((char *)ImportSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)ImportSectionHeader.Name,".idata");
+	ImportSectionHeader.Misc.VirtualSize=		MemSize_ImportSection;
+	ImportSectionHeader.VirtualAddress=			MemPos_ImportSection;	//開始アドレス
+	ImportSectionHeader.SizeOfRawData=			FileSize_ImportSection;	//サイズ
+	ImportSectionHeader.PointerToRawData=		FilePos_ImportSection;	//ファイル上の開始アドレス
+	ImportSectionHeader.PointerToRelocations=	0;
+	ImportSectionHeader.PointerToLinenumbers=	0;
+	ImportSectionHeader.NumberOfRelocations=	0;
+	ImportSectionHeader.NumberOfLinenumbers=	0;
+	ImportSectionHeader.Characteristics=		IMAGE_SCN_CNT_INITIALIZED_DATA|
+												IMAGE_SCN_MEM_READ;
+
+	//データセクションヘッダ
+	IMAGE_SECTION_HEADER DataSectionHeader;
+	memset((char *)DataSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)DataSectionHeader.Name,".sdata");
+	DataSectionHeader.Misc.VirtualSize=			MemSize_DataSection;
+	DataSectionHeader.VirtualAddress=			MemPos_DataSection;
+	DataSectionHeader.SizeOfRawData=			FileSize_DataSection;
+	DataSectionHeader.PointerToRawData=			FilePos_DataSection;
+	DataSectionHeader.PointerToRelocations=		0;
+	DataSectionHeader.PointerToLinenumbers=		0;
+	DataSectionHeader.NumberOfRelocations=		0;
+	DataSectionHeader.NumberOfLinenumbers=		0;
+	DataSectionHeader.Characteristics=			IMAGE_SCN_CNT_INITIALIZED_DATA|
+												IMAGE_SCN_MEM_READ|
+												IMAGE_SCN_MEM_WRITE;
+
+	//リライタブルセクションヘッダ
+	IMAGE_SECTION_HEADER RWSectionHeader;
+	memset((char *)RWSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)RWSectionHeader.Name,".data");
+	RWSectionHeader.Misc.VirtualSize=			AllInitGlobalVarSize+AllGlobalVarSize;
+	RWSectionHeader.VirtualAddress=				MemPos_RWSection;
+	RWSectionHeader.SizeOfRawData=				FileSize_RWSection;
+	RWSectionHeader.PointerToRawData=			FilePos_RWSection;
+	RWSectionHeader.PointerToRelocations=		0;
+	RWSectionHeader.PointerToLinenumbers=		0;
+	RWSectionHeader.NumberOfRelocations=		0;
+	RWSectionHeader.NumberOfLinenumbers=		0;
+	RWSectionHeader.Characteristics=			IMAGE_SCN_CNT_INITIALIZED_DATA|
+												IMAGE_SCN_MEM_READ|
+												IMAGE_SCN_MEM_WRITE;
+
+	//リソースセクションヘッダ
+	IMAGE_SECTION_HEADER RSrcSectionHeader;
+	memset((char *)RSrcSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)RSrcSectionHeader.Name,".rsrc");
+	RSrcSectionHeader.Misc.VirtualSize=			RSrcSectionSize;
+	RSrcSectionHeader.VirtualAddress=			MemPos_RSrcSection;
+	RSrcSectionHeader.SizeOfRawData=			FileSize_RSrcSection;
+	RSrcSectionHeader.PointerToRawData=			FilePos_RSrcSection;
+	RSrcSectionHeader.PointerToRelocations=		0;
+	RSrcSectionHeader.PointerToLinenumbers=		0;
+	RSrcSectionHeader.NumberOfRelocations=		0;
+	RSrcSectionHeader.NumberOfLinenumbers=		0;
+	RSrcSectionHeader.Characteristics=			IMAGE_SCN_CNT_INITIALIZED_DATA|
+												IMAGE_SCN_MEM_READ;
+
+	//リロケーションセクションヘッダ
+	IMAGE_SECTION_HEADER RelocSectionHeader;
+	memset((char *)RelocSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)RelocSectionHeader.Name,".reloc");
+	RelocSectionHeader.Misc.VirtualSize=		pobj_Reloc->length;
+	RelocSectionHeader.VirtualAddress=			MemPos_RelocSection;	//開始アドレス
+	RelocSectionHeader.SizeOfRawData=			FileSize_RelocSection;	//サイズ
+	RelocSectionHeader.PointerToRawData=		FilePos_RelocSection;	//ファイル上の開始アドレス
+	RelocSectionHeader.PointerToRelocations=	0;
+	RelocSectionHeader.PointerToLinenumbers=	0;
+	RelocSectionHeader.NumberOfRelocations=		0;
+	RelocSectionHeader.NumberOfLinenumbers=		0;
+	RelocSectionHeader.Characteristics=			IMAGE_SCN_CNT_INITIALIZED_DATA|
+												IMAGE_SCN_MEM_DISCARDABLE|
+												IMAGE_SCN_MEM_READ;
+
+	//デバッグセクションヘッダ
+	IMAGE_SECTION_HEADER DebugSectionHeader;
+	memset((char *)DebugSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)DebugSectionHeader.Name,".debug");
+	DebugSectionHeader.Misc.VirtualSize=		pobj_DebugSection->length;
+	DebugSectionHeader.VirtualAddress=			MemPos_DebugSection;	//開始アドレス
+	DebugSectionHeader.SizeOfRawData=			FileSize_DebugSection;	//サイズ
+	DebugSectionHeader.PointerToRawData=		FilePos_DebugSection;	//ファイル上の開始アドレス
+	DebugSectionHeader.PointerToRelocations=	0;
+	DebugSectionHeader.PointerToLinenumbers=	0;
+	DebugSectionHeader.NumberOfRelocations=		0;
+	DebugSectionHeader.NumberOfLinenumbers=		0;
+	DebugSectionHeader.Characteristics=			IMAGE_SCN_MEM_DISCARDABLE|
+												IMAGE_SCN_MEM_READ;
+
+
+	hFile=CreateFile(OutputFileName,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE){
+		SetError(53,OutputFileName,-1);
+		goto EndWriteOpcode;
+	}
+
+	//ヘッダ
+	WriteFile(hFile,(void *)&ImageDosHeader,sizeof(IMAGE_DOS_HEADER),(DWORD *)&i2,NULL);
+	i=i2;
+
+	//Dosスタブ
+	WriteFile(hFile,DosStubBuffer,DosStubSize,(DWORD *)&i2,NULL);
+	i+=i2;
+
+	//0x0100までNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,0x0100-i);
+	WriteFile(hFile,temp2,0x0100-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	//PEヘッダ
+	WriteFile(hFile,&ImagePeHdr,sizeof(IMAGE_NT_HEADERS),(DWORD *)&i2,NULL);
+	i+=i2;
+
+	//コード セクション ヘッダ
+	WriteFile(hFile,&CodeSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+	i+=i2;
+
+	if(bUse_ExportSection){
+		//エクスポート セクション ヘッダ
+		WriteFile(hFile,&ExportSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+	if(bUse_ImportSection){
+		//インポート セクション ヘッダ
+		WriteFile(hFile,&ImportSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+	if(bUse_DataSection){
+		//データ セクション ヘッダ
+		WriteFile(hFile,&DataSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+	if(bUse_RWSection){
+		//リライタブルセクションヘッダ
+		WriteFile(hFile,&RWSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+	if(bUse_RSrcSection){
+		//リソースセクションヘッダ
+		WriteFile(hFile,&RSrcSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+	if(bUse_RelocSection){
+		//リロケーションセクションヘッダ
+		WriteFile(hFile,&RelocSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+	if(bUse_DebugSection){
+		//デバッグセクションヘッダ
+		WriteFile(hFile,&DebugSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//EXE_HEADER_SIZEまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,EXE_HEADER_SIZE-i);
+	WriteFile(hFile,temp2,EXE_HEADER_SIZE-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	//コード
+	WriteFile(hFile,OpBuffer,obp,(DWORD *)&i2,NULL);
+	i+=i2;
+
+	//FilePos_ExportSectionまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FilePos_ExportSection-i);
+	WriteFile(hFile,temp2,FilePos_ExportSection-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	if(bUse_ExportSection){
+		//エクスポート ディレクトリ テーブル
+		WriteFile(hFile,&ImageExportDirectory,sizeof(IMAGE_EXPORT_DIRECTORY),(DWORD *)&i2,NULL);
+		i+=i2;
+
+		//エクスポート アドレス テーブル
+		WriteFile(hFile,lpdwExportAddressTable,ExportNum*sizeof(DWORD),(DWORD *)&i2,NULL);
+		i+=i2;
+
+		//エクスポート名ポインタ テーブル
+		WriteFile(hFile,lpdwExportNamePointerTable,ExportNum*sizeof(DWORD),(DWORD *)&i2,NULL);
+		i+=i2;
+
+		//エクスポート序数テーブル
+		WriteFile(hFile,lpwExportOrdinalTable,ExportNum*sizeof(WORD),(DWORD *)&i2,NULL);
+		i+=i2;
+
+		//シンボル名
+		WriteFile(hFile,lpExportNames,ExportNamesLength,(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//FilePos_ImportSectionまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FilePos_ImportSection-i);
+	WriteFile(hFile,temp2,FilePos_ImportSection-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	if(bUse_ImportSection){
+		//インポート ディレクトリ テーブル（Nullディレクトリ テーブルを含む）
+		for(i3=0;i3<(ImportDllNum+1);i3++){
+			WriteFile(hFile,&pImportTable[i3],sizeof(IMAGE_IMPORT_DESCRIPTOR),(DWORD *)&i2,NULL);
+			i+=i2;
+		}
+
+		//DLL名
+		for(i3=0;i3<ImportDllNum;i3++){
+			WriteFile(hFile,ppDllNames[i3],16,(DWORD *)&i2,NULL);
+			i+=i2;
+		}
+
+		//ルックアップ テーブル
+		WriteFile(hFile,pLookupTable,LookupSize,(DWORD *)&i2,NULL);
+		i+=i2;
+
+		//ヒント テーブル
+		WriteFile(hFile,pHintTable,HintSize,(DWORD *)&i2,NULL);
+		i+=i2;
+
+		//インポート アドレス テーブル
+		WriteFile(hFile,pLookupTable,LookupSize,(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//FilePos_DataSectionまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FilePos_DataSection-i);
+	WriteFile(hFile,temp2,FilePos_DataSection-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	if(bUse_DataSection){
+		//データ テーブル
+		WriteFile(hFile,dataTable.GetPtr(),dataTable.GetSize(),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//FilePos_RWSectionまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FilePos_RWSection-i);
+	WriteFile(hFile,temp2,FilePos_RWSection-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	if(bUse_RWSection){
+		//リライタブル データ テーブル（グローバル変数の初期バッファ）
+		initGlobalBuf=(BYTE *)HeapReAlloc(hHeap,
+			HEAP_ZERO_MEMORY,
+			initGlobalBuf,
+			FileSize_RWSection);
+		WriteFile(hFile,initGlobalBuf,FileSize_RWSection,(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//FilePos_RSrcSectionまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FilePos_RSrcSection-i);
+	WriteFile(hFile,temp2,FilePos_RSrcSection-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	if(bUse_RSrcSection){
+		//リソースバッファ
+		WriteFile(hFile,RSrcSectionBuffer,RSrcSectionSize,(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//FilePos_RelocSectionまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FilePos_RelocSection-i);
+	WriteFile(hFile,temp2,FilePos_RelocSection-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	if(bUse_RelocSection){
+		//リロケーション情報
+		WriteFile(hFile,pobj_Reloc->buffer,pobj_Reloc->length,(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//ファイルアラインメントを考慮
+	if(i%FILE_ALIGNMENT){
+		temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FILE_ALIGNMENT-i%FILE_ALIGNMENT);
+		WriteFile(hFile,temp2,FILE_ALIGNMENT-i%FILE_ALIGNMENT,(DWORD *)&i2,NULL);
+		HeapDefaultFree(temp2);
+		i+=i2;
+	}
+
+	if(bUse_DebugSection){
+		//デバッグセクション
+		WriteFile(hFile,pobj_DebugSection->buffer,pobj_DebugSection->length,(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//ファイルアラインメントを考慮
+	if(i%FILE_ALIGNMENT){
+		temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FILE_ALIGNMENT-i%FILE_ALIGNMENT);
+		WriteFile(hFile,temp2,FILE_ALIGNMENT-i%FILE_ALIGNMENT,(DWORD *)&i2,NULL);
+		HeapDefaultFree(temp2);
+		i+=i2;
+	}
+
+	//書き込み終了
+	CloseHandle(hFile);
+
+
+EndWriteOpcode:
+
+	//Dosスタブ用のメモリを解放
+	HeapDefaultFree(DosStubBuffer);
+
+	//エクスポート テーブル情報を解放
+	HeapDefaultFree(lpdwExportAddressTable);
+	HeapDefaultFree(lpdwExportNamePointerTable);
+	HeapDefaultFree(lpwExportOrdinalTable);
+
+	//インポートDLL情報を解放
+	HeapDefaultFree(pImportTable);
+	for(i=0;i<ImportDllNum;i++)
+		HeapDefaultFree(ppDllNames[i]);
+	HeapDefaultFree(ppDllNames);
+
+	//ルックアップテーブルに関する情報を解放
+	HeapDefaultFree(pLookupTable);
+
+	//ヒントテーブルに関する情報を解放
+	HeapDefaultFree(pHintTable);
+
+	//グローバル変数の初期バッファを解放
+	HeapDefaultFree(initGlobalBuf);
+
+	//コードバッファを解放
+	HeapDefaultFree(OpBuffer);
+	OpBuffer=0;
+
+	//リソースセクションバッファを解放
+	HeapDefaultFree(RSrcSectionBuffer);
+
+	//デバッグセクションを開放
+	delete pobj_DebugSection;
+
+	//リロケーション情報を解放
+	delete pobj_Reloc;
+
+	//列挙体に関する情報の破棄
+	CEnumParent::DestroyEnum();
+
+	//クラスに関するメモリを解放
+	delete pobj_DBClass;
+	pobj_DBClass=0;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/NumOpe.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/NumOpe.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/NumOpe.cpp	(revision 178)
@@ -0,0 +1,1132 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void PushReturnValue(int type){
+	//関数の戻り値をスタックへプッシュする
+	//※この処理内では、esi、ediは使用不可
+
+	if(type==DEF_OBJECT || type==DEF_STRUCT){
+		//push eax
+		op_push(REG_EAX);
+	}
+	else if(type==DEF_DOUBLE){
+		//sub esp,8
+		op_sub_esp(8);
+
+		//fstp qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDD;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(type==DEF_SINGLE){
+		//sub esp,4
+		op_sub_esp(4);
+
+		//fstp dword ptr[esp]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(type==DEF_INT64||type==DEF_QWORD){
+		//push edx
+		op_push(REG_EDX);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else if(type==DEF_LONG){
+		//push eax
+		op_push(REG_EAX);
+	}
+	else if(type==DEF_INTEGER || (isUnicode&&type==DEF_CHAR)){
+		//movsx ebx,ax
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0xBF;
+		OpBuffer[obp++]=(char)0xD8;
+
+		//push ebx
+		op_push(REG_EBX);
+	}
+	else if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){
+		//movsx ebx,al
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0xBE;
+		OpBuffer[obp++]=(char)0xD8;
+
+		//push ebx
+		op_push(REG_EBX);
+	}
+	else if(type==DEF_DWORD||type==DEF_WORD||type==DEF_BYTE||type==DEF_BOOLEAN||
+		IsPtrType(type)){
+		//push eax
+		op_push(REG_EAX);
+	}
+	else{
+		SetError();
+	}
+}
+
+void NewStringObject( const char *str ){
+	///////////////////////////////////////////////////////
+	// lpszTextを元にStringオブジェクトを生成し、
+	// オブジェクトポインタをregに格納する
+	///////////////////////////////////////////////////////
+
+	char *parameter = (char *)malloc( lstrlen( str ) + 32 );
+	sprintf( parameter, "\"%s\"%c%c*Char", str, 1, ESC_AS );
+	SetStringQuotes( parameter );
+
+	Operator_New( *pobj_DBClass->GetStringClassPtr(), "", parameter, Type( DEF_OBJECT, *pobj_DBClass->GetStringClassPtr() ) );
+
+	free( parameter );
+}
+
+void ExtendRegToBigType( int reg, int bigBasicType, int baseBasicType ){
+	if( reg != REG_EAX ){
+		SetError();
+	}
+	switch( Type::GetBasicSize( bigBasicType ) ){
+		case sizeof(_int64):
+			ExtendTypeTo64(baseBasicType);
+			break;
+		case sizeof(long):
+			ExtendTypeTo32(baseBasicType,reg);
+			break;
+		case sizeof(short):
+			ExtendTypeTo16(baseBasicType,reg);
+			break;
+	}
+}
+
+
+
+bool VarToReg( RELATIVE_VAR &relativeVar, const Type &baseType, Type &resultType ){
+	const int useReg = REG_EAX;
+
+	//大きな型への暗黙の変換
+	int bigType = AutoBigCast(baseType.GetBasicType(),resultType.GetBasicType());
+
+	if(resultType.GetBasicType()&FLAG_PTR){
+		//配列ポインタ
+		resultType.SetBasicType( GetPtrType(resultType.GetBasicType()^FLAG_PTR) );
+
+		SetVarPtrToReg(useReg, &relativeVar);
+	}
+	else if( resultType.IsStruct() ){
+		//構造体ポインタをeaxへ格納（構造体は値型）
+		SetVarPtrToReg(useReg, &relativeVar);
+	}
+	else if( resultType.IsReal() ){
+		// 実数
+		SetReg_RealVariable( resultType.GetBasicType(), &relativeVar );
+	}
+	else if( resultType.IsWhole() || resultType.IsObject()){
+		//整数型
+		SetReg_WholeVariable(resultType.GetBasicType(),&relativeVar,useReg);
+	}
+	else if( resultType.IsStruct() ){
+		//構造体ポインタをUseRegへ格納（構造体は値型）
+		SetVarPtrToReg(useReg,&relativeVar);
+	}
+	else{
+		return false;
+	}
+
+	if( resultType.GetBasicType() != bigType ){
+		// 大きな型へ変換された場合
+		// ※レジスタの値をキャストする
+		ExtendRegToBigType( useReg, bigType, resultType.GetBasicType() );
+
+		resultType.SetBasicType( bigType );
+	}
+
+	return true;
+}
+bool TermMemberOpe( const CClass &objClass, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member ){
+	const int useReg = REG_EAX;
+
+	if( GetMemberType( objClass, member, resultType, 0, false ) ){
+		// メンバが見つかったとき
+
+		//オブジェクトポインタをecxにコピー
+		op_mov_RR( REG_ECX, useReg );
+
+		RELATIVE_VAR relativeVar;
+		relativeVar.dwKind=VAR_DIRECTMEM;
+
+		if( !_member_offset(
+			true,	//エラー表示あり
+			false,	//読み込み専用
+			objClass,
+			member,&relativeVar,resultType,0)){
+				return false;
+		}
+
+		if( !VarToReg( relativeVar, baseType, resultType ) ){
+			SetError(11,termFull,cp);
+		}
+
+		return true;
+	}
+
+
+	///////////////////////////////////////////////////////////////////
+	// 動的メソッドを検索
+	///////////////////////////////////////////////////////////////////
+	vector<UserProc *> userProcs;
+
+	char methodName[VN_SIZE], lpPtrOffset[VN_SIZE], parameter[VN_SIZE], dummy[1];
+	CClass::RefType refType;
+	lstrcpy( methodName, member );
+	GetVarFormatString(methodName,parameter,lpPtrOffset,dummy,refType);
+
+	objClass.GetMethods().Enum( methodName, userProcs );
+	UserProc *pUserProc;
+	if(userProcs.size()){
+		//オーバーロードを解決
+		pUserProc=OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft);
+
+		if( pUserProc ){
+
+			resultType = pUserProc->ReturnType();
+
+			{
+				//オブジェクトポインタをスタックに入れておく
+				//push reg
+				op_push( useReg );
+
+				if( !Opcode_CallProc(parameter,pUserProc,PROCFLAG_NEW,termLeft,0 ) ){
+
+					return false;
+				}
+
+				op_pop();
+
+				/////////////////////
+				// 戻り値の処理
+				/////////////////////
+
+				//大きな型への暗黙の変換
+				int bigType = AutoBigCast(baseType.GetBasicType(), resultType.GetBasicType() );
+
+				if( resultType.GetBasicType() != bigType ){
+					// 大きな型へ変換された場合
+					// ※レジスタの値をキャストする
+					ExtendRegToBigType( REG_EAX, bigType, resultType.GetBasicType() );
+
+					resultType.SetBasicType( bigType );
+				}
+
+				//SetUseRegFromRax(resultType.GetBasicType(),UseReg,XmmReg);
+			}
+			
+			return true;
+		}
+	}
+
+	return false;
+}
+bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool isWantObject, bool *pIsClassName, bool isProcedureCallOnly ){
+	char parameter[VN_SIZE];
+
+	// Withを解決
+	char termFull[VN_SIZE];
+	if(term[0]=='.'){
+		GetWithName(termFull);
+		lstrcat(termFull,term);
+	}
+	else lstrcpy(termFull,term);
+
+	char termLeft[VN_SIZE];
+	lstrcpy(termLeft,termFull);
+
+	// パース
+	char member[VN_SIZE];
+	CClass::RefType refType;
+	if( SplitMemberName( termFull, termLeft, member, refType ) ){
+		///////////////////////////////////////////////////////////////////
+		// オブジェクトとメンバに分解できるとき
+		// termLeft.member
+		///////////////////////////////////////////////////////////////////
+
+		isLiteral = false;
+
+		// オブジェクト側の型を取得
+		bool isClassName = false;
+		Type leftType;
+		if( GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){
+			if( isClassName == false && Smoothie::meta.blittableTypes.IsExist( leftType ) ){
+				// 左側のオブジェクト部分がBlittable型のとき
+
+				char temporary[VN_SIZE];
+				lstrcpy( temporary, termLeft );
+				sprintf( termLeft, "%s(%s)",
+					Smoothie::meta.blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(),
+					temporary );
+			}
+		}
+
+		if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, true, &isClassName ) ){
+			goto globalArea;
+		}
+
+		if( isClassName ){
+			// 静的メンバ/メソッドの場合
+			goto globalArea;
+		}
+
+		if( !leftType.HasMember() ){
+			// メンバを持たない型の場合
+			return false;
+		}
+
+		return TermMemberOpe( leftType.GetClass(), baseType, resultType, termFull, termLeft, member );
+	}
+globalArea:
+
+
+	//////////////////////////////////////////////
+	// クラス名かどうかをチェック（静的メンバ用）
+	//////////////////////////////////////////////
+
+	if( pIsClassName ){
+		if( pobj_DBClass->Find( termFull ) ){
+			*pIsClassName = true;
+			return true;
+		}
+	}
+
+
+	/////////////////////////////////////////////////////////////////
+	// グローバル属性エリア
+	/////////////////////////////////////////////////////////////////
+
+	const int useReg = REG_EAX;
+
+
+	if(lstrcmpi(termFull,"This")==0 && isProcedureCallOnly == false ){
+		//Thisオブジェクト
+		resultType.SetType( DEF_OBJECT, pobj_CompilingClass );
+
+		SetThisPtrToReg( useReg );
+
+		isLiteral = false;
+
+		return true;
+	}
+
+
+	//////////////////////////////////////
+	// 関数（DLL、ユーザー定義、組み込み）
+	//////////////////////////////////////
+	char procName[VN_SIZE];
+	char temporary[8192];
+
+	int i2=GetCallProcName(termFull,procName);
+	if(termFull[i2]=='('){
+		int i4=GetStringInPare_RemovePare(parameter,termFull+i2+1);
+
+		void *pInfo;
+		int idProc=GetProc(procName,(void **)&pInfo);
+
+		if(idProc){
+			//閉じカッコ")"に続く文字がNULLでないとき
+			if(termFull[i2+1+i4+1]!='\0'){
+				SetError(42,NULL,cp);
+			}
+
+
+			{
+				////////////////
+				// 呼び出し
+				////////////////
+
+				CallProc(idProc,pInfo,procName,parameter,resultType);
+
+
+				/////////////////////
+				// 戻り値の処理
+				/////////////////////
+
+				//大きな型への暗黙の変換
+				int bigType = AutoBigCast(baseType.GetBasicType(), resultType.GetBasicType() );
+
+				/*
+				※後でNumOpe内でプッシュする
+				//スタックへプッシュ
+				PushReturnValue( resultType.GetBasicType() );
+				*/
+
+				if( resultType.GetBasicType() != bigType ){
+					// 大きな型へ変換された場合
+					// ※レジスタの値をキャストする
+					ExtendRegToBigType( useReg, bigType, resultType.GetBasicType() );
+
+					resultType.SetBasicType( bigType );
+				}
+
+				//SetUseRegFromRax(resultType.GetBasicType(),UseReg,XmmReg);
+			}
+
+
+			if(resultType.IsStruct()){
+				//構造体が戻ったときはヒープ領域にインスタンスが格納されている
+				//※後にfreeする必要あり
+				// TODO: 解放はGCに任せる
+				*pbUseHeap = 1;
+			}
+
+			isLiteral = false;
+
+			return true;
+		}
+		else if(GetConstCalcBuffer(procName,parameter,temporary)){
+			/////////////////////////
+			// マクロ関数
+			/////////////////////////
+
+			//閉じカッコ")"に続く文字がNULLでないときはエラーにする
+			if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
+
+			//マクロ関数の場合
+			NumOpe(useReg, temporary,Type(),resultType);
+
+			if(!IS_LITERAL(resultType.GetIndex())){
+				//リテラル値ではなかったとき
+				isLiteral = false;
+			}
+
+			return true;
+		}
+	}
+	else if( isProcedureCallOnly ){
+		// 関数呼び出し以外は受け付けない
+		return false;
+	}
+
+
+	////////////////////////////////
+	// インデクサ（getアクセサ）
+	////////////////////////////////
+
+	char VarName[VN_SIZE],ArrayElements[VN_SIZE];
+	GetArrayElement(termFull,VarName,ArrayElements);
+	if(ArrayElements[0]){
+		GetVarType(VarName,resultType,false);
+		if( resultType.IsObject() ){
+			CallIndexerGetterProc(/*UseReg,*/&resultType.GetClass(),VarName,ArrayElements,resultType);
+
+			isLiteral = false;
+
+			return true;
+		}
+	}
+
+
+	////////////////////////////////
+	// 変数
+	////////////////////////////////
+
+	RELATIVE_VAR relativeVar;
+	if(GetVarOffset(
+		false,	//エラー表示なし
+		false,	//読み込み専用
+		termFull,
+		&relativeVar,resultType)){
+		//////////
+		// 変数
+		//////////
+
+		if( !VarToReg( relativeVar, baseType, resultType ) ){
+			SetError(11,termFull,cp);
+		}
+
+		isLiteral = false;
+
+		return true;
+	}
+
+
+	/////////////////////////////////
+	// プロパティ用のメソッド
+	/////////////////////////////////
+
+	//配列要素を排除
+	GetArrayElement(termFull,VarName,ArrayElements);
+
+	if(GetSubHash(VarName,0)){
+
+		{
+			CallPropertyMethod(termFull,NULL,resultType);
+
+			//大きな型への暗黙の変換
+			int bigType = AutoBigCast(baseType.GetBasicType(), resultType.GetBasicType() );
+
+			if( resultType.GetBasicType() != bigType ){
+				// 大きな型へ変換された場合
+				// ※レジスタの値をキャストする
+				ExtendRegToBigType( REG_EAX, bigType, resultType.GetBasicType() );
+
+				resultType.SetBasicType( bigType );
+			}
+
+			//SetUseRegFromRax(resultType.GetBasicType(),UseReg,XmmReg);
+		}
+
+
+		if(resultType.IsStruct()){
+			//構造体が戻ったときはヒープ領域にインスタンスが格納されている
+			//※後にfreeする必要あり
+			// TODO: 解放はGCに任せる
+			*pbUseHeap = 1;
+		}
+
+		isLiteral = false;
+
+		return true;
+	}
+
+
+	return false;
+}
+
+
+bool NumOpe( int reg,
+			const char *expression,
+			const Type &baseType,
+			Type &resultType,
+			BOOL *pbUseHeap ){
+
+	if( !NumOpe( expression, baseType, resultType, pbUseHeap ) ){
+		return false;
+	}
+
+	if( reg != REG_EAX ){
+		// TODO: 未実装
+		SetError();
+	}
+
+	if( resultType.IsReal() ){
+		//fld ptr[esp]
+		op_fld_ptr_esp( resultType.GetBasicType() );
+
+		//add esp,size
+		op_add_esp( resultType.GetBasicSize() );
+	}
+	else{
+		//pop eax
+		op_pop(REG_EAX);
+
+		if( resultType.Is64() ){
+			//pop edx
+			op_pop(REG_EDX);
+		}
+	}
+	return true;
+}
+bool NumOpe( const char *expression,
+			const Type &baseType,
+			Type &resultType,
+			BOOL *pbUseHeap ){
+
+	int i,i2,i3;
+	char temporary[1024],temp2[1024];
+
+	if(expression[0]=='\0'){
+		SetError(1,NULL,cp);
+		return false;
+	}
+
+	if(expression[0]==1&& expression[1]==ESC_NEW ){
+		//New演算子（オブジェクト生成）
+
+		if( !Operator_New( expression+2, baseType, resultType ) ){
+			return false;
+		}
+
+		return true;
+	}
+
+	if( !baseType.IsNull() && expression[0] == '[' ){
+		// リテラル配列の場合
+
+		if( !baseType.IsPointer() ){
+			SetError(1,NULL,cp);
+			return false;
+		}
+		Type tempBaseType( baseType );
+		tempBaseType.PtrLevelDown();
+
+		char *buffer = (char *)malloc( lstrlen( expression ) + 1 );
+		lstrcpy( buffer, expression );
+		RemoveStringBracket( buffer );
+
+		void *binary = malloc( 1 );
+		int num = 0;
+
+		i = 0;
+		while( buffer[i] ){
+			i = GetOneParameter( buffer, i, temporary );
+			if( buffer[i] == ',' ){
+				i++;
+			}
+
+			Type resultType;
+			_int64 i64data;
+			if( !StaticCalculation( true, temporary, tempBaseType.GetBasicType(), &i64data, resultType ) ){
+				return false;
+			}
+			if( !resultType.IsWhole() ){
+				// TODO: 実数に未対応
+				SetError();
+				return false;
+			}
+
+			binary = realloc( binary, ( num + 1 ) * tempBaseType.GetSize() );
+			memcpy( (char *)binary + (num * tempBaseType.GetSize()), &i64data, tempBaseType.GetSize() );
+			num++;
+		}
+
+		i2 = dataTable.AddBinary( binary, num * tempBaseType.GetSize() );
+
+		//mov eax,i2
+		op_mov_RV(REG_EAX,i2);
+		obp-=sizeof(long);
+		pobj_DataTableSchedule->add();
+		obp+=sizeof(long);
+
+		free( buffer );
+
+		resultType = baseType;
+
+		//push eax
+		op_push( REG_EAX );
+
+		return true;
+	}
+
+
+	/////////////////////////////////
+	// 式要素を逆ポーランド式で取得
+	/////////////////////////////////
+
+	char *values[255];
+	long calc[255];
+	long stack[255];
+	int pnum;
+	if(!GetNumOpeElements(expression,&pnum,values,calc,stack)){
+		for(i=0;i<pnum;i++){
+			if(values[i]) HeapDefaultFree(values[i]);
+		}
+		return false;
+	}
+
+
+	BOOL bError;
+	bError=0;
+
+	//リテラル値のみの計算かどうかを判別するためのフラグ
+	BOOL bLiteralCalculation=1;
+
+	//リテラル演算の場合を考慮した演算前のバッファ位置
+	int BeforeObp;
+	BeforeObp=obp;
+
+	//リテラル演算の場合を考慮した演算前のプロシージャスケジュール位置
+	//※64ビットの掛け算、除算などで特殊関数が呼ばれるため
+	int Before_ProcAddrScheduleNum;
+	Before_ProcAddrScheduleNum=pobj_SubAddrSchedule->num;
+
+	//リテラル演算の場合を考慮した演算前のデータテーブルスケジュール位置
+	int Before_DataTableScheduleNum;
+	Before_DataTableScheduleNum=pobj_DataTableSchedule->num;
+
+	//リテラル演算の場合を考慮した演算前の再配置スケジュール
+	CReloc *pobj_BackReloc;
+	pobj_BackReloc=new CReloc();
+	pobj_BackReloc->copy(pobj_Reloc);
+
+	double dbl;
+	int sp;
+	int type_stack[255];
+	bool isNothing_stack[255];
+	LONG_PTR index_stack[255];
+	BOOL bUseHeap[255];
+	_int64 i64data;
+	for(i=0,sp=0;i<pnum;i++){
+		int idCalc;
+		idCalc=calc[i]%100;
+
+		if(idCalc){
+			if(type_stack[sp-2]==DEF_OBJECT){
+				if( idCalc == CALC_AS
+					&& type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST )
+					&& index_stack[sp-1] == index_stack[sp-2]
+					|| isNothing_stack[sp-2] ){
+						// 同一の型、またはNothingに対するAsはAs演算子を呼び出さない
+				}
+				else if( idCalc == CALC_AS
+					&& type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST )
+					&& ( ((CClass *)index_stack[sp-1])->IsEqualsOrSubClass( (CClass *)index_stack[sp-2] ) || ((CClass *)index_stack[sp-2])->IsEqualsOrSubClass( (CClass *)index_stack[sp-1] )
+					)){
+						// ダウンキャストを許可する
+				}
+				else{
+					//オーバーロードされたオペレータを呼び出す
+					i2=CallOperatorProc(idCalc,baseType,type_stack,index_stack,bUseHeap,sp);
+					if(i2==0){
+						if(idCalc==CALC_EQUAL) lstrcpy(temp2,"==");
+						else GetCalcName(idCalc,temp2);
+						sprintf(temporary,"Operator %s",temp2);
+						SetError(27,temporary,cp);
+						goto error;
+					}
+					else if(i2==-1) goto error;
+
+					continue;
+				}
+			}
+
+			if(!CheckCalcType(idCalc,type_stack,sp)) goto error;
+		}
+
+		switch(idCalc){
+			//数値
+			case 0:
+				index_stack[sp]=-1;
+				isNothing_stack[sp] = false;
+				bUseHeap[sp]=0;
+
+				char *term;
+				term=values[i];
+
+				if( calc[i+1]%100 == CALC_AS ){
+					// As演算子の右辺値
+					//型名
+					if( Type::StringToType( term, resultType ) ){
+						resultType.SetBasicType( resultType.GetBasicType() | FLAG_CAST );
+					}
+					else{
+						SetError(3, term, cp );
+						goto error;
+					}
+
+					type_stack[sp] = resultType.GetBasicType();
+					index_stack[sp] = resultType.GetIndex();
+					sp++;
+
+					break;
+				}
+
+				if(term[0]=='\"'){
+					//リテラル文字列
+					if(!RemoveStringQuotes(term)){
+						SetError(43,NULL,cp);
+						goto error;
+					}
+					i3=lstrlen(term);
+StrLiteral:
+
+					if( baseType.IsObject() || baseType.IsNull() ){
+						//要求タイプがオブジェクト、または未定のとき
+
+						//String型オブジェクトを生成
+						NewStringObject(term);
+
+						type_stack[sp]=DEF_OBJECT;
+						index_stack[sp]=(LONG_PTR)pobj_DBClass->GetStringClassPtr();
+						bLiteralCalculation=0;
+
+						sp++;
+						break;
+					}
+
+
+					type_stack[sp]=typeOfPtrChar;
+					bLiteralCalculation=0;
+
+					i2=dataTable.AddString(term,i3);
+
+					//push DataSize
+					OpBuffer[obp++]=(char)0x68;
+					*((long *)(OpBuffer+obp))=i2;
+					pobj_DataTableSchedule->add();
+					obp+=sizeof(long);
+				}
+				else if((term[0]=='e'||term[0]=='E')&&
+					(term[1]=='x'||term[1]=='X')&&
+					term[2]=='\"'){
+					//拡張版リテラル文字列（エスケープシーケンス可能）
+					if(!RemoveStringQuotes(term+2)){
+						SetError(43,NULL,cp);
+						goto error;
+					}
+					i3=FormatString_EscapeSequence(term+2);
+					term+=2;
+
+					goto StrLiteral;
+				}
+				else if(IsVariableTopChar(term[0])||
+					term[0]=='*'||
+					(term[0]=='.'&&IsVariableTopChar(term[1]))){
+					//////////////////
+					// 何らかの識別子
+
+					bool isLiteral;
+					if( TermOpe( term, baseType, resultType, isLiteral, &bUseHeap[sp] ) ){
+						if(resultType.IsNull()){
+							//戻り値が存在しないとき
+							for(i2=0;;i2++){
+								if(term[i2]=='('||term[i2]=='\0'){
+									term[i2]=0;
+									break;
+								}
+							}
+							SetError(38,term,cp);
+
+							goto error;
+						}
+
+						type_stack[sp] = resultType.GetBasicType();
+						index_stack[sp] = resultType.GetIndex();
+
+						if( !isLiteral ){
+							bLiteralCalculation=0;
+						}
+
+						if( resultType.GetBasicType() & FLAG_CAST ){
+							// 型名のみ
+							SetError();
+						}
+						else{
+							if( resultType.IsReal() ){
+								//sub esp,size
+								//fstp ptr[esp]
+								op_fstp_push( resultType );
+							}
+							else{
+								if( resultType.Is64() ){
+									//push edx
+									op_push( REG_EDX );
+								}
+								else{
+									ExtendTypeTo32( resultType.GetBasicType(), REG_EAX );
+								}
+
+								//push eax
+								op_push( REG_EAX );
+							}
+						}
+
+						sp++;
+						break;
+					}
+
+
+					// Nothing
+					if( lstrcmp( term, "Nothing" ) == 0 ){
+						isNothing_stack[sp] = true;
+
+						type_stack[sp] = DEF_OBJECT;
+						if( baseType.IsObject() ){
+							index_stack[sp] = baseType.GetIndex();
+						}
+						else{
+							index_stack[sp] = (LONG_PTR)pobj_DBClass->GetObjectClassPtr();
+						}
+
+						bLiteralCalculation = 0;
+
+						//push 0
+						op_push_V( 0 );
+
+						sp++;
+						break;
+					}
+
+
+					//////////////
+					// 定数の場合
+					//////////////
+
+					i3 = CDBConst::obj.GetBasicType(term);
+					if(i3){
+						if( CDBConst::obj.IsStringPtr( term ) ){
+							//リテラル文字列
+
+							double dbl = CDBConst::obj.GetDoubleData(term);
+							memcpy(&i64data,&dbl,sizeof(double));
+
+							//バイト数
+							i3=lstrlen((char *)i64data);
+
+							memcpy(term,(char *)i64data,i3);
+							term[i3]=0;
+							goto StrLiteral;
+						}
+
+						type_stack[sp]=i3;
+						if(IsRealNumberType(i3)){
+							//実数
+							double dbl = CDBConst::obj.GetDoubleData(term);
+							memcpy(&i64data,&dbl,sizeof(double));
+							goto Literal;
+						}
+						else if(IsWholeNumberType(i3)){
+							//整数
+							i64data = CDBConst::obj.GetWholeData(term);
+							goto Literal;
+						}
+						else{
+							SetError(300,NULL,cp);
+							goto error;
+						}
+					}
+
+
+					//該当する識別子が見当たらないときはエラー扱いにする
+					bError=1;
+					SetError(3,term,cp);
+					type_stack[sp]=DEF_DOUBLE;
+				}
+				else{
+					//リテラル値
+					type_stack[sp]=GetLiteralValue(term,&i64data,baseType.GetBasicType());
+Literal:
+					if(type_stack[sp]==DEF_INT64||
+						type_stack[sp]==DEF_QWORD||
+						type_stack[sp]==DEF_DOUBLE){
+						//64ビット（符号有り整数/実数）
+
+						//push HILONG(dbl)
+						op_push_V((long)*(long *)(((char *)(&i64data))+4));
+
+						//push LOLONG(dbl)
+						op_push_V(*(long *)(&i64data));
+					}
+					else if(type_stack[sp]==DEF_SINGLE){
+						//single実数
+
+						float flt;
+						memcpy(&dbl,&i64data,sizeof(double));
+						flt=(float)dbl;
+						memcpy(&i3,&flt,sizeof(long));
+
+						//push term
+						op_push_V(i3);
+					}
+					else{
+						//その他
+
+						//push term
+						op_push_V((long)i64data);
+
+						if((long)i64data==0) index_stack[sp]=LITERAL_NULL;
+					}
+
+
+					//リテラル値の種類
+					if(Is64Type(type_stack[sp])==0&&IsRealNumberType(type_stack[sp])==0){
+						//整数（符号有り/無し）
+
+						index_stack[sp]=GetLiteralIndex(i64data);
+					}
+				}
+				sp++;
+				break;
+
+			//論理演算子
+			case CALC_XOR:
+				//value[sp-2] xor= value[sp-1]
+				//xor演算
+				if(!Calc_Xor(type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_OR:
+				//value[sp-2] or= value[sp-1]
+				//or演算
+				if(!Calc_Or(type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_AND:
+				//value[sp-2] and= value[sp-1]
+				//and演算
+				if(!Calc_And(type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_NOT:
+				//value[sp-1]=Not value[sp-1]
+				//NOT演算子
+				if(!Calc_Not(type_stack,sp)) goto error;
+				break;
+
+			//比較演算子
+			case CALC_PE:
+				//value[sp-2]<=value[sp-1]
+				if(!Calc_Relation_PE(type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_QE:
+				//value[sp-2]>=value[sp-1]
+				if(!Calc_Relation_QE(type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_P:
+				//value[sp-2]<value[sp-1]
+				if(!Calc_Relation_P(type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_Q:
+				//value[sp-2]>value[sp-1]
+				if(!Calc_Relation_Q(type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_NOTEQUAL:
+				//value[sp-2]<>value[sp-1]
+				if(!Calc_Relation_NotEqual(type_stack,&sp)) goto error;
+				break;
+			case CALC_EQUAL:
+				//value[sp-2]=value[sp-1]
+				if(!Calc_Relation_Equal(type_stack,&sp)) goto error;
+				break;
+
+			//ビットシフト
+			case CALC_SHL:
+				//value[sp-2]=value[sp-2]<<value[sp-1]
+				if(!Calc_SHL(type_stack,&sp)) goto error;
+				break;
+			case CALC_SHR:
+				//value[sp-2]=value[sp-2]>>value[sp-1]
+				if(!Calc_SHR(type_stack,&sp)) goto error;
+				break;
+
+			//算術演算
+			case CALC_ADDITION:
+			case CALC_SUBTRACTION:
+			case CALC_PRODUCT:
+				if(!CalcTwoTerm_Arithmetic(idCalc,type_stack,index_stack,&sp)) goto error;
+				break;
+
+			case CALC_MOD:
+				//value[sp-2]%=value[sp-1]
+				//剰余演算
+				if(!Calc_Mod(type_stack,&sp)) goto error;
+				break;
+			case CALC_QUOTIENT:
+				//value[sp-2]/=value[sp-1];
+				//除算
+				if(!Calc_Divide(type_stack,&sp,baseType.GetBasicType())) goto error;
+				break;
+			case CALC_INTQUOTIENT:
+				//value[sp-2]/=value[sp-1]
+				//整数除算
+				if(!Calc_IntDivide(type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_MINUSMARK:
+				//value[sp-1]=-value[sp-1]
+				//符号反転
+				if(!Calc_MinusMark(type_stack,sp)) goto error;
+				index_stack[sp-1]=-1;
+				break;
+			case CALC_POWER:
+				//べき乗演算（浮動小数点演算のみ）
+				if(!Calc_Power(type_stack,&sp)) goto error;
+				break;
+			case CALC_AS:
+				//キャスト
+				if(!Calc_Cast(type_stack,index_stack,&sp)) goto error;
+				break;
+
+			case CALC_BYVAL:
+				//ポインタ型→参照型
+				if( PTR_LEVEL( type_stack[sp-1] ) <= 0 ){
+					//ポインタ型ではないとき
+					SetError( 3, NULL, cp );
+					goto error;
+				}
+
+				type_stack[sp-1] = PTR_LEVEL_DOWN( type_stack[sp-1] );
+
+				break;
+
+			default:
+				SetError(300,NULL,cp);
+				goto error;
+		}
+	}
+
+	if(bError) goto error;
+
+	if(sp!=1){
+		SetError(1,NULL,cp);
+		goto error;
+	}
+
+	if(bLiteralCalculation){
+		//右辺値が数値の定数式の場合
+		Type resultType;
+		StaticCalculation(true, expression,baseType.GetBasicType(),&i64data,resultType);
+
+		obp=BeforeObp;
+		pobj_SubAddrSchedule->num=Before_ProcAddrScheduleNum;
+		pobj_DataTableSchedule->num=Before_DataTableScheduleNum;
+		pobj_Reloc->copy(pobj_BackReloc);
+
+		if( resultType.GetBasicSize() == sizeof(_int64) ){
+			//64ビット（符号有り整数/実数）
+
+			//push HILONG(i64data)
+			op_push_V((long)*(long *)(((char *)(&i64data))+4));
+
+			//push LOLONG(i64data)
+			op_push_V(*(long *)(&i64data));
+		}
+		else if( resultType.IsSingle() ){
+			//single実数
+
+			memcpy(&dbl,&i64data,sizeof(_int64));
+
+			float flt;
+			flt=(float)dbl;
+			memcpy(&i3,&flt,sizeof(long));
+
+			//push flt
+			op_push_V(i3);
+		}
+		else{
+			//整数（符号有り/無し）
+
+			i3=(long)i64data;
+
+			if(resultType.GetBasicSize()==sizeof(char)) i3=i3&0x000000FF;
+			if(resultType.GetBasicSize()==sizeof(short)) i3=i3&0x0000FFFF;
+
+			//push term
+			op_push_V(i3);
+		}
+
+		type_stack[0]=resultType.GetBasicType();
+		index_stack[0]=resultType.GetIndex();
+	}
+	else{
+		//右辺値が数値の定数式ではないとき
+		if(IS_LITERAL(index_stack[0])) index_stack[0]=-1;
+	}
+
+	if(pbUseHeap) *pbUseHeap=bUseHeap[0];
+
+	resultType.SetType( type_stack[0], index_stack[0] );
+
+	bool isSuccessful = true;
+	goto finish;
+
+
+error:
+	isSuccessful = false;
+	goto finish;
+
+
+finish:
+
+	for(i=0;i<pnum;i++){
+		if(values[i]) HeapDefaultFree(values[i]);
+	}
+
+	//再配置スケジュールバックアップ情報を解放
+	delete pobj_BackReloc;
+
+	return isSuccessful;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/NumOpe_Arithmetic.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/NumOpe_Arithmetic.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/NumOpe_Arithmetic.cpp	(revision 178)
@@ -0,0 +1,1471 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void GetStackData_ToRegister(int *type,int sp){
+	/*NumOpeポーランドのスタック蓄積による演算内容（2つのデータ）を
+		レジスタedx:eax、ecx:ebxに取得する*/
+
+	if(type[sp-1]==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//fistp qword ptr[esp]
+		op_fistp_ptr_esp( sizeof(_int64) );
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop ecx
+		op_pop(REG_ECX);
+	}
+	else if(type[sp-1]==DEF_SINGLE){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//fistp qword ptr[esp]
+		op_fistp_ptr_esp( sizeof(_int64) );
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop ecx
+		op_pop(REG_ECX);
+	}
+	else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop ecx
+		op_pop(REG_ECX);
+	}
+	else{
+		//pop eax
+		op_pop(REG_EAX);
+
+		if(IsSignedType(type[sp-1])){
+			//符号拡張
+			//edx:eax ← eax
+				
+			//cdq
+			op_cdq();
+		}
+		else{
+			//ビット拡張
+			//edx:eax ← eax
+
+			//xor edx,edx
+			op_zero_reg(REG_EDX);
+		}
+
+		//mov ebx,eax
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0xD8;
+
+		//mov ecx,edx
+		OpBuffer[obp++]=(char)0x8B;
+		OpBuffer[obp++]=(char)0xCA;
+	}
+
+	//第1項を64ビットに対応させる
+	if(type[sp-2]==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//fistp qword ptr[esp]
+		op_fistp_ptr_esp( sizeof(_int64) );
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//pop edx
+		op_pop(REG_EDX);
+	}
+	else if(type[sp-2]==DEF_SINGLE){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//fistp qword ptr[esp]
+		op_fistp_ptr_esp( sizeof(_int64) );
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//pop edx
+		op_pop(REG_EDX);
+	}
+	else if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//pop edx
+		op_pop(REG_EDX);
+	}
+	else{
+		//pop eax
+		op_pop(REG_EAX);
+
+		if(IsSignedType(type[sp-2])){
+			//符号拡張
+			//edx:eax ← eax
+				
+			//cdq
+			op_cdq();
+		}
+		else{
+			//ビット拡張
+			//edx:eax ← eax
+
+			//xor edx,edx
+			op_zero_reg(REG_EDX);
+		}
+	}
+}
+
+void FormatStackData_To64bit(int *type,int sp){
+	//NumOpeポーランドのスタック蓄積による演算内容（2つのデータ）を64ビット整数型にする
+
+	GetStackData_ToRegister(type,sp);
+
+	//push ecx
+	op_push(REG_ECX);
+
+	//push ebx
+	op_push(REG_EBX);
+
+	//push edx
+	op_push(REG_EDX);
+
+	//push eax
+	op_push(REG_EAX);
+}
+
+BOOL CalcTwoTerm_Arithmetic(int idCalc,int *type,LONG_PTR *index_stack,int *pStackPointer){
+	/*	value[sp-2] = value[sp-2] + value[sp-1]
+		value[sp-2] = value[sp-2] - value[sp-1]
+		value[sp-2] = value[sp-2] * value[sp-1]		*/
+
+	int sp;
+	sp=*pStackPointer;
+
+	int AnswerType;
+	AnswerType=NeutralizationType(type[sp-2],index_stack[sp-2],type[sp-1],index_stack[sp-1]);
+
+	if(type[sp-2]==DEF_DOUBLE||type[sp-2]==DEF_SINGLE||
+		type[sp-1]==DEF_DOUBLE||type[sp-1]==DEF_SINGLE){
+		/////////////
+		// 実数演算
+		/////////////
+
+		if(type[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else if(type[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else{
+			//その他整数型
+
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+
+		if(type[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+		}
+		else if(type[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+		}
+		else if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+			//64ビット整数値
+			op_fld_ptr_esp(DEF_INT64);
+		}
+		else{
+			//その他整数型
+
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+		}
+
+		if(GetTypeSize(type[sp-2],-1)==sizeof(_int64)){
+			if(AnswerType==DEF_SINGLE){
+				//add esp,4
+				op_add_esp(4);
+			}
+		}
+		else{
+			if(AnswerType==DEF_DOUBLE){
+				//sub esp,4
+				op_sub_esp(4);
+			}
+		}
+
+		if(idCalc==CALC_ADDITION){
+			//faddp st(1),st
+			OpBuffer[obp++]=(char)0xDE;
+			OpBuffer[obp++]=(char)0xC1;
+		}
+		else if(idCalc==CALC_SUBTRACTION){
+			//fsubrp st(1),st
+			OpBuffer[obp++]=(char)0xDE;
+			OpBuffer[obp++]=(char)0xE1;
+		}
+		else if(idCalc==CALC_PRODUCT){
+			//fmulp st(1),st
+			OpBuffer[obp++]=(char)0xDE;
+			OpBuffer[obp++]=(char)0xC9;
+		}
+
+		if(AnswerType==DEF_DOUBLE){
+			//fstp qword ptr[esp]
+			OpBuffer[obp++]=(char)0xDD;
+			OpBuffer[obp++]=(char)0x1C;
+			OpBuffer[obp++]=(char)0x24;
+		}
+		else{
+			//fstp dword ptr[esp]
+			OpBuffer[obp++]=(char)0xD9;
+			OpBuffer[obp++]=(char)0x1C;
+			OpBuffer[obp++]=(char)0x24;
+		}
+	}
+	else if(Is64Type(type[sp-2])||Is64Type(type[sp-1])){
+		//////////////////////
+		// 64ビット整数演算
+		//////////////////////
+
+		if(idCalc==CALC_PRODUCT){
+			if(!((type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD)&&
+				(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD))){
+				//2つの項のどちらかが64ビット整数でないとき
+				FormatStackData_To64bit(type,sp);
+			}
+
+			//call _allmul
+			extern UserProc *pSub_allmul;
+			op_call(pSub_allmul);
+
+			//push edx
+			op_push(REG_EDX);
+
+			//push eax
+			op_push(REG_EAX);
+		}
+		else{
+			if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+				//第2項が64ビット整数値のとき
+
+				//pop ebx
+				op_pop(REG_EBX);
+
+				//pop ecx
+				op_pop(REG_ECX);
+			}
+			else{
+				//第2項がその他整数値のとき
+
+				//pop eax
+				op_pop(REG_EAX);
+
+				if(IsSignedType(type[sp-1])){
+					//符号拡張
+					//edx:eax ← eax
+					
+					//cdq
+					op_cdq();
+				}
+				else{
+					//ビット拡張
+					//edx:eax ← eax
+
+					//xor edx,edx
+					op_zero_reg(REG_EDX);
+				}
+
+				//mov ebx,eax
+				OpBuffer[obp++]=(char)0x8B;
+				OpBuffer[obp++]=(char)0xD8;
+
+				//mov ecx,edx
+				OpBuffer[obp++]=(char)0x8B;
+				OpBuffer[obp++]=(char)0xCA;
+			}
+
+			if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+				//第1項が64ビット整数値のとき
+
+				if(idCalc==CALC_ADDITION){
+					//add dword ptr[esp],ebx
+					OpBuffer[obp++]=(char)0x01;
+					OpBuffer[obp++]=(char)0x1C;
+					OpBuffer[obp++]=(char)0x24;
+
+					//adc dword ptr[esp+sizeof(long)],ecx
+					OpBuffer[obp++]=(char)0x11;
+					OpBuffer[obp++]=(char)0x4C;
+					OpBuffer[obp++]=(char)0x24;
+					OpBuffer[obp++]=(char)0x04;
+				}
+				else if(idCalc==CALC_SUBTRACTION){
+					//sub dword ptr[esp],ebx
+					OpBuffer[obp++]=(char)0x29;
+					OpBuffer[obp++]=(char)0x1C;
+					OpBuffer[obp++]=(char)0x24;
+
+					//sbb dword ptr[esp+sizeof(long)],ecx
+					OpBuffer[obp++]=(char)0x19;
+					OpBuffer[obp++]=(char)0x4C;
+					OpBuffer[obp++]=(char)0x24;
+					OpBuffer[obp++]=(char)0x04;
+				}
+			}
+			else{
+				//第1項がその他整数値のとき
+
+				//pop eax
+				op_pop(REG_EAX);
+
+				if(IsSignedType(type[sp-2])){
+					//符号拡張
+					//edx:eax ← eax
+
+					//cdq
+					op_cdq();
+				}
+				else{
+					//ビット拡張
+					//edx:eax ← eax
+
+					//xor edx,edx
+					op_zero_reg(REG_EDX);
+				}
+
+				if(idCalc==CALC_ADDITION){
+					//add ebx,eax
+					OpBuffer[obp++]=(char)0x03;
+					OpBuffer[obp++]=(char)0xD8;
+
+					//adc ecx,edx
+					OpBuffer[obp++]=(char)0x13;
+					OpBuffer[obp++]=(char)0xCA;
+				}
+				else if(idCalc==CALC_SUBTRACTION){
+					//sub ebx,eax
+					OpBuffer[obp++]=(char)0x2B;
+					OpBuffer[obp++]=(char)0xC3;
+
+					//sbb ecx,edx
+					OpBuffer[obp++]=(char)0x1B;
+					OpBuffer[obp++]=(char)0xD1;
+				}
+
+				//push ecx
+				op_push(REG_ECX);
+
+				//push ebx
+				op_push(REG_EBX);
+			}
+		}
+	}
+	else{
+		//////////////////////////
+		//32ビット以下の整数演算
+		//////////////////////////
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		if(idCalc==CALC_ADDITION){
+			//add eax,ebx
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0xC3;
+		}
+		else if(idCalc==CALC_SUBTRACTION){
+			//sub eax,ebx
+			OpBuffer[obp++]=(char)0x2B;
+			OpBuffer[obp++]=(char)0xC3;
+		}
+		else if(idCalc==CALC_PRODUCT){
+			//imul eax,ebx（64ビット演算ではないので、符号を考慮しない）
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0xAF;
+			OpBuffer[obp++]=(char)0xC3;
+		}
+
+		//mov dword ptr[esp],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+	}
+
+	sp--;
+	type[sp-1]=AnswerType;
+
+	*pStackPointer=sp;
+
+	return 1;
+}
+
+BOOL Calc_Mod(int *type,int *pStackPointer){
+	//value[sp-2]%=value[sp-1]
+	//剰余演算
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD||
+		type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+		////////////////
+		// 64ビット演算
+		////////////////
+
+		//第2項を64ビットに対応させる
+		FormatStackData_To64bit(type,sp);
+
+		if(IsSignedType(type[sp-2])==0&&IsSignedType(type[sp-1])==0){
+			//符号なし演算
+
+			//call _aullrem
+			extern UserProc *pSub_aullrem;
+			op_call(pSub_aullrem);
+		}
+		else{
+			//符号あり演算
+
+			//call _allrem
+			extern UserProc *pSub_allrem;
+			op_call(pSub_allrem);
+		}
+
+		//push edx
+		op_push(REG_EDX);
+
+		//push eax
+		op_push(REG_EAX);
+
+		sp--;
+		if(type[sp-1]==DEF_QWORD&&type[sp]==DEF_QWORD) type[sp-1]=DEF_QWORD;
+		else type[sp-1]=DEF_INT64;
+	}
+	else{
+		////////////////
+		// 32ビット演算
+		////////////////
+
+		if(type[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+		else if(type[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		if(type[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+		else if(type[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		if(type[sp-2]==DEF_DWORD&&type[sp-1]==DEF_DWORD){
+			//xor edx,edx
+			op_zero_reg(REG_EDX);
+
+			//div ebx (eax=eax/ebx...edx)
+			OpBuffer[obp++]=(char)0xF7;
+			OpBuffer[obp++]=(char)0xF3;
+		}
+		else{
+			//cdq
+			op_cdq();
+
+			//idiv ebx (eax=eax/ebx...edx)
+			OpBuffer[obp++]=(char)0xF7;
+			OpBuffer[obp++]=(char)0xFB;
+		}
+
+		//mov dword ptr[esp],edx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x14;
+		OpBuffer[obp++]=(char)0x24;
+
+		sp--;
+		type[sp-1]=DEF_LONG;
+	}
+
+	*pStackPointer=sp;
+
+	return 1;
+}
+
+BOOL Calc_Divide(int *type,int *pStackPointer,int BaseType){
+	//value[sp-2]/=value[sp-1];
+	//除算
+
+	int sp;
+	sp=*pStackPointer;
+
+	///////////////////////
+	// 浮動小数点演算のみ
+	///////////////////////
+
+	int AnswerType;
+	if(type[sp-2]==DEF_DOUBLE||type[sp-1]==DEF_DOUBLE||BaseType==DEF_DOUBLE) AnswerType=DEF_DOUBLE;
+	else AnswerType=DEF_SINGLE;
+
+	if(type[sp-1]==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//add esp,8
+		op_add_esp(8);
+	}
+	else if(type[sp-1]==DEF_SINGLE){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//add esp,4
+		op_add_esp(4);
+	}
+	else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+		//64ビット整数値
+
+		//fild qword ptr[esp]
+		op_fld_ptr_esp(DEF_INT64);
+
+		//add esp,8
+		op_add_esp(8);
+	}
+	else if(type[sp-1]==DEF_DWORD){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//push 0
+		op_push_V(0);
+
+		//push eax
+		op_push(REG_EAX);
+
+		//fild qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0x2C;
+		OpBuffer[obp++]=(char)0x24;
+
+		//add esp,8
+		op_add_esp(8);
+	}
+	else{
+		//fild dword ptr[esp]
+		op_fld_ptr_esp(DEF_LONG);
+
+		//add esp,4
+		op_add_esp(4);
+	}
+
+	if(type[sp-2]==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+	}
+	else if(type[sp-2]==DEF_SINGLE){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+	}
+	else if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+		//64ビット整数値
+
+		//fild qword ptr[esp]
+		op_fld_ptr_esp(DEF_INT64);
+	}
+	else if(type[sp-2]==DEF_DWORD){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//push 0
+		op_push_V(0);
+
+		//push eax
+		op_push(REG_EAX);
+
+		//fild qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0x2C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else{	//Long
+		//fild dword ptr[esp]
+		op_fld_ptr_esp(DEF_LONG);
+	}
+                                                            //↓ここだけ例外DWord
+	if(GetTypeSize(type[sp-2],-1)==sizeof(_int64)||type[sp-2]==DEF_DWORD){
+		if(AnswerType==DEF_SINGLE){
+			//add esp,4
+			op_add_esp(4);
+		}
+	}
+	else{
+		if(AnswerType==DEF_DOUBLE){
+			//sub esp,4
+			op_sub_esp(4);
+		}
+	}
+
+	//fdivrp st(1),st
+	OpBuffer[obp++]=(char)0xDE;
+	OpBuffer[obp++]=(char)0xF1;
+
+	sp--;
+	if(AnswerType==DEF_DOUBLE){
+		//fstp qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDD;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+
+		type[sp-1]=DEF_DOUBLE;
+	}
+	else{
+		//fstp dword ptr[esp]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+
+		type[sp-1]=DEF_SINGLE;
+	}
+
+	*pStackPointer=sp;
+
+	return 1;
+}
+
+BOOL Calc_IntDivide(int *type,LONG_PTR *index_stack,int *pStackPointer){
+	//value[sp-2]/=value[sp-1]
+	//除算（整数）
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD||
+		type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+		////////////////
+		// 64ビット演算
+		////////////////
+
+		//2つの項を64ビットに対応させる
+		FormatStackData_To64bit(type,sp);
+
+		if(IsSignedType(type[sp-2])==0&&IsSignedType(type[sp-1])==0){
+			//符号なし演算
+
+			//call _aulldiv
+			extern UserProc *pSub_aulldiv;
+			op_call(pSub_aulldiv);
+		}
+		else{
+			//符号あり演算
+
+			//call _alldiv
+			extern UserProc *pSub_alldiv;
+			op_call(pSub_alldiv);
+		}
+
+		//push edx
+		op_push(REG_EDX);
+
+		//push eax
+		op_push(REG_EAX);
+
+		sp--;
+		if(type[sp-1]==DEF_QWORD&&type[sp]==DEF_QWORD) type[sp-1]=DEF_QWORD;
+		else type[sp-1]=DEF_INT64;
+	}
+	else{
+		////////////////
+		// 32ビット演算
+		////////////////
+
+		if(type[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+		else if(type[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		if(type[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+		else if(type[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		if((type[sp-2]==DEF_DWORD&&type[sp-1]==DEF_DWORD)||
+			(IS_POSITIVE_LITERAL(index_stack[sp-2])&&type[sp-1]==DEF_DWORD)||
+			(type[sp-2]==DEF_DWORD&&IS_POSITIVE_LITERAL(index_stack[sp-1]))){
+			//xor edx,edx
+			op_zero_reg(REG_EDX);
+
+			//div ebx (eax=eax/ebx...edx)
+			OpBuffer[obp++]=(char)0xF7;
+			OpBuffer[obp++]=(char)0xF3;
+		}
+		else{
+			//cdq
+			op_cdq();
+
+			//idiv ebx (eax=eax/ebx...edx)
+			OpBuffer[obp++]=(char)0xF7;
+			OpBuffer[obp++]=(char)0xFB;
+		}
+
+		//mov dword ptr[esp],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+
+		sp--;
+
+		//整数以外の型だったときはLong型にする
+		if(!IsWholeNumberType(type[sp-1])) type[sp-1]=DEF_LONG;
+	}
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_MinusMark(int *type,int sp){
+	//value[sp-1]=-value[sp-1]
+	//符号反転
+
+	if(type[sp-1]==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//push -1
+		op_push_V(-1);
+
+		//fild dword ptr[esp]
+		op_fld_ptr_esp(DEF_LONG);
+
+		//add esp,4
+		op_add_esp(4);
+
+		//fmulp st(1),st
+		OpBuffer[obp++]=(char)0xDE;
+		OpBuffer[obp++]=(char)0xC9;
+
+		//fstp qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDD;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(type[sp-1]==DEF_SINGLE){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//push -1
+		op_push_V(-1);
+
+		//fild dword ptr[esp]
+		op_fld_ptr_esp(DEF_LONG);
+
+		//add esp,4
+		op_add_esp(4);
+
+		//fmulp st(1),st
+		OpBuffer[obp++]=(char)0xDE;
+		OpBuffer[obp++]=(char)0xC9;
+
+		//fstp dword ptr[esp]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//neg eax
+		OpBuffer[obp++]=(char)0xF7;
+		OpBuffer[obp++]=(char)0xD8;
+
+		//pop edx
+		op_pop(REG_EDX);
+
+		//adc edx,0
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xD2;
+		OpBuffer[obp++]=(char)0x00;
+
+		//neg edx
+		OpBuffer[obp++]=(char)0xF7;
+		OpBuffer[obp++]=(char)0xDA;
+
+		//push edx
+		op_push(REG_EDX);
+
+		//push eax
+		op_push(REG_EAX);
+
+		type[sp-1]=DEF_INT64;	//QWordはInt64へ
+	}
+	else if(IsWholeNumberType(type[sp-1])){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//imul eax,-1
+		OpBuffer[obp++]=(char)0x6B;
+		OpBuffer[obp++]=(char)0xC0;
+		OpBuffer[obp++]=(char)0xFF;
+
+		//push eax
+		op_push(REG_EAX);
+
+		type[sp-1]=GetSignedType(type[sp-1]);
+	}
+
+	return 1;
+}
+
+BOOL Calc_Power(int *type,int *pStackPointer){
+	//べき乗（実数演算のみ）
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(type[sp-1]==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+
+		//add esp,8
+		op_add_esp(8);
+	}
+	else if(type[sp-1]==DEF_SINGLE){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//add esp,4
+		op_add_esp(4);
+	}
+	else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+		//64ビット整数値
+
+		//fild qword ptr[esp]
+		op_fld_ptr_esp(DEF_INT64);
+
+		//add esp,8
+		op_add_esp(8);
+	}
+	else{
+		//32ビット整数値
+
+		//fild dword ptr[esp]
+		op_fld_ptr_esp(DEF_LONG);
+
+		//add esp,4
+		op_add_esp(4);
+	}
+
+	if(type[sp-2]==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		op_fld_ptr_esp(DEF_DOUBLE);
+	}
+	else if(type[sp-2]==DEF_SINGLE){
+		//fld dword ptr[esp]
+		op_fld_ptr_esp(DEF_SINGLE);
+
+		//sub esp,4
+		op_sub_esp(4);
+	}
+	else if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+		//64ビット整数値
+
+		//fild qword ptr[esp]
+		op_fld_ptr_esp(DEF_INT64);
+	}
+	else{
+		//32ビット整数値
+
+		//fild dword ptr[esp]
+		op_fld_ptr_esp(DEF_LONG);
+
+		//sub esp,4
+		op_sub_esp(4);
+	}
+
+	//sub esp,8
+	op_sub_esp(8);
+
+	//fstp qword ptr[esp]
+	OpBuffer[obp++]=(char)0xDD;
+	OpBuffer[obp++]=(char)0x1C;
+	OpBuffer[obp++]=(char)0x24;
+
+	//fstp qword ptr[esp+8]
+	OpBuffer[obp++]=(char)0xDD;
+	OpBuffer[obp++]=(char)0x5C;
+	OpBuffer[obp++]=(char)0x24;
+	OpBuffer[obp++]=(char)0x08;
+
+	//call pow
+	extern UserProc *pSub_pow;
+	op_call(pSub_pow);
+
+	//sub esp,8
+	op_sub_esp(8);
+
+	//fstp qword ptr[esp]
+	OpBuffer[obp++]=(char)0xDD;
+	OpBuffer[obp++]=(char)0x1C;
+	OpBuffer[obp++]=(char)0x24;
+
+	sp--;
+	type[sp-1]=DEF_DOUBLE;
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_Cast(int *type,LONG_PTR *index_stack,int *pStackPointer){
+	//キャスト
+
+	int sp;
+	sp=*pStackPointer;
+
+	int CastType;
+	CastType=type[sp-1];
+	if((CastType&FLAG_CAST)==0){
+		SetError(47,NULL,cp);
+		return 0;
+	}
+	CastType=CastType&(~FLAG_CAST);
+
+	if(IsPtrType(CastType)){
+		ChangeTypeToLong(type[sp-2]);
+	}
+	else if(IsRealNumberType(CastType)){
+		if(CastType==DEF_DOUBLE) ChangeTypeToDouble(type[sp-2]);
+		else if(CastType==DEF_SINGLE) ChangeTypeToSingle(type[sp-2]);
+	}
+	else ChangeTypeToWhole(type[sp-2],CastType);
+
+	type[sp-2]=CastType;
+	index_stack[sp-2]=index_stack[sp-1];
+
+	sp--;
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_SHL(int *type,int *pStackPointer){
+	//左ビットシフト
+	//value[sp-2]=value[sp-2]<<value[sp-1]
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+		////////////////
+		// 64ビット演算
+		////////////////
+
+		//2項目は32ビット整数として利用
+		if(type[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+		else if(type[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+		else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+			//pop ecx
+			op_pop(REG_ECX);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else{
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+
+		//第1項を64ビットに対応させる
+		if(type[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//fistp qword ptr[esp]
+			op_fistp_ptr_esp( sizeof(_int64) );
+
+			//pop eax
+			op_pop(REG_EAX);
+
+			//pop edx
+			op_pop(REG_EDX);
+		}
+		else if(type[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//sub esp,4
+			op_sub_esp(4);
+
+			//fistp qword ptr[esp]
+			op_fistp_ptr_esp( sizeof(_int64) );
+
+			//pop eax
+			op_pop(REG_EAX);
+
+			//pop edx
+			op_pop(REG_EDX);
+		}
+		else if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+			//pop eax
+			op_pop(REG_EAX);
+
+			//pop edx
+			op_pop(REG_EDX);
+		}
+		else{
+			//pop eax
+			op_pop(REG_EAX);
+
+			if(IsSignedType(type[sp-2])){
+				//符号拡張
+				//edx:eax ← eax
+					
+				//cdq
+				op_cdq();
+			}
+			else{
+				//ビット拡張
+				//edx:eax ← eax
+
+				//xor edx,edx
+				op_zero_reg(REG_EDX);
+			}
+		}
+
+		//call _allshl
+		extern UserProc *pSub_allshl;
+		op_call(pSub_allshl);
+
+		//push edx
+		op_push(REG_EDX);
+
+		//push eax
+		op_push(REG_EAX);
+
+		sp--;
+	}
+	else{
+		////////////////
+		// 32ビット演算
+		////////////////
+
+		//2項目は32ビット整数として利用
+		if(type[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+		else if(type[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+		else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+			//pop ecx
+			op_pop(REG_ECX);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else{
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+
+		if(type[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+		else if(type[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//shl eax,cl
+		OpBuffer[obp++]=(char)0xD3;
+		OpBuffer[obp++]=(char)0xE0;
+
+		//mov dword ptr[esp],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+
+		sp--;
+
+		//32ビット型にする
+		if(IsSignedType(type[sp-1])) type[sp-1]=DEF_LONG;
+		else type[sp-1]=DEF_DWORD;
+	}
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_SHR(int *type,int *pStackPointer){
+	//右ビットシフト
+	//value[sp-2]=value[sp-2]>>value[sp-1]
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+		////////////////
+		// 64ビット演算
+		////////////////
+
+		//2項目は32ビット整数として利用
+		if(type[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+		else if(type[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+		else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+			//pop ecx
+			op_pop(REG_ECX);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else{
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+
+		//第1項を64ビットに対応させる
+		if(type[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//fistp qword ptr[esp]
+			op_fistp_ptr_esp( sizeof(_int64) );
+
+			//pop eax
+			op_pop(REG_EAX);
+
+			//pop edx
+			op_pop(REG_EDX);
+		}
+		else if(type[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//sub esp,4
+			op_sub_esp(4);
+
+			//fistp qword ptr[esp]
+			op_fistp_ptr_esp( sizeof(_int64) );
+
+			//pop eax
+			op_pop(REG_EAX);
+
+			//pop edx
+			op_pop(REG_EDX);
+		}
+		else if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+			//pop eax
+			op_pop(REG_EAX);
+
+			//pop edx
+			op_pop(REG_EDX);
+		}
+		else{
+			//pop eax
+			op_pop(REG_EAX);
+
+			if(IsSignedType(type[sp-2])){
+				//符号拡張
+				//edx:eax ← eax
+
+				//cdq
+				op_cdq();
+			}
+			else{
+				//ビット拡張
+				//edx:eax ← eax
+
+				//xor edx,edx
+				op_zero_reg(REG_EDX);
+			}
+		}
+
+		if(type[sp-2]==DEF_QWORD){
+			//符号なし演算
+
+			//call _aullshr
+			extern UserProc *pSub_aullshr;
+			op_call(pSub_aullshr);
+		}
+		else{
+			//符号あり演算
+
+			//call _allshr
+			extern UserProc *pSub_allshr;
+			op_call(pSub_allshr);
+		}
+
+		//push edx
+		op_push(REG_EDX);
+
+		//push eax
+		op_push(REG_EAX);
+
+		sp--;
+	}
+	else{
+		////////////////
+		// 32ビット演算
+		////////////////
+
+		//2項目は32ビット整数として利用
+		if(type[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+		else if(type[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+		else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+			//pop ecx
+			op_pop(REG_ECX);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else{
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+
+		if(type[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+		else if(type[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		if(type[sp-2]==DEF_DWORD){
+			//shr eax,cl
+			OpBuffer[obp++]=(char)0xD3;
+			OpBuffer[obp++]=(char)0xE8;
+		}
+		else{
+			//sar eax,cl
+			OpBuffer[obp++]=(char)0xD3;
+			OpBuffer[obp++]=(char)0xF8;
+		}
+
+		//mov dword ptr[esp],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+
+		sp--;
+
+		//整数以外の型だったときはLong型にする
+		if(!IsWholeNumberType(type[sp-1])) type[sp-1]=DEF_LONG;
+	}
+
+	*pStackPointer=sp;
+	return 1;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/NumOpe_Logical.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/NumOpe_Logical.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/NumOpe_Logical.cpp	(revision 178)
@@ -0,0 +1,505 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+BOOL Calc_Xor(int *type,LONG_PTR *index_stack,int *pStackPointer){
+	//value[sp-2] xor= value[sp-1]
+	//xor演算
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
+		//いずれかの項が実数のとき
+		SetError(45,"xor",cp);
+		return 0;
+	}
+
+	if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD||
+		type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+		////////////////////
+		// 64ビット整数演算
+		////////////////////
+
+		//第2項を64ビットに対応させる
+		if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+			//第2項が64ビット整数値のとき
+
+			//pop ebx
+			op_pop(REG_EBX);
+
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+		else{
+			//第2項がその他整数値のとき
+
+			//pop eax
+			op_pop(REG_EAX);
+
+			if(IsSignedType(type[sp-1])){
+				//符号拡張
+				//edx:eax ← eax
+				
+				//cdq
+				op_cdq();
+			}
+			else{
+				//ビット拡張
+				//edx:eax ← eax
+
+				//xor edx,edx
+				op_zero_reg(REG_EDX);
+			}
+
+			//mov ebx,eax
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0xD8;
+
+			//mov ecx,edx
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0xCA;
+		}
+
+		if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+			//第1項が64ビット整数値のとき
+
+			//xor dword ptr[esp],ebx
+			OpBuffer[obp++]=(char)0x31;
+			OpBuffer[obp++]=(char)0x1C;
+			OpBuffer[obp++]=(char)0x24;
+
+			//xor dword ptr[esp+sizeof(long)],ecx
+			OpBuffer[obp++]=(char)0x31;
+			OpBuffer[obp++]=(char)0x4C;
+			OpBuffer[obp++]=(char)0x24;
+			OpBuffer[obp++]=(char)0x04;
+		}
+		else{
+			//第1項がその他整数値のとき
+			if(IsSignedType(type[sp-2])){
+				//pop eax
+				op_pop(REG_EAX);
+
+				//符号拡張
+				//edx:eax ← eax
+
+				//cdq
+				op_cdq();
+			}
+			else{
+				//pop eax
+				op_pop(REG_EAX);
+
+				//ビット拡張
+				//edx:eax ← eax
+
+				//xor edx,edx
+				op_zero_reg(REG_EDX);
+			}
+
+			//xor ebx,eax
+			OpBuffer[obp++]=(char)0x33;
+			OpBuffer[obp++]=(char)0xD8;
+
+			//xor ecx,edx
+			OpBuffer[obp++]=(char)0x33;
+			OpBuffer[obp++]=(char)0xCA;
+
+			//push ecx
+			op_push(REG_ECX);
+
+			//push ebx
+			op_push(REG_EBX);
+		}
+
+		sp--;
+		if(type[sp-1]==DEF_QWORD&&type[sp]==DEF_QWORD) type[sp-1]=DEF_QWORD;
+		else type[sp-1]=DEF_INT64;
+	}
+	else{
+		////////////////////
+		// 整数演算
+		////////////////////
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//xor eax,ebx
+		OpBuffer[obp++]=(char)0x33;
+		OpBuffer[obp++]=(char)0xC3;
+
+		//mov dword ptr[esp],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+
+		sp--;
+		type[sp-1]=NeutralizationType(type[sp-1],index_stack[sp-1],type[sp],index_stack[sp]);
+	}
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_Or(int *type,LONG_PTR *index_stack,int *pStackPointer){
+	//value[sp-2] or= value[sp-1]
+	//or演算
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
+		//いずれかの項が実数のとき
+		SetError(45,"or",cp);
+		return 0;
+	}
+
+	if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD||
+		type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+		////////////////////
+		// 64ビット整数演算
+		////////////////////
+
+		//第2項を64ビットに対応させる
+		if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+			//第2項が64ビット整数値のとき
+
+			//pop ebx
+			op_pop(REG_EBX);
+
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+		else{
+			//第2項が32ビット整数値のとき
+
+			//pop eax
+			op_pop(REG_EAX);
+
+			if(IsSignedType(type[sp-1])){
+				//符号拡張
+				//edx:eax ← eax
+				
+				//cdq
+				op_cdq();
+			}
+			else{
+				//ビット拡張
+				//edx:eax ← eax
+
+				//xor edx,edx
+				op_zero_reg(REG_EDX);
+			}
+
+			//mov ebx,eax
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0xD8;
+
+			//mov ecx,edx
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0xCA;
+		}
+
+		if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+			//第1項が64ビット整数値のとき
+
+			//or dword ptr[esp],ebx
+			OpBuffer[obp++]=(char)0x09;
+			OpBuffer[obp++]=(char)0x1C;
+			OpBuffer[obp++]=(char)0x24;
+
+			//or dword ptr[esp+sizeof(long)],ecx
+			OpBuffer[obp++]=(char)0x09;
+			OpBuffer[obp++]=(char)0x4C;
+			OpBuffer[obp++]=(char)0x24;
+			OpBuffer[obp++]=(char)0x04;
+		}
+		else{
+			//第1項が32ビット整数値のとき
+			if(IsSignedType(type[sp-2])){
+				//pop eax
+				op_pop(REG_EAX);
+
+				//符号拡張
+				//edx:eax ← eax
+
+				//cdq
+				op_cdq();
+			}
+			else{
+				//pop eax
+				op_pop(REG_EAX);
+
+				//ビット拡張
+				//edx:eax ← eax
+
+				//xor edx,edx
+				op_zero_reg(REG_EDX);
+			}
+
+			//or ebx,eax
+			OpBuffer[obp++]=(char)0x0B;
+			OpBuffer[obp++]=(char)0xD8;
+
+			//or ecx,edx
+			OpBuffer[obp++]=(char)0x0B;
+			OpBuffer[obp++]=(char)0xCA;
+
+			//push ecx
+			op_push(REG_ECX);
+
+			//push ebx
+			op_push(REG_EBX);
+		}
+
+		sp--;
+		if(type[sp-1]==DEF_QWORD&&type[sp]==DEF_QWORD) type[sp-1]=DEF_QWORD;
+		else type[sp-1]=DEF_INT64;
+	}
+	else{
+		////////////////////
+		// 32ビット整数演算
+		////////////////////
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//or eax,ebx
+		OpBuffer[obp++]=(char)0x0B;
+		OpBuffer[obp++]=(char)0xC3;
+
+		//mov dword ptr[esp],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+
+		sp--;
+		type[sp-1]=NeutralizationType(type[sp-1],index_stack[sp-1],type[sp],index_stack[sp]);
+	}
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_And(int *type,LONG_PTR *index_stack,int *pStackPointer){
+	//value[sp-2] and= value[sp-1]
+	//and演算
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
+		//いずれかの項が実数のとき
+		SetError(45,"and",cp);
+		return 0;
+	}
+
+	if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD||
+		type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+		////////////////////
+		// 64ビット整数演算
+		////////////////////
+
+		//第2項を64ビットに対応させる
+		if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+			//第2項が64ビット整数値のとき
+
+			//pop ebx
+			op_pop(REG_EBX);
+
+			//pop ecx
+			op_pop(REG_ECX);
+		}
+		else{
+			//第2項が32ビット整数値のとき
+
+			//pop eax
+			op_pop(REG_EAX);
+
+			if(IsSignedType(type[sp-1])){
+				//符号拡張
+				//edx:eax ← eax
+				
+				//cdq
+				op_cdq();
+			}
+			else{
+				//ビット拡張
+				//edx:eax ← eax
+
+				//xor edx,edx
+				op_zero_reg(REG_EDX);
+			}
+
+			//mov ebx,eax
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0xD8;
+
+			//mov ecx,edx
+			OpBuffer[obp++]=(char)0x8B;
+			OpBuffer[obp++]=(char)0xCA;
+		}
+
+		if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+			//第1項が64ビット整数値のとき
+
+			//and dword ptr[esp],ebx
+			OpBuffer[obp++]=(char)0x21;
+			OpBuffer[obp++]=(char)0x1C;
+			OpBuffer[obp++]=(char)0x24;
+
+			//and dword ptr[esp+sizeof(long)],ecx
+			OpBuffer[obp++]=(char)0x21;
+			OpBuffer[obp++]=(char)0x4C;
+			OpBuffer[obp++]=(char)0x24;
+			OpBuffer[obp++]=(char)0x04;
+		}
+		else{
+			//第1項が32ビット整数値のとき
+			if(IsSignedType(type[sp-2])){
+				//pop eax
+				op_pop(REG_EAX);
+
+				//符号拡張
+				//edx:eax ← eax
+
+				//cdq
+				op_cdq();
+			}
+			else{
+				//pop eax
+				op_pop(REG_EAX);
+
+				//ビット拡張
+				//edx:eax ← eax
+
+				//xor edx,edx
+				op_zero_reg(REG_EDX);
+			}
+
+			//and ebx,eax
+			OpBuffer[obp++]=(char)0x23;
+			OpBuffer[obp++]=(char)0xD8;
+
+			//and ecx,edx
+			OpBuffer[obp++]=(char)0x23;
+			OpBuffer[obp++]=(char)0xCA;
+
+			//push ecx
+			op_push(REG_ECX);
+
+			//push ebx
+			op_push(REG_EBX);
+		}
+
+		sp--;
+		if(type[sp-1]==DEF_QWORD&&type[sp]==DEF_QWORD) type[sp-1]=DEF_QWORD;
+		else type[sp-1]=DEF_INT64;
+	}
+	else{
+		////////////////////
+		// 32ビット整数演算
+		////////////////////
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//and eax,ebx
+		OpBuffer[obp++]=(char)0x23;
+		OpBuffer[obp++]=(char)0xC3;
+
+		//mov dword ptr[esp],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+
+		sp--;
+		type[sp-1]=NeutralizationType(type[sp-1],index_stack[sp-1],type[sp],index_stack[sp]);
+	}
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_Not(int *type,int sp){
+	//value[sp-1]=Not value[sp-1]
+	//NOT演算子
+
+	if(IsRealNumberType(type[sp-1])){
+		//実数のとき
+		SetError(45,"Not",cp);
+		return 0;
+	}
+
+	if( type[sp - 1] == DEF_BOOLEAN ){
+		//pop eax
+		op_pop( REG_EAX );
+
+		//cmp eax,0
+		op_cmp_value(GetTypeSize(type[sp-1],-1),REG_EAX,0);
+
+		//setne al
+		op_setne( REG_EAX );
+
+		//and eax,000000FFh
+		op_and_RV(REG_EAX,(int)0xFF);
+
+		//neg
+		op_neg( REG_EAX );
+
+		//sbb eax, eax
+		op_sbb_RR( REG_EAX, REG_EAX );
+
+		//add eax, 1
+		op_add_RV8( REG_EAX, 1 );
+
+		//push eax
+		op_push( REG_EAX );
+	}
+	else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+		////////////////////
+		// 64ビット整数演算
+		////////////////////
+
+		//not dword ptr[esp]
+		OpBuffer[obp++]=(char)0xF7;
+		OpBuffer[obp++]=(char)0x14;
+		OpBuffer[obp++]=(char)0x24;
+
+		//not dword ptr[esp+4]
+		OpBuffer[obp++]=(char)0xF7;
+		OpBuffer[obp++]=(char)0x54;
+		OpBuffer[obp++]=(char)0x24;
+		OpBuffer[obp++]=(char)0x04;
+	}
+	else{
+		////////////////////
+		// 32ビット整数演算
+		////////////////////
+
+		//not dword ptr[esp]
+		OpBuffer[obp++]=(char)0xF7;
+		OpBuffer[obp++]=(char)0x14;
+		OpBuffer[obp++]=(char)0x24;
+	}
+
+	return 1;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/NumOpe_Relation.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/NumOpe_Relation.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/NumOpe_Relation.cpp	(revision 178)
@@ -0,0 +1,1385 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void AutoExtendToBigType( int *type_stack,int sp, int reg1, int reg2 ){
+	/*
+	int bigSize = GetTypeSize( type_stack[sp-1], -1 );
+	if( bigSize != GetTypeSize( type_stack[sp-2], -1 ) ){
+		int extReg = reg2;
+		int oldType = type_stack[sp-2];
+		if( bigSize < GetTypeSize( type_stack[sp-2], -1 ) ){
+			bigSize = GetTypeSize( type_stack[sp-2], -1 );
+			extReg = reg1;
+			oldType = type_stack[sp-1];
+		}
+		if( bigSize == 2 ){
+			ExtendTypeTo16( oldType, extReg );
+		}
+		else if( bigSize == 4 ){
+			ExtendTypeTo32( oldType, extReg );
+		}
+		else{
+			SetError();
+		}
+	}*/
+}
+
+
+BOOL Calc_Relation_PE(int *type_stack,LONG_PTR *index_stack,int *pStackPointer){
+	//value[sp-2]<=value[sp-1]
+
+	int sp;
+	sp=*pStackPointer;
+
+	int AnswerType;
+	AnswerType=NeutralizationType(type_stack[sp-2],index_stack[sp-2],type_stack[sp-1],index_stack[sp-1]);
+
+	if(IsRealNumberType(AnswerType)){
+		//////////////
+		// 実数演算
+		//////////////
+
+		if(type_stack[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else if(type_stack[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type_stack[sp-1]==DEF_INT64||type_stack[sp-1]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else{
+			//その他整数型
+
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+
+		if(type_stack[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type_stack[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+		}
+		else if(type_stack[sp-2]==DEF_INT64||type_stack[sp-2]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else{
+			//その他整数型
+
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+		}
+
+		//fcompp
+		OpBuffer[obp++]=(char)0xDE;
+		OpBuffer[obp++]=(char)0xD9;
+
+		//fnstsw ax
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0xE0;
+
+		//mov ecx,1
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//test ah,41h
+		OpBuffer[obp++]=(char)0xF6;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)0x41;
+
+		//jne 5
+		OpBuffer[obp++]=(char)0x75;
+		OpBuffer[obp++]=(char)0x02;
+
+		//xor ecx,ecx（ecxを0にする）
+		op_zero_reg(REG_ECX);
+
+		//mov dword ptr[esp],ecx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x0C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(Is64Type(AnswerType)){
+		////////////////////
+		// 64ビット整数演算
+		////////////////////
+		int TrueSchedule,
+			FalseSchedule1,
+			FalseSchedule2;
+
+		// 第1項 <= 第2項
+
+		//第1項 edx:eax
+		//第2項 ecx:ebx
+		GetStackData_ToRegister(type_stack,sp);
+
+		//cmp edx,ecx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xD1;
+
+		if(IsSignedType(type_stack[sp-2])==0&&IsSignedType(type_stack[sp-1])==0){
+			//符号なし演算
+
+			//ja FalseSchedule1（偽へジャンプ）
+			OpBuffer[obp++]=(char)0x77;
+		}
+		else{
+			//符号あり演算
+
+			//jg FalseSchedule1（偽へジャンプ）
+			OpBuffer[obp++]=(char)0x7F;
+		}
+		FalseSchedule1=obp;
+		obp++;
+
+		if(IsSignedType(type_stack[sp-2])==0&&IsSignedType(type_stack[sp-1])==0){
+			//符号なし演算
+
+			//jb TrueSchedule（真へジャンプ）
+			OpBuffer[obp++]=(char)0x72;
+		}
+		else{
+			//符号あり演算
+
+			//jl TrueSchedule（真へジャンプ）
+			OpBuffer[obp++]=(char)0x7C;
+		}
+		TrueSchedule=obp;
+		obp++;
+
+		//cmp eax,ebx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xC3;
+
+		//ja FalseSchedule2（偽へジャンプ）
+		OpBuffer[obp++]=(char)0x77;
+		FalseSchedule2=obp;
+		obp++;
+
+		//TrueScheduleのジャンプ先の設定
+		OpBuffer[TrueSchedule]=obp-(TrueSchedule+1);
+
+		//mov eax,1
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//jmp 2（演算終了位置へジャンプ）
+		OpBuffer[obp++]=(char)0xEB;
+		OpBuffer[obp++]=(char)0x02;
+
+		//FalseScheduleのジャンプ先の設定
+		OpBuffer[FalseSchedule1]=obp-(FalseSchedule1+1);
+		OpBuffer[FalseSchedule2]=obp-(FalseSchedule2+1);
+
+		//xor eax,eax（eaxを0にする）
+		op_zero_reg(REG_EAX);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else{
+		////////////////////
+		// 32ビット整数演算
+		////////////////////
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		// どちらかのサイズが足りない場合は自動拡張する
+		AutoExtendToBigType( type_stack, sp, REG_EAX, REG_EBX );
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//mov ecx,1
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//cmp eax,ebx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xC3;
+
+		if(IsSignedType(type_stack[sp-2])==0&&IsSignedType(type_stack[sp-1])==0){
+			//符号なし演算
+
+			//jbe 5（次のmovを飛び越す）
+			OpBuffer[obp++]=(char)0x76;
+			OpBuffer[obp++]=(char)0x05;
+		}
+		else{
+			//符号あり演算
+
+			//jle 5（次のmovを飛び越す）
+			OpBuffer[obp++]=(char)0x7E;
+			OpBuffer[obp++]=(char)0x05;
+		}
+
+		//mov ecx,0
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=0;
+		obp+=sizeof(long);
+
+		//mov dword ptr[esp],ecx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x0C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+
+	sp--;
+	type_stack[sp-1]=DEF_BOOLEAN;
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_Relation_QE(int *type_stack,LONG_PTR *index_stack,int *pStackPointer){
+	//value[sp-2]>=value[sp-1]
+
+	int sp;
+	sp=*pStackPointer;
+
+	int AnswerType;
+	AnswerType=NeutralizationType(type_stack[sp-2],index_stack[sp-2],type_stack[sp-1],index_stack[sp-1]);
+
+	if(IsRealNumberType(AnswerType)){
+		//浮動小数点演算
+		if(type_stack[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else if(type_stack[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type_stack[sp-1]==DEF_INT64||type_stack[sp-1]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else{
+			//その他整数型
+
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+
+		if(type_stack[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type_stack[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+		}
+		else if(type_stack[sp-2]==DEF_INT64||type_stack[sp-2]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else{
+			//その他整数型
+
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+		}
+
+		//fcompp
+		OpBuffer[obp++]=(char)0xDE;
+		OpBuffer[obp++]=(char)0xD9;
+
+		//fnstsw ax
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0xE0;
+
+		//mov ecx,1
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//test ah,1
+		OpBuffer[obp++]=(char)0xF6;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)0x01;
+
+		//je 5
+		OpBuffer[obp++]=(char)0x74;
+		OpBuffer[obp++]=(char)0x05;
+
+		//mov ecx,0
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=0;
+		obp+=sizeof(long);
+
+		//mov dword ptr[esp],ecx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x0C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(Is64Type(AnswerType)){
+		////////////////////
+		// 64ビット整数演算
+		////////////////////
+		int TrueSchedule,
+			FalseSchedule1,
+			FalseSchedule2;
+
+		// 第1項 >= 第2項
+
+		//第1項 edx:eax
+		//第2項 ecx:ebx
+		GetStackData_ToRegister(type_stack,sp);
+
+		//cmp edx,ecx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xD1;
+
+		if(IsSignedType(AnswerType)){
+			//符号あり演算
+
+			//jl FalseSchedule1（偽へジャンプ）
+			OpBuffer[obp++]=(char)0x7C;
+		}
+		else{
+			//符号なし演算
+
+			//jb FalseSchedule1（偽へジャンプ）
+			OpBuffer[obp++]=(char)0x72;
+		}
+		FalseSchedule1=obp;
+		obp++;
+
+		if(IsSignedType(AnswerType)){
+			//符号あり演算
+
+			//jg TrueSchedule（真へジャンプ）
+			OpBuffer[obp++]=(char)0x7F;
+		}
+		else{
+			//符号なし演算
+
+			//ja TrueSchedule（真へジャンプ）
+			OpBuffer[obp++]=(char)0x77;
+		}
+		TrueSchedule=obp;
+		obp++;
+
+		//cmp eax,ebx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xC3;
+
+		//jb FalseSchedule2（偽へジャンプ）
+		OpBuffer[obp++]=(char)0x72;
+		FalseSchedule2=obp;
+		obp++;
+
+		//TrueScheduleのジャンプ先の設定
+		OpBuffer[TrueSchedule]=obp-(TrueSchedule+1);
+
+		//mov eax,1
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//jmp 2（演算終了位置へジャンプ）
+		OpBuffer[obp++]=(char)0xEB;
+		OpBuffer[obp++]=(char)0x02;
+
+		//FalseScheduleのジャンプ先の設定
+		OpBuffer[FalseSchedule1]=obp-(FalseSchedule1+1);
+		OpBuffer[FalseSchedule2]=obp-(FalseSchedule2+1);
+
+		//xor eax,eax（eaxを0にする）
+		op_zero_reg(REG_EAX);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else{
+		////////////////////
+		// 32ビット整数演算
+		////////////////////
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		// どちらかのサイズが足りない場合は自動拡張する
+		AutoExtendToBigType( type_stack, sp, REG_EAX, REG_EBX );
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//mov ecx,1
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//cmp eax,ebx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xC3;
+
+		if(IsSignedType(AnswerType)){
+			//符号あり演算
+
+			//jge 5（次のmovを飛び越す）符号有り
+			OpBuffer[obp++]=(char)0x7D;
+			OpBuffer[obp++]=(char)0x05;
+		}
+		else{
+			//符号なし演算
+
+			//jae 5（次のmovを飛び越す）
+			OpBuffer[obp++]=(char)0x73;
+			OpBuffer[obp++]=(char)0x05;
+		}
+
+		//mov ecx,0
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=0;
+		obp+=sizeof(long);
+
+		//mov dword ptr[esp],ecx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x0C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+
+	sp--;
+	type_stack[sp-1]=DEF_BOOLEAN;
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_Relation_P(int *type_stack,LONG_PTR *index_stack,int *pStackPointer){
+	//value[sp-2]<value[sp-1]
+
+	int sp;
+	sp=*pStackPointer;
+
+	int AnswerType;
+	AnswerType=NeutralizationType(type_stack[sp-2],index_stack[sp-2],type_stack[sp-1],index_stack[sp-1]);
+
+	if(IsRealNumberType(AnswerType)){
+		//////////////
+		// 実数演算
+		//////////////
+
+		if(type_stack[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else if(type_stack[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type_stack[sp-1]==DEF_INT64||type_stack[sp-1]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else{
+			//その他整数型
+
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+
+		if(type_stack[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type_stack[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+		}
+		else if(type_stack[sp-2]==DEF_INT64||type_stack[sp-2]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else{
+			//その他整数型
+
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+		}
+
+		//fcompp
+		OpBuffer[obp++]=(char)0xDE;
+		OpBuffer[obp++]=(char)0xD9;
+
+		//fnstsw ax
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0xE0;
+
+		//mov ecx,1
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//test ah,01h
+		OpBuffer[obp++]=(char)0xF6;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)0x01;
+
+		//jne 5
+		OpBuffer[obp++]=(char)0x75;
+		OpBuffer[obp++]=(char)0x05;
+
+		//mov ecx,0
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=0;
+		obp+=sizeof(long);
+
+		//mov dword ptr[esp],ecx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x0C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(Is64Type(AnswerType)){
+		////////////////////
+		// 64ビット整数演算
+		////////////////////
+		int TrueSchedule1,
+			TrueSchedule2,
+			FalseSchedule;
+
+		// 第1項 < 第2項
+
+		//第1項 edx:eax
+		//第2項 ecx:ebx
+		GetStackData_ToRegister(type_stack,sp);
+
+		//cmp edx,ecx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xD1;
+
+		if(IsSignedType(AnswerType)){
+			//符号あり演算
+
+			//jl TrueSchedule1（真へジャンプ）
+			OpBuffer[obp++]=(char)0x7C;
+		}
+		else{
+			//符号なし演算
+
+			//jb TrueSchedule1（真へジャンプ）
+			OpBuffer[obp++]=(char)0x72;
+		}
+		TrueSchedule1=obp;
+		obp++;
+
+		if(IsSignedType(AnswerType)){
+			//符号あり演算
+
+			//jg FalseSchedule（偽へジャンプ）
+			OpBuffer[obp++]=(char)0x7F;
+		}
+		else{
+			//符号なし演算
+
+			//ja FalseSchedule（偽へジャンプ）
+			OpBuffer[obp++]=(char)0x77;
+		}
+		FalseSchedule=obp;
+		obp++;
+
+		//cmp eax,ebx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xC3;
+
+		//jb TrueSchedule2（真へジャンプ）
+		OpBuffer[obp++]=(char)0x72;
+		TrueSchedule2=obp;
+		obp++;
+
+		//FalseScheduleのジャンプ先の設定
+		OpBuffer[FalseSchedule]=obp-(FalseSchedule+1);
+
+		//xor eax,eax（eaxを0にする）
+		op_zero_reg(REG_EAX);
+
+		//jmp 5（演算終了位置へジャンプ）
+		OpBuffer[obp++]=(char)0xEB;
+		OpBuffer[obp++]=(char)0x05;
+
+		//TrueScheduleのジャンプ先の設定
+		OpBuffer[TrueSchedule1]=obp-(TrueSchedule1+1);
+		OpBuffer[TrueSchedule2]=obp-(TrueSchedule2+1);
+
+		//mov eax,1
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else{
+		///////////////////
+		//32ビット整数演算
+		///////////////////
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		// どちらかのサイズが足りない場合は自動拡張する
+		AutoExtendToBigType( type_stack, sp, REG_EAX, REG_EBX );
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//mov ecx,1
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//cmp eax,ebx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xC3;
+
+		if(IsSignedType(AnswerType)){
+			//符号あり演算
+
+			//jl 5（次のmovを飛び越す）
+			OpBuffer[obp++]=(char)0x7C;
+			OpBuffer[obp++]=(char)0x05;
+		}
+		else{
+			//符号なし演算
+
+			//jb 5（次のmovを飛び越す）
+			OpBuffer[obp++]=(char)0x72;
+			OpBuffer[obp++]=(char)0x05;
+		}
+
+		//mov ecx,0
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=0;
+		obp+=sizeof(long);
+
+		//mov dword ptr[esp],ecx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x0C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+
+	sp--;
+	type_stack[sp-1]=DEF_BOOLEAN;
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_Relation_Q(int *type_stack,LONG_PTR *index_stack,int *pStackPointer){
+	//value[sp-2]>value[sp-1]
+
+	int sp;
+	sp=*pStackPointer;
+
+	int AnswerType;
+	AnswerType=NeutralizationType(type_stack[sp-2],index_stack[sp-2],type_stack[sp-1],index_stack[sp-1]);
+
+	if(IsRealNumberType(AnswerType)){
+		//////////////
+		// 実数演算
+		//////////////
+
+		if(type_stack[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else if(type_stack[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type_stack[sp-1]==DEF_INT64||type_stack[sp-1]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else{	//Long、DWord
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+
+		if(type_stack[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type_stack[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+		}
+		else if(type_stack[sp-2]==DEF_INT64||type_stack[sp-2]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else{	//Long、DWord
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+		}
+
+		//fcompp
+		OpBuffer[obp++]=(char)0xDE;
+		OpBuffer[obp++]=(char)0xD9;
+
+		//fnstsw ax
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0xE0;
+
+		//mov ecx,1
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//test ah,41
+		OpBuffer[obp++]=(char)0xF6;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)0x41;
+
+		//je 5
+		OpBuffer[obp++]=(char)0x74;
+		OpBuffer[obp++]=(char)0x05;
+
+		//mov ecx,0
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=0;
+		obp+=sizeof(long);
+
+		//mov dword ptr[esp],ecx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x0C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(Is64Type(AnswerType)){
+		////////////////////
+		// 64ビット整数演算
+		////////////////////
+		int FalseSchedule,
+			TrueSchedule1,
+			TrueSchedule2;
+
+		// 第1項 > 第2項
+
+		//第1項 edx:eax
+		//第2項 ecx:ebx
+		GetStackData_ToRegister(type_stack,sp);
+
+		//cmp edx,ecx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xD1;
+
+		if(IsSignedType(AnswerType)){
+			//符号有り
+
+			//jg TrueSchedule1（真へジャンプ）
+			OpBuffer[obp++]=(char)0x7F;
+		}
+		else{
+			//符号無し
+
+			//ja TrueSchedule1（真へジャンプ）
+			OpBuffer[obp++]=(char)0x77;
+		}
+		TrueSchedule1=obp;
+		obp++;
+
+		if(IsSignedType(AnswerType)){
+			//符号有り
+
+			//jl FalseSchedule（偽へジャンプ）
+			OpBuffer[obp++]=(char)0x7C;
+		}
+		else{
+			//符号無し
+
+			//jb FalseSchedule（偽へジャンプ）
+			OpBuffer[obp++]=(char)0x72;
+		}
+		FalseSchedule=obp;
+		obp++;
+
+		//cmp eax,ebx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xC3;
+
+		//ja TrueSchedule2（真へジャンプ）
+		OpBuffer[obp++]=(char)0x77;
+		TrueSchedule2=obp;
+		obp++;
+
+		//FalseScheduleのジャンプ先の設定
+		OpBuffer[FalseSchedule]=obp-(FalseSchedule+1);
+
+		//xor eax,eax（eaxを0にする）
+		op_zero_reg(REG_EAX);
+
+		//jmp 5（演算終了位置へジャンプ）
+		OpBuffer[obp++]=(char)0xEB;
+		OpBuffer[obp++]=(char)0x05;
+
+		//TrueScheduleのジャンプ先の設定
+		OpBuffer[TrueSchedule1]=obp-(TrueSchedule1+1);
+		OpBuffer[TrueSchedule2]=obp-(TrueSchedule2+1);
+
+		//mov eax,1
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else{
+		////////////////////
+		// 32ビット整数演算
+		////////////////////
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		// どちらかのサイズが足りない場合は自動拡張する
+		AutoExtendToBigType( type_stack, sp, REG_EAX, REG_EBX );
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//mov ecx,1
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//cmp eax,ebx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xC3;
+
+		if(IsSignedType(AnswerType)){
+			//jg 5（次のmovを飛び越す）
+			OpBuffer[obp++]=(char)0x7F;
+			OpBuffer[obp++]=(char)0x05;
+		}
+		else{
+			//ja 5（次のmovを飛び越す）
+			OpBuffer[obp++]=(char)0x77;
+			OpBuffer[obp++]=(char)0x05;
+		}
+
+		//mov ecx,0
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=0;
+		obp+=sizeof(long);
+
+		//mov dword ptr[esp],ecx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x0C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+
+	sp--;
+	type_stack[sp-1]=DEF_BOOLEAN;
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_Relation_NotEqual(int *type,int *pStackPointer){
+	//value[sp-2]<>value[sp-1]
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(type[sp-2]==DEF_DOUBLE||type[sp-2]==DEF_SINGLE||
+		type[sp-1]==DEF_DOUBLE||type[sp-1]==DEF_SINGLE){
+		//////////////
+		// 実数演算
+		//////////////
+
+		if(type[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else if(type[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else{	//Long、DWord
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+
+		if(type[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+		}
+		else if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else{	//Long、DWord
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+		}
+
+		//fcompp
+		OpBuffer[obp++]=(char)0xDE;
+		OpBuffer[obp++]=(char)0xD9;
+
+		//fnstsw ax
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0xE0;
+
+		//mov ecx,1
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//test ah,40
+		OpBuffer[obp++]=(char)0xF6;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)0x40;
+
+		//je 5
+		OpBuffer[obp++]=(char)0x74;
+		OpBuffer[obp++]=(char)0x05;
+
+		//mov ecx,0
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=0;
+		obp+=sizeof(long);
+
+		//mov dword ptr[esp],ecx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x0C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD||
+		type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+		////////////////////
+		// 64ビット整数演算
+		////////////////////
+		int TrueSchedule1,
+			TrueSchedule2;
+
+		// 第1項 <> 第2項
+
+		//第1項 edx:eax
+		//第2項 ecx:ebx
+		GetStackData_ToRegister(type,sp);
+
+		//cmp eax,ebx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xC3;
+
+		//jnz TrueSchedule1（真へジャンプ）
+		OpBuffer[obp++]=(char)0x75;
+		TrueSchedule1=obp;
+		obp++;
+
+		//cmp edx,ecx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xD1;
+
+		//jnz TrueSchedule2（真へジャンプ）
+		OpBuffer[obp++]=(char)0x75;
+		TrueSchedule2=obp;
+		obp++;
+
+		//xor eax,eax（eaxを0にする）
+		op_zero_reg(REG_EAX);
+
+		//jmp 5（演算終了位置へジャンプ）
+		OpBuffer[obp++]=(char)0xEB;
+		OpBuffer[obp++]=(char)0x05;
+
+		//TrueScheduleのジャンプ先の設定
+		OpBuffer[TrueSchedule1]=obp-(TrueSchedule1+1);
+		OpBuffer[TrueSchedule2]=obp-(TrueSchedule2+1);
+
+		//mov eax,1
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else{
+		////////////////////
+		// 32ビット整数演算
+		////////////////////
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		// どちらかのサイズが足りない場合は自動拡張する
+		AutoExtendToBigType( type, sp, REG_EAX, REG_EBX );
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//xor eax,ebx
+		OpBuffer[obp++]=(char)0x33;
+		OpBuffer[obp++]=(char)0xC3;
+
+		//jz 5（次のmovを飛び越す）
+		OpBuffer[obp++]=(char)0x74;
+		OpBuffer[obp++]=(char)0x05;
+
+		//mov eax,1
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//mov dword ptr[esp],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+	}
+
+	sp--;
+	type[sp-1]=DEF_BOOLEAN;
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_Relation_Equal(int *type,int *pStackPointer){
+	//value[sp-2]=value[sp-1]
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(type[sp-2]==DEF_DOUBLE||type[sp-2]==DEF_SINGLE||
+		type[sp-1]==DEF_DOUBLE||type[sp-1]==DEF_SINGLE){
+		//////////////
+		// 実数演算
+		//////////////
+
+		if(type[sp-1]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else if(type[sp-1]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else{	//Long、DWord
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+
+		if(type[sp-2]==DEF_DOUBLE){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if(type[sp-2]==DEF_SINGLE){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+		}
+		else if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD){
+			//64ビット整数値
+
+			//fild qword ptr[esp]
+			op_fld_ptr_esp(DEF_INT64);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else{	//Long、DWord
+			//fild dword ptr[esp]
+			op_fld_ptr_esp(DEF_LONG);
+		}
+
+		//fcompp
+		OpBuffer[obp++]=(char)0xDE;
+		OpBuffer[obp++]=(char)0xD9;
+
+		//fnstsw ax
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0xE0;
+
+		//mov ecx,1
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//test ah,40
+		OpBuffer[obp++]=(char)0xF6;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)0x40;
+
+		//jne 5
+		OpBuffer[obp++]=(char)0x75;
+		OpBuffer[obp++]=(char)0x05;
+
+		//mov ecx,0
+		OpBuffer[obp++]=(char)0xB9;
+		*((long *)(OpBuffer+obp))=0;
+		obp+=sizeof(long);
+
+		//mov dword ptr[esp],ecx
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x0C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(type[sp-2]==DEF_INT64||type[sp-2]==DEF_QWORD||
+		type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+		////////////////////
+		// 64ビット整数演算
+		////////////////////
+		int FalseSchedule1,
+			FalseSchedule2;
+
+		// 第1項 == 第2項
+
+		//第1項 edx:eax
+		//第2項 ecx:ebx
+		GetStackData_ToRegister(type,sp);
+
+		//cmp eax,ebx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xC3;
+
+		//jnz FalseSchedule1（偽へジャンプ）
+		OpBuffer[obp++]=(char)0x75;
+		FalseSchedule1=obp;
+		obp++;
+
+		//cmp edx,ecx
+		OpBuffer[obp++]=(char)0x3B;
+		OpBuffer[obp++]=(char)0xD1;
+
+		//jnz FalseSchedule2（偽へジャンプ）
+		OpBuffer[obp++]=(char)0x75;
+		FalseSchedule2=obp;
+		obp++;
+
+		//mov eax,1
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//jmp 2（演算終了位置へジャンプ）
+		OpBuffer[obp++]=(char)0xEB;
+		OpBuffer[obp++]=(char)0x02;
+
+		//FalseScheduleのジャンプ先の設定
+		OpBuffer[FalseSchedule1]=obp-(FalseSchedule1+1);
+		OpBuffer[FalseSchedule2]=obp-(FalseSchedule2+1);
+
+		//xor eax,eax（eaxを0にする）
+		op_zero_reg(REG_EAX);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else{
+		////////////////////
+		// 32ビット整数演算
+		////////////////////
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//pop ebx
+		op_pop(REG_EBX);
+
+		// どちらかのサイズが足りない場合は自動拡張する
+		AutoExtendToBigType( type, sp, REG_EAX, REG_EBX );
+
+		//sub esp,4
+		op_sub_esp(4);
+
+		//xor eax,ebx
+		OpBuffer[obp++]=(char)0x33;
+		OpBuffer[obp++]=(char)0xC3;
+
+		//jz 4（次のxorとjmpを飛び越す）
+		OpBuffer[obp++]=(char)0x74;
+		OpBuffer[obp++]=(char)0x04;
+
+		//xor eax,eax
+		OpBuffer[obp++]=(char)0x33;
+		OpBuffer[obp++]=(char)0xC0;
+
+		//jmp 5
+		OpBuffer[obp++]=(char)0xEB;
+		OpBuffer[obp++]=(char)0x05;
+
+		//mov eax,1
+		OpBuffer[obp++]=(char)0xB8;
+		*((long *)(OpBuffer+obp))=1;
+		obp+=sizeof(long);
+
+		//mov dword ptr[esp],eax
+		OpBuffer[obp++]=(char)0x89;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+	}
+
+	sp--;
+	type[sp-1]=DEF_BOOLEAN;
+
+	*pStackPointer=sp;
+	return 1;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/NumOpe_TypeOperation.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/NumOpe_TypeOperation.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/NumOpe_TypeOperation.cpp	(revision 178)
@@ -0,0 +1,197 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void ExtendStackTo32(int type);
+void ExtendStackTo64(int type){
+	if(Is64Type(type)) return;
+
+	//32ビットに拡張
+	ExtendStackTo32(type);
+
+	//64ビットに拡張
+	if(IsSignedType(type)){
+		//符号あり
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//cdq
+		op_cdq();
+
+		//push edx
+		op_push(REG_EDX);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else{
+		//符号なし
+
+		//pop eax
+		op_pop(REG_EAX);
+
+		//push 0
+		op_push_V(0);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+}
+void ExtendStackTo32(int type){
+	if(GetTypeSize(type,-1)==sizeof(long)) return;
+
+	if(Is64Type(type)){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//pop edx
+		op_pop(REG_EDX);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else if(type==DEF_INTEGER || (isUnicode&&type==DEF_CHAR)){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//movsx eax,ax
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0xBF;
+		OpBuffer[obp++]=(char)0xC0;
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else if(type==DEF_WORD){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//and eax,0000FFFFh
+		OpBuffer[obp++]=(char)0x25;
+		*((long *)(OpBuffer+obp))=0x0000FFFF;
+		obp+=sizeof(long);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//movsx eax,al
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0xBE;
+		OpBuffer[obp++]=(char)0xC0;
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else if(type==DEF_BYTE||type==DEF_BOOLEAN){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//and eax,000000FFh
+		OpBuffer[obp++]=(char)0x25;
+		*((long *)(OpBuffer+obp))=0x000000FF;
+		obp+=sizeof(long);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+}
+void ExtendStackTo16(int type){
+	if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//movsx eax,al
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0xBE;
+		OpBuffer[obp++]=(char)0xC0;
+
+		//push eax
+		op_push(REG_EAX);
+	}
+	else if(type==DEF_BYTE){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//and eax,000000FFh
+		OpBuffer[obp++]=(char)0x25;
+		*((long *)(OpBuffer+obp))=0x000000FF;
+		obp+=sizeof(long);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+}
+void ExtendStackTo8(int type){
+	if(Is64Type(type)){
+		//pop eax
+		op_pop(REG_EAX);
+
+		//pop edx
+		op_pop(REG_EDX);
+
+		//push eax
+		op_push(REG_EAX);
+	}
+}
+
+
+void ChangeTypeToWhole(int OldType,int NewType){
+	if(OldType==DEF_DOUBLE){
+		if(Is64Type(NewType)){
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//fistp qword ptr[esp]
+			op_fistp_ptr_esp( sizeof(_int64) );
+		}
+		else{
+			//fld qword ptr[esp]
+			op_fld_ptr_esp(DEF_DOUBLE);
+
+			//add esp,4
+			op_add_esp(4);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+	}
+	else if(OldType==DEF_SINGLE){
+		if(Is64Type(NewType)){
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//sub esp,4
+			op_sub_esp(4);
+
+			//fistp qword ptr[esp]
+			op_fistp_ptr_esp( sizeof(_int64) );
+		}
+		else{
+			//fld dword ptr[esp]
+			op_fld_ptr_esp(DEF_SINGLE);
+
+			//fistp dword ptr[esp]
+			op_fistp_ptr_esp( sizeof(long) );
+		}
+	}
+	else{
+		//整数から整数へ変換
+
+		if(Is64Type(NewType)){
+			ExtendStackTo64(OldType);
+		}
+		else if(GetTypeSize(NewType,-1)==sizeof(long)){
+			ExtendStackTo32(OldType);
+		}
+		else if(GetTypeSize(NewType,-1)==sizeof(short)){
+			ExtendStackTo16(OldType);
+		}
+		else if(GetTypeSize(NewType,-1)==sizeof(char)){
+			ExtendStackTo8(OldType);
+		}
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/Opcode.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/Opcode.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/Opcode.h	(revision 178)
@@ -0,0 +1,354 @@
+//Opcode.h
+
+//未定義の定数情報
+#define IMAGE_FILE_MACHINE_AMD64 0x8664
+
+
+//レジスタを示す定数
+#define REG_NON -1
+#define REG_EAX 0x00	//reg:000
+#define REG_ECX 0x01	//reg:001
+#define REG_EDX 0x02	//reg:010
+#define REG_EBX 0x03	//reg:011
+#define REG_ESP 0x04	//reg:100
+#define REG_EBP 0x05	//reg:101
+#define REG_ESI 0x06	//reg:110
+#define REG_EDI 0x07	//reg:111
+
+#define REG_RAX REG_EAX
+#define REG_RCX REG_ECX
+#define REG_RDX REG_EDX
+#define REG_RBX REG_EBX
+#define REG_RSP REG_ESP
+#define REG_RBP REG_EBP
+#define REG_RSI REG_ESI
+#define REG_RDI REG_EDI
+
+#define REGISTER_OPERAND(reg) (reg&0x07)
+
+//変数の種類
+#define NON_VAR				0
+#define VAR_GLOBAL			1	// Global Variable
+#define VAR_REFGLOBAL		2	// Global Refference Variable
+#define VAR_LOCAL			3	// Local Variable
+#define VAR_REFLOCAL		4	// Local Refference Variable
+#define VAR_DIRECTMEM		5	// Direct memory
+
+
+extern int cp;
+extern int obp;
+extern char *OpBuffer;
+
+#define breakpoint OpBuffer[obp++]=(char)0xCC;
+
+
+//ラベルアドレス
+struct LABEL{
+	char *pName;
+	int line;
+	DWORD address;
+};
+
+//Goto未知ラベル
+struct GOTOLABELSCHEDULE{
+	char *pName;
+	int line;
+	DWORD pos;
+	DWORD now_cp;
+};
+
+//プロシージャの種類
+#define PROC_DEFAULT	1	//ユーザー定義関数
+#define PROC_DLL		2	//DLL関数
+#define PROC_BUILTIN	3	//コンパイラ埋め込み型
+#define PROC_PTR		4	//関数ポインタ
+
+//プロシージャ
+struct PROCEDURE{
+	char name[255];
+	int address;
+	int types[MAX_PARMS];
+	_int8 ByVal[MAX_PARMS];
+	BOOL ReturnType;
+};
+
+//With情報
+struct WITHINFO{
+	char **ppName;
+	int *pWithCp;
+	int num;
+};
+
+
+//RSrcSection.cpp
+char *GetRSrcSectionBuffer(int *pLen);
+
+//Compile.cpp
+void ChangeOpcode(char *Command);
+void GetGlobalDataForDll(void);
+DWORD CompileBuffer(char Return_Sequence,WORD Return_Command);
+
+//Compile_Calc.cpp
+void ChangeTypeToDouble_ToFpuReg(int OldType);
+void ChangeTypeToDouble(int OldType);
+void ChangeTypeToSingle(int OldType);
+void ChangeTypeToInt64(int OldType);
+void ChangeTypeToLong(int OldType);
+void ChangeTypeToInteger(int OldType);
+void ChangeTypeToByte(int OldType);
+void SetVariableFromEax(int VarType,int CalcType,RELATIVE_VAR *pRelativeVar);
+void OpcodeCalc( const char *Command );
+
+//NumOpe.cpp
+void PushReturnValue(int type);
+bool TermOpe(
+			 const char *term,
+			 const Type &baseType,
+			 Type &resultType,
+			 bool &isLiteral,
+			 BOOL *pbUseHeap,
+			 bool isWantObject = false,
+			 bool *pIsClassName = NULL,
+			 bool isProcedureCallOnly = false );
+bool NumOpe( int reg,
+			const char *expression,
+			const Type &baseType,
+			Type &resultType,
+			BOOL *pbUseHeap = NULL );
+bool NumOpe( const char *Command,
+		   const Type &baseType,
+		   Type &resultType,
+		   BOOL *pbUseHeap = NULL );
+
+//NumOpe_Arithmetic.cpp
+void GetStackData_ToRegister(int *type,int sp);
+BOOL CalcTwoTerm_Arithmetic(int idCalc,int *type,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_Mod(int *type,int *pStackPointer);
+BOOL Calc_Divide(int *type,int *pStackPointer,int BaseType);
+BOOL Calc_IntDivide(int *type,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_MinusMark(int *type,int sp);
+BOOL Calc_Power(int *type,int *pStackPointer);
+BOOL Calc_Cast(int *type,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_SHL(int *type,int *pStackPointer);
+BOOL Calc_SHR(int *type,int *pStackPointer);
+
+//NumOpe_Logical.cpp
+BOOL Calc_Xor(int *type,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_Or(int *type,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_And(int *type,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_Not(int *type,int sp);
+
+//NumOpe_Relation.cpp
+BOOL Calc_Relation_PE(int *type_stack,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_Relation_QE(int *type_stack,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_Relation_P(int *type_stack,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_Relation_Q(int *type_stack,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_Relation_NotEqual(int *type,int *pStackPointer);
+BOOL Calc_Relation_Equal(int *type,int *pStackPointer);
+
+//NumOpe_TypeOperation.cpp
+void ExtendStackTo64(int type);
+void ChangeTypeToWhole(int OldType,int NewType);
+
+//Compile_Set_Var.cpp
+BOOL IsUse_ecx(RELATIVE_VAR *pRelativeVar);
+void SetStructVariable( const Type &varType, const Type &calcType, BOOL bUseHeap);
+void SetRealVariable(int VarType, int CalcType, RELATIVE_VAR *pRelativeVar);
+void SetWholeVariable( int varSize,int calcType, RELATIVE_VAR *pRelative );
+
+void SetDoubleVariable(int type,DWORD VarKind,DWORD offset,BOOL bOffsetOffset);
+void SetSingleVariable(int type,DWORD VarKind,DWORD offset,BOOL bOffsetOffset);
+void SetInt64Variable(int type,RELATIVE_VAR *pRelative);
+void SetDWordVariable(int type,DWORD VarKind,DWORD offset,BOOL bOffsetOffset);
+void SetLongVariable(int type,DWORD VarKind,DWORD offset,BOOL bOffsetOffset);
+void Set16Variable(int type,DWORD VarKind,DWORD offset,BOOL bOffsetOffset);
+void Set8Variable(int type,DWORD VarKind,DWORD offset,BOOL bOffsetOffset);
+void SetBooleanVariable(int type,RELATIVE_VAR *pRelative);
+void ExtendTypeTo64(int type);
+void ExtendTypeTo32(int type,int reg);
+void ExtendTypeTo16(int type,int reg);
+
+//increment.cpp
+void IncDec(int idCalc, const char *lpszLeft, const char *lpszRight);
+
+//calc2.cpp
+#define EXP_TYPE_NUMBER	1
+#define EXP_TYPE_EAX	2
+#define EXP_TYPE_FPU	3
+#define EXP_TYPE_VAR	4
+int NumOpEx(char *Command,double *pDbl,DWORD *pdwType,RELATIVE_VAR *pRelativeVar);
+
+//SetVar.cpp
+BOOL SetVariable(DWORD dwVarType,RELATIVE_VAR *pVarRelativeVar,
+				 DWORD dwExpType,DWORD dwType,void *data);
+
+//Compile_Calc_PushVar.cpp
+void SetReg_RealVariable(int type,RELATIVE_VAR *pRelativeVar);
+void SetReg_WholeVariable(int type,RELATIVE_VAR *pRelativeVar,int reg, bool is64Head = false);
+void PushDoubleVariable(RELATIVE_VAR *pRelativeVar);
+void PushLongVariable(RELATIVE_VAR *pRelativeVar);
+void PushIntegerVariable(RELATIVE_VAR *pRelativeVar);
+void PushWordVariable(RELATIVE_VAR *pRelativeVar);
+void PushCharVariable(RELATIVE_VAR *pRelativeVar);
+void PushByteVariable(RELATIVE_VAR *pRelativeVar);
+
+//Compile_Object.cpp
+void Operator_New( const CClass &classObj, const char *objectSizeStr, const char *parameter, const Type &baseType );
+void OpcodeDelete(const char *Parameter, bool isSweeping);
+
+//Compile_Var.cpp
+void SetRelativeOffset( RELATIVE_VAR &relativeVar );
+bool _member_offset(bool isErrorEnabled, bool isWriteAccess, const CClass &objClass, const char *member, RELATIVE_VAR *pRelativeVar, Type &resultType, BOOL bPrivateAccess);
+void SetThisPtrToReg(int reg);
+bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss = 0);
+bool SetInitGlobalData(int offset,const Type &type,const int *SubScripts,const char *InitBuf);
+#define DIMFLAG_INITDEBUGVAR			1
+#define DIMFLAG_NONCALL_CONSTRACTOR		2
+#define DIMFLAG_STATIC					4
+#define DIMFLAG_CONST					8
+void dim( char *VarName,int *SubScripts,Type &type, const char *InitBuf,const char *ConstractParameter,DWORD dwFlags);
+void SetVarPtrToEax(RELATIVE_VAR *pRelativeVar);
+void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar);
+bool Compile_AddGlobalRootsForGc();
+
+//ParamImpl.cpp
+class ParamImpl{
+	char *Parms[255];
+	vector<Type> types;
+	int ParmsNum;
+
+	Type returnType;
+
+	//一時オブジェクト管理用
+	bool useTempObject;
+	bool useTempParameters[255];
+	int nCountOfTempObjects;
+
+public:
+	ParamImpl(const char *buffer);
+	ParamImpl(const Parameters &params);
+	~ParamImpl();
+	void SetReturnType( const Type &returnType );
+
+private:
+	bool EvaluateOverloadScore( int level, const Parameters &targetParms, const Type &targetResultType );
+public:
+	UserProc *_OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType = false );
+	UserProc *OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType = false );
+
+	void ApplyDefaultParameters( const Parameters &params );
+	bool ErrorCheck( const string &procName, const Parameters &params, int SecondParmNum = -1 );
+	void MacroParameterSupport( const Parameters &params );
+	void SetStructParameter( const Type &baseType, const char *expression );
+	int SetParameter( const string &procName, const Parameters &params, int SecondParmNum = -1 );
+
+	//一時オブジェクトパラメータの生成と破棄
+	int NewTempParameters( const string &procName, const Parameters &params, int SecondParmNum = -1 );
+	void DeleteTempParameters();
+};
+
+//Compile_CallProc.cpp
+void AddLocalVarAddrSchedule();
+#define PROCFLAG_NEW	1
+bool Opcode_CallProcPtr( const char *variable, const char *lpszParms,ProcPointer *pProcPointer);
+bool Opcode_CallProc(const char *Parameter,UserProc *pUserProc,DWORD dwFlags,const char *ObjectName,int RefType);
+bool Opcode_CallDllProc( const char *lpszParms, DllProc *pDllProc );
+
+//Compile_ProcOp.cpp
+void CompileLocal();
+
+//Compile_Func.cpp
+int GetFunctionFromName(char *FuncName);
+bool Opcode_CallFunc( const char *Parameter, const int FuncNum, Type &resultType, bool isCallOn = true );
+
+//OperatorProc.cpp
+void FreeTempObject(int reg,const CClass *pobj_c);
+int CallOperatorProc(int idCalc, const Type &baseType, int *type_stack,LONG_PTR *index_stack,BOOL *bUseHeap,int &sp);
+void CallCastOperatorProc(Type &calcType,BOOL bCalcUseHeap,const Type &toType);
+void CallIndexerGetterProc(const CClass *pobj_Class,char *ObjectName,char *Parameter,Type &resultType);
+
+//Compile_Statement.cpp
+void OpcodeOthers( const char *Command );
+void OpcodeIf(char *Parameter);
+void OpcodeGoto(char *Parameter);
+void OpcodeWhile(char *Parameter);
+void OpcodeFor(char *Parameter);
+void OpcodeDo(char *Parameter);
+void OpcodeContinue(void);
+void OpcodeExitSub(void);
+void OpcodeSelect(const char *lpszParms);
+void OpcodeCase(char *Parameter);
+void OpcodeGosub(char *Parameter);
+void OpcodeReturn(char *Parameter);
+void OpcodeSetPtrData(char *Parameter,int type);
+
+
+
+
+////////////////////////////////
+// IA-32機械語生成に利用する関数郡
+////////////////////////////////
+
+//Mod（モード）
+#define MOD_BASE		(char)0x00
+#define MOD_DISP32		(char)0xFF
+#define MOD_BASE_DISP8	(char)0x40
+#define MOD_BASE_DISP32	(char)0x80
+#define MOD_REG				(char)0xC0
+
+#define USE_OFFSET 1
+#define NON_OFFSET 0
+
+//op32_main.cpp
+BOOL IsSafeReg(int reg);
+void op_mov_RV			(int reg,int offset);
+void op_mov_RV			(int op_size,int reg,int offset);
+void op_mov_RR			(int reg1,int reg2);
+void op_mov_RM			(int op_size,int reg,int base_reg,int offset,char mod);
+void op_mov_RM_ex		(int op_size,int reg,int base_reg1,int base_reg2,int offset,BOOL bUseOffset);
+void op_mov_MR			(int op_size,int reg,int base_reg,int offset,char mod);
+void op_mov_MR_ex		(int op_size,int reg,int base_reg1,int base_reg2,int offset,BOOL bUseOffset);
+void op_movsx_R32R16	(int reg32,int reg16);
+void op_movsx_R32R8		(int reg32,int reg8);
+void op_movsx_R16R8		(int reg16,int reg8);
+void op_inc				(int reg);
+void op_dec				(int reg);
+void op_add_RV8			(int reg,char cValue);
+void op_add_RM			(int op_size,int reg,int base_reg,int offset,char mod);
+void op_adc_RV8			(int reg,char cValue);
+void op_sub_RV8			(int reg,char cValue);
+void op_sbb_RV8			(int reg,char cValue);
+void op_sbb_RR			( int reg1, int reg2 );
+void op_imul_RR			(int reg1,int reg2);
+void op_imul_RV			(int reg,int i32data);
+void op_and_RV			(int reg,int value);
+void op_or_RR			( int op_size, int reg1, int reg2 );
+void op_neg				( int reg );
+void op_cdq				();
+
+void op_rep_movs		(int op_size);
+
+void op_push(int reg);
+void op_push_V(long data);
+void op_pop(int reg = REG_NON);
+void op_add_esp(int num);
+void op_sub_esp(int num);
+void op_cmp_RR( int reg1, int reg2 );
+void op_cmp_value(int op_size,int reg,char byte_data);
+void op_setne( int reg );
+void op_test(int reg1,int reg2);
+void op_fld_ptr_esp(int type);
+void op_fld_basereg			(int type,int base_reg);
+void op_fld_base_offset		(int type,int base_reg,int offset);
+void op_fld_base_offset_ex	(int type,int base_reg1,int base_reg2,int offset,BOOL bUseOffset);
+void op_fstp_basereg		(int type,int base_reg);
+void op_fstp_base_offset	(int type,int base_reg,int offset);
+void op_fstp_base_offset_ex	(int type,int base_reg1,int base_reg2,int offset,BOOL bUseOffset);
+void op_fstp_push			( Type &type );
+void op_fistp_ptr_esp		( int typeSize );
+void op_zero_reg(int reg);
+void fpu_cast();
+void fpu_cast_end();
+
+void op_call(UserProc *pUserProc);
+void op_ret();
Index: tag/abdev(2007.06.20)/BasicCompiler32/OperatorProc.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/OperatorProc.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/OperatorProc.cpp	(revision 178)
@@ -0,0 +1,259 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void FreeTempObject(int reg,const CClass *pobj_c){
+	if(!IsSafeReg(reg)) SetError(300,NULL,cp);
+
+	const CMethod *method = pobj_c->GetDestructorMethod();
+	if( method ){
+		//push reg
+		op_push(reg);
+
+		//call DestructorProcAddr
+		op_call( method->pUserProc );
+	}
+
+	//push reg
+	op_push(reg);
+
+	//call free
+	extern UserProc *pSub_free;
+	op_call(pSub_free);
+}
+
+int CallOperatorProc(int idCalc, const Type &baseType, int *type_stack,LONG_PTR *index_stack,BOOL *bUseHeap,int &sp){
+	//オーバーロードされたオペレータ関数を呼び出す
+	CClass *pobj_c;
+	pobj_c=(CClass *)index_stack[sp-2];
+
+	std::vector<UserProc *> subs;
+	pobj_c->GetMethods().Enum( idCalc, subs );
+	if( subs.size() == 0 ){
+		return 0;
+	}
+
+
+	//項の数
+	BOOL bTwoTerm=1;
+	if(idCalc==CALC_AS) bTwoTerm=0;
+
+
+	/////////////////////////////////////////////
+	// オーバーロード解決用のパラメータを設定
+	/////////////////////////////////////////////
+
+	Parameters params;
+
+	if(bTwoTerm){
+		params.push_back( new Parameter( "", Type( type_stack[sp-1], index_stack[sp-1] ) ) );
+	}
+
+	//オーバーロードを解決
+	char temporary[255];
+	if(idCalc==CALC_EQUAL) lstrcpy(temporary,"==");
+	else GetCalcName(idCalc,temporary);
+	UserProc *pUserProc = OverloadSolution( temporary, subs, params, baseType );
+
+	if(!pUserProc){
+		if(bTwoTerm){
+			delete params[0];
+		}
+		return -1;
+	}
+	else{
+		//オーバーロードされていないが、パラメータ個数が一致しないとき
+		if(params.size()!=pUserProc->Params().size()){
+			if(bTwoTerm){
+				delete params[0];
+			}
+			return -1;
+		}
+	}
+
+	for(int i=0;i<(int)params.size();i++){
+		CheckDifferentType(
+			pUserProc->Params()[i]->GetBasicType(),
+			pUserProc->Params()[i]->GetIndex(),
+			params[i]->GetBasicType(),
+			params[i]->GetIndex(),
+			"",
+			i);
+	}
+
+	if(bTwoTerm){
+		delete params[0];
+	}
+
+	int right_side_size = GetTypeSize(type_stack[sp-1],index_stack[sp-1]);
+
+	if(bTwoTerm){
+		if( pUserProc->RealParams()[1]->IsStruct() &&pUserProc->RealParams()[1]->IsRef() == false ){
+			//一時オブジェクトはメソッド内で破棄される
+			bUseHeap[sp-1]=0;
+		}
+	}
+
+
+	if( pUserProc->ReturnType().IsStruct() ){
+		//////////////////////////////////////////////////////
+		// 戻り値に構造体インスタンスを持つ場合
+		// ※ByRef _System_ReturnValue パラメータ用領域を取得
+		//////////////////////////////////////////////////////
+
+		int object_size = pUserProc->ReturnType().GetClass().GetSize();
+
+		//push object_size
+		op_push_V(object_size);
+
+		//call calloc
+		extern UserProc *pSub_calloc;
+		op_call(pSub_calloc);
+
+		//mov ebx,eax
+		op_mov_RR(REG_EBX,REG_EAX);
+	}
+
+
+	//2つの項を取り出す
+	if(bTwoTerm){
+		if(right_side_size==sizeof(_int64)){
+			//pop eax
+			op_pop(REG_EAX);
+
+			//pop edx
+			op_pop(REG_EDX);
+		}
+		else{
+			//pop eax
+			op_pop(REG_EAX);
+		}
+	}
+
+	//pop ecx
+	op_pop(REG_ECX);
+
+
+	//ヒープ解放用に退避
+	if(bUseHeap[sp-1]){
+		//mov esi,eax
+		op_mov_RR(REG_ESI,REG_EAX);
+	}
+	if(bUseHeap[sp-2]){
+		//mov edi,ecx
+		op_mov_RR(REG_EDI,REG_ECX);
+	}
+
+
+
+	if(bTwoTerm){
+		if(right_side_size==sizeof(_int64)){
+			//push edx
+			op_push(REG_EDX);
+
+			//push eax
+			op_push(REG_EAX);
+		}
+		else{
+			//push eax
+			op_push(REG_EAX);
+		}
+
+		if( pUserProc->RealParams()[1]->IsRef() ){
+			//一時参照を作成
+
+			//mov eax,esp
+			op_mov_RR( REG_EAX, REG_ESP );
+
+			//push eax
+			op_push( REG_EAX );
+		}
+	}
+
+	if( pUserProc->ReturnType().IsStruct() ){
+		//push ebx
+		op_push(REG_EBX);
+	}
+
+	//push ecx
+	op_push(REG_ECX);
+
+	//call operator_proc
+	op_call(pUserProc);
+
+	if(bTwoTerm){
+		if( pUserProc->RealParams()[1]->IsRef() ){
+			//一時参照を破棄
+			op_pop( REG_NON );
+		}
+	}
+
+	if( !pUserProc->ReturnType().IsNull() ){
+		//スタックへプッシュ
+		PushReturnValue(pUserProc->ReturnType().GetBasicType());
+	}
+
+	if(bUseHeap[sp-1]){
+		FreeTempObject(REG_ESI,(CClass *)index_stack[sp-1]);
+	}
+	if(bUseHeap[sp-2]){
+		FreeTempObject(REG_EDI,(CClass *)index_stack[sp-2]);
+	}
+
+	sp--;
+	type_stack[sp-1]=pUserProc->ReturnType().GetBasicType();
+	index_stack[sp-1]=pUserProc->ReturnType().GetIndex();
+
+	if( pUserProc->ReturnType().IsStruct() ){
+		//構造体が戻ったときはヒープ領域にインスタンスが格納されている
+		//※後にfreeする必要あり
+		bUseHeap[sp-1]=1;
+	}
+	else bUseHeap[sp-1]=0;
+
+	return 1;
+}
+
+void CallCastOperatorProc(Type &calcType,BOOL bCalcUseHeap,const Type &toType){
+	int type_stack[10];
+	LONG_PTR index_stack[10];
+	BOOL array_bUseHeap[10];
+	int sp=2;
+
+	if(bCalcUseHeap){
+		//未解放のインスタンスが存在する旨を示す警告
+		SetError(-105,NULL,cp);
+	}
+
+	//左辺
+	type_stack[0]=calcType.GetBasicType();
+	index_stack[0]=calcType.GetIndex();
+	array_bUseHeap[0]=0;
+	type_stack[1]=toType.GetBasicType();
+	index_stack[1]=toType.GetIndex();
+	array_bUseHeap[1]=0;
+
+	int iRet = CallOperatorProc(CALC_AS,toType,type_stack,index_stack,array_bUseHeap,sp);
+
+	if(iRet==1){
+		//成功したとき
+		calcType.SetType( type_stack[0], index_stack[0] );
+		return;
+	}
+	else if(iRet==-1){
+		//エラーが発行されたとき
+		return;
+	}
+
+	//エラーを発行
+	SetError(-1,"キャスト演算子がオーバーロードされていません。",cp);
+}
+void CallIndexerGetterProc(const CClass *pobj_Class,char *ObjectName,char *Parameter,Type &resultType){
+	std::vector<UserProc *> subs;
+	pobj_Class->GetMethods().Enum( CALC_ARRAY_GET, subs );
+	if( subs.size() == 0 ){
+		return;
+	}
+
+	Opcode_CallProc(Parameter,subs[0],0,ObjectName,DEF_OBJECT);
+	resultType = subs[0]->ReturnType();
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/commandvalue.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/commandvalue.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/commandvalue.h	(revision 178)
@@ -0,0 +1,100 @@
+/* 命令語定数 */
+
+//条件、分岐、繰り返し
+#define COM_DO		0x1021
+/* 0x22は「"」なので使用不可 */
+#define COM_GOTO	0x1023
+#define COM_GOSUB	0x1024
+#define COM_LOOP	0x1026
+#define COM_RETURN	0x1027
+/* 0x28は「(」なので使用不可 */
+/* 0x29は「)」なので使用不可 */
+#define COM_FOR		0x1031
+#define COM_NEXT	0x1032
+#define COM_WHILE	0x1036
+#define COM_WEND	0x1037
+
+//データ操作
+#define COM_DIM		0x1062
+#define COM_LET		0x1066
+#define COM_DELETE	0x1068
+#define COM_SWEEPINGDELETE	0x1069
+
+//その他
+#define COM_DEBUG		0x1073
+
+//ポインタ
+#define COM_SETDOUBLE		0x10C1
+#define COM_SETSINGLE		0x10C2
+#define COM_SETQWORD		0x10C3
+#define COM_SETDWORD		0x10C4
+#define COM_SETWORD			0x10C5
+#define COM_SETBYTE			0x10C6
+
+
+
+///////////////////////////////////
+// 以下はProjectEditorで使用される
+
+//入出力コマンド
+#define COM_PRINT		0x1150
+#define COM_INPUT		0x1151
+#define COM_OPEN		0x1152
+#define COM_CLOSE		0x1153
+#define COM_FIELD		0x1154
+#define COM_WRITE		0x1155
+
+//条件、分岐、繰り返し
+#define COM_IF			0x1160
+#define COM_SELECT		0x1161
+
+//ファイル操作
+#define COM_CHDIR		0x1170
+#define COM_KILL		0x1171
+#define COM_MKDIR		0x1172
+#define COM_GET			0x1173
+#define COM_PUT			0x1174
+
+//グラフィックス
+#define COM_CIRCLE		0x1180
+#define COM_LINE		0x1181
+#define COM_PAINT		0x1182
+#define COM_PSET		0x1183
+
+//データ操作
+#define COM_CONST		0x1190
+#define COM_TYPEDEF		0x1191
+
+//クラス関連
+#define COM_CLASS		0x1195
+#define COM_PRIVATE		0x1196
+#define COM_PUBLIC		0x1197
+#define COM_INHERITS	0x1198
+#define COM_PROTECTED	0x1199
+#define COM_INTERFACE	0x119A
+
+//その他
+#define COM_BEEP		0x11A0
+#define COM_CLS			0x11A1
+#define COM_COLOR		0x11A2
+#define COM_DECLARE		0x11A4
+#define COM_DEF			0x11A5
+#define COM_END			0x11A6
+#define COM_FUNCTION	0x11A7
+#define COM_LOCATE		0x11A8
+#define COM_RANDOMIZE	0x11A9
+#define COM_REM			0x11AA
+#define COM_SLEEP		0x11AB
+#define COM_SUB			0x11AC
+#define COM_TYPE		0x11AD
+#define COM_VIRTUAL		0x11AE
+#define COM_OVERRIDE	0x11AF
+#define COM_WITH		0x11B0
+#define COM_ENUM		0x11B1
+#define COM_ABSTRACT	0x11B2
+#define COM_NAMESPACE	0x11B3
+
+//ウィンドウ制御
+#define COM_DELWND		0x11C0
+#define COM_MSGBOX		0x11C1
+#define COM_WINDOW		0x11C2
Index: tag/abdev(2007.06.20)/BasicCompiler32/increment.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/increment.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/increment.cpp	(revision 178)
@@ -0,0 +1,201 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void IncDec(int idCalc, const char *lpszLeft, const char *lpszRight){
+
+	///////////////////////////
+	// 変数アドレスを取得
+	///////////////////////////
+
+	RELATIVE_VAR VarRelativeVar;
+	Type varType;
+	if(!GetVarOffsetReadWrite(
+		lpszLeft,
+		&VarRelativeVar,
+		varType)) return;
+
+	if(IsUse_ecx(&VarRelativeVar)){
+		//push ecx
+		op_push(REG_ECX);
+	}
+
+
+	///////////////////////////////////
+	// レジスタへ変数の内容をコピー
+	///////////////////////////////////
+
+	if( varType.IsReal() ){
+		//実数
+		SetReg_RealVariable(varType.GetBasicType(),&VarRelativeVar);
+	}
+	else{
+		//整数
+		SetReg_WholeVariable(varType.GetBasicType(),&VarRelativeVar,REG_EAX);
+	}
+
+	
+	if(varType.IsWhole()&&lstrcmp(lpszRight,"1")==0&&
+		(idCalc==CALC_ADDITION||idCalc==CALC_SUBTRACTION)){
+		////////////////////////////////////////////
+		// 整数型のインクリメント・デクリメント
+		////////////////////////////////////////////
+
+		if( varType.Is64() ){
+			if(idCalc==CALC_ADDITION){
+				//64ビット インクリメント
+
+				//add eax,1
+				op_add_RV8(REG_EAX,1);
+
+				//adc edx,0
+				op_adc_RV8(REG_EDX,0);
+			}
+			else if(idCalc==CALC_SUBTRACTION){
+				//64ビット デクリメント
+
+				//sub eax,1
+				op_sub_RV8(REG_EAX,1);
+
+				//sbb edx,0
+				op_sbb_RV8(REG_EDX,0);
+			}
+		}
+		else{
+			if(idCalc==CALC_ADDITION){
+				//インクリメント
+				op_inc(REG_EAX);
+			}
+			else if(idCalc==CALC_SUBTRACTION){
+				//デクリメント
+				op_dec(REG_EAX);
+			}
+		}
+	}
+	else{
+		//変数オフセットを一時退避
+		//push ecx
+		op_push(REG_ECX);
+
+		if( varType.IsDouble() ){
+			//sub esp,8
+			op_sub_esp(8);
+
+			//fstp qword ptr[esp]
+			op_fstp_basereg(varType.GetBasicType(),REG_ESP);
+		}
+		else if( varType.IsSingle() ){
+			//sub esp,4
+			op_sub_esp(4);
+
+			//fstp dword ptr[esp]
+			op_fstp_basereg(varType.GetBasicType(),REG_ESP);
+		}
+		else if( varType.Is64() ){
+			//push edx
+			op_push(REG_EDX);
+
+			//push eax
+			op_push(REG_EAX);
+		}
+		else{
+			//push eax
+			op_push(REG_EAX);
+		}
+
+		Type calcType;
+		if( !NumOpe(lpszRight,varType,calcType) ){
+			return;
+		}
+
+		if( varType.IsDouble() )		ChangeTypeToDouble(calcType.GetBasicType());
+		else if( varType.IsSingle() )	ChangeTypeToSingle(calcType.GetBasicType());
+		else ChangeTypeToWhole(calcType.GetBasicType(),varType.GetBasicType());
+
+		int type_stack[255],sp;
+		LONG_PTR index_stack[255];
+		type_stack[0]=varType.GetBasicType();
+		type_stack[1]=varType.GetBasicType();
+		index_stack[0]=varType.GetIndex();
+		index_stack[1]=varType.GetIndex();
+		sp=2;
+
+		switch(idCalc){
+			case CALC_XOR:
+				Calc_Xor(type_stack,index_stack,&sp);
+				break;
+			case CALC_OR:
+				Calc_Or(type_stack,index_stack,&sp);
+				break;
+			case CALC_AND:
+				Calc_And(type_stack,index_stack,&sp);
+				break;
+			case CALC_SHL:
+				Calc_SHL(type_stack,&sp);
+				break;
+			case CALC_SHR:
+				Calc_SHR(type_stack,&sp);
+				break;
+			case CALC_ADDITION:
+			case CALC_SUBTRACTION:
+			case CALC_PRODUCT:
+				CalcTwoTerm_Arithmetic(idCalc,type_stack,index_stack,&sp);
+				break;
+			case CALC_MOD:
+				Calc_Mod(type_stack,&sp);
+				break;
+			case CALC_QUOTIENT:
+				Calc_Divide(type_stack,&sp,varType.GetBasicType());
+				break;
+			case CALC_INTQUOTIENT:
+				Calc_IntDivide(type_stack,index_stack,&sp);
+				break;
+			case CALC_POWER:
+				Calc_Power(type_stack,&sp);
+				break;
+		}
+
+
+		if( varType.IsDouble() ){
+			//fld qword ptr[esp]
+			op_fld_basereg(varType.GetBasicType(),REG_ESP);
+
+			//add esp,8
+			op_add_esp(8);
+		}
+		else if( varType.IsSingle() ){
+			//fld dword ptr[esp]
+			op_fld_basereg(varType.GetBasicType(),REG_ESP);
+
+			//add esp,4
+			op_add_esp(4);
+		}
+		else if( varType.Is64() ){
+			//pop eax
+			op_pop(REG_EAX);
+
+			//pop edx
+			op_pop(REG_EDX);
+		}
+		else{
+			//pop eax
+			op_pop(REG_EAX);
+		}
+
+
+		//変数オフセットを復元
+		//pop ecx
+		op_pop(REG_ECX);
+	}
+
+
+	/////////////////////////////////////////////////
+	// レジスタの内容を変数にコピー
+	/////////////////////////////////////////////////
+
+	if(IsUse_ecx(&VarRelativeVar)){
+		//pop ecx
+		op_pop(REG_ECX);
+	}
+
+	SetVariableFromEax(varType.GetBasicType(),varType.GetBasicType(),&VarRelativeVar);
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/manifest.xml
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/manifest.xml	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/manifest.xml	(revision 178)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+version="1.0.0.0"
+processorArchitecture="x86"
+name="Microsoft.Winweb.BasicCompiler.exe"
+type="win32"
+/>
+<description>Description</description>
+<dependency>
+<dependentAssembly>
+<assemblyIdentity
+type="win32"
+name="Microsoft.Windows.Common-Controls"
+version="6.0.0.0"
+processorArchitecture="x86"
+publicKeyToken="6595b64144ccf1df"
+language="*"
+/>
+</dependentAssembly>
+</dependency>
+</assembly>
Index: tag/abdev(2007.06.20)/BasicCompiler32/op32_main.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/op32_main.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/op32_main.cpp	(revision 178)
@@ -0,0 +1,990 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+
+
+BOOL IsSafeReg(int reg){
+	if(reg==REG_EBX||reg==REG_ESI||reg==REG_EDI) return 1;
+	return 0;
+}
+
+
+
+/////////////////////////////////////////////////
+// ModR/Mバイト、SIBバイト、ディスプレースメント
+/////////////////////////////////////////////////
+
+//スケール
+#define SCALE_NON	(char)0x00
+#define SCALE_2		(char)0x40
+#define SCALE_4		(char)0x80
+#define SCALE_8		(char)0xC0
+
+//インデックスなし
+#define INDEX_NON	0x04
+
+void set_mod_rm_sib_disp(char mod,int reg,int scale,int index_reg,int base_reg,int disp){
+	if(mod==MOD_DISP32){
+		//ModR/Mバイト
+		OpBuffer[obp++]=(char)(      REGISTER_OPERAND(reg)<<3 | REGISTER_OPERAND(0x04));
+
+		base_reg=0x05;
+		index_reg=INDEX_NON;
+	}
+	else{
+		//ModR/Mバイト
+		OpBuffer[obp++]=(char)(mod | REGISTER_OPERAND(reg)<<3 | REGISTER_OPERAND(base_reg));
+	}
+
+
+	//レジスタモードの場合は、ここで終了
+	if(mod==MOD_REG) return;
+
+
+	if(REGISTER_OPERAND(base_reg)==0x04||mod==MOD_DISP32){
+		//////////////////////
+		// SIBバイトを使う
+		//////////////////////
+
+		OpBuffer[obp++]=(char)(scale| REGISTER_OPERAND(index_reg)<<3 | REGISTER_OPERAND(base_reg));
+	}
+
+	//ディスプレースメントを必要としない場合は、ここで終了
+	if(mod==MOD_BASE) return;
+
+
+	//////////////////////////
+	// ディスプレースメント
+	//////////////////////////
+
+	if(mod==MOD_BASE_DISP8) OpBuffer[obp++]=(char)disp;
+	else{
+		*((long *)(OpBuffer+obp))=disp;
+		obp+=sizeof(long);
+	}
+}
+
+
+
+void __op_format(char op_prefix,char opcode,int reg){
+	//命令プリフィックス
+	if(op_prefix) OpBuffer[obp++]=op_prefix;
+
+	//オペコード、レジスタ
+	OpBuffer[obp++]=(char)(opcode|REGISTER_OPERAND(reg));
+}
+void __op_format(char op_prefix,char opcode1,char opcode2,int reg,int base_reg,int offset,char mod){
+	//命令プリフィックス
+	if(op_prefix) OpBuffer[obp++]=op_prefix;
+
+	//オペコード
+	OpBuffer[obp++]=opcode1;
+	if(opcode2) OpBuffer[obp++]=opcode2;
+
+	//ModR/M, SIB, disp
+	set_mod_rm_sib_disp(mod,reg,SCALE_NON,INDEX_NON,base_reg,offset);
+}
+
+
+
+///////////////////
+// mov関連
+///////////////////
+
+void op_mov_RV(int reg,int offset){
+	//mov reg,value
+
+	//オペコード、レジスタ
+	OpBuffer[obp++]=(char)(0xB8|REGISTER_OPERAND(reg));
+
+	//DISP32
+	*((long *)(OpBuffer+obp))=offset;
+	obp+=sizeof(long);
+}
+void op_mov_RV(int op_size,int reg,int offset){
+	if(op_size==PTR_SIZE) op_mov_RV(reg,offset);
+	else SetError(300,NULL,cp);
+}
+void op_mov_RR(int reg1,int reg2){
+	//mov reg1,reg2
+
+	if(reg1==reg2) return;
+
+	//1000 1011 11xx xbbb
+	OpBuffer[obp++]=(char)0x8B;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+void op_mov_RM(int op_size,int reg,int base_reg,int offset,char mod){
+	//mov reg32,dword ptr[base_reg+offset]
+	//mov reg16,word ptr[base_reg+offset]
+	//mov reg8,byte ptr[base_reg+offset]
+
+	//16ビット演算の命令プリフィックス
+	char op_prefix=0;
+	if(op_size==sizeof(short)) op_prefix=(char)0x66;
+
+	//オペコード
+	char opcode;
+	if(op_size==sizeof(char)) opcode=(char)0x8A;
+	else opcode=(char)0x8B;
+
+	__op_format(op_prefix,opcode,0,reg,base_reg,offset,mod);
+}
+void op_mov_RM_ex(int op_size,int reg,int base_reg1,int base_reg2,int offset,BOOL bUseOffset){
+	//mov reg32,dword ptr[base_reg1+base_reg2+offset]
+	//mov reg16,word ptr[base_reg1+base_reg2+offset]
+	//mov reg8,byte ptr[base_reg1+base_reg2+offset]
+
+	if(base_reg1==REG_ESP){
+		//SIBバイトのindex部にespは指定できない
+		base_reg1=base_reg2;
+		base_reg2=REG_ESP;
+	}
+
+	//16ビット演算のプリフィックス
+	if(op_size==sizeof(short)) OpBuffer[obp++]=(char)0x66;
+
+	//オペコード
+	if(op_size==sizeof(char)) OpBuffer[obp++]=(char)0x8A;
+	else OpBuffer[obp++]=(char)0x8B;
+
+	if(bUseOffset){
+		///////////////////////////
+		// オフセット値を使う
+		///////////////////////////
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0x84| REGISTER_OPERAND(reg)<<3);
+
+		//ベースレジスタ
+		OpBuffer[obp++]=(char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2));
+
+		//オフセット値
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+	else{
+		///////////////////////////
+		// オフセット値を使わない
+		///////////////////////////
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0x04| REGISTER_OPERAND(reg)<<3);
+
+		//ベースレジスタ
+		OpBuffer[obp++]=(char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2));
+	}
+}
+void op_mov_MR(int op_size,int reg,int base_reg,int offset,char mod){
+	//mov dword ptr[base_reg+offset],reg32
+	//mov word ptr[base_reg+offset],reg16
+	//mov byte ptr[base_reg+offset],reg8
+
+	//16ビット演算の命令プリフィックス
+	char op_prefix=0;
+	if(op_size==sizeof(short)) op_prefix=(char)0x66;
+
+	//オペコード
+	char opcode;
+	if(op_size==sizeof(char)) opcode=(char)0x88;
+	else opcode=(char)0x89;
+
+	__op_format(op_prefix,opcode,0,reg,base_reg,offset,mod);
+}
+void op_mov_MR_ex(int op_size,int reg,int base_reg1,int base_reg2,int offset,BOOL bUseOffset){
+	//mov dword ptr[base_reg1+base_reg2+offset],reg32
+	//mov word ptr[base_reg1+base_reg2+offset],reg16
+	//mov byte ptr[base_reg1+base_reg2+offset],reg8
+
+	if(base_reg1==REG_ESP){
+		//SIBバイトのindex部にrspは指定できない
+		base_reg1=base_reg2;
+		base_reg2=REG_ESP;
+	}
+
+	//16ビット演算のプリフィックス
+	if(op_size==sizeof(short)) OpBuffer[obp++]=(char)0x66;
+
+	//オペコード
+	if(op_size==sizeof(char)) OpBuffer[obp++]=(char)0x88;
+	else OpBuffer[obp++]=(char)0x89;
+
+	if(bUseOffset==USE_OFFSET){
+		//////////////////////////
+		//オフセット値を使う
+		//////////////////////////
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0x84| REGISTER_OPERAND(reg)<<3);
+
+		//ベースレジスタ
+		OpBuffer[obp++]=(char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2));
+
+		//オフセット値
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+	else{
+		//////////////////////////
+		//オフセット値を使わない
+		//////////////////////////
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0x04| REGISTER_OPERAND(reg)<<3);
+
+		//ベースレジスタ
+		OpBuffer[obp++]=(char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2));
+	}
+}
+
+
+
+
+////////////////////////////////
+// movsx関連
+////////////////////////////////
+
+void op_movsx_R32R16(int reg32,int reg16){
+	//movsx reg32,reg16
+
+	//16ビット演算の命令プリフィックス
+	char op_prefix=0;
+
+	//オペコード
+	char opcode=(char)0x0F;
+	char opcode2=(char)0xBF;
+
+	__op_format(op_prefix,opcode,opcode2,reg32,reg16,0,MOD_REG);
+}
+void op_movsx_R32R8(int reg32,int reg8){
+	//movsx reg32,reg8
+
+	//16ビット演算の命令プリフィックス
+	char op_prefix=0;
+
+	//オペコード
+	char opcode=(char)0x0F;
+	char opcode2=(char)0xBE;
+
+	__op_format(op_prefix,opcode,opcode2,reg32,reg8,0,MOD_REG);
+}
+void op_movsx_R16R8(int reg16,int reg8){
+	//movsx reg16,reg8
+
+	//16ビット演算の命令プリフィックス
+	char op_prefix=(char)0x66;
+
+	//オペコード
+	char opcode=(char)0x0F;
+	char opcode2=(char)0xBE;
+
+	__op_format(op_prefix,opcode,opcode2,reg16,reg8,0,MOD_REG);
+}
+
+
+
+//////////////////////////////////
+// インクリメント・デクリメント
+//////////////////////////////////
+
+void op_inc(int reg){
+	//inc reg
+
+	//16ビット演算の命令プリフィックス
+	char op_prefix=0;
+
+	//オペコード
+	char opcode=(char)0xFF;
+
+	__op_format(op_prefix,opcode,0,0,reg,0,MOD_REG);
+}
+void op_dec(int reg){
+	op_inc(reg);
+	OpBuffer[obp-1]=OpBuffer[obp-1]|0x08;
+}
+
+
+
+/////////////////////
+// add関連
+/////////////////////
+
+void op_add_RV8(int reg,char cValue){
+	//add reg,value8
+
+	OpBuffer[obp++]=(char)0x83;
+	OpBuffer[obp++]=(char)(0xC0|REGISTER_OPERAND(reg));
+	OpBuffer[obp++]=cValue;
+}
+void op_add_RM(int op_size,int reg,int base_reg,int offset,char mod){
+	//add reg32,dword ptr[base_reg+offset]
+	//add reg16,word ptr[base_reg+offset]
+	//add reg8,byte ptr[base_reg+offset]
+
+	//16ビット演算の命令プリフィックス
+	char op_prefix=0;
+	if(op_size==sizeof(short)) op_prefix=(char)0x66;
+
+	//オペコード
+	char opcode;
+	if(op_size==sizeof(char)) opcode=(char)0x02;
+	else opcode=(char)0x03;
+
+	__op_format(op_prefix,opcode,0,reg,base_reg,offset,mod);
+}
+void op_adc_RV8(int reg,char cValue){
+	//adc reg,value8
+
+	OpBuffer[obp++]=(char)0x83;
+	OpBuffer[obp++]=(char)(0xD0|REGISTER_OPERAND(reg));
+	OpBuffer[obp++]=cValue;
+}
+
+
+/////////////////////
+// sub関連
+/////////////////////
+
+void op_sub_RV8(int reg,char cValue){
+	//sub reg,value8
+
+	OpBuffer[obp++]=(char)0x83;
+	OpBuffer[obp++]=(char)(0xE8|REGISTER_OPERAND(reg));
+	OpBuffer[obp++]=cValue;
+}
+void op_sbb_RV8(int reg,char cValue){
+	//sbb reg,value8
+
+	OpBuffer[obp++]=(char)0x83;
+	OpBuffer[obp++]=(char)(0xD8|REGISTER_OPERAND(reg));
+	OpBuffer[obp++]=cValue;
+}
+void op_sbb_RR( int reg1, int reg2 ){
+	//sbb reg1,reg2
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x1B;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+
+
+
+////////////////////////
+// imul関連
+////////////////////////
+
+void op_imul_RR(int reg1,int reg2){
+	//imul reg1,reg2
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0xAF;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+
+void op_imul_RV(int reg,int i32data){
+	//imul reg,i32data
+
+	if(-128<=i32data&&i32data<=127){
+		//オペコード
+		OpBuffer[obp++]=(char)0x6B;
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg)<<3 | REGISTER_OPERAND(reg));
+
+		//値
+		OpBuffer[obp++]=(char)i32data;
+	}
+	else{
+		//オペコード
+		OpBuffer[obp++]=(char)0x69;
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg)<<3 | REGISTER_OPERAND(reg));
+
+		//値
+		*((long *)(OpBuffer+obp))=i32data;
+		obp+=sizeof(long);
+	}
+}
+
+
+
+//////////////////////
+// and関連
+//////////////////////
+
+void op_and_RV(int reg,int value){
+	//and reg,value
+
+	if(reg==REG_RAX){
+		//eaxのみ特殊
+
+		// [8bit rex] 0010 0101 [32bit offset]
+		OpBuffer[obp++]=(char)0x25;
+		*((long *)(OpBuffer+obp))=value;
+		obp+=sizeof(long);
+	}
+	else{
+		//16ビット演算の命令プリフィックス
+		char op_prefix=0;
+
+		//オペコード
+		char opcode=(char)0x81;
+
+		__op_format(op_prefix,opcode,0,0,reg,value,MOD_REG);
+	}
+}
+
+void op_or_RR( int op_size, int reg1, int reg2 ){
+	//16ビット演算のプリフィックス
+	if(op_size==sizeof(short)) OpBuffer[obp++]=(char)0x66;
+
+	//オペコード
+	if(op_size==sizeof(char)) OpBuffer[obp++]=(char)0x0A;
+	else OpBuffer[obp++]=(char)0x0B;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+
+
+
+void op_neg( int reg ){
+	//neg reg
+
+	//オペコード
+	OpBuffer[obp++]=(char)0xF7;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xD8| REGISTER_OPERAND(reg));
+}
+
+
+
+///////////////////////
+// 64ビット関連
+///////////////////////
+
+void op_cdq(){
+	//cdq
+	OpBuffer[obp++]=(char)0x99;
+}
+
+
+
+/////////////////////
+// ストリング関係
+/////////////////////
+
+void op_rep_movs(int op_size){
+	if(op_size==sizeof(BYTE)){
+		//rep movs byte ptr[edi],byte ptr[esi]
+		OpBuffer[obp++]=(char)0xF3;
+		OpBuffer[obp++]=(char)0xA4;
+	}
+	else if(op_size==sizeof(short)){
+		//rep movs word ptr[edi],word ptr[esi]
+		OpBuffer[obp++]=(char)0xF3;
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0xA5;
+	}
+	else if(op_size==sizeof(long)){
+		//rep movs dword ptr[edi],dword ptr[esi]
+		OpBuffer[obp++]=(char)0xF3;
+		OpBuffer[obp++]=(char)0xA5;
+	}
+}
+
+
+
+
+//////////////////////////
+// スタック関連
+//////////////////////////
+
+void op_push(int reg){
+	//push reg
+
+	if( reg == REG_NON ){
+		op_sub_esp( PTR_SIZE );
+		return;
+	}
+
+	//オペコード、レジスタ
+	__op_format(0,(char)0x50,reg);
+}
+void op_push_V(long data){
+	//スタックにリテラル値をプッシュ
+	if(-128<=data&&data<=127){
+		//push 8ビット値
+		OpBuffer[obp++]=(char)0x6A;
+		OpBuffer[obp++]=(char)data;
+	}
+	else{
+		//push 32ビット値
+		OpBuffer[obp++]=(char)0x68;
+		*((long *)(OpBuffer+obp))=data;
+		obp+=sizeof(long);
+	}
+}
+void op_pop(int reg){
+	//pop reg
+
+	if( reg == REG_NON ){
+		op_add_esp( PTR_SIZE );
+		return;
+	}
+
+	//オペコード、レジスタ
+	__op_format(0,(char)0x58,reg);
+}
+void op_add_esp(int num){
+	//スタックポインタの加算（pop方向）
+
+	//add esp,num
+	if(0xFFFFFF80&num){
+		OpBuffer[obp++]=(char)0x81;
+		OpBuffer[obp++]=(char)0xC4;
+		*((long *)(OpBuffer+obp))=num;
+		obp+=sizeof(long);
+	}
+	else{
+		//「128 > num > -127」の場合
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)num;
+	}
+}
+void op_sub_esp(int num){
+	//スタックポインタの減算（push方向）
+
+	//sub esp,num
+	if(0xFFFFFF80&num){
+		OpBuffer[obp++]=(char)0x81;
+		OpBuffer[obp++]=(char)0xEC;
+		*((long *)(OpBuffer+obp))=num;
+		obp+=sizeof(long);
+	}
+	else{
+		//「128 > num > -127」の場合
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xEC;
+		OpBuffer[obp++]=(char)num;
+	}
+}
+
+
+
+/////////////////////
+// cmp関連
+/////////////////////
+void op_cmp_RR( int reg1, int reg2 ){
+	//オペコード
+	OpBuffer[obp++]=(char)0x3B;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+void op_cmp_value(int op_size,int reg,char byte_data){
+	//cmp reg,byte_data
+
+	if(op_size==sizeof(char)&&reg==REG_EAX){
+		//alレジスタの場合は特殊
+		OpBuffer[obp++]=(char)0x3C;
+
+		//8ビット値
+		OpBuffer[obp++]=byte_data;
+
+		return;
+	}
+
+	//16ビット演算のプリフィックス
+	if(op_size==sizeof(short)) OpBuffer[obp++]=(char)0x66;
+
+	//オペコード
+	if(op_size==sizeof(char)) OpBuffer[obp++]=(char)0x80;
+	else OpBuffer[obp++]=(char)0x83;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xF8| REGISTER_OPERAND(reg));
+
+	//8ビット値
+	OpBuffer[obp++]=byte_data;
+}
+void op_setne( int reg ){
+	//オペコード
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x95;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)( 0xC0 | REGISTER_OPERAND(reg) );
+}
+
+
+
+////////////////////
+// test関連
+////////////////////
+
+void op_test(int reg1,int reg2){
+	//test reg1,reg2
+
+	//1000 0101 11rr rbbb
+	OpBuffer[obp++]=(char)0x85;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+
+
+
+//////////////////////////////
+// 浮動小数点関連
+//////////////////////////////
+
+void op_fld_ptr_esp(int type){
+	//スタックポインタが示すバッファのデータを浮動小数点レジスタへロード
+
+	if(type==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDD;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(type==DEF_SINGLE){
+		//fld dword ptr[esp]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(type==DEF_INT64){
+		//fild qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0x2C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(type==DEF_LONG){
+		//fild dword ptr[esp]
+		OpBuffer[obp++]=(char)0xDB;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+	}
+}
+void op_fld_basereg(int type,int base_reg){
+	//fld ptr[reg]
+
+	//オペコード
+	if(type==DEF_DOUBLE)		OpBuffer[obp++]=(char)0xDD;
+	else if(type==DEF_SINGLE)	OpBuffer[obp++]=(char)0xD9;
+	else SetError(300,NULL,cp);
+
+	if(base_reg==REG_ESP){
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(base_reg==REG_EBP){
+		OpBuffer[obp++]=(char)0x45;
+		OpBuffer[obp++]=(char)0x00;
+	}
+	else{
+		OpBuffer[obp++]=(char)REGISTER_OPERAND(base_reg);
+	}
+}
+void op_fld_base_offset(int type,int base_reg,int offset){
+	//fld ptr[reg+offset]
+
+	//オペコード
+	if(type==DEF_DOUBLE)		OpBuffer[obp++]=(char)0xDD;
+	else if(type==DEF_SINGLE)	OpBuffer[obp++]=(char)0xD9;
+	else SetError(300,NULL,cp);
+
+	//オペコード、レジスタ
+	if(base_reg==REG_ESP){
+		OpBuffer[obp++]=(char)0x84;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else{
+		OpBuffer[obp++]=(char)(0x80|REGISTER_OPERAND(base_reg));
+	}
+
+	//オフセット値
+	*((long *)(OpBuffer+obp))=offset;
+	obp+=sizeof(long);
+}
+void op_fld_base_offset_ex(int type,int base_reg1,int base_reg2,int offset,BOOL bUseOffset){
+	//fld ptr[base_reg1+base_reg2+offset]
+
+	if(base_reg1==REG_ESP){
+		//SIBバイトのindex部にespは指定できない
+		base_reg1=base_reg2;
+		base_reg2=REG_ESP;
+	}
+
+	//オペコード
+	if(type==DEF_DOUBLE)		OpBuffer[obp++]=(char)0xDD;
+	else if(type==DEF_SINGLE)	OpBuffer[obp++]=(char)0xD9;
+	else SetError(300,NULL,cp);
+
+	int reg=0;
+	if(bUseOffset){
+		///////////////////////////
+		// オフセット値を使う
+		///////////////////////////
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0x84| REGISTER_OPERAND(reg)<<3);
+
+		//ベースレジスタ
+		OpBuffer[obp++]=(char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2));
+
+		//オフセット値
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+	else{
+		///////////////////////////
+		// オフセット値を使わない
+		///////////////////////////
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0x04| REGISTER_OPERAND(reg)<<3);
+
+		//ベースレジスタ
+		OpBuffer[obp++]=(char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2));
+	}
+}
+void op_fstp_basereg(int type,int base_reg){
+	//fstp ptr[reg]
+
+	//オペコード
+	if(type==DEF_DOUBLE)		OpBuffer[obp++]=(char)0xDD;
+	else if(type==DEF_SINGLE)	OpBuffer[obp++]=(char)0xD9;
+	else SetError(300,NULL,cp);
+
+	if(base_reg==REG_ESP){
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(base_reg==REG_EBP){
+		OpBuffer[obp++]=(char)0x5D;
+		OpBuffer[obp++]=(char)0x00;
+	}
+	else{
+		OpBuffer[obp++]=(char)(0x18|REGISTER_OPERAND(base_reg));
+	}
+}
+void op_fstp_base_offset(int type,int base_reg,int offset){
+	//fstp ptr[reg+offset]
+
+	//オペコード
+	if(type==DEF_DOUBLE)		OpBuffer[obp++]=(char)0xDD;
+	else if(type==DEF_SINGLE)	OpBuffer[obp++]=(char)0xD9;
+	else SetError(300,NULL,cp);
+
+	//オペコード、レジスタ
+	if(base_reg==REG_ESP){
+		OpBuffer[obp++]=(char)0x9C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else{
+		OpBuffer[obp++]=(char)(0x98|REGISTER_OPERAND(base_reg));
+	}
+
+	//オフセット値
+	*((long *)(OpBuffer+obp))=offset;
+	obp+=sizeof(long);
+}
+void op_fstp_base_offset_ex(int type,int base_reg1,int base_reg2,int offset,BOOL bUseOffset){
+	//fstp ptr[base_reg1+base_reg2+offset]
+
+	if(base_reg1==REG_ESP){
+		//SIBバイトのindex部にespは指定できない
+		base_reg1=base_reg2;
+		base_reg2=REG_ESP;
+	}
+
+	//オペコード
+	if(type==DEF_DOUBLE)		OpBuffer[obp++]=(char)0xDD;
+	else if(type==DEF_SINGLE)	OpBuffer[obp++]=(char)0xD9;
+	else SetError(300,NULL,cp);
+
+	int reg=0;
+	if(bUseOffset){
+		///////////////////////////
+		// オフセット値を使う
+		///////////////////////////
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0x9C| REGISTER_OPERAND(reg)<<3);
+
+		//ベースレジスタ
+		OpBuffer[obp++]=(char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2));
+
+		//オフセット値
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+	else{
+		///////////////////////////
+		// オフセット値を使わない
+		///////////////////////////
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0x1C| REGISTER_OPERAND(reg)<<3);
+
+		//ベースレジスタ
+		OpBuffer[obp++]=(char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2));
+	}
+}
+void op_fistp_ptr_esp( int typeSize ){
+	if( typeSize == sizeof(_int64) ){
+		//64bit
+
+		//fistp qword ptr[esp]
+		fpu_cast();
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0x3C;
+		OpBuffer[obp++]=(char)0x24;
+		fpu_cast_end();
+	}
+	else if( typeSize == sizeof(long) ){
+		//32bit
+
+		//fistp dword ptr[esp]
+		fpu_cast();
+		OpBuffer[obp++]=(char)0xDB;
+		OpBuffer[obp++]=(char)0x1C;
+		OpBuffer[obp++]=(char)0x24;
+		fpu_cast_end();
+	}
+	else{
+		SetError();
+	}
+}
+void op_fstp_push( Type &type ){
+	//sub esp,size
+	op_sub_esp( type.GetBasicSize() );
+
+	op_fstp_basereg( type.GetBasicType(), REG_ESP );
+}
+
+
+
+//////////////////////////////
+// レジスタ関連
+//////////////////////////////
+
+void op_zero_reg(int reg){
+	//レジスタに0をセット
+
+	switch(reg){
+		case REG_EAX:
+			//xor eax,eax
+			OpBuffer[obp++]=(char)0x33;
+			OpBuffer[obp++]=(char)0xC0;
+			break;
+		case REG_EBX:
+			//xor ebx,ebx
+			OpBuffer[obp++]=(char)0x33;
+			OpBuffer[obp++]=(char)0xDB;
+			break;
+		case REG_ECX:
+			//xor ecx,ecx
+			OpBuffer[obp++]=(char)0x33;
+			OpBuffer[obp++]=(char)0xC9;
+			break;
+		case REG_EDX:
+			//xor edx,edx
+			OpBuffer[obp++]=(char)0x33;
+			OpBuffer[obp++]=(char)0xD2;
+			break;
+		case REG_EBP:
+			//xor ebp,ebp
+			OpBuffer[obp++]=(char)0x33;
+			OpBuffer[obp++]=(char)0xED;
+			break;
+	}
+}
+
+void fpu_cast(){
+	///////////////////////
+	// FPUの切り捨て設定
+	///////////////////////
+
+	//sub esp,16
+	op_sub_esp(16);
+
+	//mov dword ptr[esp+4],eax
+	OpBuffer[obp++]=(char)0x89;
+	OpBuffer[obp++]=(char)0x44;
+	OpBuffer[obp++]=(char)0x24;
+	OpBuffer[obp++]=(char)0x04;
+
+	//fnstcw word ptr[esp]
+	OpBuffer[obp++]=(char)0xD9;
+	OpBuffer[obp++]=(char)0x3C;
+	OpBuffer[obp++]=(char)0x24;
+
+	//mov ax,word ptr[esp]
+	OpBuffer[obp++]=(char)0x66;
+	OpBuffer[obp++]=(char)0x8B;
+	OpBuffer[obp++]=(char)0x04;
+	OpBuffer[obp++]=(char)0x24;
+
+	//or ah,0Ch
+	OpBuffer[obp++]=(char)0x80;
+	OpBuffer[obp++]=(char)0xCC;
+	OpBuffer[obp++]=(char)0x0C;
+
+	//mov word ptr[esp+2],ax
+	OpBuffer[obp++]=(char)0x66;
+	OpBuffer[obp++]=(char)0x89;
+	OpBuffer[obp++]=(char)0x44;
+	OpBuffer[obp++]=(char)0x24;
+	OpBuffer[obp++]=(char)0x02;
+
+	//fldcw word ptr[esp+2]
+	OpBuffer[obp++]=(char)0xD9;
+	OpBuffer[obp++]=(char)0x6C;
+	OpBuffer[obp++]=(char)0x24;
+	OpBuffer[obp++]=(char)0x02;
+
+	//mov eax,dword ptr[esp+4]
+	OpBuffer[obp++]=(char)0x8B;
+	OpBuffer[obp++]=(char)0x44;
+	OpBuffer[obp++]=(char)0x24;
+	OpBuffer[obp++]=(char)0x04;
+
+	//add esp,16
+	op_add_esp(16);
+}
+void fpu_cast_end(){
+	//sub esp,16
+	op_sub_esp(16);
+
+	//fldcw word ptr[esp]
+	OpBuffer[obp++]=(char)0xD9;
+	OpBuffer[obp++]=(char)0x2C;
+	OpBuffer[obp++]=(char)0x24;
+
+	//add esp,16
+	op_add_esp(16);
+}
+
+
+/////////////////////////////
+// 関数呼び出し
+/////////////////////////////
+
+void op_call(UserProc *pUserProc){
+	OpBuffer[obp++]=(char)0xE8;
+	pobj_SubAddrSchedule->add(pUserProc,1);
+	pUserProc->Using();
+	obp+=sizeof(long);
+}
+void op_ret(){
+	OpBuffer[obp++]=(char)0xC3;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler32/resource.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler32/resource.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler32/resource.h	(revision 178)
@@ -0,0 +1,56 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by BasicCompiler.rc
+//
+#define IDD_MAIN                        101
+#define IDD_VARLIST                     103
+#define IDI_MAIN                        108
+#define IDI_VARSTRUCT                   109
+#define IDI_VARDATA                     110
+#define IDI_VARSTR                      111
+#define IDI_VARARRAY                    112
+#define IDI_VARPTRSTRUCT                113
+#define IDD_CLIPMAIN                    114
+#define IDD_DEBUGGER                    115
+#define IDR_DEBUGGERTOOLBAR             117
+#define IDD_DEBUGGER_TOOLBARBASE        120
+#define IDR_DEBUGGER_VARLIST_MENU       122
+#define IDR_DEBUGGERTOOLBAR_DISABLED    125
+#define IDC_EXEPATH                     1000
+#define IDC_PROGRESS                    1001
+#define IDC_ERRORLIST                   1002
+#define IDC_MESSAGE                     1003
+#define IDC_DEBUGLIST                   1005
+#define IDC_SHOWERROR                   1006
+#define IDC_SHOWDEBUG                   1007
+#define IDC_THREADCOMBO                 1014
+#define IDC_VARTREE                     1015
+#define IDC_GLOBAL                      1016
+#define IDC_LOCAL                       1017
+#define IDC_PROCCOMBO                   1018
+#define IDC_HIDESYSVAR                  1019
+#define IDC_STEPIN                      1021
+#define IDC_STEPOVER                    1022
+#define IDC_ESP                         1023
+#define IDC_DUMMYCANCEL                 1024
+#define IDC_TAB1                        1025
+#define IDC_VARPOS                      1029
+#define IDC_WATCHLIST                   1033
+#define IDC_STATIC_VERSION              1034
+#define IDC_DEBUG_START                 40003
+#define IDC_DEBUG_STEPOVER              40004
+#define IDC_DEBUG_STEPIN                40005
+#define IDM_SHOW_DEFAULTSYSTEM_VAR      40007
+#define IDM_SHOW_RAD_VAR                40008
+#define IDM_SHOW_GUID_VAR               40009
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        126
+#define _APS_NEXT_COMMAND_VALUE         40010
+#define _APS_NEXT_CONTROL_VALUE         1035
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
Index: tag/abdev(2007.06.20)/BasicCompiler64/BasicCompiler.rc
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/BasicCompiler.rc	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/BasicCompiler.rc	(revision 178)
@@ -0,0 +1,412 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// 日本語 resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
+#ifdef _WIN32
+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
+#pragma code_page(932)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+#if defined(APSTUDIO_INVOKED) || defined(JPN)
+#if defined(APSTUDIO_INVOKED)
+IDD_MAIN$(JPN) DIALOG DISCARDABLE  0, 0, 205, 229
+#else
+IDD_MAIN DIALOG DISCARDABLE  0, 0, 205, 229
+#endif
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "ActiveBasic Compiler&Debugger"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "コンパイル",IDOK,148,208,50,14
+    LTEXT           "出力先:",IDC_STATIC,7,10,23,8
+    EDITTEXT        IDC_EXEPATH,34,7,164,14,ES_AUTOHSCROLL
+    CONTROL         "Progress1",IDC_PROGRESS,"msctls_progress32",0x0,13,56,
+                    179,14
+    GROUPBOX        "進行状況",IDC_STATIC,7,31,191,45
+    LTEXT           "準備中...",IDC_MESSAGE,13,44,161,8
+    GROUPBOX        "メッセージ リスト",IDC_STATIC,7,83,191,117
+    EDITTEXT        IDC_ERRORLIST,13,113,179,80,ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_AUTOHSCROLL | WS_DISABLED | 
+                    WS_VSCROLL | WS_HSCROLL
+    CONTROL         "エラー",IDC_SHOWERROR,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,13,97,35,10
+    CONTROL         "デバッグ",IDC_SHOWDEBUG,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,50,97,35,10
+    EDITTEXT        IDC_DEBUGLIST,13,113,179,80,ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_AUTOHSCROLL | NOT WS_VISIBLE | 
+                    WS_DISABLED | WS_VSCROLL | WS_HSCROLL
+    LTEXT           "Version",IDC_STATIC_VERSION,7,214,140,8
+END
+#endif
+
+#if defined(APSTUDIO_INVOKED) || defined(JPN)
+#if defined(APSTUDIO_INVOKED)
+IDD_VARLIST$(JPN) DIALOG DISCARDABLE  0, 0, 215, 199
+#else
+IDD_VARLIST DIALOG DISCARDABLE  0, 0, 215, 199
+#endif
+STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
+CAPTION "ブレーク ポイント"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    PUSHBUTTON      "閉じる",IDCANCEL,165,6,50,14
+    LTEXT           "対象領域:",IDC_STATIC,2,9,30,8
+    LTEXT           "対象スレッド:",IDC_STATIC,2,26,38,8
+    COMBOBOX        IDC_THREADCOMBO,43,24,69,100,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "Tree1",IDC_VARTREE,"SysTreeView32",TVS_HASBUTTONS | 
+                    TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP,
+                    0,88,215,111
+    CONTROL         "グローバル",IDC_GLOBAL,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,43,6,47,14
+    CONTROL         "ローカル",IDC_LOCAL,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,92,6,47,14
+    LTEXT           "プロシージャ:",IDC_STATIC,2,43,39,8
+    COMBOBOX        IDC_PROCCOMBO,43,40,69,116,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    CONTROL         "システム変数を表示しない",IDC_HIDESYSVAR,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,117,44,93,10
+    PUSHBUTTON      "ステップ(IN)",IDC_STEPIN,4,64,50,14
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,59,215,1
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,81,215,1
+    PUSHBUTTON      "ステップ(OVER)",IDC_STEPOVER,57,64,50,14
+END
+#endif
+
+#if defined(APSTUDIO_INVOKED) || defined(JPN)
+#if defined(APSTUDIO_INVOKED)
+IDD_CLIPMAIN$(JPN) DIALOGEX 0, 0, 332, 88
+#else
+IDD_CLIPMAIN DIALOGEX 0, 0, 332, 88
+#endif
+STYLE WS_CHILD
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    PUSHBUTTON      "コンパイル",IDOK,0,0,37,13
+    EDITTEXT        IDC_EXEPATH,285,57,24,12,ES_AUTOHSCROLL | ES_READONLY | 
+                    NOT WS_VISIBLE
+    EDITTEXT        IDC_ERRORLIST,38,14,129,74,ES_MULTILINE | ES_AUTOVSCROLL | 
+                    ES_AUTOHSCROLL | WS_DISABLED | WS_VSCROLL | WS_HSCROLL
+    CONTROL         "ビルド",IDC_SHOWERROR,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,0,20,37,12
+    CONTROL         "デバッグ",IDC_SHOWDEBUG,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,0,34,37,12
+    EDITTEXT        IDC_DEBUGLIST,38,15,179,73,ES_MULTILINE | ES_AUTOVSCROLL | 
+                    ES_AUTOHSCROLL | NOT WS_VISIBLE | WS_DISABLED | 
+                    WS_VSCROLL | WS_HSCROLL
+    CONTROL         "Progress1",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH,
+                    38,1,293,12
+    LTEXT           "準備中...",IDC_MESSAGE,286,47,24,8,NOT WS_VISIBLE,
+                    WS_EX_TRANSPARENT
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,16,39,1
+END
+#endif
+
+#if defined(APSTUDIO_INVOKED) || defined(ENG)
+#if defined(APSTUDIO_INVOKED)
+IDD_CLIPMAIN$(ENG) DIALOGEX 0, 0, 332, 88
+#else
+IDD_CLIPMAIN DIALOGEX 0, 0, 332, 88
+#endif
+STYLE WS_CHILD
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    PUSHBUTTON      "Compile",IDOK,0,0,37,11
+    EDITTEXT        IDC_EXEPATH,285,57,24,12,ES_AUTOHSCROLL | ES_READONLY | 
+                    NOT WS_VISIBLE
+    EDITTEXT        IDC_ERRORLIST,38,13,129,75,ES_MULTILINE | ES_AUTOVSCROLL | 
+                    ES_AUTOHSCROLL | WS_DISABLED | WS_VSCROLL | WS_HSCROLL
+    CONTROL         "Error",IDC_SHOWERROR,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,0,17,37,10
+    CONTROL         "Debug",IDC_SHOWDEBUG,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,0,28,37,10
+    EDITTEXT        IDC_DEBUGLIST,38,14,179,74,ES_MULTILINE | ES_AUTOVSCROLL | 
+                    ES_AUTOHSCROLL | NOT WS_VISIBLE | WS_DISABLED | 
+                    WS_VSCROLL | WS_HSCROLL
+    CONTROL         "Progress1",IDC_PROGRESS,"msctls_progress32",PBS_SMOOTH,
+                    38,0,293,12
+    LTEXT           "Waiting...",IDC_MESSAGE,286,47,24,8,NOT WS_VISIBLE,
+                    WS_EX_TRANSPARENT
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,13,39,1
+END
+#endif
+
+#if defined(APSTUDIO_INVOKED) || defined(ENG)
+#if defined(APSTUDIO_INVOKED)
+IDD_MAIN$(ENG) DIALOG DISCARDABLE  0, 0, 205, 229
+#else
+IDD_MAIN DIALOG DISCARDABLE  0, 0, 205, 229
+#endif
+STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
+CAPTION "ActiveBasic Compiler&Debugger"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "Compile",IDOK,148,208,50,14
+    LTEXT           "Output:",IDC_STATIC,7,10,22,8
+    EDITTEXT        IDC_EXEPATH,34,7,164,14,ES_AUTOHSCROLL
+    CONTROL         "Progress1",IDC_PROGRESS,"msctls_progress32",0x0,13,56,
+                    179,14
+    GROUPBOX        "Advance situation",IDC_STATIC,7,31,191,45
+    LTEXT           "ready...",IDC_MESSAGE,13,44,161,8
+    GROUPBOX        "Message list",IDC_STATIC,7,83,191,117
+    EDITTEXT        IDC_ERRORLIST,13,113,179,80,ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_AUTOHSCROLL | WS_DISABLED | 
+                    WS_VSCROLL | WS_HSCROLL
+    CONTROL         "Error",IDC_SHOWERROR,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,13,97,30,10
+    CONTROL         "Debug",IDC_SHOWDEBUG,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,50,97,35,10
+    EDITTEXT        IDC_DEBUGLIST,13,113,179,80,ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_AUTOHSCROLL | NOT WS_VISIBLE | 
+                    WS_DISABLED | WS_VSCROLL | WS_HSCROLL
+    LTEXT           "Version 4.00 Global Edition beta1",IDC_STATIC,7,214,98,
+                    8
+END
+#endif
+
+#if defined(APSTUDIO_INVOKED) || defined(ENG)
+#if defined(APSTUDIO_INVOKED)
+IDD_VARLIST$(ENG) DIALOG DISCARDABLE  0, 0, 215, 199
+#else
+IDD_VARLIST DIALOG DISCARDABLE  0, 0, 215, 199
+#endif
+STYLE WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
+CAPTION "Breakpoint"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    PUSHBUTTON      "Close",IDCANCEL,165,6,50,14
+    LTEXT           "Level:",IDC_STATIC,2,9,18,8
+    LTEXT           "Thread:",IDC_STATIC,2,26,22,8
+    COMBOBOX        IDC_THREADCOMBO,43,24,69,100,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "Tree1",IDC_VARTREE,"SysTreeView32",TVS_HASBUTTONS | 
+                    TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP,
+                    0,88,215,111
+    CONTROL         "Global",IDC_GLOBAL,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,43,6,47,14
+    CONTROL         "Local",IDC_LOCAL,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,92,6,47,14
+    LTEXT           "Procedure:",IDC_STATIC,2,43,31,8
+    COMBOBOX        IDC_PROCCOMBO,43,40,69,116,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    CONTROL         "Hide system variables",IDC_HIDESYSVAR,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,117,44,81,10
+    PUSHBUTTON      "Step In",IDC_STEPIN,4,64,50,14
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,59,215,1
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,81,215,1
+    PUSHBUTTON      "Step Over",IDC_STEPOVER,57,64,50,14
+END
+#endif
+
+#if defined(APSTUDIO_INVOKED) || defined(JPN)
+#if defined(APSTUDIO_INVOKED)
+IDD_DEBUGGER$(JPN) DIALOGEX 0, 0, 291, 148
+#else
+IDD_DEBUGGER DIALOGEX 0, 0, 291, 148
+#endif
+STYLE WS_CHILD
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    LTEXT           "対象スレッド:",IDC_STATIC,5,21,38,8
+    COMBOBOX        IDC_THREADCOMBO,5,30,69,100,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "プロシージャ:",IDC_STATIC,5,49,39,8
+    COMBOBOX        IDC_PROCCOMBO,5,58,69,116,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,15,99,1
+    LTEXT           "dummy",IDC_VARPOS,98,0,35,41,NOT WS_VISIBLE,
+                    WS_EX_STATICEDGE
+    CONTROL         "List2",IDC_WATCHLIST,"SysListView32",LVS_REPORT | 
+                    LVS_EDITLABELS | WS_BORDER | WS_TABSTOP,171,9,60,50,
+                    WS_EX_ACCEPTFILES
+    LTEXT           "コマンド",IDC_STATIC,3,3,23,8
+END
+#endif
+
+IDD_DEBUGGER_TOOLBARBASE DIALOG DISCARDABLE  0, 0, 62, 15
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+END
+
+#if defined(APSTUDIO_INVOKED) || defined(ENG)
+#if defined(APSTUDIO_INVOKED)
+IDD_DEBUGGER$(ENG) DIALOGEX 0, 0, 291, 148
+#else
+IDD_DEBUGGER DIALOGEX 0, 0, 291, 148
+#endif
+STYLE WS_CHILD
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    LTEXT           "Thread:",IDC_STATIC,5,21,22,8
+    COMBOBOX        IDC_THREADCOMBO,5,30,69,100,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    LTEXT           "Procedure:",IDC_STATIC,5,49,31,8
+    COMBOBOX        IDC_PROCCOMBO,5,58,69,116,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,0,15,99,1
+    LTEXT           "dummy",IDC_VARPOS,98,0,35,41,NOT WS_VISIBLE,
+                    WS_EX_STATICEDGE
+    CONTROL         "List2",IDC_WATCHLIST,"SysListView32",LVS_REPORT | 
+                    LVS_EDITLABELS | WS_BORDER | WS_TABSTOP,171,9,60,50,
+                    WS_EX_ACCEPTFILES
+    LTEXT           "コマンド",IDC_STATIC,3,3,23,8
+END
+#endif
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    "IDD_MAIN$(JPN)", DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 198
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 222
+    END
+
+    "IDD_VARLIST$(JPN)", DIALOG
+    BEGIN
+        BOTTOMMARGIN, 161
+    END
+
+    "IDD_MAIN$(ENG)", DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 198
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 222
+    END
+
+    "IDD_VARLIST$(ENG)", DIALOG
+    BEGIN
+        BOTTOMMARGIN, 161
+    END
+
+    IDD_DEBUGGER_TOOLBARBASE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 55
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 8
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_MAIN                ICON    DISCARDABLE     "icon1.ico"
+IDI_VARSTRUCT           ICON    DISCARDABLE     "VarStruct.ico"
+IDI_VARDATA             ICON    DISCARDABLE     "VarData.ico"
+IDI_VARSTR              ICON    DISCARDABLE     "VarStr.ico"
+IDI_VARARRAY            ICON    DISCARDABLE     "VarArray.ico"
+IDI_VARPTRSTRUCT        ICON    DISCARDABLE     "VarPtrStruct.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Toolbar
+//
+
+IDR_DEBUGGERTOOLBAR TOOLBAR DISCARDABLE  16, 15
+BEGIN
+    BUTTON      IDC_DEBUG_START
+    BUTTON      IDC_DEBUG_STEPOVER
+    BUTTON      IDC_DEBUG_STEPIN
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDR_DEBUGGERTOOLBAR     BITMAP  DISCARDABLE     "toolbar_debugger.bmp"
+IDR_DEBUGGERTOOLBAR_DISABLED BITMAP  DISCARDABLE     "toolbar_debugger_disable.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_DEBUGGER_VARLIST_MENU MENU DISCARDABLE 
+BEGIN
+    POPUP "dummy"
+    BEGIN
+        MENUITEM "一般システム変数を表示する",  IDM_SHOW_DEFAULTSYSTEM_VAR
+        MENUITEM "RADシステム変数を表示する",   IDM_SHOW_RAD_VAR
+        MENUITEM "GUID変数を表示する",          IDM_SHOW_GUID_VAR
+    END
+END
+
+#endif    // 日本語 resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
Index: tag/abdev(2007.06.20)/BasicCompiler64/BasicCompiler.vcproj
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/BasicCompiler.vcproj	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/BasicCompiler.vcproj	(revision 178)
@@ -0,0 +1,1148 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="BasicCompiler"
+	ProjectGUID="{864B921B-423B-4F9E-9E6B-31B15968EDF9}"
+	RootNamespace="BasicCompiler"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="Debug"
+			IntermediateDirectory="Debug"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/BasicCompiler.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="..\..\;..\..\cpplibs\boost;..\BasicCompiler_Common\include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;JPN;_AMD64_;_WIN64"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Debug/BasicCompiler.pch"
+				AssemblerListingLocation=".\Debug/"
+				ObjectFile=".\Debug/"
+				ProgramDataBaseFileName=".\Debug/"
+				BrowseInformation="0"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="3"
+				CallingConvention="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG,JPN"
+				Culture="1041"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:AMD64"
+				AdditionalDependencies="comctl32.lib psapi.lib bufferoverflowu.lib commond.lib"
+				OutputFile="../ActiveBasic/BasicCompiler64.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="..\..\jenga\lib\amd64"
+				IgnoreDefaultLibraryNames=""
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\Debug/BasicCompiler64.pdb"
+				SubSystem="2"
+				TargetMachine="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				AdditionalManifestFiles="$(ProjectDir)\manifest.xml"
+				EmbedManifest="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile="$(OutDir)/$(ProjectName).bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\Debug/BasicCompiler.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="2"
+				FavorSizeOrSpeed="1"
+				AdditionalIncludeDirectories="..\..\;..\..\cpplibs\boost;..\BasicCompiler_Common\include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;_AMD64_;_WIN64"
+				MinimalRebuild="false"
+				ExceptionHandling="1"
+				BasicRuntimeChecks="0"
+				RuntimeLibrary="0"
+				RuntimeTypeInfo="true"
+				UsePrecompiledHeader="0"
+				PrecompiledHeaderFile=".\Release/BasicCompiler.pch"
+				AssemblerListingLocation=".\Release/"
+				ObjectFile=".\Release/"
+				ProgramDataBaseFileName=".\Release/"
+				BrowseInformation="0"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				Detect64BitPortabilityProblems="true"
+				DebugInformationFormat="0"
+				CallingConvention="0"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="_DEBUG,JPN"
+				Culture="1041"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions="/MACHINE:AMD64"
+				AdditionalDependencies="comctl32.lib psapi.lib bufferoverflowu.lib common.lib"
+				OutputFile="../ActiveBasic/BasicCompiler64.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				AdditionalLibraryDirectories="..\..\jenga\lib\amd64"
+				IgnoreDefaultLibraryNames="libcpmtd.lib"
+				GenerateDebugInformation="false"
+				ProgramDatabaseFile=".\Release/BasicCompiler64.pdb"
+				SubSystem="2"
+				TargetMachine="0"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				AdditionalManifestFiles="$(ProjectDir)\manifest.xml"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile="$(OutDir)/$(ProjectName).bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="..\BasicCompiler_Common\BasicCompiler.h"
+				>
+			</File>
+			<File
+				RelativePath="..\BasicCompiler_Common\BasicFixed.h"
+				>
+			</File>
+			<File
+				RelativePath="CommandValue.h"
+				>
+			</File>
+			<File
+				RelativePath="..\BasicCompiler_Common\common.h"
+				>
+			</File>
+			<File
+				RelativePath="Opcode.h"
+				>
+			</File>
+			<Filter
+				Name="言語対応文字列"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\common_msg_eng.h"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\common_msg_jpn.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="Parts_h"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\NonVolatile.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="Common Classes"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\include\Smoothie.h"
+					>
+				</File>
+				<Filter
+					Name="Meta Parts"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\include\Namespace.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Parameter.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Procedure.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\include\Symbol.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Type.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\TypeDef.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Variable.h"
+						>
+					</File>
+					<Filter
+						Name="Prototype"
+						>
+						<File
+							RelativePath="..\BasicCompiler_Common\include\Class.h"
+							>
+						</File>
+						<File
+							RelativePath="..\BasicCompiler_Common\include\Member.h"
+							>
+						</File>
+						<File
+							RelativePath="..\BasicCompiler_Common\include\Method.h"
+							>
+						</File>
+						<File
+							RelativePath="..\BasicCompiler_Common\include\Prototype.h"
+							>
+						</File>
+					</Filter>
+				</Filter>
+				<Filter
+					Name="Lexical Parts"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\include\Source.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Operation Statements"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\include\Exception.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Module"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\include\ObjectModule.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="Application Classes"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\include\Program.h"
+					>
+				</File>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Resource Files"
+			Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+			>
+			<File
+				RelativePath="icon1.ico"
+				>
+			</File>
+			<File
+				RelativePath="toolbar_debugger.bmp"
+				>
+			</File>
+			<File
+				RelativePath="VarArray.ico"
+				>
+			</File>
+			<File
+				RelativePath="VarData.ico"
+				>
+			</File>
+			<File
+				RelativePath="VarPtrStruct.ico"
+				>
+			</File>
+			<File
+				RelativePath="VarStr.ico"
+				>
+			</File>
+			<File
+				RelativePath="VarStruct.ico"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="BasicCompiler.rc"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions="_DEBUG;JPN;$(NoInherit)"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions="_DEBUG;JPN;$(NoInherit)"
+					/>
+				</FileConfiguration>
+			</File>
+			<Filter
+				Name="Compile"
+				>
+				<File
+					RelativePath="Compile_Statement.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+							UsePrecompiledHeader="0"
+							BrowseInformation="0"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+							UsePrecompiledHeader="0"
+							BrowseInformation="0"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="Compile_Var.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+							UsePrecompiledHeader="0"
+							BrowseInformation="0"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+							UsePrecompiledHeader="0"
+							BrowseInformation="0"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="MakePeHdr.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+							UsePrecompiledHeader="0"
+							BrowseInformation="0"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+							UsePrecompiledHeader="0"
+							BrowseInformation="0"
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="Register.cpp"
+					>
+					<FileConfiguration
+						Name="Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+							UsePrecompiledHeader="0"
+							BrowseInformation="0"
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+							UsePrecompiledHeader="0"
+							BrowseInformation="0"
+						/>
+					</FileConfiguration>
+				</File>
+				<Filter
+					Name="Calculation"
+					>
+					<File
+						RelativePath="Compile_Calc.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="Compile_Calc_PushVar.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="Compile_Set_Var.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath=".\increment.cpp"
+						>
+					</File>
+					<File
+						RelativePath="NumOpe.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="NumOpe_Arithmetic.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="NumOpe_Logical.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="NumOpe_Relation.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="NumOpe_TypeOperation.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="Object"
+					>
+					<File
+						RelativePath=".\Compile_Interface.cpp"
+						>
+					</File>
+					<File
+						RelativePath=".\Compile_Object.cpp"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Opcode"
+					>
+					<File
+						RelativePath="amd64_main.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath=".\stack_frame.cpp"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Procedure"
+					>
+					<File
+						RelativePath=".\CLockParameter.cpp"
+						>
+					</File>
+					<File
+						RelativePath=".\Compile_CallProc.cpp"
+						>
+					</File>
+					<File
+						RelativePath="Compile_Func.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="Compile_ProcOp.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_MBCS;JPN;$(NoInherit)"
+								UsePrecompiledHeader="0"
+								BrowseInformation="0"
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath=".\CParameter.cpp"
+						>
+					</File>
+					<File
+						RelativePath=".\OperatorProc.cpp"
+						>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="32及び64共通"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\BasicCompiler.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\calculation.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\Compile.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\Diagnose.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\error.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\gc.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\hash.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\MakeExe.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\NumOpe_GetType.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\Object.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\OldStatement.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\Overload.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\RSrcSection.cpp"
+					>
+				</File>
+				<File
+					RelativePath="..\BasicCompiler_Common\StrOperation.cpp"
+					>
+				</File>
+				<Filter
+					Name="Intermediate"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\CommandFormat.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Intermediate_Step1.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Intermediate_Step2.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Resource.cpp"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Parts"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\DataTable.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\LoopRefCheck.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\NonVolatile.cpp"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Debug（共通）"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\BreakPoint.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\BreakPoint.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\CDebugThreadInfo.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Debug.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\debug.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\DebugMiddleFile.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\DebugSection.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\VarList.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\WatchList.cpp"
+						>
+						<FileConfiguration
+							Name="Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								ObjectFile="$(IntDir)\$(InputName)1.obj"
+								XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								ObjectFile="$(IntDir)\$(InputName)1.obj"
+								XMLDocumentationFileName="$(IntDir)\$(InputName)1.xdc"
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="Type"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\Class.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Class.h"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Enum.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Enum.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Schedule"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\PESchedule.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\PESchedule.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="LexicalScoping"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\LexicalScoping.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\LexicalScoping.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Constant"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\Const.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Const.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Variable"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\VariableOpe.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\VariableOpe.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Procedure"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\ParamImpl.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Subroutine.cpp"
+						>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="Common Classes"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\src\Smoothie.cpp"
+					>
+				</File>
+				<Filter
+					Name="Meta Parts"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Member.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Method.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Namespace.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Procedure.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Prototype.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Symbol.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Type.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\TypeDef.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\BasicCompiler_Common\Variable.cpp"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Lexical Parts"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Source.cpp"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Operation Statements"
+					>
+					<File
+						RelativePath="..\BasicCompiler_Common\src\Exception.cpp"
+						>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="Application Classes"
+				>
+				<File
+					RelativePath="..\BasicCompiler_Common\src\Program.cpp"
+					>
+				</File>
+			</Filter>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: tag/abdev(2007.06.20)/BasicCompiler64/BasicCompiler64.sln
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/BasicCompiler64.sln	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/BasicCompiler64.sln	(revision 178)
@@ -0,0 +1,26 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicCompiler", "BasicCompiler.vcproj", "{864B921B-423B-4F9E-9E6B-31B15968EDF9}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		English_Rel|Win32 = English_Rel|Win32
+		Release|Win32 = Release|Win32
+		SmallDebug|Win32 = SmallDebug|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{864B921B-423B-4F9E-9E6B-31B15968EDF9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{864B921B-423B-4F9E-9E6B-31B15968EDF9}.Debug|Win32.Build.0 = Debug|Win32
+		{864B921B-423B-4F9E-9E6B-31B15968EDF9}.English_Rel|Win32.ActiveCfg = English_Rel|Win32
+		{864B921B-423B-4F9E-9E6B-31B15968EDF9}.English_Rel|Win32.Build.0 = English_Rel|Win32
+		{864B921B-423B-4F9E-9E6B-31B15968EDF9}.Release|Win32.ActiveCfg = Release|Win32
+		{864B921B-423B-4F9E-9E6B-31B15968EDF9}.Release|Win32.Build.0 = Release|Win32
+		{864B921B-423B-4F9E-9E6B-31B15968EDF9}.SmallDebug|Win32.ActiveCfg = SmallDebug|Win32
+		{864B921B-423B-4F9E-9E6B-31B15968EDF9}.SmallDebug|Win32.Build.0 = SmallDebug|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: tag/abdev(2007.06.20)/BasicCompiler64/CLockParameter.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/CLockParameter.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/CLockParameter.cpp	(revision 178)
@@ -0,0 +1,15 @@
+#include "../BasicCompiler_Common/common.h"
+#include "opcode.h"
+
+CDBLockParms::CDBLockParms(){
+}
+CDBLockParms::~CDBLockParms(){
+}
+void CDBLockParms::lock(int level){
+	array_LevelCount[level]++;
+}
+void CDBLockParms::unlock(int level){
+	array_LevelCount[level]--;
+}
+
+CDBLockParms obj_DBLockParms;
Index: tag/abdev(2007.06.20)/BasicCompiler64/CParameter.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/CParameter.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/CParameter.cpp	(revision 178)
@@ -0,0 +1,506 @@
+#include "../BasicCompiler_Common/common.h"
+#include "opcode.h"
+
+int ParamImpl::NewTempParameters( const string &procName, const Parameters &params, int SecondParmNum ){
+	if( SecondParmNum == -1 ) SecondParmNum = (int)params.size();
+
+	///////////////////////////////////////////////////////
+	// 一時オブジェクトをあらかじめスタックに積んでおく
+	///////////////////////////////////////////////////////
+
+	int stackItemNum = 0;
+
+	useTempObject = false;
+
+	BOOL bEllipse;
+	if(params.size()){
+		if(params[params.size()-1]->GetBasicType()==DEF_ELLIPSE) bEllipse=1;
+		else bEllipse=0;
+	}
+	else bEllipse=0;
+
+	for(int i2=ParmsNum-1;i2>=0;i2--){
+		useTempParameters[i2] = false;
+
+		if(bEllipse&&i2<=(int)params.size()-2) bEllipse=0;
+
+		if(i2==0){
+			if( params[i2]->GetVarName() == "_System_LocalThis" ){
+				//オブジェクトメンバの第一パラメータのThisポインタ
+				continue;
+			}
+		}
+		if( i2==0||i2==1 ){
+			if( params[i2]->GetVarName() == procName ){
+				//オブジェクトメンバの第一または第二パラメータの戻り値用オブジェクト
+				continue;
+			}
+		}
+
+		Type dummyType;
+		BOOL bByVal;
+		if(bEllipse){
+			NumOpe_GetType( Parms[i2], Type(), dummyType );
+			bByVal=1;
+		}
+		else{
+			dummyType = *params[i2];
+			bByVal = ( params[i2]->IsRef() == false ) ? TRUE:FALSE;
+		}
+
+
+		if( !bByVal ){
+			//ポインタ参照
+			if(Parms[i2][0]==1&&Parms[i2][1]==ESC_BYVAL){
+				//ポインタ指定
+				continue;
+			}
+
+			if( !GetVarType( Parms[i2], Type(), FALSE ) ){
+				//変数ではないとき
+				int reg = REG_RAX;
+				Type calcType;
+				NumOpe( &reg, Parms[i2], dummyType, calcType );
+
+				if( !calcType.IsStruct() ){
+					//一時参照を作成
+					pobj_sf->push( reg );
+					pobj_sf->mov_sp( reg );
+
+					stackItemNum++;
+				}
+
+				//スタックフレームへコピー
+				StackOffsetOfTempObject[i2] = pobj_sf->push(reg);
+
+				stackItemNum++;
+
+				bool result = CheckDifferentType(
+					dummyType,
+					calcType,
+					procName.c_str(),
+					i2);
+
+				if( result ){
+					useTempParameters[i2] = true;
+					useTempObject = true;
+
+					types[i2] = calcType;
+				}
+			}
+		}
+	}
+
+	return stackItemNum * PTR_SIZE;
+}
+void ParamImpl::DeleteTempParameters(){
+	///////////////////////////////////////////////////////
+	// 一時オブジェクトを破棄
+	///////////////////////////////////////////////////////
+	if( !useTempObject ) return;
+
+	for(int i2=ParmsNum-1;i2>=0;i2--){
+		if( useTempParameters[i2] ){
+			if( types[i2].IsStruct() ){
+				// 構造体の一時メモリ
+
+				//メモリを解放する
+
+				pobj_sf->pop( REG_RCX );
+
+				//call free
+				extern UserProc *pSub_free;
+				op_call(pSub_free);
+			}
+			else{
+				pobj_sf->pop();
+				pobj_sf->pop();
+			}
+		}
+	}
+}
+
+void ParamImpl::SetStructParameter( int reg, const Type &baseType, const char *expression ){
+	//////////////////////////////////////////////////////
+	/////    レジスタ資源のバックアップ
+	{	BACKUP_REGISTER_RESOURCE
+	//////////////////////////////////////////////////////
+
+		int object_size = baseType.GetClass().GetSize();
+
+		//mov rcx,object_size
+		op_mov_RV(sizeof(_int64),REG_RCX,object_size);
+
+		//call calloc
+		extern UserProc *pSub_calloc;
+		op_call(pSub_calloc);
+
+		//mov r11,rax
+		op_mov_RR(REG_R11,REG_RAX);
+
+		//mov qword ptr[rsp+offset],r11     ※スタックフレームを利用
+		pobj_sf->push(REG_R11);
+
+
+		Type calcType;
+		BOOL bUseHeap;
+		int temp_reg=REG_RAX;
+		NumOpe( &temp_reg,
+			expression,
+			baseType,
+			calcType,
+			&bUseHeap );
+
+
+		//mov r11,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->ref(REG_R11);
+
+
+		RELATIVE_VAR RelativeVar;
+		RelativeVar.bOffsetOffset=0;
+		RelativeVar.offset=0;
+		RelativeVar.dwKind=VAR_DIRECTMEM;
+
+		SetStructVariableFromRax(
+			baseType,
+			calcType,
+			&RelativeVar,bUseHeap);
+
+
+		//mov r11,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_R11);
+
+	/////////////////////////////////////////////
+	//////   レジスタ資源を復元
+		RESTORE_REGISTER_RESOURCE
+	}////////////////////////////////////////////
+
+	//mov reg,r11
+	op_mov_RR(reg,REG_R11);
+}
+
+
+void ParamImpl::SetParameter( const string &procName, const Parameters &params, int SecondParmNum ){
+	if( SecondParmNum == -1 ) SecondParmNum = (int)params.size();
+
+	///////////////////////////////////////////////////////////
+	// パラメータをレジスタ及びスタックフレームにセット
+	///////////////////////////////////////////////////////////
+	int i2,i3;
+
+	BOOL bEllipse;
+	if( params.size() ){
+		if(params[params.size()-1]->GetBasicType()==DEF_ELLIPSE) bEllipse=1;
+		else bEllipse=0;
+	}
+	else bEllipse=0;
+
+	BOOL bHas_System_LocalThis=0;
+	if(ParmsNum>=1){
+		if( params[0]->GetVarName() == "_System_LocalThis" ){
+			bHas_System_LocalThis=1;
+		}
+	}
+
+	//戻り値用の変数名を取得
+	const char *lpszVarNameToReturn = (procName[0]==1&&procName[1]==ESC_OPERATOR)?"_System_ReturnValue":procName.c_str();
+
+	//パラメータをレジスタとスタックに格納
+	int ParmSize=0;
+	int reg,temp_reg;
+	RELATIVE_VAR RelativeVar;
+	for(i2=ParmsNum-1;i2>=0;i2--){
+		if(bEllipse&&i2<=(int)params.size()-2) bEllipse=0;
+
+		if(i2==0){
+			if( params[i2]->GetVarName() == "_System_LocalThis" ){
+				//オブジェクトメンバの第一パラメータのThisポインタ
+				continue;
+			}
+		}
+		if(i2==0||i2==1){
+			if( params[i2]->GetVarName() == lpszVarNameToReturn ){
+				//オブジェクトメンバの第一または第二パラメータの戻り値用オブジェクト
+				continue;
+			}
+		}
+
+		Type dummyType;
+		BOOL bByVal;
+		if(bEllipse){
+			NumOpe_GetType( Parms[i2], Type(), dummyType );
+			bByVal=1;
+		}
+		else{
+			dummyType = *params[i2];
+			bByVal = ( params[i2]->IsRef() == false ) ? TRUE:FALSE;
+		}
+
+		int xmm_temp_sw=0;
+		if(dummyType.IsReal()&&bByVal){
+			//実数型
+			if(i2==0) reg=REG_XMM0;
+			else if(i2==1) reg=REG_XMM1;
+			else if(i2==2) reg=REG_XMM2;
+			else if(i2==3) reg=REG_XMM3;
+			else{
+				reg=REG_XMM0;
+				xmm_temp_sw=1;
+			}
+		}
+		else{
+			//整数型
+			if(i2==0) reg=REG_RCX;
+			else if(i2==1) reg=REG_RDX;
+			else if(i2==2) reg=REG_R8;
+			else if(i2==3) reg=REG_R9;
+			else reg=REG_RAX;
+		}
+
+		if(bByVal==1){
+			//値参照
+
+			if(Parms[i2][0]==1&&Parms[i2][1]==ESC_BYVAL){
+				char temp2[255];
+				sprintf(temp2,"%s関数の第%dパラメータ",procName,i2+1);
+				SetError(19,temp2,cp);
+				continue;
+			}
+
+			if( dummyType.IsStruct() ){
+				SetStructParameter( reg, dummyType, Parms[i2] );
+				goto next;
+			}
+
+			temp_reg=reg;
+
+			extern LONG_PTR ProcPtr_BaseIndex;
+			LONG_PTR back_ProcPtr_BaseIndex = ProcPtr_BaseIndex;
+			if( dummyType.IsProcPtr() ){
+				ProcPtr_BaseIndex = dummyType.GetIndex();
+			}
+			else{
+				ProcPtr_BaseIndex=-1;
+			}
+
+			BOOL bCalcUseHeap;
+			Type calcType;
+			if( !NumOpe( &temp_reg, Parms[i2], dummyType, calcType, &bCalcUseHeap ) ){
+				break;
+			}
+
+			ProcPtr_BaseIndex=back_ProcPtr_BaseIndex;
+
+			if( calcType.IsObject() ){
+				if( !dummyType.IsObject()
+					||
+					dummyType.IsObject() &&
+					!dummyType.GetClass().IsEqualsOrSubClass( &calcType.GetClass() ) ){
+						//キャスト演算子のオーバーロードに対応する
+						CallCastOperatorProc( reg, calcType, bCalcUseHeap,dummyType );
+				}
+			}
+
+
+			if(bEllipse){
+				if( calcType.IsReal() ){
+					//整数レジスタへコピー
+					//※cdeclの拡張パラメータは実数の場合も汎用レジスタで引渡し
+
+					if(0<=i2&&i2<=3){
+						if(i2==0) reg=REG_RCX;
+						else if(i2==1) reg=REG_RDX;
+						else if(i2==2) reg=REG_R8;
+						else if(i2==3) reg=REG_R9;
+
+						//movd reg,temp_reg
+						op_movd_RX(reg,temp_reg);
+					}
+				}
+				else if( calcType.IsWhole() ){
+					//整数型の場合は、64ビットへ拡張する
+					ExtendTypeTo64( calcType.GetBasicType(), temp_reg );
+				}
+			}
+			else{
+				//型チェック
+				// TODO: _System_ReturnValueが考慮されていない？
+				if(bHas_System_LocalThis) i3=i2-1;
+				else i3=i2;
+				CheckDifferentType(
+					dummyType,
+					calcType,
+					procName.c_str(),
+					i3);
+
+				if( dummyType.IsDouble() ){
+					//Double型へ変換
+					ChangeTypeToXmm_Double(calcType.GetBasicType(),reg,temp_reg);
+				}
+				else if( dummyType.IsSingle() ){
+					//Single型へ変換
+					ChangeTypeToXmm_Single(calcType.GetBasicType(),reg,temp_reg);
+				}
+				else if( dummyType.IsWhole() ){
+					//実数型 → 整数型
+					ChangeTypeToWhole(calcType.GetBasicType(),dummyType.GetBasicType(),reg,temp_reg);
+				}
+			}
+		}
+		else{
+			//ポインタ参照
+			if(Parms[i2][0]==1&&Parms[i2][1]==ESC_BYVAL){
+				//ポインタ指定
+
+				temp_reg=reg;
+				Type calcType;
+				if( !NumOpe(&temp_reg, Parms[i2]+2, dummyType, calcType) ){
+					break;
+				}
+
+				dummyType.PtrLevelUp();
+
+				//型チェック
+				if(bHas_System_LocalThis) i3=i2-1;
+				else i3=i2;
+				CheckDifferentType(
+					dummyType,
+					calcType,
+					procName.c_str(),
+					i3);
+
+				if( calcType.IsReal() ){
+					//実数型 → 整数型
+					ChangeTypeToWhole( calcType.GetBasicType(), DEF_QWORD,reg,temp_reg);
+				}
+			}
+			else{
+				if( useTempParameters[i2] ){
+					//一時オブジェクトをコピー
+
+					//mov reg, qword ptr[rsp+offset]
+					pobj_sf->ref_offset_data( reg, StackOffsetOfTempObject[i2] );
+				}
+				else{
+					//変数のアドレスを取得
+					Type varType;
+					if(GetVarOffset(
+						false,
+						false,
+						Parms[i2],
+						&RelativeVar,
+						varType)){
+
+							if( !dummyType.IsAny() ){
+								//型チェックを行う
+								if( dummyType.GetBasicType() == varType.GetBasicType() ){
+									if( dummyType.IsObject() ){
+										if( !dummyType.GetClass().IsEqualsOrSubClass( &varType.GetClass() ) ){
+											SetError(11,Parms[i2],cp);
+										}
+									}
+									else if( dummyType.IsStruct() ){
+										if( !dummyType.GetClass().IsEquals( &varType.GetClass() ) ){
+											SetError(11,Parms[i2],cp);
+										}
+									}
+								}
+								else if( (varType.GetBasicType()&FLAG_PTR)
+									&&((varType.GetBasicType()^FLAG_PTR)==dummyType.GetBasicType())){
+									//仮引数がポインタ参照で、実引数が配列の先頭ポインタのとき
+								}
+								else{
+									SetError(11,Parms[i2],cp);
+								}
+							}
+
+							//変数アドレスをレジスタにセット
+							SetVarPtrToReg(reg,&RelativeVar);
+
+					}
+				}
+			}
+		}
+
+next:
+
+		if(reg==REG_RAX){
+			//スタックフレームへコピー
+			//mov qword ptr[rsp+offset],rax
+			op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,i2*sizeof(_int64),MOD_BASE_DISP32);
+		}
+		else if(xmm_temp_sw){
+			//スタックフレームへコピー
+
+			//movlpd qword ptr[rsp+offset],xmm0
+			op_movlpd_MR(REG_XMM0,REG_RSP,i2*sizeof(_int64),MOD_BASE_DISP32);
+		}
+
+
+		/////////////////////
+		// レジスタをロック
+		/////////////////////
+
+		if(0<=i2&&i2<=3){
+			//	※rcx, rdx, r8, r9の場合のみ
+			pobj_BlockReg->lock(reg);
+		}
+	}
+
+	//パラメータが収まるだけのスタックフレームを確保
+	pobj_sf->parameter_allocate((int)params.size()*sizeof(_int64)+   sizeof(_int64)/*ret用*/  );
+}
+void ParamImpl::BackupParameter(int pi_num){
+	///////////////////////////////////////////////////////////
+	// スタックフレームに存在する既存のパラメータをバックアップ
+	///////////////////////////////////////////////////////////
+	int i2;
+
+	for(i2=0;i2<ParmsNum;i2++){
+		/////////////////////
+		// バックアップ
+		/////////////////////
+
+		extern CDBLockParms obj_DBLockParms;
+		if(obj_DBLockParms.array_LevelCount[i2]){
+			//mov r14,qword ptr[rsp+offset]
+			op_mov_RM(sizeof(_int64),REG_R14,REG_RSP,i2*sizeof(_int64),MOD_BASE_DISP32);
+
+			//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+			pobj_sf->push(REG_R14);
+		}
+
+		if(3<i2){
+			//スタックフレームをロック
+			extern CDBLockParms obj_DBLockParms;
+			obj_DBLockParms.lock(i2);
+		}
+	}
+}
+void ParamImpl::RestoreParameter(int pi_num){
+	///////////////////////////////////////////////////////////
+	// スタックフレームに存在する既存のパラメータを復元
+	///////////////////////////////////////////////////////////
+	int i2;
+
+	for(i2=ParmsNum-1;i2>=0;i2--){
+		/////////////////////
+		// 復元
+		/////////////////////
+
+		if(3<i2){
+			//スタックフレームをアンロック
+			extern CDBLockParms obj_DBLockParms;
+			obj_DBLockParms.unlock(i2);
+		}
+
+		extern CDBLockParms obj_DBLockParms;
+		if(obj_DBLockParms.array_LevelCount[i2]){
+			//mov r14,qword ptr[rsp+offset]     ※スタックフレームを利用
+			pobj_sf->pop(REG_R14);
+
+			//mov qword ptr[rsp+offset],r14
+			op_mov_MR(sizeof(_int64),REG_R14,REG_RSP,i2*sizeof(_int64),MOD_BASE_DISP32);
+		}
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/CommandValue.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/CommandValue.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/CommandValue.h	(revision 178)
@@ -0,0 +1,96 @@
+/* 命令語定数 */
+
+//条件、分岐、繰り返し
+#define COM_DO		0x1021
+/* 0x22は「"」なので使用不可 */
+#define COM_GOTO	0x1023
+#define COM_GOSUB	0x1024
+#define COM_LOOP	0x1026
+#define COM_RETURN	0x1027
+/* 0x28は「(」なので使用不可 */
+/* 0x29は「)」なので使用不可 */
+#define COM_FOR		0x1031
+#define COM_NEXT	0x1032
+#define COM_WHILE	0x1036
+#define COM_WEND	0x1037
+
+//データ操作
+#define COM_DIM		0x1062
+#define COM_LET		0x1066
+#define COM_DELETE	0x1068
+#define COM_SWEEPINGDELETE	0x1069
+
+//その他
+#define COM_DEBUG		0x1073
+
+//ポインタ
+#define COM_SETDOUBLE		0x10C1
+#define COM_SETSINGLE		0x10C2
+#define COM_SETQWORD		0x10C3
+#define COM_SETDWORD		0x10C4
+#define COM_SETWORD			0x10C5
+#define COM_SETBYTE			0x10C6
+
+
+
+///////////////////////////////////
+// 以下はProjectEditorで使用される
+
+//入出力コマンド
+#define COM_PRINT		0x1150
+#define COM_INPUT		0x1151
+#define COM_OPEN		0x1152
+#define COM_CLOSE		0x1153
+#define COM_FIELD		0x1154
+#define COM_WRITE		0x1155
+
+//条件、分岐、繰り返し
+#define COM_IF			0x1160
+#define COM_SELECT		0x1161
+
+//ファイル操作
+#define COM_CHDIR		0x1170
+#define COM_KILL		0x1171
+#define COM_MKDIR		0x1172
+#define COM_GET			0x1173
+#define COM_PUT			0x1174
+
+//グラフィックス
+#define COM_CIRCLE		0x1180
+#define COM_LINE		0x1181
+#define COM_PAINT		0x1182
+#define COM_PSET		0x1183
+
+//データ操作
+#define COM_CONST		0x1190
+#define COM_TYPEDEF		0x1191
+
+//クラス関連
+#define COM_CLASS		0x1195
+#define COM_PRIVATE		0x1196
+#define COM_PUBLIC		0x1197
+#define COM_INHERITS	0x1198
+#define COM_PROTECTED	0x1199
+
+//その他
+#define COM_BEEP		0x11A0
+#define COM_CLS			0x11A1
+#define COM_COLOR		0x11A2
+#define COM_DECLARE		0x11A4
+#define COM_DEF			0x11A5
+#define COM_END			0x11A6
+#define COM_FUNCTION	0x11A7
+#define COM_LOCATE		0x11A8
+#define COM_RANDOMIZE	0x11A9
+#define COM_REM			0x11AA
+#define COM_SLEEP		0x11AB
+#define COM_SUB			0x11AC
+#define COM_TYPE		0x11AD
+#define COM_VIRTUAL		0x11AE
+#define COM_WITH		0x11AF
+#define COM_ENUM		0x11B0
+
+//ウィンドウ制御
+#define COM_DELWND		0x11C0
+#define COM_MSGBOX		0x11C1
+#define COM_WINDOW		0x11C2
Index: tag/abdev(2007.06.20)/BasicCompiler64/Compile_Calc.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Compile_Calc.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Compile_Calc.cpp	(revision 178)
@@ -0,0 +1,259 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void SetVariableFromRax(int VarType,int CalcType,RELATIVE_VAR *pRelativeVar){
+	/////////////////////////////////////////////////
+	// raxの内容を変数にコピーするコードを抽出
+	/////////////////////////////////////////////////
+
+	if(VarType==DEF_BOOLEAN){
+		//bool
+		SetBooleanVariable(CalcType,pRelativeVar);
+	}
+	else if( IsRealNumberType( VarType ) ){
+		// Double/Single型変数へレジスタの値を代入
+		SetRealVariable(VarType, CalcType, pRelativeVar);
+	}
+	else if( IsWholeNumberType( VarType ) || VarType == DEF_OBJECT ){
+		int typeSize = GetTypeSize( VarType, -1 );
+
+		//整数変数へraxの値を格納する
+		SetWholeVariable( typeSize, CalcType, pRelativeVar );
+	}
+	else{
+		SetError(300,NULL,cp);
+	}
+}
+void OpcodeCalc(const char *Command){
+	int i,i2,i3;
+	char variable[VN_SIZE];
+
+
+
+	//////////////////////////////////////
+	// インクリメント・デクリメント
+	//////////////////////////////////////
+
+	for(i=0;;i++){
+		if(Command[i]=='\"'){
+			//ダブルクォートは不正なのでエラー扱い
+			variable[i]=0;
+			SetError(3,variable,cp);
+			return;
+		}
+
+		if(Command[i]=='('){
+			i2=GetStringInPare(variable+i,Command+i);
+			i+=i2-1;
+			continue;
+		}
+		if(Command[i]=='['){
+			i2=GetStringInBracket(variable+i,Command+i);
+			i+=i2-1;
+			continue;
+		}
+		if(Command[i]=='\0'){
+
+			///////////////////////////////////
+			// インクリメント・デクリメント
+			///////////////////////////////////
+
+			if(i>2){
+				if(Command[i-2]=='+'&&Command[i-1]=='+'){
+					//インクリメント
+					variable[i-2]=0;
+					IncDec(CALC_ADDITION,variable,"1");
+					return;
+				}
+				else if(Command[i-2]=='-'&&Command[i-1]=='-'){
+					//デクリメント
+					variable[i-2]=0;
+					IncDec(CALC_SUBTRACTION,variable,"1");
+					return;
+				}
+			}
+
+
+			//先端部分の識別子をエラーキーワードにする
+			for(i=0;;i++){
+				if(!IsVariableChar(Command[i])){
+					variable[i]=0;
+					break;
+				}
+				variable[i]=Command[i];
+			}
+
+			if(GetVarType(variable,Type(),0)){
+				//変数リストに該当したとき
+				SetError(1,NULL,cp);
+			}
+			else{
+				if(GetConstHash(variable)){
+					//定数リストに該当したとき
+					SetError(1,NULL,cp);
+				}
+				else{
+					//変数リスト、定数リストに該当しないとき
+					SetError(3,variable,cp);
+				}
+			}
+			return;
+		}
+
+		i2=GetCalcId(Command+i,&i3);
+		if(i2){
+			variable[i]=0;
+
+			if(Command[i]=='=') break;
+
+			if(Command[i+1+i3]=='='){
+				IncDec(i2,variable,Command+i+1+i3+1);
+				return;
+			}
+		}
+
+		variable[i]=Command[i];
+	}
+
+	if(Command[i+1]=='\0'){
+		SetError(1,NULL,cp);
+		return;
+	}
+
+
+
+	///////////////////////////////////////////////////////////////
+	// インデクサのsetアクセサ（[]=演算子のオーバーロードに対応）
+	///////////////////////////////////////////////////////////////
+
+	char ObjName[VN_SIZE],array_element[VN_SIZE];
+	GetArrayElement(variable,ObjName,array_element);
+	if(array_element[0]){
+		Type varType;
+		if( GetVarType(ObjName,varType,0) && varType.IsObject() ){
+			char temporary[VN_SIZE];
+			sprintf(temporary,"%s.%c%c%c",ObjName,1,ESC_OPERATOR,CALC_ARRAY_SET);
+
+			char temp2[VN_SIZE];
+			sprintf(temp2,"%s,%s",array_element,Command+i+1);
+
+			int idProc;
+			void *pProc;
+			idProc=GetProc(temporary,(void **)&pProc);
+			if(idProc){
+				CallProc(idProc,pProc,temporary,temp2,Type());
+				return;
+			}
+		}
+	}
+
+
+	if( lstrcmpi( variable, "This" ) == 0 ){
+		SetError(133,NULL,cp);
+		return;
+	}
+
+
+	////////////////////////////////////////
+	// 変数のタイプ型を識別して、演算を行う
+	////////////////////////////////////////
+
+	Type varType;
+
+	//型を識別
+	if( !GetVarType(variable,varType,false) ){
+
+		// プロパティ用のメソッドを呼び出す
+		if(!CallPropertyMethod( variable, Command+i+1, Type() )){
+			//エラーを表示
+			GetVarType(variable,varType,true);
+		}
+
+		return;
+	}
+
+	extern LONG_PTR ProcPtr_BaseIndex;
+	if(varType.IsProcPtr()) ProcPtr_BaseIndex=varType.GetIndex();
+	else ProcPtr_BaseIndex=-1;
+
+	//NumOpe...（rax、またはxmm0に答えが格納される）
+	int reg=REG_RAX;
+	BOOL bCalcUseHeap;
+	Type calcType;
+	if( !NumOpe(&reg,Command+i+1,varType,calcType,&bCalcUseHeap) ){
+		return;
+	}
+
+	if(reg!=REG_RAX&&calcType.IsWhole()||
+		varType.IsNull()||calcType.IsNull()){
+		SetError(300,NULL,cp);
+	}
+
+	//結果を格納しているレジスタをブロッキング
+	pobj_BlockReg->lock(reg);
+
+	//変数アドレスを取得
+	RELATIVE_VAR VarRelativeVar;
+	if(!GetVarOffsetReadWrite(
+		variable,
+		&VarRelativeVar,
+		varType)) return;
+
+	//レジスタのブロッキングを解除
+	pobj_BlockReg->clear();
+
+	if(varType.GetBasicType()&FLAG_PTR){
+		SetError(14,variable,cp);
+		return;
+	}
+
+	if( varType.IsStruct() ){
+		//構造体インスタンスへの代入
+		SetStructVariableFromRax(varType,calcType,&VarRelativeVar,bCalcUseHeap);
+		return;
+	}
+
+	if( calcType.IsObject() && !calcType.Equals( varType ) ){
+		bool isUpCast = false;
+		if( varType.IsObject() ){
+			if( varType.GetClass().IsEqualsOrSubClass( &calcType.GetClass() ) ){
+				isUpCast = true;
+			}
+		}
+		if( !isUpCast ){
+			//キャスト演算子のオーバーロードに対応する
+			CallCastOperatorProc(REG_RAX,calcType,bCalcUseHeap,varType);
+		}
+	}
+
+	if( varType.IsObject() && Smoothie::meta.blittableTypes.IsExist( calcType ) ){
+		// Blittable型をオブジェクトとして扱う
+		vector<UserProc *> userProcs;
+		Smoothie::meta.blittableTypes.GetClass( calcType ).GetStaticMethods().Enum( "_Create", userProcs );
+		if( userProcs.size() != 1 ){
+			SetError();
+			return;
+		}
+		UserProc *pUserProc = userProcs[0];
+
+		// mov rcx, rax
+		op_mov_RR( REG_RCX, REG_RAX );
+
+		// call System.[TypeClass]._Create
+		op_call( pUserProc );
+
+		calcType = pUserProc->ReturnType();
+	}
+
+	/////////////////////////////////
+	// 右辺、左辺の型チェックを行う
+	/////////////////////////////////
+
+	CheckDifferentType(varType,calcType,0,0);
+
+
+	/////////////////////////////////////////////////
+	// rax（実数はxmm0）の内容を変数にコピー
+	/////////////////////////////////////////////////
+	SetVariableFromRax(varType.GetBasicType(),calcType.GetBasicType(),&VarRelativeVar);
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/Compile_Calc_PushVar.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Compile_Calc_PushVar.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Compile_Calc_PushVar.cpp	(revision 178)
@@ -0,0 +1,253 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+
+void SetXmmReg_DoubleVariable(RELATIVE_VAR *pRelativeVar,int xmm_reg){
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//movlpd xmm_reg,qword ptr[r11+offset]
+			OpBuffer[obp++]=(char)0x66;
+			OpBuffer[obp++]=(char)0x41;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x12;
+			OpBuffer[obp++]=(char)(0x83 | REGISTER_OPERAND(xmm_reg)<<3);
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//movlpd xmm_reg,qword ptr[offset]
+			OpBuffer[obp++]=(char)0x66;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x12;
+			OpBuffer[obp++]=(char)(0x04 | REGISTER_OPERAND(xmm_reg)<<3);
+			OpBuffer[obp++]=(char)0x25;
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if( pRelativeVar->dwKind == VAR_REFGLOBAL ){
+		SetError(300,NULL,cp);
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//movlpd xmm_reg,qword ptr[rsp+r11+offset]
+			OpBuffer[obp++]=(char)0x66;
+			OpBuffer[obp++]=(char)0x42;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x12;
+			OpBuffer[obp++]=(char)(0x84 | REGISTER_OPERAND(xmm_reg)<<3);
+			OpBuffer[obp++]=(char)0x1C;
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//movlpd xmm_reg,qword ptr[rsp+offset]
+			OpBuffer[obp++]=(char)0x66;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x12;
+			OpBuffer[obp++]=(char)(0x84 | REGISTER_OPERAND(xmm_reg)<<3);
+			OpBuffer[obp++]=(char)0x24;
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if( pRelativeVar->dwKind == VAR_REFLOCAL ){
+		if(pRelativeVar->bOffsetOffset){
+			//add r11,qword ptr[rsp+offset]
+			OpBuffer[obp++]=(char)0x4C;
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0x9C;
+			OpBuffer[obp++]=(char)0x24;
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov r11,qword ptr[rsp+offset]
+			op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+
+		goto directmem;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+directmem:
+		//movlpd xmm_reg,qword ptr[r11]
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0x41;
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x12;
+		OpBuffer[obp++]=(char)(0x03 | REGISTER_OPERAND(xmm_reg)<<3);
+	}
+}
+void SetXmmReg_SingleVariable(RELATIVE_VAR *pRelativeVar,int xmm_reg){
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//movss xmm_reg,dword ptr[r11+offset]
+			OpBuffer[obp++]=(char)0xF3;
+			OpBuffer[obp++]=(char)0x41;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x10;
+			OpBuffer[obp++]=(char)(0x83 | REGISTER_OPERAND(xmm_reg)<<3);
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//movss xmm_reg,dword ptr[offset]
+			OpBuffer[obp++]=(char)0xF3;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x10;
+			OpBuffer[obp++]=(char)(0x04 | REGISTER_OPERAND(xmm_reg)<<3);
+			OpBuffer[obp++]=(char)0x25;
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if( pRelativeVar->dwKind == VAR_REFGLOBAL ){
+		SetError(300,NULL,cp);
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//movss xmm_reg,dword ptr[rsp+r11+offset]
+			OpBuffer[obp++]=(char)0xF3;
+			OpBuffer[obp++]=(char)0x42;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x10;
+			OpBuffer[obp++]=(char)(0x84 | REGISTER_OPERAND(xmm_reg)<<3);
+			OpBuffer[obp++]=(char)0x1C;
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//movss xmm_reg,dword ptr[rsp+offset]
+			OpBuffer[obp++]=(char)0xF3;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x10;
+			OpBuffer[obp++]=(char)(0x84 | REGISTER_OPERAND(xmm_reg)<<3);
+			OpBuffer[obp++]=(char)0x24;
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if( pRelativeVar->dwKind == VAR_REFLOCAL ){
+		if(pRelativeVar->bOffsetOffset){
+			//add r11,qword ptr[rsp+offset]
+			OpBuffer[obp++]=(char)0x4C;
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0x9C;
+			OpBuffer[obp++]=(char)0x24;
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov r11,qword ptr[rsp+offset]
+			op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+
+		goto directmem;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+directmem:
+		//movss xmm_reg,dword ptr[r11]
+		OpBuffer[obp++]=(char)0xF3;
+		OpBuffer[obp++]=(char)0x41;
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x10;
+		OpBuffer[obp++]=(char)(0x03 | REGISTER_OPERAND(xmm_reg)<<3);
+	}
+}
+
+
+void SetReg_WholeVariable(int type,RELATIVE_VAR *pRelativeVar,int reg){
+	int varSize;
+
+	varSize=GetTypeSize(type,-1);
+
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//mov reg, ptr[r11+offset]
+			op_mov_RM(varSize,reg,REG_R11,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov reg, ptr[offset]
+			op_mov_RM(varSize,reg,0,(int)pRelativeVar->offset,MOD_DISP32);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if( pRelativeVar->dwKind == VAR_REFGLOBAL ){
+		if(pRelativeVar->bOffsetOffset){
+			//add r11,qword ptr[offset]
+			op_add_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov r11,qword ptr[offset]
+			op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+
+		goto directmem;
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//mov reg, ptr[rsp+r11+offset]
+			op_mov_RM_ex(varSize,reg,REG_RSP,REG_R11,(int)pRelativeVar->offset,USE_OFFSET);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov reg, ptr[rsp+offset]
+			op_mov_RM(varSize,reg,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if( pRelativeVar->dwKind == VAR_REFLOCAL ){
+		if(pRelativeVar->bOffsetOffset){
+			//add r11,qword ptr[rsp+offset]
+			op_add_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov r11,qword ptr[rsp+offset]
+			op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+
+		goto directmem;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+directmem:
+		//mov reg, ptr[r11]
+		op_mov_RM(varSize,reg,REG_R11,0,MOD_BASE);
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/Compile_CallProc.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Compile_CallProc.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Compile_CallProc.cpp	(revision 178)
@@ -0,0 +1,458 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+//ローカル変数アドレススケジュール
+DWORD *pLocalVarAddrSchedule;
+int LocalVarAddrScheduleNum;
+
+void Call_DebugSys_SaveContext(){
+	//call _System_GetEip
+	extern UserProc *pSub_System_GetEip;
+	op_call(pSub_System_GetEip);
+
+	//mov rdx,rax
+	op_mov_RR(REG_RDX,REG_RAX);
+
+	//mov rcx,rsp
+	op_mov_RR(REG_RCX,REG_RSP);
+
+	//call _DebugSys_SaveContext
+	extern UserProc *pSub_DebugSys_SaveContext;
+	op_call(pSub_DebugSys_SaveContext);
+}
+
+void AddLocalVarAddrSchedule(){
+	extern HANDLE hHeap;
+
+	//ローカル変数アドレススケジュールに追加する
+	pLocalVarAddrSchedule=(DWORD *)HeapReAlloc(hHeap,0,pLocalVarAddrSchedule,(LocalVarAddrScheduleNum+1)*sizeof(DWORD));
+	pLocalVarAddrSchedule[LocalVarAddrScheduleNum]=obp;
+	LocalVarAddrScheduleNum++;
+}
+
+
+bool Opcode_CallProcPtr( const char *variable, const char *lpszParms,ProcPointer *pProcPointer){
+
+	extern BOOL bDebugCompile;
+	extern BOOL bDebugSupportProc;
+	if(bDebugCompile&&bDebugSupportProc==0)
+		Call_DebugSys_SaveContext();
+
+
+	////////////////////////
+	// パラメータのセット
+	////////////////////////
+
+	//パラメータオブジェクトを生成
+	ParamImpl *pobj_parameter=0;
+	pobj_parameter=new ParamImpl(lpszParms);
+
+	// デフォルト引数を適用
+	pobj_parameter->ApplyDefaultParameters( pProcPointer->Params() );
+
+	//エラーチェック
+	if( !pobj_parameter->ErrorCheck(variable,pProcPointer->Params() ) ){
+		//パラメータにエラーがあるときは処理を終える
+		return false;
+	}
+
+	//スタックフレームに存在する既存のパラメータをバックアップ
+	pobj_parameter->BackupParameter( (int)pProcPointer->Params().size() );
+
+	//一時オブジェクトを生成
+	pobj_parameter->NewTempParameters( variable,pProcPointer->Params() );
+
+	//レジスタ、スタックフレームにセット
+	pobj_parameter->SetParameter(variable,pProcPointer->Params() );
+
+
+
+	RELATIVE_VAR RelativeVar;
+	GetVarOffsetReadOnly(variable,&RelativeVar,Type());
+	SetVarPtrToReg(REG_RAX,&RelativeVar);
+
+	//mov rax,qword ptr[rax]
+	op_mov_RM(sizeof(_int64),REG_RAX,REG_RAX,0,MOD_BASE);
+
+	//call rax
+	OpBuffer[obp++]=(char)0xFF;
+	OpBuffer[obp++]=(char)0xD0;
+
+
+	//レジスタのブロッキングを解除		※パラメータセット時にロックされたレジスタ
+	pobj_BlockReg->clear();
+
+	//一時オブジェクトを破棄
+	pobj_parameter->DeleteTempParameters();
+
+	//スタックフレームに存在する既存のパラメータを復元
+	pobj_parameter->RestoreParameter( (int)pProcPointer->Params().size() );
+
+	//パラメータオブジェクトを破棄
+	delete pobj_parameter;
+
+	return true;
+}
+
+bool Opcode_CallProc(const char *Parameter,UserProc *pUserProc,DWORD dwFlags,const char *ObjectName,int RefType){
+	// TODO: RefTypeは不必要なので削除する
+	int i2;
+
+	if( pUserProc->IsMacro() ){
+		if( lstrcmpi( pUserProc->GetName().c_str(), "Print" ) == 0 ){
+			Opcode_Print(Parameter,0);
+			return true;
+		}
+		if( lstrcmpi( pUserProc->GetName().c_str(), "Input" ) == 0 ){
+			Opcode_Input(Parameter);
+			return true;
+		}
+		if( lstrcmpi( pUserProc->GetName().c_str(), "Write" ) == 0 ){
+			Opcode_Print(Parameter,1);
+			return true;
+		}
+	}
+
+	pUserProc->Using();
+
+	bool isStatic = false;
+	const CClass *pobj_c = NULL;
+	const CMethod *pMethod = NULL;
+	if( pUserProc->GetParentClassPtr() ){
+		//クラスのメンバ関数を呼び出す場合はアクセスチェックを行う
+		if(ObjectName[0] && (dwFlags&PROCFLAG_NEW)==0){
+			if(lstrcmpi(ObjectName,"Super")==0){
+				//クラスメンバ関数内から基底クラスの呼び出し
+				pobj_c=pobj_CompilingClass;
+			}
+			else{
+				//"->"によってオブジェクトを指定する通常のメンバ関数呼び出し
+				Type varType;
+				GetVarType( ObjectName, varType, false );
+				pobj_c = &varType.GetClass();
+				if( NATURAL_TYPE( varType.GetBasicType() ) != DEF_OBJECT ){
+					pobj_c=pobj_DBClass->Find(ObjectName);
+					if( pobj_c ){
+						isStatic = true;
+					}
+					else{
+						SetError(300,NULL,cp);
+					}
+				}
+			}
+		}
+		else{
+			if(dwFlags&PROCFLAG_NEW){
+				//New演算子によるコンストラクタ呼び出し
+				pobj_c=pUserProc->GetParentClassPtr();
+			}
+			else{
+				//クラスメンバ関数内から同一クラスのメンバ関数の呼び出し
+				pobj_c=pobj_CompilingClass;
+			}
+		}
+
+
+		/////////////////////////////////
+		// メソッド情報を取得
+		/////////////////////////////////
+		pMethod = NULL;
+		if( ! isStatic ) pMethod = pobj_c->GetMethods().GetMethodPtr( pUserProc );
+		if( ! pMethod ){
+			//動的メソッドが取得できなかったときは静的メソッドを当たる
+			pMethod = pobj_c->GetStaticMethods().GetMethodPtr( pUserProc );
+			if( !pMethod ){
+				SetError(300,NULL,cp);
+				return false;
+			}
+
+			//静的メンバ
+			isStatic = true;
+		}
+
+
+		//////////////////////////////
+		// アクセスエラーチェック
+		//////////////////////////////
+
+		if(ObjectName[0]){
+			//外部からの呼び出し
+			if(pobj_c==pobj_CompilingClass){
+				//同一クラスオブジェクトの場合はプライベートアクセスを容認する
+				if( pMethod->IsNoneAccess() ){
+					SetError(109,pUserProc->GetName(),cp);
+					return false;
+				}
+			}
+			else{
+				if( pMethod->IsPrivate()
+					|| pMethod->IsNoneAccess() ){
+					SetError(109,pUserProc->GetName(),cp);
+					return false;
+				}
+				if( pMethod->IsProtected() ){
+					SetError(110,pUserProc->GetName(),cp);
+					return false;
+				}
+			}
+		}
+		else{
+			//クラス内部からの呼び出し（継承によるACCESS_NONのみをエラーとする）
+			if( pMethod->IsNoneAccess() ){
+				SetError(109,pUserProc->GetName(),cp);
+				return false;
+			}
+		}
+	}
+
+
+	///////////////////////////////////////////////////////////////
+	// _System_LocalThisのダミーをセット
+	///////////////////////////////////////////////////////////////
+
+	char temporary[VN_SIZE]={0};
+	if( pUserProc->GetParentClassPtr() && isStatic == false ){
+		//_System_LocalThis（第一パラメータ）のダミーを作成
+		lstrcpy(temporary,"0,");
+	}
+
+	if(Parameter[0]=='\0'&&temporary[0])
+		temporary[lstrlen(temporary)-1]=0;
+	else lstrcat(temporary,Parameter);
+
+
+	//パラメータセット前のspオフセットを取得（Newの場合はここにThisポインタが格納されている）
+	int this_sp_offset = pobj_sf->GetNowSp();
+
+
+	////////////////////////
+	// パラメータをセット
+	////////////////////////
+
+	//パラメータオブジェクトを生成
+	ParamImpl *pobj_parameter=0;
+	pobj_parameter=new ParamImpl(temporary);
+
+	// デフォルト引数を適用
+	pobj_parameter->ApplyDefaultParameters( pUserProc->RealParams() );
+
+	//エラーチェック
+	if( !pobj_parameter->ErrorCheck(pUserProc->GetName(),pUserProc->RealParams(),pUserProc->GetSecondParmNum() ) ){
+		//パラメータにエラーがあるときは処理を終える
+		return false;
+	}
+
+	if(pUserProc->IsMacro()){
+		//マクロ関数の場合は、パラメータ省略を考慮する
+		pobj_parameter->MacroParameterSupport( pUserProc->RealParams() );
+	}
+
+	//スタックフレームに存在する既存のパラメータをバックアップ
+	pobj_parameter->BackupParameter( (int)pUserProc->RealParams().size() );
+
+	//一時オブジェクトを生成
+	pobj_parameter->NewTempParameters( pUserProc->GetName(),pUserProc->RealParams(),pUserProc->GetRealSecondParmNum() );
+
+	//レジスタ、スタックフレームにセット
+	pobj_parameter->SetParameter(pUserProc->GetName(),pUserProc->RealParams(),pUserProc->GetRealSecondParmNum() );
+
+	if(pUserProc->ReturnType().IsStruct() ){
+		//////////////////////////////////////////////////////
+		// 戻り値に構造体インスタンスを持つ場合
+		// ※ByRef _System_ReturnValue パラメータをセット
+		//////////////////////////////////////////////////////
+
+
+		//////////////////////////////////////////////////////
+		/////    レジスタ資源のバックアップ
+		{	BACKUP_REGISTER_RESOURCE
+		//////////////////////////////////////////////////////
+
+			int object_size = pUserProc->ReturnType().GetClass().GetSize();
+
+			//mov rcx,object_size
+			op_mov_RV(sizeof(_int64),REG_RCX,object_size);
+
+			//call calloc
+			extern UserProc *pSub_calloc;
+			op_call(pSub_calloc);
+
+			//mov r13,rax
+			op_mov_RR(REG_R13,REG_RAX);
+
+		/////////////////////////////////////////////
+		//////   レジスタ資源を復元
+			RESTORE_REGISTER_RESOURCE
+		}////////////////////////////////////////////
+
+		if( pUserProc->GetParentClassPtr() && isStatic == false ){
+			//mov rdx,r13
+			op_mov_RR(REG_RDX,REG_R13);
+		}
+		else{
+			//mov rcx,r13
+			op_mov_RR(REG_RCX,REG_R13);
+		}
+	}
+
+
+	if( pUserProc->GetParentClassPtr() && isStatic == false ){
+		///////////////////////////////
+		// メンバ関数の場合
+		// thisポインタをrcxで受け渡す
+		///////////////////////////////
+
+		if(ObjectName[0] && (dwFlags&PROCFLAG_NEW)==0){
+			if(lstrcmpi(ObjectName,"Super")==0) goto InClassMember;
+			else{
+				RELATIVE_VAR RelativeVar;
+				if( pMethod->IsConst() ){
+					//Constアクセスが可能なメソッドの場合
+					if( !GetVarOffsetReadOnly( ObjectName, &RelativeVar, Type() ) ){
+						return false;
+					}
+				}
+				else{
+					//Constアクセスが不可能なメソッドの場合
+					if( !GetVarOffsetReadWrite( ObjectName, &RelativeVar, Type() ) ){
+						return false;
+					}
+				}
+
+				SetVarPtrToReg(REG_RCX,&RelativeVar);
+
+				// 参照を実体ポインタにする
+				//mov rcx,qword ptr[rcx]
+				op_mov_RM(sizeof(_int64),REG_RCX,REG_RCX,0,MOD_BASE);
+			}
+		}
+		else{
+InClassMember:
+			if(dwFlags&PROCFLAG_NEW){
+				//New演算子によるコンストラクタ呼び出しの場合
+
+				//mov rcx,qword ptr[rsp+offset]     ※スタックフレームを利用
+				pobj_sf->ref_offset_data(REG_RCX, this_sp_offset);
+			}
+			else{
+				//自身のオブジェクトのThisポインタをrcxにコピー
+				SetThisPtrToReg(REG_RCX);
+			}
+		}
+	}
+
+	if( pUserProc->IsVirtual() ){
+		//仮想関数（オブジェクトメソッド）呼び出し
+		//pObj->func_table->func1
+		//                ->func2
+		//                ->func3
+
+		//mov r11,qword ptr[rcx]
+		op_mov_RM(sizeof(_int64),REG_R11,REG_RCX,0,MOD_BASE);
+
+		i2 = pobj_c->GetFuncNumInVtbl( pUserProc );
+
+		//call qword ptr[r11+func_index]
+		if(i2*PTR_SIZE<=0x7F){
+			OpBuffer[obp++]=(char)0x41;
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0x53;
+			OpBuffer[obp++]=(char)(i2*PTR_SIZE);
+		}
+		else{
+			OpBuffer[obp++]=(char)0x41;
+			OpBuffer[obp++]=(char)0xFF;
+			OpBuffer[obp++]=(char)0x93;
+			*((long *)(OpBuffer+obp))=i2*PTR_SIZE;
+			obp+=sizeof(long);
+		}
+	}
+	else{
+		//通常呼び出し
+
+		//call ProcAddr
+		op_call(pUserProc);
+	}
+
+	/* 64コンパイラでは不要
+	if(pDllProc->bCdecl){
+		//add esp,ParmSize
+	}*/
+
+
+	//レジスタのブロッキングを解除		※パラメータセット時にロックされたレジスタ
+	pobj_BlockReg->clear();
+
+	//一時オブジェクトを破棄
+	pobj_parameter->DeleteTempParameters();
+
+	//スタックフレームに存在する既存のパラメータを復元
+	pobj_parameter->RestoreParameter( (int)pUserProc->RealParams().size() );
+
+	//パラメータオブジェクトを破棄
+	delete pobj_parameter;
+
+	return true;
+}
+
+bool Opcode_CallDllProc( const char *lpszParms, DllProc *pDllProc ){
+
+	extern BOOL bDebugCompile;
+	extern BOOL bDebugSupportProc;
+	if(bDebugCompile&&bDebugSupportProc==0&& pDllProc->GetName() != "DebugBreak" ){
+		Call_DebugSys_SaveContext();
+	}
+
+
+	////////////////////////
+	// パラメータのセット
+	////////////////////////
+
+	//パラメータオブジェクトを生成
+	ParamImpl *pobj_parameter=0;
+	pobj_parameter=new ParamImpl(lpszParms);
+
+	// デフォルト引数を適用
+	pobj_parameter->ApplyDefaultParameters( pDllProc->Params() );
+
+	//エラーチェック
+	if( !pobj_parameter->ErrorCheck( pDllProc->GetName(), pDllProc->Params() ) ){
+		//パラメータにエラーがあるときは処理を終える
+		return false;
+	}
+
+	//スタックフレームに存在する既存のパラメータをバックアップ
+	pobj_parameter->BackupParameter( (int)pDllProc->Params().size() );
+
+	//一時オブジェクトを生成
+	pobj_parameter->NewTempParameters( pDllProc->GetName(), pDllProc->Params() );
+
+	//レジスタ、スタックフレームにセット
+	pobj_parameter->SetParameter(pDllProc->GetName(), pDllProc->Params() );
+
+
+	//レジスタのブロッキングを解除		※パラメータセット時にロックされたレジスタ
+	pobj_BlockReg->clear();
+
+
+	//動的リンクされたプロシージャの呼び出し
+
+	//call dword ptr[ImportTable]
+	op_call( pDllProc );
+
+	/* 64コンパイラでは不要
+	if(pDllProc->bCdecl){
+		//add esp,ParmSize
+	}*/
+
+	//一時オブジェクトを破棄
+	pobj_parameter->DeleteTempParameters();
+
+	//スタックフレームに存在する既存のパラメータを復元
+	pobj_parameter->RestoreParameter( (int)pDllProc->Params().size() );
+
+	//パラメータオブジェクトを破棄
+	delete pobj_parameter;
+
+	return true;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/Compile_Func.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Compile_Func.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Compile_Func.cpp	(revision 178)
@@ -0,0 +1,320 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+int GetFunctionFromName(char *FuncName){
+	if(lstrcmpi(FuncName,"Len")==0)			return FUNC_LEN;
+	if(lstrcmpi(FuncName,"AddressOf")==0)	return FUNC_ADDRESSOF;
+	if(lstrcmpi(FuncName,"SizeOf")==0)		return FUNC_SIZEOF;
+	if(lstrcmpi(FuncName,"VarPtr")==0)		return FUNC_VARPTR;
+	if(lstrcmpi(FuncName,"ObjPtr")==0)		return FUNC_OBJPTR;
+	if(lstrcmpi(FuncName,"GetDouble")==0)	return FUNC_GETDOUBLE;
+	if(lstrcmpi(FuncName,"GetSingle")==0)	return FUNC_GETSINGLE;
+	if(lstrcmpi(FuncName,"GetQWord")==0)	return FUNC_GETQWORD;
+	if(lstrcmpi(FuncName,"GetDWord")==0)	return FUNC_GETDWORD;
+	if(lstrcmpi(FuncName,"GetWord")==0)		return FUNC_GETWORD;
+	if(lstrcmpi(FuncName,"GetByte")==0)		return FUNC_GETBYTE;
+	return 0;
+}
+void Opcode_Func_Len( const char *Parameter ){
+	BOOL bArrayHead;
+
+	const char *tempParm=Parameter;
+	char temporary[VN_SIZE];
+	char temp2[32];
+	Type type;
+	if( !GetVarType(Parameter,type,0) ){
+		sprintf(temporary,"_System_DummyStr2=%s",Parameter);
+		OpcodeCalc(temporary);
+
+		lstrcpy(temp2,"_System_DummyStr2");
+		tempParm=temp2;
+
+		type.SetType( DEF_OBJECT, pobj_DBClass->GetStringClassPtr() );
+	}
+
+	if( type.IsStringClass() ){
+		//Stringオブジェクトの場合
+		sprintf(temporary,"%s.Length",tempParm);
+
+		int reg=REG_RAX;
+		NumOpe(&reg,temporary,Type(),Type());
+		return;
+	}
+
+	int SubScripts[MAX_ARRAYDIM];
+	RELATIVE_VAR RelativeVar;
+	if(!GetVarOffsetReadOnly(tempParm,&RelativeVar,type,SubScripts)) return;
+
+	if(type.GetBasicType()&FLAG_PTR){
+		type.SetBasicType( type.GetBasicType() & ( ~FLAG_PTR ) );
+
+		bArrayHead=1;
+	}
+	else bArrayHead=0;
+
+	int typeSize = type.GetSize();
+
+	if(bArrayHead) typeSize*=JumpSubScripts(SubScripts);
+
+	//mov rax,TypeSize
+	op_mov_RV(sizeof(_int64),REG_RAX,typeSize);
+
+	return;
+}
+void Opcode_Func_AddressOf( const char *name ){
+	extern int cp;
+	UserProc *pUserProc;
+
+	extern LONG_PTR ProcPtr_BaseIndex;
+	if(ProcPtr_BaseIndex!=-1){
+		//左辺の型にのっとり、オーバーロードを解決
+
+		std::vector<UserProc *> subs;
+		GetOverloadSubHash( name, subs );
+		if( subs.size() == 0 ){
+			SetError(27,name,cp);
+			return;
+		}
+
+		//オーバーロードを解決
+		pUserProc=OverloadSolution(name,subs,Smoothie::meta.procPointers[ProcPtr_BaseIndex]->Params(), Type() );
+
+		if(!pUserProc){
+			SetError(27,name,cp);
+			return;
+		}
+	}
+	else{
+		pUserProc=GetSubHash(name);
+		if(!pUserProc){
+			SetError(27,name,cp);
+			return;
+		}
+	}
+
+	if( pUserProc->IsVirtual() ){
+		///////////////////////////////
+		// 仮想関数の場合
+		// thisポインタをrcxにコピー
+		///////////////////////////////
+
+		const CClass *pobj_c;
+
+		char ObjectName[VN_SIZE];
+		int RefType;
+		SplitObjectName(name,ObjectName,&RefType);
+
+		if(ObjectName[0]){
+			if(lstrcmpi(ObjectName,"Super")==0) goto InClassMember;
+			else{
+				RELATIVE_VAR RelativeVar;
+				Type type;
+				if(!GetVarOffsetReadOnly(ObjectName,&RelativeVar,type)) return;
+				SetVarPtrToReg(REG_RCX,&RelativeVar);
+
+				//参照タイプが整合しているかをチェック
+				if(type.GetBasicType()!=RefType) SetError(104,ObjectName,cp);
+
+				if(type.IsObjectPtr()){
+					//mov rcx,qword ptr[rcx]
+					op_mov_RM(sizeof(_int64),REG_RCX,REG_RCX,0,MOD_BASE);
+				}
+			}
+		}
+		else{
+InClassMember:
+			//自身のオブジェクトのThisポインタをrcxにコピー
+			SetThisPtrToReg(REG_RCX);
+
+			pobj_c=pobj_CompilingClass;
+		}
+
+
+		//仮想関数（オブジェクトメソッド）
+		//pObj->func_table->func1
+		//                ->func2
+		//                ->func3
+
+		//mov r11,qword ptr[rcx]
+		op_mov_RM(sizeof(_int64),REG_R11,REG_RCX,0,MOD_BASE);
+
+		int i2 = pobj_c->GetFuncNumInVtbl( pUserProc );
+
+		//mov rax,qword ptr[r11+func_index]
+		if(i2*PTR_SIZE<=0x7F){
+			op_mov_RM(sizeof(_int64),REG_RAX,REG_R11,i2*PTR_SIZE,MOD_BASE_DISP8);
+		}
+		else{
+			op_mov_RM(sizeof(_int64),REG_RAX,REG_R11,i2*PTR_SIZE,MOD_BASE_DISP32);
+		}
+	}
+	else{
+		//一般の関数
+
+		//mov rax,ProcAddr
+		op_mov_RV(sizeof(_int64),REG_RAX,0);
+		obp-=sizeof(long);
+		pobj_SubAddrSchedule->add(pUserProc,0);
+		obp+=sizeof(long);
+	}
+
+	pUserProc->Using();
+}
+void Opcode_Func_SizeOf( const string &typeName ){
+	Type tempType;
+	if( !Type::StringToType( typeName, tempType ) ){
+		SetError(3,typeName,cp);
+		return;
+	}
+
+	int typeSize = ( tempType.IsObject() ) ?
+		tempType.GetClass().GetSize() : tempType.GetSize();
+
+	//mov rax,size
+	op_mov_RV(sizeof(_int64),REG_RAX,typeSize);
+}
+void Opcode_Func_VarPtr( const char *Parameter, Type &resultType, bool isCallOn ){
+	if( isCallOn == false ){
+		// 戻り値の型を取得するだけ
+
+		//変数のアドレスを取得
+		if(!GetVarType( Parameter, resultType, true )) return;
+
+		resultType.PtrLevelUp();
+
+		return;
+	}
+
+	RELATIVE_VAR RelativeVar;
+
+	//変数のアドレスを取得
+	if(!GetVarOffsetReadOnly( Parameter, &RelativeVar, resultType )) return;
+
+	int beforeType = resultType.GetBasicType();
+
+	resultType.PtrLevelUp();
+
+	SetVarPtrToReg(REG_RAX,&RelativeVar);
+
+	// TODO: 取り除く（この動きはObjPtrに託す）
+	/*
+	if( beforeType == DEF_OBJECT && lstrcmpi( Parameter, "This" ) != 0 ){
+		//参照をオブジェクトポインタに変更
+
+		//mov rax,qword ptr[rax]
+		op_mov_RM( sizeof(_int64), REG_RAX, REG_RAX, 0, MOD_BASE );
+
+		SetError(-120,NULL,cp);
+	}*/
+}
+void Opcode_Func_ObjPtr( const char *Parameter, Type &resultType, bool isCallOn ){
+	if( isCallOn == false ){
+		// 戻り値の型を取得するだけ
+
+		//変数のアドレスを取得
+		if(!GetVarType( Parameter, resultType, true )) return;
+
+		resultType.PtrLevelUp();
+
+		return;
+	}
+
+	RELATIVE_VAR RelativeVar;
+
+	//変数のアドレスを取得
+	if(!GetVarOffsetReadOnly( Parameter, &RelativeVar, resultType )) return;
+
+	int beforeType = resultType.GetBasicType();
+
+	resultType.PtrLevelUp();
+
+	SetVarPtrToReg(REG_RAX,&RelativeVar);
+
+	if( lstrcmpi( Parameter, "This" )==0 ){
+		// Thisの場合は特別にオブジェクトポインタが返ってくるので、何もせずに抜ける
+	}
+	else if( beforeType == DEF_OBJECT ){
+		//参照をオブジェクトポインタに変更
+
+		//mov rax,qword ptr[rax]
+		op_mov_RM( sizeof(_int64), REG_RAX, REG_RAX, 0, MOD_BASE );
+	}
+	else{
+		SetError(134,NULL,cp );
+	}
+}
+void Opcode_Func_GetPtrData( const char *Parameter, const int type ){
+	int reg=REG_RAX;
+	Type tempType;
+	if( !NumOpe(&reg,Parameter,Type(),tempType) ){
+		return;
+	}
+	if(!tempType.IsWhole()){
+		SetError(11,Parameter,cp);
+		return;
+	}
+
+	if(type==DEF_DOUBLE){
+		//movlpd xmm0,qword ptr[rax]
+		op_movlpd_RM(REG_XMM0,REG_RAX,0,MOD_BASE);
+	}
+	else if(type==DEF_SINGLE){
+		//movss xmm0,dword ptr[rax]
+		op_movss_RM(REG_XMM0,REG_RAX,0,MOD_BASE);
+	}
+	else{
+		//mov rax,ptr[rax]
+		op_mov_RM(GetTypeSize(type,-1),REG_RAX,REG_RAX,0,MOD_BASE);
+	}
+}
+
+bool Opcode_CallFunc( const char *Parameter, const int FuncNum, Type &resultType, bool isCallOn ){
+	switch(FuncNum){
+		case FUNC_LEN:
+			if( isCallOn ) Opcode_Func_Len(Parameter);
+			resultType.SetBasicType( DEF_LONG );
+			break;
+		case FUNC_ADDRESSOF:
+			if( isCallOn ) Opcode_Func_AddressOf(Parameter);
+			resultType.SetBasicType( DEF_PTR_VOID );
+			break;
+		case FUNC_SIZEOF:
+			if( isCallOn ) Opcode_Func_SizeOf(Parameter);
+			resultType.SetBasicType( DEF_LONG );
+			break;
+		case FUNC_VARPTR:
+			Opcode_Func_VarPtr( Parameter, resultType, isCallOn );
+			break;
+		case FUNC_OBJPTR:
+			Opcode_Func_ObjPtr( Parameter, resultType, isCallOn );
+			break;
+
+		case FUNC_GETDOUBLE:
+			if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_DOUBLE);
+			resultType.SetBasicType( DEF_DOUBLE );
+			break;
+		case FUNC_GETSINGLE:
+			if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_SINGLE);
+			resultType.SetBasicType( DEF_SINGLE );
+			break;
+		case FUNC_GETQWORD:
+			if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_QWORD);
+			resultType.SetBasicType( DEF_QWORD );
+			break;
+		case FUNC_GETDWORD:
+			if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_DWORD);
+			resultType.SetBasicType( DEF_DWORD );
+			break;
+		case FUNC_GETWORD:
+			if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_WORD);
+			resultType.SetBasicType( DEF_WORD );
+			break;
+		case FUNC_GETBYTE:
+			if( isCallOn ) Opcode_Func_GetPtrData(Parameter,DEF_BYTE);
+			resultType.SetBasicType( DEF_BYTE );
+			break;
+		default:
+			return false;
+	}
+	return true;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/Compile_Interface.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Compile_Interface.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Compile_Interface.cpp	(revision 178)
@@ -0,0 +1,6 @@
+#include "../BasicCompiler_Common/common.h"
+#include "opcode.h"
+
+bool CastToInterface( int reg, int vtblReg, const CClass &baseClass, const CClass &interfaceClass ){
+	return true;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/Compile_Object.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Compile_Object.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Compile_Object.cpp	(revision 178)
@@ -0,0 +1,309 @@
+#include "../BasicCompiler_Common/common.h"
+#include "opcode.h"
+
+void _call_constructor( const CClass *pobj_c,const char *CreateParameter,int ObjectSize,BOOL bSomeObjects){
+	////////////////////////////
+	// コンストラクタの呼び出し
+	////////////////////////////
+	
+	//この関数を使用する場合は、
+	//・ebxにオブジェクトの個数（複数個の場合のみ）
+	//・スタックフレームの先頭参照位置に先頭Thisポインタ
+	//をセットしておかなければならない
+
+	int jnz_back;
+
+
+	//jnzの番地
+	jnz_back=obp;
+
+	if(bSomeObjects){
+		SetError();
+		//mov qword ptr[rsp+offset],rbx     ※スタックフレームを利用
+		pobj_sf->push(REG_RBX);
+
+		// ※ここでプッシュされた値はコンストラクタのthisポインタとなる
+		//mov qword ptr[rsp+offset],rax     ※スタックフレームを利用
+		pobj_sf->push(REG_RAX);
+	}
+
+
+	////////////////////////
+	// オーバーロードを解決
+	////////////////////////
+
+	std::vector<UserProc *> subs;
+	pobj_c->GetMethods().Enum( pobj_c->GetName().c_str(), subs );
+
+	UserProc *pUserProc;
+	if( subs.size() > 0 ){
+		//オーバーロードを解決
+		pUserProc=OverloadSolutionWithStrParam(pobj_c->GetName().c_str(),
+			subs,CreateParameter,"");
+
+		if(!pUserProc) return;
+	}
+
+	//コンストラクタを呼び出す
+	Opcode_CallProc(CreateParameter,
+		pUserProc,
+		PROCFLAG_NEW,"",0);
+
+	{
+		// 動的型情報をセットする
+		// obj._System_SetType( _System_TypeBase.Search( strNamespace, name ) )
+		subs.clear();
+		pobj_c->GetMethods().Enum( "_System_SetType", subs );
+		if( subs.size() == 1 ){
+			char temporary[VN_SIZE];
+			sprintf( temporary, "ActiveBasic.Core._System_TypeBase.Search(\"\",\"%s\"))", pobj_c->GetName().c_str() );
+
+			Opcode_CallProc(temporary,
+				subs[0],
+				PROCFLAG_NEW,"",0);
+		}
+		else{
+			SetError();
+		}
+	}
+
+	if(bSomeObjects){
+		//mov rax,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_RAX);
+
+		//mov rbx,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_RBX);
+
+		//add eax,TypeSize
+		OpBuffer[obp++]=(char)0x05;
+		*((long *)(OpBuffer+obp))=ObjectSize;
+		obp+=sizeof(long);
+
+		//sub ebx,1
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xEB;
+		OpBuffer[obp++]=(char)0x01;
+
+		//jnz ↑
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x85;
+		*((long *)(OpBuffer+obp))=jnz_back-(obp+sizeof(long));
+		obp+=sizeof(long);
+	}
+}
+void Operator_New( const CClass &classObj, const char *objectSizeStr, const char *parameter, const Type &baseType ){
+	int typeSize = classObj.GetSize();
+
+	if(classObj.IsAbstract()){
+		//抽象クラスだったとき
+		SetError(125,classObj.GetName().c_str(),cp);
+	}
+
+	BOOL bSomeObjects=0;
+	if(objectSizeStr[0]){
+		bSomeObjects=1;
+
+		int reg=REG_RAX;
+		Type tempType;
+		NumOpe(&reg,objectSizeStr,Type(),tempType);
+		if( !tempType.IsWhole() ) SetError(49,NULL,cp);
+
+		//※添え字上限値であることを考慮
+		//add rax,1
+		op_add_RV(REG_RAX,1);
+
+		//オブジェクトの個数をrbxに一時保持
+		//※rbxは関数が呼ばれても不変
+		//mov rbx,rax
+		op_mov_RR(REG_RBX,REG_RAX);
+
+		//imul rax,size
+		op_imul_RV(sizeof(_int64),REG_RAX,typeSize);
+
+		//add rax,OBJECT_HEAD_SIZE
+		op_add_RV(REG_RAX,OBJECT_HEAD_SIZE);
+
+		//mov rcx,rax
+		op_mov_RR(REG_RCX,REG_RAX);
+	}
+	else{
+		//オブジェクトの個数をrbxに一時保持
+		//※rbxは関数が呼ばれても不変
+		//mov rbx,1
+		op_mov_RV(sizeof(_int64),REG_RBX,1);
+
+		//mov rcx,typeSize+OBJECT_HEAD_SIZE
+		op_mov_RV(sizeof(_int64),REG_RCX,typeSize+OBJECT_HEAD_SIZE);
+	}
+
+	if( baseType.IsObject() ){
+		// オブジェクト インスタンス
+		// ※DeleteはGCで処理
+
+		//call _System_GC_malloc_ForObject
+		extern UserProc *pSub_System_GC_malloc_ForObject;
+		op_call(pSub_System_GC_malloc_ForObject);
+	}
+	else{
+		// オブジェクトポインタ
+		// ※明示的なDeleteが必要
+
+		//call _System_GC_malloc_ForObjectPtr
+		extern UserProc *pSub_System_GC_malloc_ForObjectPtr;
+		op_call(pSub_System_GC_malloc_ForObjectPtr);
+	}
+
+
+	/*
+	確保されたヒープ領域のポインタ（callocの戻り値eax）をpPtrとすると、
+	pPtr-=OBJECT_HEAD_SIZE ... ( sizeof(DWORD)*4 )
+	pPtr[0]=オブジェクトの個数
+	pPtr[1]=オブジェクトのサイズ
+	pPtr[2]=デストラクタの関数ポインタ
+	pPtr[3]=reserve
+	*/
+
+
+	//mov qword ptr[rax],rbx（オブジェクトの個数）
+	op_mov_MR(sizeof(_int64),REG_RBX,REG_RAX,0,MOD_BASE);
+
+	//add rax,PTR_SIZE
+	op_add_RV(REG_RAX,PTR_SIZE);
+
+
+	//mov qword ptr[rax],typeSize（オブジェクトのサイズ）
+	op_mov_MV(sizeof(_int64),REG_RAX,0,NON_OFFSET,typeSize);
+
+	//add rax,PTR_SIZE
+	op_add_RV(REG_RAX,PTR_SIZE);
+
+
+	const CMethod *method = classObj.GetDestructorMethod();
+	if( method == NULL ) return;
+
+	//mov rcx,DestructorProcAddr（デストラクタの関数ポインタ）
+	op_mov_RV(sizeof(_int64),REG_RCX,0);
+	obp-=sizeof(long);
+	pobj_SubAddrSchedule->add(method->pUserProc,0);
+	method->pUserProc->Using();
+	obp+=sizeof(long);
+
+	//mov qword ptr[rax],rcx
+	op_mov_MR(sizeof(_int64),REG_RCX,REG_RAX,0,MOD_BASE);
+
+	//add rax,PTR_SIZE
+	op_add_RV(REG_RAX,PTR_SIZE);
+
+
+	// リザーブ領域
+	//add rax,PTR_SIZE
+	op_add_RV(REG_RAX,PTR_SIZE);
+
+
+	// ※ここでプッシュされた値はNew演算子の戻り値となる
+	//mov qword ptr[rsp+offset],rax     ※スタックフレームを利用
+	pobj_sf->push(REG_RAX);
+
+
+	/////////////////////////////////////////////////////////////////////
+
+	////////////////////////////
+	// コンストラクタの呼び出し
+	////////////////////////////
+
+	_call_constructor(&classObj,parameter,typeSize,bSomeObjects);
+
+
+	//mov rax,qword ptr[rsp+offset]     ※スタックフレームを利用
+	pobj_sf->pop(REG_RAX);
+}
+void OpcodeDelete(const char *Parameter, bool isSweeping){
+	int reg=REG_RAX;
+	Type tempType;
+	if( !NumOpe(&reg,Parameter,Type(),tempType) ){
+		return;
+	}
+	if(!( tempType.IsObjectPtr() || tempType.IsVoidPtr() )) SetError(122,NULL,cp);
+
+	//sub rax,OBJECT_HEAD_SIZE
+	op_sub_RV(sizeof(_int64),REG_RAX,OBJECT_HEAD_SIZE);
+
+	//mov qword ptr[rsp+offset],rax     ※スタックフレームを利用
+	pobj_sf->push(REG_RAX);
+
+
+	//mov rbx,qword ptr[rax]（オブジェクトの個数）
+	op_mov_RM(sizeof(_int64),REG_RBX,REG_RAX,0,MOD_BASE);
+
+	//add rax,PTR_SIZE
+	op_add_RV(REG_RAX,PTR_SIZE);
+
+
+	//mov rsi,qword ptr[rax]（オブジェクトのサイズ）
+	op_mov_RM(sizeof(_int64),REG_RSI,REG_RAX,0,MOD_BASE);
+
+	//add rax,PTR_SIZE
+	op_add_RV(REG_RAX,PTR_SIZE);
+
+
+	//mov rdi,qword ptr[rax]（デストラクタの関数ポインタ）
+	op_mov_RM(sizeof(_int64),REG_RDI,REG_RAX,0,MOD_BASE);
+
+	//add rax,PTR_SIZE
+	op_add_RV(REG_RAX,PTR_SIZE);
+
+
+	// リザーブ領域
+	//add rax,PTR_SIZE
+	op_add_RV(REG_RAX,PTR_SIZE);
+
+
+	//mov rcx,rax
+	op_mov_RR(REG_RCX,REG_RAX);
+
+
+	//jnzの番地
+	int jnz_back;
+	jnz_back=obp;
+
+	//mov qword ptr[rsp+offset],rcx     ※スタックフレームを利用
+	pobj_sf->push(REG_RCX);
+
+	//call rdi
+	OpBuffer[obp++]=(char)0xFF;
+	OpBuffer[obp++]=(char)0xD7;
+
+	//mov rcx,qword ptr[rsp+offset]     ※スタックフレームを利用
+	pobj_sf->pop(REG_RCX);
+
+	//add rcx,rsi
+	op_add64_reg(REG_RCX,REG_RSI);
+
+	//sub rbx,1
+	op_sub_RV(sizeof(_int64),REG_RBX,1);
+
+	//jnz ↑
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x85;
+	*((long *)(OpBuffer+obp))=jnz_back-(obp+sizeof(long));
+	obp+=sizeof(long);
+
+
+	//////////////////////////////////////////
+	// オブジェクトメンバ変数用のメモリを解放
+	//////////////////////////////////////////
+
+	//mov rcx,qword ptr[rsp+offset]     ※スタックフレームを利用
+	pobj_sf->pop(REG_RCX);
+
+	if( isSweeping ){
+		//call _System_GC_free_for_SweepingDelete
+		extern UserProc *pSub_System_GC_free_for_SweepingDelete;
+		op_call(pSub_System_GC_free_for_SweepingDelete);
+	}
+	else{
+		//call free
+		extern UserProc *pSub_free;
+		op_call(pSub_free);
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/Compile_ProcOp.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Compile_ProcOp.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Compile_ProcOp.cpp	(revision 178)
@@ -0,0 +1,867 @@
+#include <Program.h>
+
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void SystemProc( const UserProc &userProc ){
+	if( userProc.GetName() == "_System_GetEip" ){
+		//mov rax,qword ptr[rsp]
+		op_mov_RM(sizeof(_int64),REG_RAX,REG_RSP,0,MOD_BASE);
+
+		//ret
+		op_ret();
+	}
+	else if( userProc.GetName() == "_System_InitDllGlobalVariables" ){
+		////////////////////////////////////////
+		// DLLのグローバル領域をコンパイル
+		////////////////////////////////////////
+		extern BOOL bDll;
+		if(!bDll){
+			//ret
+			op_ret();
+
+			return;
+		}
+
+		UserProc *pBackUserProc;
+		pBackUserProc = &UserProc::CompilingUserProc();
+		UserProc::CompileStartForGlobalArea();
+
+		int BackCp;
+		BackCp=cp;
+		cp=-1;
+
+		//sub rsp,スタックフレームサイズ
+		int StackFrameSchedule;
+		op_sub_rsp(0xFFFFFFFF);
+		StackFrameSchedule=obp-sizeof(long);
+
+		extern BOOL bDebugCompile;
+		if(bDebugCompile){
+			//デバッグ用の変数を定義
+			DebugVariable();
+		}
+
+		//GC用の変数を定義
+		InitGCVariables();
+
+		//_System_StartupProgramの呼び出し
+		extern UserProc *pSub_System_StartupProgram;
+		op_call(pSub_System_StartupProgram);
+
+		//クラスに属する静的メンバを定義
+		CMember::InitStaticMember();
+
+		GetGlobalDataForDll();
+
+		//add rsp,スタックフレームサイズ
+		op_add_RV(REG_RSP,pobj_sf->GetFrameSize());
+
+		//スタックフレームスケジュール（subコマンドに渡す値）
+		*((long *)(OpBuffer+StackFrameSchedule))=pobj_sf->GetFrameSize();
+
+		UserProc::CompileStartForUserProc( pBackUserProc );
+		cp=BackCp;
+
+		//ret
+		op_ret();
+	}
+	else if( userProc.GetName() == "_System_InitStaticLocalVariables" ){
+		//静的ローカルオブジェクトのコンストラクタ呼び出し
+
+		//sub rsp,スタックフレームサイズ
+		int StackFrameSchedule;
+		op_sub_rsp(0xFFFFFFFF);
+		StackFrameSchedule=obp-sizeof(long);
+
+		foreach( Variable *pVar, globalVars ){
+			if(memicmp(pVar->GetName().c_str(),"Static%",7)==0){
+				//コンストラクタ呼び出し
+				if( pVar->IsObject() ){
+
+					//エラー用
+					cp=pVar->source_code_address;
+
+					CallConstructor(
+						pVar->GetName().c_str(),
+						pVar->GetSubScriptsPtr(),
+						*pVar,
+						pVar->paramStrForConstructor.c_str());
+				}
+			}
+		}
+
+		//add rsp,スタックフレームサイズ
+		op_add_RV(REG_RSP,pobj_sf->GetFrameSize());
+
+		//スタックフレームスケジュール（subコマンドに渡す値）
+		*((long *)(OpBuffer+StackFrameSchedule))=pobj_sf->GetFrameSize();
+
+		//ret
+		op_ret();
+	}
+	else if( userProc.GetName() == "_System_Call_Destructor_of_GlobalObject" ){
+		//sub rsp,8（※RSPを16バイト境界にあわせるため）
+		op_sub_rsp(0x8);
+
+
+		UserProc *pBackUserProc;
+		pBackUserProc = &UserProc::CompilingUserProc();
+		UserProc::CompileStartForGlobalArea();
+
+		obj_LexScopes.CallDestructorsOfScopeEnd();
+
+		UserProc::CompileStartForUserProc( pBackUserProc );
+
+
+		//add rsp,8
+		op_add_RV(REG_RSP,0x8);
+
+		//ret
+		op_ret();
+	}
+	else if( userProc.GetName() == "_System_GetSp" ){
+		//mov rax,rsp
+		op_mov_RR(REG_RAX,REG_RSP);
+
+		//add rax,PTR_SIZE
+		op_add_RV(REG_RAX,PTR_SIZE);
+
+		//ret
+		op_ret();
+	}
+	else if( userProc.GetName() == "_allrem" ){
+		//乗除演算用の特殊関数（64ビット整数対応）
+		BYTE Buffer_allrem[]={
+			0x53,0x57,0x33,0xFF,0x8B,0x44,0x24,0x10,0x0B,0xC0,0x7D,0x14,0x47,0x8B,0x54,0x24,0x0C,0xF7,0xD8,0xF7,0xDA,0x83,0xD8,0x00,0x89,0x44,0x24,0x10,0x89,0x54,0x24,0x0C,0x8B,0x44,0x24,0x18,0x0B,0xC0,0x7D,0x13,0x8B,0x54,0x24,0x14,0xF7,0xD8,0xF7,0xDA,0x83,0xD8,0x00,0x89,0x44,0x24,0x18,0x89,0x54,0x24,0x14,0x0B,0xC0,0x75,0x1B,0x8B,0x4C,0x24,0x14,0x8B,0x44,0x24,0x10,0x33,0xD2,0xF7,0xF1,0x8B,0x44,0x24,0x0C,0xF7,0xF1,0x8B,0xC2,0x33,0xD2,0x4F,0x79,0x4E,0xEB,0x53,0x8B,0xD8,0x8B,0x4C,0x24,0x14,0x8B,0x54,0x24,0x10,0x8B,0x44,0x24,0x0C,0xD1,0xEB,0xD1,0xD9,0xD1,0xEA,0xD1,0xD8,0x0B,0xDB,0x75,0xF4,0xF7,0xF1,0x8B,0xC8,0xF7,0x64,0x24,0x18,0x91,0xF7,0x64,0x24,0x14,0x03,0xD1,0x72,0x0E,0x3B,0x54,0x24,0x10,0x77,0x08,0x72,0x0E,0x3B,0x44,0x24,0x0C,0x76,0x08,0x2B,0x44,0x24,0x14,0x1B,0x54,0x24,0x18,0x2B,0x44,0x24,0x0C,0x1B,0x54,0x24,0x10,0x4F,0x79,0x07,0xF7,0xDA,0xF7,0xD8,0x83,0xDA,0x00,0x5F,0x5B,0xC2,0x10,0x00
+		};
+
+		memcpy(OpBuffer+obp,Buffer_allrem,178);
+		obp+=178;
+	}
+	else if( userProc.GetName() == "_allmul" ){
+		//乗算用の特殊関数（64ビット整数対応）
+		BYTE Buffer_allmul[]={
+			0x8B,0x44,0x24,0x08,0x8B,0x4C,0x24,0x10,0x0B,0xC8,0x8B,0x4C,0x24,0x0C,0x75,0x09,0x8B,0x44,0x24,0x04,0xF7,0xE1,0xC2,0x10,0x00,0x53,0xF7,0xE1,0x8B,0xD8,0x8B,0x44,0x24,0x08,0xF7,0x64,0x24,0x14,0x03,0xD8,0x8B,0x44,0x24,0x08,0xF7,0xE1,0x03,0xD3,0x5B,0xC2,0x10,0x00
+		};
+
+		memcpy(OpBuffer+obp,Buffer_allmul,52);
+		obp+=52;
+	}
+	else if( userProc.GetName() == "_alldiv" ){
+		//除算用の特殊関数（64ビット整数対応）
+		BYTE Buffer_alldiv[]={
+			0x57,0x56,0x53,0x33,0xFF,0x8B,0x44,0x24,0x14,0x0B,0xC0,0x7D,0x14,0x47,0x8B,0x54,0x24,0x10,0xF7,0xD8,0xF7,0xDA,0x83,0xD8,0x00,0x89,0x44,0x24,0x14,0x89,0x54,0x24,0x10,0x8B,0x44,0x24,0x1C,0x0B,0xC0,0x7D,0x14,0x47,0x8B,0x54,0x24,0x18,0xF7,0xD8,0xF7,0xDA,0x83,0xD8,0x00,0x89,0x44,0x24,0x1C,0x89,0x54,0x24,0x18,0x0B,0xC0,0x75,0x18,0x8B,0x4C,0x24,0x18,0x8B,0x44,0x24,0x14,0x33,0xD2,0xF7,0xF1,0x8B,0xD8,0x8B,0x44,0x24,0x10,0xF7,0xF1,0x8B,0xD3,0xEB,0x41,0x8B,0xD8,0x8B,0x4C,0x24,0x18,0x8B,0x54,0x24,0x14,0x8B,0x44,0x24,0x10,0xD1,0xEB,0xD1,0xD9,0xD1,0xEA,0xD1,0xD8,0x0B,0xDB,0x75,0xF4,0xF7,0xF1,0x8B,0xF0,0xF7,0x64,0x24,0x1C,0x8B,0xC8,0x8B,0x44,0x24,0x18,0xF7,0xE6,0x03,0xD1,0x72,0x0E,0x3B,0x54,0x24,0x14,0x77,0x08,0x72,0x07,0x3B,0x44,0x24,0x10,0x76,0x01,0x4E,0x33,0xD2,0x8B,0xC6,0x4F,0x75,0x07,0xF7,0xDA,0xF7,0xD8,0x83,0xDA,0x00,0x5B,0x5E,0x5F,0xC2,0x10,0x00
+		};
+
+		memcpy(OpBuffer+obp,Buffer_alldiv,170);
+		obp+=170;
+	}
+	else if( userProc.GetName() == "_allshl" ){
+		//符号あり左ビットシフト用の特殊関数（64ビット整数対応）
+		BYTE Buffer_allshl[]={
+			0x80,0xF9,0x40,0x73,0x15,0x80,0xF9,0x20,0x73,0x06,0x0F,0xA5,0xC2,0xD3,0xE0,0xC3,0x8B,0xD0,0x33,0xC0,0x80,0xE1,0x1F,0xD3,0xE2,0xC3,0x33,0xC0,0x33,0xD2,0xC3
+		};
+
+		memcpy(OpBuffer+obp,Buffer_allshl,31);
+		obp+=31;
+	}
+	else if( userProc.GetName() == "_allshr" ){
+		//符号あり右ビットシフト用の特殊関数（64ビット整数対応）
+		BYTE Buffer_allshr[]={
+			0x80,0xF9,0x40,0x73,0x16,0x80,0xF9,0x20,0x73,0x06,0x0F,0xAD,0xD0,0xD3,0xFA,0xC3,0x8B,0xC2,0xC1,0xFA,0x1F,0x80,0xE1,0x1F,0xD3,0xF8,0xC3,0xC1,0xFA,0x1F,0x8B,0xC2,0xC3
+		};
+
+		memcpy(OpBuffer+obp,Buffer_allshr,33);
+		obp+=33;
+	}
+	else if( userProc.GetName() == "_aullshr" ){
+		//符号なし右ビットシフト用の特殊関数（64ビット整数対応）
+		BYTE Buffer_aullshr[]={
+			0x80,0xF9,0x40,         //cmp         cl,40h
+			0x73,0x15,              //jae         RETZERO (0040d71a)
+			0x80,0xF9,0x20,         //cmp         cl,20h
+			0x73,0x06,              //jae         MORE32 (0040d710)
+			0x0F,0xAD,0xD0,         //shrd        eax,edx,cl
+			0xD3,0xEA,              //shr         edx,cl
+			0xC3,                   //ret
+			//MORE32:
+			0x8B,0xC2,              //mov         eax,edx
+			0x33,0xD2,              //xor         edx,edx
+			0x80,0xE1,0x1F,         //and         cl,1Fh
+			0xD3,0xE8,              //shr         eax,cl
+			0xC3,                   //ret
+			//RETZERO:
+			0x33,0xC0,              //xor         eax,eax
+			0x33,0xD2,              //xor         edx,edx
+			0xC3                    //ret
+		};
+
+		memcpy(OpBuffer+obp,Buffer_aullshr,31);
+		obp+=31;
+	}
+	else{
+		SetError();
+	}
+}
+void AutoGeneration(UserProc &userProc){
+	if( userProc.GetName() == "InitializeUserTypes"
+		&& userProc.HasParentClass()
+		&& userProc.GetParentClass().GetName() == "_System_TypeBase" ){
+
+			pobj_DBClass->Compile_System_InitializeUserTypes();
+	}
+	else if( userProc.GetName() == "RegisterGlobalRoots"
+		&& userProc.HasParentClass()
+		&& userProc.GetParentClass().GetName() == "_System_CGarbageCollection" ){
+
+			Compile_AddGlobalRootsForGc();
+	}
+	else{
+		SetError();
+	}
+}
+void _compile_proc(UserProc *pUserProc){
+	extern char *basbuf;
+	extern HANDLE hHeap;
+	extern GlobalProc **ppSubHash;
+	extern BOOL bDebugCompile;
+	int i3,i4;
+	char temporary[VN_SIZE];
+
+	if( pUserProc->IsUsing() == false || pUserProc->IsCompiled() ) return;
+
+	if( pUserProc->localVars.size() ){
+		SetError();
+		return;
+	}
+
+	pUserProc->CompleteCompile();
+
+	extern BOOL bSystemProc;
+	if(memcmp(pUserProc->GetName().c_str(),"_System_",8)==0) bSystemProc=1;
+	else bSystemProc=0;
+
+	extern BOOL bDebugSupportProc;
+	if(memcmp(pUserProc->GetName().c_str(),"_DebugSys_",10)==0){
+		if(!bDebugCompile){
+			return;
+		}
+		bDebugSupportProc=1;
+	}
+	else bDebugSupportProc=0;
+
+	pUserProc->beginOpAddress=obp;
+
+	//コンパイル中の関数が属するクラス
+	pobj_CompilingClass=pUserProc->GetParentClassPtr();
+
+	//コンパイルスタートをクラス管理クラスに追加
+	pobj_DBClass->StartCompile( pUserProc );
+
+	//コンパイル中の関数
+	UserProc::CompileStartForUserProc( pUserProc );
+
+	// コンパイル中の関数が属する名前空間
+	Smoothie::Lexical::liveingNamespaceScopes = pUserProc->GetNamespaceScopes();
+
+	// コンパイル中の関数でImportsされている名前空間
+	Smoothie::Temp::importedNamespaces = pUserProc->GetImportedNamespaces();
+
+	if(pUserProc->IsSystem()){
+		////////////////////
+		// 特殊関数
+		////////////////////
+
+		extern int AllLocalVarSize;
+		AllLocalVarSize=0;
+
+		//スタックフレーム管理用オブジェクトを初期化
+		extern CStackFrame *pobj_sf;
+		pobj_sf=new CStackFrame();
+
+		SystemProc(*pUserProc);
+
+		//スタックフレーム管理用オブジェクトを破棄
+		delete pobj_sf;
+		pobj_sf=0;
+
+		pUserProc->endOpAddress=obp;
+		return;
+	}
+
+	cp=pUserProc->GetCodePos();
+	for(;;cp++){
+		if(IsCommandDelimitation(basbuf[cp])) break;
+	}
+	cp--;
+
+	//プロシージャ抜け出しスケジュール（Exit Sub/Function）
+	extern DWORD *pExitSubSchedule;
+	extern int ExitSubScheduleNum;
+	pExitSubSchedule=(DWORD *)HeapAlloc(hHeap,0,1);
+	ExitSubScheduleNum=0;
+
+	//ラベル用のメモリを確保
+	extern LABEL *pLabelNames;
+	extern int MaxLabelNum;
+	pLabelNames=(LABEL *)HeapAlloc(hHeap,0,1);
+	MaxLabelNum=0;
+
+	//Gotoラベルスケジュール
+	extern GOTOLABELSCHEDULE *pGotoLabelSchedule;
+	extern int GotoLabelScheduleNum;
+	pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapAlloc(hHeap,0,1);
+	GotoLabelScheduleNum=0;
+
+	//With情報のメモリを確保
+	extern WITHINFO WithInfo;
+	WithInfo.ppName=(char **)HeapAlloc(hHeap,0,1);
+	WithInfo.pWithCp=(int *)HeapAlloc(hHeap,0,1);
+	WithInfo.num=0;
+
+	//重複エラー情報管理のメモリを確保
+	extern char **SynonymErrorWords;
+	extern int SynonymErrorNum;
+	SynonymErrorNum=0;
+	SynonymErrorWords=(char **)HeapAlloc(hHeap,0,1);
+
+	//Continueアドレスを初期化
+	extern DWORD dwContinueAddress;
+	dwContinueAddress=-1;
+
+	//ローカル変数に関する情報
+	extern int AllLocalVarSize;
+	AllLocalVarSize=0;
+
+	//ローカル変数アドレススケジュール
+	extern DWORD *pLocalVarAddrSchedule;
+	extern int LocalVarAddrScheduleNum;
+	pLocalVarAddrSchedule=(DWORD *)HeapAlloc(hHeap,0,1);
+	LocalVarAddrScheduleNum=0;
+
+	//レキシカルスコープ情報を初期化
+	obj_LexScopes.Init(obp);
+
+
+	/////////////////////////////////////
+	// パラメータ用の変数データを考慮
+	/////////////////////////////////////
+
+	//パラメータ用の変数データを考慮
+	for(i3=(int)pUserProc->RealParams().size()-1;i3>=0;i3--){
+		Parameter &param = *pUserProc->RealParams()[i3];
+
+		Variable *pVar = new Variable( param.GetVarName(), param, false, param.IsRef() );
+
+		if( param.IsArray() ){
+			pVar->SetArray( param.GetSubScriptsPtr() );
+		}
+
+		int varSize;
+		if( param.IsRef() == false && param.IsStruct() ){
+			//構造体のByValパラメータ
+			pVar->ThisIsParameter();
+			varSize=PTR_SIZE;
+		}
+		else{
+			if( param.IsArray() == false ){
+				varSize = pVar->GetMemorySize();
+			}
+			else{
+				varSize=PTR_SIZE;
+			}
+		}
+		AllLocalVarSize+=varSize;
+		pVar->offset=AllLocalVarSize;
+
+		//レキシカルスコープ情報
+		pVar->ScopeLevel=obj_LexScopes.GetNowLevel();
+		pVar->ScopeStartAddress=obj_LexScopes.GetStartAddress();
+		pVar->bLiving=TRUE;
+
+		pUserProc->localVars.push_back( pVar );
+	}
+
+	//Thisポインタを示すローカルオフセット値をセット
+	extern int LocalVar_ThisPtrOffset;
+	LocalVar_ThisPtrOffset=AllLocalVarSize;
+
+	//スタックフレーム管理用クラスを初期化
+	extern CStackFrame *pobj_sf;
+	pobj_sf=new CStackFrame();
+
+
+	///////////////////////
+	// ここからコード生成
+
+	for(i3=(int)pUserProc->RealParams().size()-1;i3>=0;i3--){
+		Parameter &param = *pUserProc->RealParams()[i3];
+		if(i3==3){
+			if(param.IsReal()&&param.IsRef() == false){
+				//movsd qword ptr[rsp+0x20],xmm3
+				op_movsd_MR(REG_XMM3,REG_RSP,0x20,MOD_BASE_DISP32);
+			}
+			else{
+				//mov qword ptr[rsp+0x20],r9
+				op_mov_MR(sizeof(_int64),REG_R9,REG_RSP,0x20,MOD_BASE_DISP32);
+			}
+		}
+		if(i3==2){
+			if(param.IsReal()&&param.IsRef() == false){
+				//movsd qword ptr[rsp+0x18],xmm2
+				op_movsd_MR(REG_XMM2,REG_RSP,0x18,MOD_BASE_DISP32);
+			}
+			else{
+				//mov qword ptr[rsp+0x18],r8
+				op_mov_MR(sizeof(_int64),REG_R8,REG_RSP,0x18,MOD_BASE_DISP32);
+			}
+		}
+		if(i3==1){
+			if(param.IsReal()&&param.IsRef() == false){
+				//movsd qword ptr[rsp+0x10],xmm1
+				op_movsd_MR(REG_XMM1,REG_RSP,0x10,MOD_BASE_DISP32);
+			}
+			else{
+				//mov qword ptr[rsp+0x10],rdx
+				op_mov_MR(sizeof(_int64),REG_RDX,REG_RSP,0x10,MOD_BASE_DISP32);
+			}
+		}
+		if(i3==0){
+			if(param.IsReal()&&param.IsRef() == false){
+				//movsd qword ptr[rsp+0x8],xmm0
+				op_movsd_MR(REG_XMM0,REG_RSP,0x8,MOD_BASE_DISP32);
+			}
+			else{
+				//mov qword ptr[rsp+0x8],rcx
+				op_mov_MR(sizeof(_int64),REG_RCX,REG_RSP,0x8,MOD_BASE_DISP32);
+			}
+		}
+	}
+
+	//ret用のアドレスを考慮
+	AllLocalVarSize+=sizeof(_int64);
+
+	//sub rsp,スタックフレームサイズ
+	int StackFrameSchedule;
+	op_sub_rsp(0xFFFFFFFF);
+	StackFrameSchedule=obp-sizeof(long);
+
+	//mov qword ptr[rsp+offset],reg     ※スタックフレームを利用
+	pobj_sf->push(REG_RBX);
+	pobj_sf->push(REG_RSI);
+	pobj_sf->push(REG_RDI);
+	pobj_sf->push(REG_R12);
+	pobj_sf->push(REG_R13);
+	pobj_sf->push(REG_R14);
+	pobj_sf->push(REG_R15);
+
+	//ローカル変数のベース値
+	int BaseLocalVar;
+	BaseLocalVar=AllLocalVarSize;
+
+	if( !pUserProc->ReturnType().IsNull() ){
+		//戻り値が存在するとき
+
+		const char *temp = pUserProc->GetName().c_str();
+		if( temp[0]==1&&temp[1]==ESC_OPERATOR ){
+			temp = "_System_ReturnValue";
+		}
+
+		if( pUserProc->ReturnType().IsStruct() ){
+			//戻り値用の構造体（値型）はパラメータで引き渡される
+		}
+		else{
+			if( pUserProc->ReturnType().IsObject() ){
+				sprintf(temporary,"%s=Nothing%c%c%s",temp,1,ESC_AS, pUserProc->ReturnType().ToString().c_str() );
+			}
+			else{
+				//戻り値用の変数の定義
+				sprintf(temporary,"%s%c%c%s",temp,1,ESC_AS, pUserProc->ReturnType().ToString().c_str() );
+			}
+
+			OpcodeDim(temporary,0);
+		}
+	}
+
+	int RspOffsetSchedule=0;
+	int RspOffsetSchedule2;
+	if(bDebugCompile&&bDebugSupportProc==0){
+		//mov rdx, qword ptr[rsp+スタックフレームサイズ]
+		op_mov_RM(sizeof(_int64),REG_RDX,REG_RSP,0,MOD_BASE_DISP32);
+		RspOffsetSchedule=obp-sizeof(long);
+
+		//mov rcx,rsp
+		op_mov_RR(REG_RCX,REG_RSP);
+
+		//add rcx,スタックフレームサイズ+sizeof(_int64) ※ret用のサイズを考慮
+		op_add_RV(REG_RCX,0);
+		RspOffsetSchedule2=obp-sizeof(long);
+
+		//call _DebugSys_StartProc
+		extern UserProc *pSub_DebugSys_StartProc;
+		op_call(pSub_DebugSys_StartProc);
+	}
+
+	if(pobj_CompilingClass){
+		if( pUserProc->GetName() == pobj_CompilingClass->GetName() ){
+			////////////////////////////////////
+			// コンストラクタをコンパイルするとき
+			////////////////////////////////////
+
+			//コンストラクタのコンパイル開始を通知
+			pobj_CompilingClass->NotifyStartConstructorCompile();
+
+			//基底クラスかどうかの識別
+			//（継承元がインターフェイスの場合も基底クラスと見なす）
+			BOOL bThisIsSuperClass;
+			if(pobj_CompilingClass->pobj_InheritsClass==0) bThisIsSuperClass=1;
+			else if( pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod() == NULL ){
+				//インターフェイスを継承したときはコンストラクタを持たない
+				bThisIsSuperClass=1;
+			}
+			else bThisIsSuperClass=0;
+
+			if(!bThisIsSuperClass){
+				/* サブクラスコンストラクタをコンパイルしているときは、
+					基底クラスのコンストラクタを呼び出す */
+
+				i3=cp+1;
+				while(IsCommandDelimitation(basbuf[i3])) i3++;
+				for(i4=0;;i3++,i4++){
+					if(!IsVariableChar(basbuf[i3])){
+						temporary[i4]=0;
+						break;
+					}
+					temporary[i4]=basbuf[i3];
+				}
+				if( pobj_CompilingClass->pobj_InheritsClass->GetName() == temporary ){
+					//基底クラスのコンストラクタを呼び出す
+					cp=i3;
+					for(i4=0;;cp++,i4++){
+						if(IsCommandDelimitation(basbuf[cp])){
+							temporary[i4]=0;
+							break;
+						}
+						temporary[i4]=basbuf[cp];
+					}
+					if(!(temporary[0]=='('&&temporary[lstrlen(temporary)-1]==')')){
+						SetError(1,NULL,cp);
+					}
+					RemoveStringPare(temporary);
+
+					Type dummyType;
+					CallProc( PROC_DEFAULT
+						, pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc
+						, pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc->GetName().c_str()
+						, temporary
+						, dummyType );
+				}
+				else{
+					//基底クラスのコンストラクタを暗黙的に呼び出す
+					Opcode_CallProc("",
+						pobj_CompilingClass->pobj_InheritsClass->GetConstructorMethod()->pUserProc,
+						0,
+						"",
+						0);
+				}
+			}
+
+			//仮想関数テーブルを初期化
+			if( pobj_CompilingClass->IsExistVirtualFunctions()
+				&& !pobj_CompilingClass->IsAbstract() ){
+					//関数テーブルに値をセット
+					int offset = (int)pobj_CompilingClass->GetVtblGlobalOffset();
+
+					//mov rax,offset
+					op_mov_RV(sizeof(_int64),REG_RAX,offset);
+					obp-=sizeof(long);
+					pobj_DataTableSchedule->add();
+					obp+=sizeof(long);
+
+					//Thisポインタをrcxにコピー
+					SetThisPtrToReg(REG_RCX);
+
+					//mov qword ptr[rcx],rax
+					op_mov_MR(sizeof(_int64),REG_RAX,REG_RCX,0,MOD_BASE);
+			}
+		}
+		else if( pUserProc->IsDestructor() ){
+			//デストラクタをコンパイルしたとき
+
+			//デストラクタのコンパイル開始を通知
+			pobj_CompilingClass->NotifyStartDestructorCompile();
+		}
+	}
+
+	//////////////////////////////////////////
+	//////////////////////////////////////////
+	////// プロシージャ内をコンパイル ////////
+	if( pUserProc->IsAutoGeneration() ){
+		AutoGeneration( *pUserProc );
+	}
+	else{
+		if(pUserProc->IsMacro()){
+			CompileBuffer(ESC_ENDMACRO,0);
+		}
+		else{
+			if(pUserProc->IsSub()){
+				CompileBuffer(ESC_ENDSUB,0);
+			}
+			else if(pUserProc->IsFunction()){
+				CompileBuffer(ESC_ENDFUNCTION,0);
+			}
+		}
+	}
+	//////////////////////////////////////////
+	//////////////////////////////////////////
+
+	if( pobj_CompilingClass ){
+
+		if( pobj_CompilingClass->IsCompilingConstructor() ){
+			// コンストラクタをコンパイルしていたとき
+
+			// コンストラクタのコンパイルが完了したことを通知
+			pobj_CompilingClass->NotifyFinishConstructorCompile();
+		}
+		else if( pUserProc->IsDestructor() ){
+			////////////////////////////////////
+			//デストラクタをコンパイルしたとき
+			////////////////////////////////////
+
+			// デストラクタのコンパイルが完了したことを通知
+			pobj_CompilingClass->NotifyFinishDestructorCompile();
+
+			if(pobj_CompilingClass->pobj_InheritsClass){
+				/* サブクラスのデストラクタをコンパイルしているときは、
+					基底クラスのデストラクタを呼び出す */
+
+				const CMethod *method = pobj_CompilingClass->pobj_InheritsClass->GetDestructorMethod();
+				if( method ){
+					Opcode_CallProc("",
+						method->pUserProc,
+						0,
+						"",
+						0);
+				}
+			}
+		}
+	}
+
+	//ラベル用のメモリを解放
+	for(i3=0;i3<MaxLabelNum;i3++){
+		if(pLabelNames[i3].pName) HeapDefaultFree(pLabelNames[i3].pName);
+	}
+	HeapDefaultFree(pLabelNames);
+
+	//Goto未知ラベルスケジュールを解放
+	for(i3=0;i3<GotoLabelScheduleNum;i3++){
+		if(pGotoLabelSchedule[i3].pName){
+			SetError(6,pGotoLabelSchedule[i3].pName,pGotoLabelSchedule[i3].now_cp);
+			HeapDefaultFree(pGotoLabelSchedule[i3].pName);
+		}
+		else{
+			sprintf(temporary,"%d",pGotoLabelSchedule[i3].line);
+			SetError(6,temporary,pGotoLabelSchedule[i3].now_cp);
+		}
+	}
+	HeapDefaultFree(pGotoLabelSchedule);
+
+	//With情報のメモリを解放
+	for(i3=0;i3<WithInfo.num;i3++){
+		SetError(22,"With",WithInfo.pWithCp[i3]);
+		HeapDefaultFree(WithInfo.ppName[i3]);
+	}
+	HeapDefaultFree(WithInfo.ppName);
+	HeapDefaultFree(WithInfo.pWithCp);
+
+	//ローカルオブジェクト（レキシカルスコープレベル=0）の解放処理
+	obj_LexScopes.CallDestructorsOfScopeEnd();
+
+	//プロシージャ抜け出しスケジュール（Exit Sub/Function）
+	for(i3=0;i3<ExitSubScheduleNum;i3++){
+		*((long *)(OpBuffer+pExitSubSchedule[i3]))=obp-(pExitSubSchedule[i3]+sizeof(long));
+	}
+	HeapDefaultFree(pExitSubSchedule);
+
+	if(bDebugCompile&&bDebugSupportProc==0){
+		//call _DebugSys_EndProc
+		extern UserProc *pSub_DebugSys_EndProc;
+		op_call(pSub_DebugSys_EndProc);
+	}
+
+	if( !pUserProc->ReturnType().IsNull() ){
+		//////////////////////////////////
+		// 戻り値をraxまたはxmm0に設定
+		//////////////////////////////////
+
+		RELATIVE_VAR RelativeVar;
+
+		const char *temp = pUserProc->GetName().c_str();
+		if( temp[0]==1 && temp[1]==ESC_OPERATOR ){
+			temp="_System_ReturnValue";
+		}
+		GetVarOffsetReadWrite(temp,&RelativeVar,Type());
+
+		i3=pUserProc->ReturnType().GetBasicType();
+
+		if(i3==DEF_OBJECT || i3==DEF_STRUCT){
+			SetVarPtrToReg(REG_RAX,&RelativeVar);
+			if( i3==DEF_OBJECT ){
+				//mov rax,qword ptr[rax]
+				op_mov_RM( sizeof(_int64), REG_RAX, REG_RAX, 0, MOD_BASE );
+			}
+		}
+		else if(i3==DEF_DOUBLE){
+			//64ビット実数型
+			SetXmmReg_DoubleVariable(&RelativeVar,REG_XMM0);
+		}
+		else if(i3==DEF_SINGLE){
+			//32ビット実数型
+			SetXmmReg_SingleVariable(&RelativeVar,REG_XMM0);
+		}
+		else if(IsWholeNumberType(i3)){
+			//整数型
+			SetReg_WholeVariable(i3,&RelativeVar,REG_RAX);
+		}
+		else SetError(300,NULL,cp);
+	}
+
+	//ローカル変数領域のサイズをスタックフレームに通知
+	int iLocalParmSize;
+	iLocalParmSize=AllLocalVarSize-BaseLocalVar;
+	pobj_sf->SetLocalParmSize(iLocalParmSize);
+
+	//ローカル変数アドレススケジュール
+	for(i3=0;i3<LocalVarAddrScheduleNum;i3++){
+		*((long *)(OpBuffer+pLocalVarAddrSchedule[i3]))+=AllLocalVarSize+pobj_sf->GetFrameSize();
+	}
+	HeapDefaultFree(pLocalVarAddrSchedule);
+	foreach( Variable *pVar, pUserProc->localVars ){
+		//後にデバッグで利用する
+		pVar->offset = AllLocalVarSize + pobj_sf->GetFrameSize() - pVar->offset;
+	}
+
+	//mov reg,qword ptr[rsp+offset]     ※スタックフレームを利用
+	pobj_sf->pop(REG_R15);
+	pobj_sf->pop(REG_R14);
+	pobj_sf->pop(REG_R13);
+	pobj_sf->pop(REG_R12);
+	pobj_sf->pop(REG_RDI);
+	pobj_sf->pop(REG_RSI);
+	pobj_sf->pop(REG_RBX);
+
+	int iStackFrameSize;
+	iStackFrameSize=iLocalParmSize + pobj_sf->GetFrameSize();
+
+	//add rsp,スタックフレームサイズ
+	op_add_rsp(iStackFrameSize);
+
+	//ret
+	op_ret();
+
+
+	//デバッグ用
+	if(RspOffsetSchedule){
+		*((long *)(OpBuffer+RspOffsetSchedule))=iStackFrameSize;
+		*((long *)(OpBuffer+RspOffsetSchedule2))=iStackFrameSize+sizeof(_int64);
+	}
+
+
+	//スタックフレームスケジュール（subコマンド）
+	*((long *)(OpBuffer+StackFrameSchedule))=iStackFrameSize;
+
+	//スタックフレームスケジュールを実行
+	pobj_sf->RunningSchedule();
+	delete pobj_sf;
+	pobj_sf=0;
+
+
+	pUserProc->endOpAddress=obp;
+
+
+	//重複エラー情報管理のメモリを解放
+	for(i3=0;i3<SynonymErrorNum;i3++) HeapDefaultFree(SynonymErrorWords[i3]);
+	HeapDefaultFree(SynonymErrorWords);
+}
+
+void CompileBufferInProcedure( UserProc &userProc ){
+	if( userProc.IsUsing() == false || userProc.IsCompiled() ) return;
+
+	_compile_proc( &userProc );
+
+	// ログを履く
+	char temporary[8192];
+	temporary[0]=0;
+	lstrcat( temporary, "------------------------------------------------------------------\n" );
+	sprintf( temporary + lstrlen(temporary), "【 %s のコード情報】\n", userProc.GetName().c_str() );
+	sprintf( temporary + lstrlen(temporary), "code size: %d bytes\n", userProc.GetCodeSize() );
+	lstrcat( temporary, "------------------------------------------------------------------\n" );
+	lstrcat( temporary, "\n" );
+	trace_for_size( temporary );
+}
+void CompileLocal(){
+	extern GlobalProc **ppSubHash;
+	int i2;
+
+	extern BOOL bDll;
+	if(bDll){
+		//DLLの場合はグローバル変数を初期化するための関数を一番初めにコンパイルする
+		UserProc *pUserProc=GetSubHash("_System_InitDllGlobalVariables");
+		if(pUserProc){
+			CompileBufferInProcedure( *pUserProc );
+		}
+		else SetError(300,NULL,cp);
+	}
+
+	//_System_TypeBase_InitializeUserTypesは一番最後にコンパイル
+	extern UserProc *pSubStaticMethod_System_TypeBase_InitializeUserTypes;
+	pSubStaticMethod_System_TypeBase_InitializeUserTypes->CompleteCompile();
+
+	//_System_InitStaticLocalVariablesは一番最後にコンパイル
+	//※一般関数内の静的変数オブジェクトをすべて収集しなければならない
+	extern UserProc *pSub_System_InitStaticLocalVariables;
+	pSub_System_InitStaticLocalVariables->CompleteCompile();
+
+	//_System_Call_Destructor_of_GlobalObjectは一番最後にコンパイル
+	extern UserProc *pSub_System_Call_Destructor_of_GlobalObject;
+	pSub_System_Call_Destructor_of_GlobalObject->CompleteCompile();
+
+repeat:
+	GlobalProc *pGlobalProc;
+	for(i2=0;i2<MAX_HASH;i2++){
+		pGlobalProc=ppSubHash[i2];
+		while(pGlobalProc){
+			CompileBufferInProcedure( *pGlobalProc );
+			pGlobalProc=pGlobalProc->pNextData;
+		}
+	}
+
+	if( IsNeedProcCompile() ){
+		//プロシージャコンパイルによって、プロシージャコンパイルが必要になる場合
+		goto repeat;
+	}
+
+	//_System_TypeBase_InitializeUserTypesは最後のほうでコンパイル
+	pSubStaticMethod_System_TypeBase_InitializeUserTypes->KillCompileStatus();
+	CompileBufferInProcedure( *pSubStaticMethod_System_TypeBase_InitializeUserTypes );
+
+	if( IsNeedProcCompile() ){
+		//プロシージャコンパイルによって、プロシージャコンパイルが必要になる場合
+		for(i2=0;i2<MAX_HASH;i2++){
+			pGlobalProc=ppSubHash[i2];
+			while(pGlobalProc){
+				CompileBufferInProcedure( *pGlobalProc );
+				pGlobalProc=pGlobalProc->pNextData;
+			}
+		}
+	}
+
+	//_System_InitStaticLocalVariablesは一番最後にコンパイル
+	pSub_System_InitStaticLocalVariables->KillCompileStatus();
+	CompileBufferInProcedure( *pSub_System_InitStaticLocalVariables );
+
+	//_System_Call_Destructor_of_GlobalObjectは一番最後にコンパイル
+	pSub_System_Call_Destructor_of_GlobalObject->KillCompileStatus();
+	CompileBufferInProcedure( *pSub_System_Call_Destructor_of_GlobalObject );
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/Compile_Set_Var.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Compile_Set_Var.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Compile_Set_Var.cpp	(revision 178)
@@ -0,0 +1,411 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+BOOL IsUse_r11(RELATIVE_VAR *pRelativeVar){
+	if(pRelativeVar->bOffsetOffset||pRelativeVar->dwKind==VAR_DIRECTMEM) return 1;
+	return 0;
+}
+
+void SetStructVariableFromRax( const Type &varType, const Type &calcType, RELATIVE_VAR *pRelativeVar,BOOL bUseHeap){
+	int RightTermReg;
+	pobj_reg=new CRegister(REG_RCX);
+
+	//VarRegにオブジェクトポインタをコピー
+	int VarReg;
+	VarReg=pobj_reg->LockReg();
+	SetVarPtrToReg(VarReg,pRelativeVar);
+
+	//右辺
+	if( calcType.IsReal() ){
+		RightTermReg=pobj_reg->LockXmmReg();
+
+		if( calcType.IsDouble() ){
+			//movlsd RightTermReg,xmm0
+			op_movsd_RR(RightTermReg,REG_XMM0);
+		}
+		else if( calcType.IsSingle() ){
+			//movlss RightTermReg,xmm0
+			op_movss_RR(RightTermReg,REG_XMM0);
+		}
+	}
+	else{
+		RightTermReg=pobj_reg->LockReg();
+
+		//mov RightTermReg,rax
+		op_mov_RR(RightTermReg,REG_RAX);
+	}
+
+	//右辺用レジスタを解除
+	if( calcType.IsReal() ) pobj_reg->UnlockXmmReg();
+	else pobj_reg->UnlockReg();
+
+	//左辺用レジスタを解除
+	pobj_reg->UnlockReg();
+
+	//レジスタ管理オブジェクトを破棄
+	delete pobj_reg;
+	pobj_reg=0;
+
+
+	if( calcType.IsStruct() ){
+		if( varType.GetClass().IsEquals( &calcType.GetClass() ) ){			//等しい
+
+				//双方のオブジェクト型が一致、または派生・継承関係にあるとき
+				//※コピーを行う
+
+				//mov rsi,RightTermReg
+				op_mov_RR(REG_RSI,RightTermReg);
+
+				//mov rdi,VarReg
+				op_mov_RR(REG_RDI,VarReg);
+
+				int object_size = varType.GetClass().GetSize();
+
+				//mov rcx,object_size
+				op_mov_RV(sizeof(_int64),REG_RCX,object_size);
+
+				if(bUseHeap){
+					//mov rax,rsi
+					op_mov_RR(REG_RAX,REG_RSI);
+				}
+
+				//rep movs byte ptr[rdi],byte ptr[rsi]
+				op_rep_movs(sizeof(BYTE));
+
+				if(bUseHeap){
+					//mov rcx,rax
+					op_mov_RR(REG_RCX,REG_RAX);
+
+					//call free
+					extern UserProc *pSub_free;
+					op_call(pSub_free);
+				}
+
+				return;
+		}
+	}
+
+	SetError(1,NULL,cp);
+}
+
+
+void SetDoubleVariable(int type,RELATIVE_VAR *pRelative){
+	//////////////////////////
+	// Double型変数に書き込む
+	//////////////////////////
+
+	//xmm0に型変換
+	ChangeTypeToXmm_Double(type,REG_XMM0,REG_RAX);
+
+	if(pRelative->dwKind==VAR_GLOBAL){
+		if(pRelative->bOffsetOffset){
+			//movsd qword ptr[r11+offset],xmm0
+			OpBuffer[obp++]=(char)0xF2;
+			OpBuffer[obp++]=(char)0x41;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x11;
+			OpBuffer[obp++]=(char)0x83;
+			*((long *)(OpBuffer+obp))=(int)pRelative->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//movsd qword ptr[offset],xmm0
+			OpBuffer[obp++]=(char)0xF2;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x11;
+			OpBuffer[obp++]=(char)0x04;
+			OpBuffer[obp++]=(char)0x25;
+			*((long *)(OpBuffer+obp))=(int)pRelative->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelative->dwKind==VAR_REFGLOBAL){
+		SetError(300,NULL,cp);
+	}
+	else if(pRelative->dwKind==VAR_LOCAL){
+		if(pRelative->bOffsetOffset){
+			//movsd qword ptr[rsp+r11+offset],xmm0
+			OpBuffer[obp++]=(char)0xF2;
+			OpBuffer[obp++]=(char)0x42;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x11;
+			OpBuffer[obp++]=(char)0x84;
+			OpBuffer[obp++]=(char)0x1C;
+			*((long *)(OpBuffer+obp))=(int)pRelative->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//movsd qword ptr[rsp+offset],xmm0
+			OpBuffer[obp++]=(char)0xF2;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x11;
+			OpBuffer[obp++]=(char)0x84;
+			OpBuffer[obp++]=(char)0x24;
+			*((long *)(OpBuffer+obp))=(int)pRelative->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if( pRelative->dwKind == VAR_REFLOCAL ){
+		if(pRelative->bOffsetOffset){
+			//add r11,qword ptr[rsp+offset]
+			OpBuffer[obp++]=(char)0x4C;
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0x9C;
+			OpBuffer[obp++]=(char)0x24;
+			*((long *)(OpBuffer+obp))=(int)pRelative->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov r11,qword ptr[rsp+offset]
+			op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+
+		goto directmem;
+	}
+	else if(pRelative->dwKind==VAR_DIRECTMEM){
+directmem:
+		//movsd qword ptr[r11],xmm0
+		OpBuffer[obp++]=(char)0xF2;
+		OpBuffer[obp++]=(char)0x41;
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x11;
+		OpBuffer[obp++]=(char)0x03;
+	}
+}
+void SetSingleVariable(int type,RELATIVE_VAR *pRelative){
+	//////////////////////////
+	// Single型変数に書き込む
+	//////////////////////////
+
+	//xmm0に型変換
+	ChangeTypeToXmm_Single(type,REG_XMM0,REG_RAX);
+
+	if(pRelative->dwKind==VAR_GLOBAL){
+		if(pRelative->bOffsetOffset){
+			//movss dword ptr[r11+offset],xmm0
+			OpBuffer[obp++]=(char)0xF3;
+			OpBuffer[obp++]=(char)0x41;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x11;
+			OpBuffer[obp++]=(char)0x83;
+			*((long *)(OpBuffer+obp))=(int)pRelative->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//movss dword ptr[offset],xmm0
+			OpBuffer[obp++]=(char)0xF3;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x11;
+			OpBuffer[obp++]=(char)0x04;
+			OpBuffer[obp++]=(char)0x25;
+			*((long *)(OpBuffer+obp))=(int)pRelative->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if(pRelative->dwKind==VAR_REFGLOBAL){
+		SetError(300,NULL,cp);
+	}
+	else if(pRelative->dwKind==VAR_LOCAL){
+		if(pRelative->bOffsetOffset){
+			//movss dword ptr[rsp+r11+offset],xmm0
+			OpBuffer[obp++]=(char)0xF3;
+			OpBuffer[obp++]=(char)0x42;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x11;
+			OpBuffer[obp++]=(char)0x84;
+			OpBuffer[obp++]=(char)0x1C;
+			*((long *)(OpBuffer+obp))=(int)pRelative->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//movss dword ptr[rsp+offset],xmm0
+			OpBuffer[obp++]=(char)0xF3;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x11;
+			OpBuffer[obp++]=(char)0x84;
+			OpBuffer[obp++]=(char)0x24;
+			*((long *)(OpBuffer+obp))=(int)pRelative->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if( pRelative->dwKind == VAR_REFLOCAL ){
+		if(pRelative->bOffsetOffset){
+			//add r11,qword ptr[rsp+offset]
+			OpBuffer[obp++]=(char)0x4C;
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0x9C;
+			OpBuffer[obp++]=(char)0x24;
+			*((long *)(OpBuffer+obp))=(int)pRelative->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov r11,qword ptr[rsp+offset]
+			op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+
+		goto directmem;
+	}
+	else if(pRelative->dwKind==VAR_DIRECTMEM){
+directmem:
+		//movss dword ptr[r11],xmm0
+		OpBuffer[obp++]=(char)0xF3;
+		OpBuffer[obp++]=(char)0x41;
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x11;
+		OpBuffer[obp++]=(char)0x03;
+	}
+}
+void SetRealVariable(int VarType, int CalcType, RELATIVE_VAR *pRelativeVar){
+	if(VarType==DEF_DOUBLE){
+		//Double型変数へスタックの内容を格納する
+		SetDoubleVariable(CalcType,pRelativeVar);
+	}
+	else if(VarType==DEF_SINGLE){
+		//Single型変数へスタックの内容を格納する
+		SetSingleVariable(CalcType,pRelativeVar);
+	}
+}
+void SetBooleanVariable(int type,RELATIVE_VAR *pRelative){
+	if(type==DEF_DOUBLE){
+		//Double型
+
+		//cvttsd2si rax,xmm0
+		op_cvttsd2si_xmm(sizeof(_int64),REG_RAX,REG_XMM0);
+	}
+	else if(type==DEF_SINGLE){
+		//Single型
+
+		//cvttss2si rax,xmm0
+		op_cvttss2si_xmm(sizeof(_int64),REG_RAX,REG_XMM0);
+	}
+
+	//cmp rax,0
+	op_cmp_value(GetTypeSize(type,-1),REG_RAX,0);
+
+	//setne al
+	op_setne( REG_RAX );
+
+	SetWholeVariable( sizeof(char), DEF_BYTE, pRelative);
+}
+void SetWholeVariable(int varSize,int type,RELATIVE_VAR *pRelative){
+	if(type==DEF_DOUBLE){
+		//Double型
+
+		//cvttsd2si rax,xmm0
+		op_cvttsd2si_xmm(sizeof(_int64),REG_RAX,REG_XMM0);
+	}
+	else if(type==DEF_SINGLE){
+		//Single型
+
+		//cvttss2si rax,xmm0
+		op_cvttss2si_xmm(sizeof(_int64),REG_RAX,REG_XMM0);
+	}
+	else{
+		//その他の整数
+
+		if(varSize==sizeof(_int64)){
+			//レジスタの値を64ビット（rax）に拡張する
+			ExtendTypeTo64(type,REG_RAX);
+		}
+		else if(varSize==sizeof(long)){
+			//レジスタの値を32ビット（eax）に拡張する
+			ExtendTypeTo32(type,REG_RAX);
+		}
+		else if(varSize==sizeof(short)){
+			//レジスタの値を16ビット（ax）に拡張する
+			ExtendTypeTo16(type,REG_RAX);
+		}
+		//8ビットは拡張なし
+	}
+
+	if(pRelative->dwKind==VAR_GLOBAL){
+		if(pRelative->bOffsetOffset){
+			//mov ptr[r11+offset],rax/eax/ax/al
+			op_mov_MR(varSize,REG_RAX,REG_R11,(int)pRelative->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov ptr[offset],rax/eax/ax/al
+			op_mov_MR(varSize,REG_RAX,0,(int)pRelative->offset,MOD_DISP32);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if( pRelative->dwKind == VAR_REFGLOBAL ){
+		if(pRelative->bOffsetOffset){
+			//add r11,qword ptr[offset]
+			op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelative->offset, MOD_DISP32 );
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov r11,qword ptr[offset]
+			op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelative->offset,MOD_DISP32);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+
+		goto directmem;
+	}
+	else if(pRelative->dwKind==VAR_LOCAL){
+		if(pRelative->bOffsetOffset){
+			//mov ptr[rsp+r11+offset],rax/eax/ax/al
+			op_mov_MR_ex(varSize,REG_RAX,REG_RSP,REG_R11,(int)pRelative->offset,USE_OFFSET);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov ptr[rsp+offset],rax/eax/ax/al
+			op_mov_MR(varSize,REG_RAX,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if( pRelative->dwKind == VAR_REFLOCAL ){
+		if(pRelative->bOffsetOffset){
+			//add r11,qword ptr[rsp+offset]
+			op_add_RM( sizeof(_int64), REG_R11, REG_RSP, (int)pRelative->offset, MOD_BASE_DISP32 );
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov r11,qword ptr[rsp+offset]
+			op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelative->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+
+		goto directmem;
+	}
+	else if(pRelative->dwKind==VAR_DIRECTMEM){
+directmem:
+
+		//mov ptr[r11],rax/eax/ax/al
+		op_mov_MR(varSize,REG_RAX,REG_R11,0,MOD_BASE);
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/Compile_Statement.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Compile_Statement.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Compile_Statement.cpp	(revision 178)
@@ -0,0 +1,1043 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void OpcodeOthers(const char *Command){
+	int i,i2;
+	UserProc *pUserProc;
+
+	char leftTerm[8192];
+	int lastParePos = 0;
+	for(i=0;;i++){
+		if(Command[i]=='\"'){
+			//ダブルクォートは不正なのでエラー扱い
+			leftTerm[i]=0;
+			SetError(3,leftTerm,cp);
+			return;
+		}
+
+		if(Command[i]=='('){
+			lastParePos = i;
+			i2=GetStringInPare(leftTerm+i,Command+i);
+			i+=i2-1;
+			continue;
+		}
+		if(Command[i]=='['){
+			i2=GetStringInBracket(leftTerm+i,Command+i);
+			i+=i2-1;
+			continue;
+		}
+		if(Command[i]=='\0'){
+			leftTerm[i] = 0;
+			break;
+		}
+
+		if( IsNumCalcMark( Command, i ) ){
+			leftTerm[i] = 0;
+			break;
+		}
+
+		leftTerm[i]=Command[i];
+	}
+	if(!(
+		IsVariableTopChar(leftTerm[0])||
+		leftTerm[0]=='.'||
+		(leftTerm[0]==1&&leftTerm[1]==ESC_PSMEM)
+		)){
+		SetError(1,NULL,cp);
+		return;
+	}
+
+
+	if(Command[i]=='\0' && lastParePos == 0){
+		//////////////////////////////
+		// パラメータ無しのマクロ検索
+		//////////////////////////////
+
+		pUserProc=GetSubHash(Command);
+
+		//GetSubHash内でエラー提示が行われた場合
+		if(pUserProc==(UserProc *)-1) return;
+
+		if(pUserProc==0){
+			char temporary[VN_SIZE];
+			lstrcpy(temporary,Command);
+
+			CharUpper(temporary);
+			pUserProc=GetSubHash(temporary);
+
+			//GetSubHash内でエラー提示が行われた場合
+			if(pUserProc==(UserProc *)-1) return;
+		}
+
+		if(pUserProc){
+			if( !pUserProc->IsMacro() ){
+				SetError(10,Command,cp);
+			}
+
+			Opcode_CallProc("",pUserProc,0,"",0);
+
+			return;
+		}
+	}
+	else if(IsNumCalcMark(Command,i)){
+		//代入演算
+		OpcodeCalc(Command);
+		return;
+	}
+
+	if( pobj_reg ){
+		SetError();
+	}
+	pobj_reg=new CRegister(REG_RAX);
+
+	Type resultType;
+	bool isLiteral;
+	BOOL bUseHeap;
+	bool result = TermOpe( leftTerm, Type(), resultType, isLiteral, &bUseHeap, false, NULL, true );
+
+	delete pobj_reg;
+	pobj_reg = NULL;
+
+	if( result ){
+
+		/////////////////////
+		// 戻り値の処理
+		/////////////////////
+
+		if( resultType.IsStruct() ){
+			//mov r14,rax
+			op_mov_RR(REG_R14,REG_RAX);
+
+			FreeTempObject(REG_R14,&resultType.GetClass());
+		}
+
+		//成功
+		return;
+	}
+
+	// 失敗
+	SetError(1, NULL,cp);
+}
+
+void Judgment(char *buffer){
+	int reg=REG_RAX;
+	Type resultType;
+	if( !NumOpe(&reg,buffer,Type(),resultType) ){
+		return;
+	}
+
+	int offset;
+
+	if(resultType.IsDouble()){
+		double dbl=0;
+		offset=dataTable.Add( dbl );
+
+		//comisd xmm0,qword ptr[data table offset]
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x2F;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x25;
+		*((long *)(OpBuffer+obp))=offset;
+		pobj_DataTableSchedule->add();
+		obp+=sizeof(long);
+	}
+	else if(resultType.IsSingle()){
+		float flt=0;
+		offset=dataTable.Add( flt );
+
+		//comiss xmm0,dword ptr[data table offset]
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x2F;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x25;
+		*((long *)(OpBuffer+obp))=offset;
+		pobj_DataTableSchedule->add();
+		obp+=sizeof(long);
+	}
+	else{
+		//整数型
+
+		//cmp rax,0
+		op_cmp_value(resultType.GetSize(),REG_RAX,0);
+	}
+}
+
+void OpcodeIf(char *Parameter){
+	int i,i2,i3;
+
+	for(i=0;;i++){
+		if(Parameter[i]=='\0'){
+			SetError(21,NULL,cp);
+			return;
+		}
+		if(Parameter[i]==1&&Parameter[i+1]==ESC_THEN){
+			Parameter[i]=0;
+			break;
+		}
+	}
+
+	//条件式を実行してフラグをセット
+	Judgment(Parameter);
+
+	//je (endif、または else まで条件ジャンプ)
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x84;
+	obp+=sizeof(long);
+
+	//jeの番地
+	i3=obp;
+
+
+	/////////////////////////
+	// If内をコード化
+	/////////////////////////
+
+	//レキシカルスコープをレベルアップ
+	obj_LexScopes.Start( obp, SCOPE_TYPE_IF );
+
+	i2=CompileBuffer(ESC_ENDIF,0);
+
+	//レキシカルスコープをレベルダウン
+	obj_LexScopes.End();
+
+
+	if(i2==ESC_ELSE){
+		//jmp (endifまで)
+		OpBuffer[obp++]=(char)0xE9;
+		obp+=sizeof(long);
+
+		*((long *)(OpBuffer+i3-sizeof(long)))=obp-i3;	//ifからelseへのジャンプ先のオフセット値
+
+		i3=obp;
+
+
+		/////////////////////////
+		// Else内をコード化
+		/////////////////////////
+
+		//レキシカルスコープをレベルアップ
+		obj_LexScopes.Start( obp, SCOPE_TYPE_IF );
+
+		CompileBuffer(ESC_ENDIF,0);
+
+		//レキシカルスコープをレベルダウン
+		obj_LexScopes.End();
+
+
+		*((long *)(OpBuffer+i3-sizeof(long)))=obp-i3;	//jmpジャンプ先のオフセット値
+	}
+	else{
+		*((long *)(OpBuffer+i3-sizeof(long)))=obp-i3;	//jeジャンプ先のオフセット値
+	}
+}
+
+int GetLabelAddress(char *LabelName,int LineNum){
+	extern int MaxLabelNum;
+	extern LABEL *pLabelNames;
+	int i;
+
+	if(LabelName){
+		for(i=0;i<MaxLabelNum;i++){
+			if(pLabelNames[i].pName){
+				if(lstrcmp(LabelName,pLabelNames[i].pName)==0) return pLabelNames[i].address;
+			}
+		}
+	}
+	else{
+		for(i=0;i<MaxLabelNum;i++){
+			if(pLabelNames[i].pName==0){
+				if(LineNum==pLabelNames[i].line) return pLabelNames[i].address;
+			}
+		}
+	}
+	return -1;
+}
+void OpcodeGoto(char *Parameter){
+	extern HANDLE hHeap;
+	extern GOTOLABELSCHEDULE *pGotoLabelSchedule;
+	extern int GotoLabelScheduleNum;
+	int i,LineNum;
+
+	if(Parameter[0]=='*'){
+		i=GetLabelAddress(Parameter+1,0);
+
+		//jmp ...
+		OpBuffer[obp++]=(char)0xE9;
+		if(i==-1){
+			pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapReAlloc(hHeap,0,pGotoLabelSchedule,(GotoLabelScheduleNum+1)*sizeof(GOTOLABELSCHEDULE));
+			pGotoLabelSchedule[GotoLabelScheduleNum].pName=(char *)HeapAlloc(hHeap,0,lstrlen(Parameter+1)+1);
+			lstrcpy(pGotoLabelSchedule[GotoLabelScheduleNum].pName,Parameter+1);
+			pGotoLabelSchedule[GotoLabelScheduleNum].pos=obp;
+			pGotoLabelSchedule[GotoLabelScheduleNum].now_cp=cp;
+			GotoLabelScheduleNum++;
+		}
+		*((long *)(OpBuffer+obp))=i-(obp+sizeof(long));
+		obp+=sizeof(long);
+	}
+	else{
+		LineNum=atoi(Parameter);
+		i=GetLabelAddress(0,LineNum);
+
+		//jmp ...
+		OpBuffer[obp++]=(char)0xE9;
+		if(i==-1){
+			pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapReAlloc(hHeap,0,pGotoLabelSchedule,(GotoLabelScheduleNum+1)*sizeof(GOTOLABELSCHEDULE));
+			pGotoLabelSchedule[GotoLabelScheduleNum].pName=0;
+			pGotoLabelSchedule[GotoLabelScheduleNum].line=LineNum;
+			pGotoLabelSchedule[GotoLabelScheduleNum].pos=obp;
+			pGotoLabelSchedule[GotoLabelScheduleNum].now_cp=cp;
+			GotoLabelScheduleNum++;
+		}
+		*((long *)(OpBuffer+obp))=i-(obp+sizeof(long));
+		obp+=sizeof(long);
+	}
+}
+void OpcodeWhile(char *Parameter){
+	extern HANDLE hHeap;
+
+	//Continueアドレスのバックアップとセット
+	extern DWORD dwContinueAddress;
+	DWORD dwTempContinue;
+	dwTempContinue=dwContinueAddress;
+	dwContinueAddress=obp;
+	pobj_TempSchedule->lock((int *)&dwTempContinue);
+	pobj_TempSchedule->lock((int *)&dwContinueAddress);
+
+	if(!Parameter[0]) SetError(10,"While",cp);
+
+	//条件式を実行してフラグをセット
+	Judgment(Parameter);
+
+	//je (Wend まで)
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x84;
+	obp+=sizeof(long);
+
+	//実行中の番地
+	int je_schedule=obp;
+	pobj_TempSchedule->lock(&je_schedule);
+
+	//レキシカルスコープをレベルアップ
+	obj_LexScopes.Start( obp, SCOPE_TYPE_WHILE );
+
+	//While内をコンパイル
+	CompileBuffer(0,COM_WEND);
+
+	obj_LexScopes.CallDestructorsOfScopeEnd();
+
+	//jmp ...
+	OpBuffer[obp++]=(char)0xE9;
+	*((long *)(OpBuffer+obp))=dwContinueAddress-(obp+sizeof(long));
+	obp+=sizeof(long);
+	pobj_TempSchedule->unlock();
+	pobj_TempSchedule->unlock();
+
+	//レキシカルスコープをレベルダウン
+	obj_LexScopes.End();
+
+	*((long *)(OpBuffer+je_schedule-sizeof(long)))=obp-je_schedule;	//jeジャンプ先のオフセット値
+	pobj_TempSchedule->unlock();
+
+	//Continueアドレスを復元
+	dwContinueAddress=dwTempContinue;
+}
+
+char szNextVariable[VN_SIZE];
+void OpcodeFor(char *Parameter){
+	extern HANDLE hHeap;
+	Type resultType;
+	int i,i2,i3;
+	char temporary[VN_SIZE],variable[VN_SIZE],JudgeNum[VN_SIZE],StepNum[VN_SIZE];
+	bool isError = false;
+
+	//第１パラメータを取得
+	i=GetOneParameter(Parameter,0,temporary);
+	if(!Parameter[i]){
+		SetError(12,"For",cp);
+		isError = true;
+		goto ErrorStep;
+	}
+
+	for(i2=0;;i2++){
+		if(temporary[i2]=='='){
+			variable[i2]=0;
+
+			//カウンタ初期化
+			OpcodeCalc(temporary);
+			break;
+		}
+		if(temporary[i2]=='\0'){
+			SetError(12,"For",cp);
+			isError = true;
+			goto ErrorStep;
+		}
+		variable[i2]=temporary[i2];
+	}
+
+	//jmp ...
+	OpBuffer[obp++]=(char)0xE9;
+	i2=obp;
+	obp+=sizeof(long);
+
+	//Continueアドレスのバックアップとセット
+	extern DWORD dwContinueAddress;
+	DWORD dwTempContinue;
+	dwTempContinue=dwContinueAddress;
+	dwContinueAddress=obp;
+	pobj_TempSchedule->lock((int *)&dwTempContinue);
+	pobj_TempSchedule->lock((int *)&dwContinueAddress);
+
+	//第２パラメータを取得（to～）
+	i=GetOneParameter(Parameter,i,JudgeNum);
+
+	//第３パラメータを取得（step～）
+	if(Parameter[i]){
+		i=GetOneParameter(Parameter,i,StepNum);
+		if(Parameter[i]) SetError(12,"For",cp);
+	}
+	else lstrcpy(StepNum,"1");
+
+	//カウンタを増加させる
+	sprintf(temporary,"%s=(%s)+(%s)",variable,variable,StepNum);
+	OpcodeCalc(temporary);
+
+	*((long *)(OpBuffer+i2))=obp-(i2+sizeof(long));
+
+	//増加か減少かを区別する
+	sprintf(temporary,"(%s)>=0",StepNum);
+
+	int reg;
+	reg=REG_RAX;
+	if( !NumOpe(&reg,temporary,Type(),resultType) ){
+		return;
+	}
+
+	//cmp rax,0
+	op_cmp_value(resultType.GetSize(),REG_RAX,0);
+
+	//je [カウンタ減少の場合の判定]
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x84;
+	i2=obp;
+	obp+=sizeof(long);
+
+	//判定（カウンタ増加の場合）
+	sprintf(temporary,"%s<=(%s)",variable,JudgeNum);
+
+	reg=REG_RAX;
+	NumOpe(&reg,temporary,Type(),Type());
+
+	//jmp [カウンタ減少の場合の判定を飛び越す]
+	OpBuffer[obp++]=(char)0xE9;
+	i3=obp;
+	obp+=sizeof(long);
+
+	*((long *)(OpBuffer+i2))=obp-(i2+sizeof(long)); //jeジャンプ先のオフセット値
+
+	//判定（カウンタ減少の場合）
+	sprintf(temporary,"%s>=(%s)",variable,JudgeNum);
+
+	reg=REG_RAX;
+	NumOpe(&reg,temporary,Type(),resultType);
+
+	*((long *)(OpBuffer+i3))=obp-(i3+sizeof(long)); //jmpジャンプ先のオフセット値
+
+	//cmp rax,0
+	op_cmp_value(resultType.GetSize(),REG_RAX,0);
+
+ErrorStep:
+
+	//je ...
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x84;
+	int je_schedule=obp;
+	obp+=sizeof(long);
+	pobj_TempSchedule->lock(&je_schedule);
+
+	//レキシカルスコープをレベルアップ
+	obj_LexScopes.Start( obp, SCOPE_TYPE_FOR );
+
+	//For内をコンパイル
+	CompileBuffer(0,COM_NEXT);
+
+	obj_LexScopes.CallDestructorsOfScopeEnd();
+
+	if(szNextVariable[0]){
+		if(lstrcmp(szNextVariable,variable)!=0){
+			SetError(55,szNextVariable,cp);
+		}
+	}
+
+	//jmp ...
+	OpBuffer[obp++]=(char)0xE9;
+	*((long *)(OpBuffer+obp))=dwContinueAddress-(obp+sizeof(long));
+	obp+=sizeof(long);
+	if( isError == false ){
+		pobj_TempSchedule->unlock();
+		pobj_TempSchedule->unlock();
+	}
+
+	//レキシカルスコープをレベルダウン
+	obj_LexScopes.End();
+
+	*((long *)(OpBuffer+je_schedule))=obp-(je_schedule+sizeof(long)); //jeジャンプ先のオフセット値
+	pobj_TempSchedule->unlock();
+
+	//Continueアドレスを復元
+	dwContinueAddress=dwTempContinue;
+}
+
+void OpcodeDo(char *Parameter){
+	extern HANDLE hHeap;
+	int i,i2,i3;
+
+	if(Parameter[0]) SetError(10,"Do",cp);
+
+	//Continueアドレスのバックアップとセット
+	extern DWORD dwContinueAddress;
+	DWORD dwTempContinue;
+	dwTempContinue=dwContinueAddress;
+	dwContinueAddress=obp;
+	pobj_TempSchedule->lock((int *)&dwTempContinue);
+	pobj_TempSchedule->lock((int *)&dwContinueAddress);
+
+	//レキシカルスコープをレベルアップ
+	obj_LexScopes.Start( obp, SCOPE_TYPE_DO );
+
+	//Do内をコンパイル
+	CompileBuffer(0,COM_LOOP);
+
+	obj_LexScopes.CallDestructorsOfScopeEnd();
+
+	extern char *basbuf;
+	char temporary[VN_SIZE];
+	for(i=cp-1;;i--){
+		if(IsCommandDelimitation(basbuf[i])){
+			i+=3;
+			if(!(basbuf[i]=='0'||basbuf[i]=='1')){
+				//無条件ループ
+				break;
+			}
+			i3=i;
+
+			for(i+=2,i2=0;;i++,i2++){
+				if(IsCommandDelimitation(basbuf[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+			}
+
+			//条件式を実行してフラグをセット
+			Judgment(temporary);
+
+			if(basbuf[i3]=='0'){
+				//While
+
+				//je 5（ループ終了）
+				OpBuffer[obp++]=(char)0x74;
+				OpBuffer[obp++]=(char)0x05;
+			}
+			else if(basbuf[i3]=='1'){
+				//Until
+
+				//jne 5（ループ終了）
+				OpBuffer[obp++]=(char)0x75;
+				OpBuffer[obp++]=(char)0x05;
+			}
+			break;
+		}
+	}
+
+	//jmp ...
+	OpBuffer[obp++]=(char)0xE9;
+	*((long *)(OpBuffer+obp))=dwContinueAddress-(obp+sizeof(long));
+	obp+=sizeof(long);
+	pobj_TempSchedule->unlock();
+	pobj_TempSchedule->unlock();
+
+	//jmp ...
+	OpBuffer[obp++]=(char)0xE9;
+	int je_schedule=obp;
+	obp+=sizeof(long);
+	pobj_TempSchedule->lock(&je_schedule);
+
+	//レキシカルスコープをレベルダウン
+	obj_LexScopes.End();
+
+	*((long *)(OpBuffer+je_schedule))=obp-(je_schedule+sizeof(long)); //jmpジャンプ先のオフセット値
+	pobj_TempSchedule->unlock();
+
+	//Continueアドレスを復元
+	dwContinueAddress=dwTempContinue;
+}
+void OpcodeContinue(void){
+	extern DWORD dwContinueAddress;
+
+	if(dwContinueAddress==-1){
+		SetError(12,"Continue",cp);
+		return;
+	}
+
+	//jmp ...(Continue addr)
+	OpBuffer[obp++]=(char)0xE9;
+
+	*((long *)(OpBuffer+obp))=dwContinueAddress-(obp+sizeof(long));
+	obp+=sizeof(long);
+}
+
+void OpcodeExitSub(void){
+	extern DWORD *pExitSubSchedule;
+	extern int ExitSubScheduleNum;
+	extern HANDLE hHeap;
+
+	if( UserProc::IsGlobalAreaCompiling() ){
+		SetError(12,"Exit Sub/Function",cp);
+		return;
+	}
+
+	//未解放のローカルオブジェクトのデストラクタを呼び出す
+	obj_LexScopes.CallDestructorsOfReturn();
+
+	//jmp ...(End Sub/Function)
+	OpBuffer[obp++]=(char)0xE9;
+
+	pExitSubSchedule=(DWORD *)HeapReAlloc(hHeap,0,pExitSubSchedule,(ExitSubScheduleNum+1)*sizeof(DWORD));
+	pExitSubSchedule[ExitSubScheduleNum]=obp;
+	ExitSubScheduleNum++;
+
+	obp+=sizeof(long);
+}
+
+void AddCaseSchedule(void){
+	extern DWORD *pCaseSchedule;
+	extern int CaseScheduleNum;
+	extern HANDLE hHeap;
+
+	pCaseSchedule=(DWORD *)HeapReAlloc(hHeap,0,pCaseSchedule,(CaseScheduleNum+1)*sizeof(DWORD));
+	pCaseSchedule[CaseScheduleNum]=obp;
+	CaseScheduleNum++;
+}
+void OpcodeSelect( const char *lpszParms ){
+	extern DWORD *pCaseSchedule;
+	extern int CaseScheduleNum;
+	extern int NowCaseSchedule;
+	extern HANDLE hHeap;
+	extern char *basbuf;
+	int i,i2,i3,NowCaseCp;
+	char temporary[VN_SIZE];
+
+	DWORD *temp_pCaseSchedule;
+	int temp_CaseScheduleNum;
+	int temp_NowCaseSchedule;
+
+	temp_pCaseSchedule=pCaseSchedule;
+	temp_CaseScheduleNum=CaseScheduleNum;
+	temp_NowCaseSchedule=NowCaseSchedule;
+	pCaseSchedule=(DWORD *)HeapAlloc(hHeap,0,1);
+	CaseScheduleNum=0;
+	NowCaseSchedule=0;
+
+	int reg1=REG_RAX;
+	Type type1;
+	if( !NumOpe(&reg1,lpszParms,Type(), type1 ) ){
+		return;
+	}
+
+	if(type1.IsDouble()){
+		//movsd qword ptr[rsp+offset],xmm_reg		※スタックフレームを利用
+		pobj_sf->push(reg1,sizeof(double));
+	}
+	else if(type1.IsSingle()){
+		//movss dword ptr[rsp+offset],xmm_reg		※スタックフレームを利用
+		pobj_sf->push(reg1,sizeof(float));
+	}
+	else{
+		ExtendTypeTo64(type1.GetBasicType(),reg1);
+
+		//mov qword ptr[rsp+offset],reg     ※スタックフレームを利用
+		pobj_sf->push(reg1);
+	}
+
+	for(i=cp;;i++){
+		if(basbuf[i]=='\0'){
+			HeapDefaultFree(pCaseSchedule);
+			pCaseSchedule=temp_pCaseSchedule;
+			CaseScheduleNum=temp_CaseScheduleNum;
+			NowCaseSchedule=temp_NowCaseSchedule;
+			SetError(22,"Select",cp);
+			return;
+		}
+		if(basbuf[i]==1&&basbuf[i+1]==ESC_SELECTCASE){
+			for(i2=0;;i++){
+				if(basbuf[i]==1&&basbuf[i+1]==ESC_SELECTCASE) i2++;
+				if(basbuf[i]==1&&basbuf[i+1]==ESC_ENDSELECT){
+					i2--;
+					if(i2==0) break;
+				}
+			}
+			continue;
+		}
+		if(basbuf[i]==1&&basbuf[i+1]==ESC_ENDSELECT) break;
+
+		if(basbuf[i]==1&&basbuf[i+1]==ESC_CASE){
+			NowCaseCp=i;
+
+			i++;
+			while(1){
+				for(i++,i2=0;;i++,i2++){
+					if(basbuf[i]=='\"'){
+						i3=GetStringInQuotation(temporary+i2,basbuf+i);
+						i+=i3-1;
+						i2+=i3-1;
+						continue;
+					}
+					if(basbuf[i]=='('){
+						i3=GetStringInPare(temporary+i2,basbuf+i);
+						i+=i3-1;
+						i2+=i3-1;
+						continue;
+					}
+					if(basbuf[i]=='['){
+						i3=GetStringInBracket(temporary+i2,basbuf+i);
+						i+=i3-1;
+						i2+=i3-1;
+						continue;
+					}
+
+					if(IsCommandDelimitation(basbuf[i])){
+						temporary[i2]=0;
+						break;
+					}
+					if(basbuf[i]==','){
+						temporary[i2]=0;
+						break;
+					}
+
+					temporary[i2]=basbuf[i];
+				}
+
+				//エラー用
+				i2=cp;
+				cp=NowCaseCp;
+
+				int reg2=REG_RDX;
+				Type type2;
+				if( !NumOpe(&reg2,temporary,type1,type2) ){
+					return;
+				}
+
+				cp=i2;
+
+				if(type1.IsObject()){
+					std::vector<UserProc *> subs;
+					type1.GetClass().GetMethods().Enum( CALC_EQUAL, subs );
+					if( subs.size() == 0 ){
+						return;
+					}
+
+					Parameters params;
+					params.push_back( new Parameter( "", Type( type2 ) ) );
+
+					//オーバーロードを解決
+					UserProc *pUserProc;
+					pUserProc=OverloadSolution("==",subs, params, NULL);
+
+					delete params[0];
+
+					if(!pUserProc){
+						//エラー
+						return;
+					}
+
+
+					//実体オブジェクト
+					if(reg2!=REG_RDX){
+						//mov rdx,reg2
+						op_mov_RR(REG_RDX,reg2);
+					}
+
+					//mov rcx,qword ptr[rsp+offset]		※スタックフレームから参照
+					pobj_sf->ref(REG_RCX);
+
+					//call operator_proc	※ ==演算子
+					op_call(pUserProc);
+
+					//test rax,rax
+					op_test(REG_RAX,REG_RAX);
+
+					//jne ...
+					OpBuffer[obp++]=(char)0x0F;
+					OpBuffer[obp++]=(char)0x85;
+				}
+				else{
+					if(type1.IsDouble()){
+						int xmm_reg;
+						if(IsXmmReg(reg2)) xmm_reg=reg2;
+						else xmm_reg=REG_XMM5;
+						ChangeTypeToXmm_Double(type2.GetBasicType(),xmm_reg,reg2);
+
+						//movsd xmm4,qword ptr[rsp+offset]	※スタックフレームから参照
+						pobj_sf->ref(REG_XMM4,sizeof(double));
+
+						//comiss xmm_reg1,xmm_reg2
+						op_comisd(xmm_reg,REG_XMM4);
+					}
+					else if(type1.IsSingle()){
+						int xmm_reg;
+						if(IsXmmReg(reg2)) xmm_reg=reg2;
+						else xmm_reg=REG_XMM5;
+						ChangeTypeToXmm_Single(type2.GetBasicType(),xmm_reg,reg2);
+
+						//movss xmm4,dword ptr[rsp+offset]	※スタックフレームから参照
+						pobj_sf->ref(REG_XMM4,sizeof(float));
+
+						//comiss xmm_reg1,xmm_reg2
+						op_comiss(xmm_reg,REG_XMM4);
+					}
+					else{
+						//その他整数型
+
+						i2=NeutralizationType(type1.GetBasicType(),-1,type2.GetBasicType(),-1);
+
+						//mov r14,qword ptr[rsp+offset]		※スタックフレームから参照
+						pobj_sf->ref(REG_R14);
+
+						//cmp reg2,r14
+						op_cmp_reg(GetTypeSize(i2,-1),reg2,REG_R14);
+					}
+
+					//je ...
+					OpBuffer[obp++]=(char)0x0F;
+					OpBuffer[obp++]=(char)0x84;
+				}
+				AddCaseSchedule();
+				obp+=sizeof(long);
+
+				if(basbuf[i]!=',') break;
+			}
+		}
+		if(basbuf[i]==1&&basbuf[i+1]==ESC_CASEELSE){
+			//jmp ...
+			OpBuffer[obp++]=(char)0xE9;
+			AddCaseSchedule();
+			obp+=sizeof(long);
+		}
+	}
+
+	//スタックフレームを1スペースだけ解除
+	pobj_sf->pop(REG_NON);
+
+	//レキシカルスコープをレベルアップ
+	obj_LexScopes.Start( obp, SCOPE_TYPE_SELECT );
+
+	//Select Case内をコンパイル
+	CompileBuffer(ESC_ENDSELECT,0);
+
+	//jmp EndSelect
+	OpBuffer[obp++]=(char)0xE9;
+	AddCaseSchedule();
+	obp+=sizeof(long);
+
+	//最終スケジュール
+	for(i=NowCaseSchedule;i<CaseScheduleNum;i++){
+		*(long *)(OpBuffer+pCaseSchedule[i])=obp-(pCaseSchedule[i]+sizeof(long));
+	}
+	HeapDefaultFree(pCaseSchedule);
+
+	//レキシカルスコープをレベルダウン
+	obj_LexScopes.End();
+
+	pCaseSchedule=temp_pCaseSchedule;
+	CaseScheduleNum=temp_CaseScheduleNum;
+	NowCaseSchedule=temp_NowCaseSchedule;
+}
+void OpcodeCase(char *Parameter){
+	extern DWORD *pCaseSchedule;
+	extern int NowCaseSchedule;
+	int i;
+
+	if(!pCaseSchedule){
+		SetError(30,"Case",cp);
+		return;
+	}
+
+	//jmp EndSelect
+	OpBuffer[obp++]=(char)0xE9;
+	AddCaseSchedule();
+	obp+=sizeof(long);
+
+	i=0;
+	while(1){
+		//Caseスケジュール
+		*(long *)(OpBuffer+pCaseSchedule[NowCaseSchedule])=obp-(pCaseSchedule[NowCaseSchedule]+sizeof(long));
+		NowCaseSchedule++;
+
+		i=JumpOneParameter(Parameter,i);
+		if(Parameter[i]=='\0') break;
+	}
+}
+
+void OpcodeGosub(char *Parameter){
+	extern HANDLE hHeap;
+	extern GOTOLABELSCHEDULE *pGotoLabelSchedule;
+	extern int GotoLabelScheduleNum;
+	int i,LineNum;
+
+	//call _System_GetEip
+	extern UserProc *pSub_System_GetEip;
+	op_call(pSub_System_GetEip);
+
+	//add rax,offset（Gosubステートメントの最終ポイント）
+	int schedule=obp,schedule2;
+	op_add_RV(REG_RAX,0);
+	schedule2=obp-sizeof(long);
+
+	//※戻り先用のrip
+	//mov qword ptr[rsp+offset],rax     ※スタックフレームを利用
+	pobj_sf->push(REG_RAX);
+
+
+	if(Parameter[0]=='*'){
+		i=GetLabelAddress(Parameter+1,0);
+
+		//jmp ...
+		OpBuffer[obp++]=(char)0xE9;
+		if(i==-1){
+			pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapReAlloc(hHeap,0,pGotoLabelSchedule,(GotoLabelScheduleNum+1)*sizeof(GOTOLABELSCHEDULE));
+			pGotoLabelSchedule[GotoLabelScheduleNum].pName=(char *)HeapAlloc(hHeap,0,lstrlen(Parameter+1)+1);
+			lstrcpy(pGotoLabelSchedule[GotoLabelScheduleNum].pName,Parameter+1);
+			pGotoLabelSchedule[GotoLabelScheduleNum].pos=obp;
+			pGotoLabelSchedule[GotoLabelScheduleNum].now_cp=cp;
+			GotoLabelScheduleNum++;
+		}
+		*((long *)(OpBuffer+obp))=i-(obp+sizeof(long));
+		obp+=sizeof(long);
+	}
+	else{
+		LineNum=atoi(Parameter);
+		i=GetLabelAddress(0,LineNum);
+
+		//jmp ...
+		OpBuffer[obp++]=(char)0xE9;
+		if(i==-1){
+			pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapReAlloc(hHeap,0,pGotoLabelSchedule,(GotoLabelScheduleNum+1)*sizeof(GOTOLABELSCHEDULE));
+			pGotoLabelSchedule[GotoLabelScheduleNum].pName=0;
+			pGotoLabelSchedule[GotoLabelScheduleNum].line=LineNum;
+			pGotoLabelSchedule[GotoLabelScheduleNum].pos=obp;
+			pGotoLabelSchedule[GotoLabelScheduleNum].now_cp=cp;
+			GotoLabelScheduleNum++;
+		}
+		*((long *)(OpBuffer+obp))=i-(obp+sizeof(long));
+		obp+=sizeof(long);
+	}
+
+	*((long *)(OpBuffer+schedule2))=obp-schedule;
+
+	//※スタックフレームを元に戻す
+	pobj_sf->pop(REG_NON);
+
+	SetError(-1,"Gosub ～ Returnステートメントは64ビットコンパイラで利用することはできません。",cp);
+}
+void OpcodeReturn(char *Parameter){
+	if( UserProc::IsGlobalAreaCompiling() ){
+		SetError(62,NULL,cp);
+	}
+	else{
+		//戻り値をセット
+		if(Parameter[0]){
+			UserProc &proc = UserProc::CompilingUserProc();
+
+			const char *temp = "_System_ReturnValue";
+			if(proc.GetName()[0]==1&&proc.GetName()[1]==ESC_OPERATOR)
+			{
+			}
+			else{
+				temp=proc.GetName().c_str();
+			}
+
+			char temporary[VN_SIZE];
+			sprintf(temporary,"%s=%s",temp,Parameter);
+			OpcodeCalc(temporary);
+		}
+
+		//プロシージャを抜け出す（C言語のreturnと同様の処理を行う）
+		OpcodeExitSub();
+	}
+}
+
+
+////////////
+// ポインタ
+////////////
+
+void OpcodeSetPtrData(char *Parameter,int type){
+	int i;
+	char temporary[VN_SIZE];
+
+	if(Parameter[0]=='('){
+		i=JumpStringInPare(Parameter,1);
+		if(Parameter[i+1]=='\0'){
+			for(i=0;;i++){
+				Parameter[i]=Parameter[i+1];
+				if(Parameter[i]=='\0') break;
+			}
+			Parameter[i-1]=0;
+		}
+	}
+
+	//第１パラメータを取得
+	i=GetOneParameter(Parameter,0,temporary);
+	if(!Parameter[i]){
+		SetError(1,NULL,cp);
+		return;
+	}
+
+	int reg_ptr=REG_RAX;
+	Type resultType;
+	if( !NumOpe(&reg_ptr,temporary,Type(),resultType) ){
+		return;
+	}
+	if(!resultType.IsWhole()){
+		SetError(11,Parameter,cp);
+		return;
+	}
+
+	//結果を格納しているレジスタをブロッキング
+	pobj_BlockReg->lock(reg_ptr);
+
+	//第２パラメータを取得
+	i=GetOneParameter(Parameter,i,temporary);
+	if(Parameter[i]){
+		SetError(1,NULL,cp);
+		return;
+	}
+
+	int temp_reg=REG_NON;
+	if( !NumOpe(&temp_reg,temporary,Type(),resultType) ){
+		return;
+	}
+
+	//レジスタのブロッキングを解除
+	pobj_BlockReg->clear();
+
+	if(type==DEF_DOUBLE){
+		ChangeTypeToXmm_Double(resultType.GetBasicType(),REG_XMM0,temp_reg);
+
+		//movsd qword ptr[reg_ptr],xmm0
+		op_movsd_MR(REG_XMM0,reg_ptr,0,MOD_BASE);
+	}
+	else if(type==DEF_SINGLE){
+		ChangeTypeToXmm_Single(resultType.GetBasicType(),REG_XMM0,temp_reg);
+
+		//movss dword ptr[reg_ptr],xmm0
+		op_movss_MR(REG_XMM0,reg_ptr,0,MOD_BASE);
+	}
+	else{
+		ChangeTypeToWhole(resultType.GetBasicType(),type,REG_RCX,temp_reg);
+
+		//mov ptr[reg_ptr],rcx
+		op_mov_MR(GetTypeSize(type,-1),REG_RCX,reg_ptr,0,MOD_BASE);
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/Compile_Var.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Compile_Var.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Compile_Var.cpp	(revision 178)
@@ -0,0 +1,1331 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+//変数
+Variables globalVars;
+int AllGlobalVarSize;
+int AllInitGlobalVarSize;
+
+int AllLocalVarSize;
+
+
+void SetRelativeOffset( Type &resultType, RELATIVE_VAR *pRelativeVar,const char *lpPtrOffset){
+	/////////////////////////////////////////////
+	// 先頭ポインタをr12に取得してメモリへ退避
+	/////////////////////////////////////////////
+
+	SetReg_WholeVariable(DEF_INT64,pRelativeVar,REG_R11);
+
+	//mov qword ptr[rsp+offset],r11     ※スタックフレームを利用
+	pobj_sf->push(REG_R11);
+
+
+	////////////////////////////////
+	// 添え字を計算する
+	////////////////////////////////
+
+	int reg=REG_NON;
+	Type type;
+	NumOpe( &reg, lpPtrOffset, Type(), type );
+	if( !type.IsWhole() ){
+		SetError(46,NULL,cp);
+	}
+	ExtendTypeTo64(type.GetBasicType(),reg);
+
+	if(reg==REG_R14){
+		//mov r14,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_R14);
+	}
+
+	if( resultType.PtrLevel() ){
+		resultType.PtrLevelDown();
+
+		int typeSize = resultType.GetSize();
+		if(typeSize>=2){
+			//imul reg,i2
+			op_imul_RV(sizeof(_int64),reg,typeSize);
+		}
+	}
+	else{
+		//エラー
+		SetError(1,NULL,cp);
+		return;
+	}
+
+
+	//////////////////////////////
+	// 先頭ポインタに添え字を加算
+	//////////////////////////////
+
+	//mov r11,qword ptr[rsp+offset]     ※スタックフレームを利用
+	pobj_sf->pop(REG_R11);
+
+	//add r11,reg
+	op_add64_reg(REG_R11,reg);
+}
+void SetRelativeOffset( RELATIVE_VAR &relativeVar ){
+	if(relativeVar.dwKind==VAR_DIRECTMEM){
+		//mov r11,qword ptr[r11]
+		op_mov_RM(sizeof(_int64),REG_R11,REG_R11,0,MOD_BASE);
+	}
+	else{
+		//直接参照に切り替え
+		SetVarPtrToReg(REG_R12,&relativeVar);
+		relativeVar.dwKind=VAR_DIRECTMEM;
+
+		//mov r11,qword ptr[r12]
+		op_mov_RM(sizeof(_int64),REG_R11,REG_R12,0,MOD_BASE);
+	}
+}
+bool GetArrayOffset(const int *SubScripts,char *array, const Type &type){
+	extern HANDLE hHeap;
+	int i,i2,i3,i4;
+	char temporary[VN_SIZE],*pParm[MAX_PARMS];
+
+	for(i=0,i2=0,i3=0;;i++,i2++){
+		if(array[i]=='('){
+			i4=GetStringInPare(temporary+i2,array+i);
+			i+=i4-1;
+			i2+=i4-1;
+			continue;
+		}
+		if(array[i]=='['){
+			i4=GetStringInBracket(temporary+i2,array+i);
+			i+=i4-1;
+			i2+=i4-1;
+			continue;
+		}
+		if(array[i]==','||array[i]=='\0'){
+			if(SubScripts[i3]==-1){
+				for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]);
+				return false;
+			}
+
+			temporary[i2]=0;
+
+			pParm[i3]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+			lstrcpy(pParm[i3],temporary);
+
+			i3++;
+
+			if(array[i]=='\0'){
+				if(SubScripts[i3]!=-1){
+					for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]);
+					return false;
+				}
+				break;
+			}
+
+			i2=-1;
+			continue;
+		}
+		temporary[i2]=array[i];
+	}
+
+	//mov qword ptr[rsp+offset],r11     ※スタックフレームを利用
+	pobj_sf->push(REG_R11);
+
+	//xor r12,r12
+	op_zero_reg(REG_R12);
+
+	for(i=i3-1;i>=0;i--){
+		//mov qword ptr[rsp+offset],r12     ※スタックフレームを利用
+		pobj_sf->push(REG_R12);
+
+		int reg=REG_NON;
+		Type type;
+		BOOL bUseHeap;
+		NumOpe( &reg, pParm[i], Type( DEF_LONG ), type, &bUseHeap );
+		if( type.IsObject() ){
+			//キャスト演算子のオーバーロードに対応する
+			CallCastOperatorProc(reg,
+				type,
+				bUseHeap, Type(DEF_LONG) );
+			type.SetBasicType( DEF_LONG );
+		}
+
+		if( !type.IsWhole() ){
+			SetError(46,NULL,cp);
+		}
+		ExtendTypeTo64( type.GetBasicType(), reg );
+
+		if(reg==REG_R14){
+			//mov r14,qword ptr[rsp+offset]     ※スタックフレームを利用
+			pobj_sf->pop(REG_R14);
+		}
+
+		//mov r12,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_R12);
+
+		for(i2=i+1,i4=1;i2<i3;i2++) i4*=SubScripts[i2]+1;
+
+		//imul reg,i4
+		op_imul_RV(sizeof(_int64),reg,i4);
+
+		//add r12,reg
+		op_add64_reg(REG_R12,reg);
+
+		HeapDefaultFree(pParm[i]);
+	}
+
+	//imul r12,TypeSize
+	OpBuffer[obp++]=(char)0x4D;
+	OpBuffer[obp++]=(char)0x69;
+	OpBuffer[obp++]=(char)0xE4;
+	*((long *)(OpBuffer+obp))=type.GetSize();
+	obp+=sizeof(long);
+
+	//mov r11,qword ptr[rsp+offset]     ※スタックフレームを利用
+	pobj_sf->pop(REG_R11);
+
+	//add r11,r12
+	OpBuffer[obp++]=(char)0x4D;
+	OpBuffer[obp++]=(char)0x03;
+	OpBuffer[obp++]=(char)0xDC;
+
+	return true;
+}
+bool _member_offset(bool isErrorEnabled, bool isWriteAccess, const CClass &objClass, const char *member, RELATIVE_VAR *pRelativeVar, Type &resultType, BOOL bPrivateAccess){
+
+	//////////////////////////////////////
+	// クラス、配列の構成要素を解析する
+	//////////////////////////////////////
+
+	char VarName[VN_SIZE];		//変数名
+	char array[VN_SIZE];		//第1次配列
+	char lpPtrOffset[VN_SIZE];	//第2次配列
+	char NestMember[VN_SIZE];	//入れ子メンバ
+	CClass::RefType refType;
+	lstrcpy(VarName,member);
+	if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,refType)) return false;
+
+
+	////////////////////////////
+	// メンバオフセットを取得
+	////////////////////////////
+
+	int memberIndex;
+	int offset = objClass.GetMemberOffset( VarName, &memberIndex );
+	if( memberIndex == objClass.GetDynamicMembers().size() ){
+		if(isErrorEnabled) SetError(103,VarName,cp);
+		return false;
+	}
+
+	CMember *pMember = objClass.GetDynamicMembers()[memberIndex];
+
+
+	//アクセシビリティをチェック
+	if(&objClass==pobj_CompilingClass){
+		//同一クラスオブジェクトの場合はプライベートアクセスを容認する
+		if(pMember->IsNoneAccess()){
+			if(isErrorEnabled) SetError(107,VarName,cp);
+			return false;
+		}
+	}
+	else{
+		if((bPrivateAccess==0&&pMember->IsPrivate())||
+			pMember->IsNoneAccess()){
+			if(isErrorEnabled) SetError(107,VarName,cp);
+			return false;
+		}
+		else if(bPrivateAccess==0&&pMember->IsProtected()){
+			if(isErrorEnabled) SetError(108,VarName,cp);
+			return false;
+		}
+	}
+
+	//Const定義の場合は書き込みアクセスを制限する
+	//※コンストラクタをコンパイル中の場合は例外的に許可する
+	if( pMember->IsConst() &&		//定数メンバである
+		isWriteAccess &&							//書き込みアクセスを要求されている
+		objClass.IsCompilingConstructor() == false	//コンストラクタ コンパイル中を除く
+		){
+			//Const定義の変数に書き込みアクセスをしようとした場合
+			SetError(61,VarName,cp);
+	}
+
+	resultType = pMember->GetType();
+
+	//ポインタ変数の場合
+	if( resultType.IsPointer() ){
+		if(pMember->SubScripts[0]==-1){
+			lstrcpy(lpPtrOffset,array);
+			array[0]=0;
+		}
+	}
+	else{
+		if(lpPtrOffset[0]){
+			if(isErrorEnabled) SetError(16,member,cp);
+			return false;
+		}
+	}
+
+	if(offset){
+		//add r11,offset
+		OpBuffer[obp++]=(char)0x49;
+		OpBuffer[obp++]=(char)0x81;
+		OpBuffer[obp++]=(char)0xC3;
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+
+	if(array[0]){
+		//配列オフセット
+		if(!GetArrayOffset(pMember->SubScripts,array,pMember->GetType())){
+			if(isErrorEnabled) SetError(14,member,cp);
+		}
+	}
+	else if(pMember->SubScripts[0]!=-1){
+		resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR );
+	}
+
+	if(NestMember[0]){
+		//入れ子構造の場合
+
+		if( resultType.IsObject() || resultType.IsStruct() ){
+			if( refType != CClass::Dot ){
+				if(isErrorEnabled) SetError(104,member,cp);
+				return false;
+			}
+
+			if( resultType.IsObject() ){
+				// 参照内容へのポインタを抽出
+				SetRelativeOffset( *pRelativeVar );
+			}
+		}
+		else if( resultType.IsObjectPtr() || resultType.IsStructPtr() ){
+			//構造体ポインタ型メンバ変数
+
+			if(lpPtrOffset[0]){
+				//pObj[n].member
+				if( ( resultType.IsObjectPtr() || resultType.IsStructPtr() )
+					&& refType != CClass::Dot ){
+						if(isErrorEnabled) SetError(104,member,cp);
+						return false;
+				}
+
+				//直接参照に切り替え
+				SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+				lpPtrOffset[0]=0;
+			}
+			else{
+				//pObj->member
+				if( (resultType.IsObjectPtr() || resultType.IsStructPtr() )
+					&& refType != CClass::Pointer ){
+						if(isErrorEnabled) SetError(104,member,cp);
+						return false;
+				}
+
+				SetRelativeOffset( *pRelativeVar );
+			}
+		}
+		else if( resultType.GetBasicType() == MAKE_PTR_TYPE(DEF_OBJECT,2)
+			|| resultType.GetBasicType() == MAKE_PTR_TYPE(DEF_STRUCT,2)){
+			//構造体ポインタのポインタ型メンバ変数
+
+			if(lpPtrOffset[0]){
+				//ppObj[n]->member
+				if( refType != CClass::Pointer ){
+					if(isErrorEnabled) SetError(104,member,cp);
+					return false;
+				}
+
+				//直接参照に切り替え
+				SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+				lpPtrOffset[0]=0;
+
+				//mov r11,qword ptr[r11]
+				op_mov_RM(sizeof(_int64),REG_R11,REG_R11,0,MOD_BASE);
+			}
+			else{
+				if(isErrorEnabled) SetError(104,member,cp);
+				return false;
+			}
+		}
+
+		if(!_member_offset(
+			isErrorEnabled,
+			isWriteAccess,
+			pMember->GetType().GetClass(),
+			NestMember,
+			pRelativeVar,
+			resultType,
+			0)) return false;
+	}
+
+	if(lpPtrOffset[0]){
+		SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+		pRelativeVar->dwKind=VAR_DIRECTMEM;
+	}
+
+	return true;
+}
+
+int LocalVar_ThisPtrOffset;
+void SetThisPtrToReg(int reg){
+	//自身のオブジェクトのThisポインタをregにコピー
+
+	RELATIVE_VAR RelativeVar;
+	RelativeVar.dwKind=VAR_LOCAL;
+	RelativeVar.bOffsetOffset=0;
+	RelativeVar.offset=-LocalVar_ThisPtrOffset;
+
+	SetReg_WholeVariable(DEF_PTR_VOID,&RelativeVar,reg);
+}
+bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss){
+	char variable[VN_SIZE];
+
+	if(NameBuffer[0]=='.'){
+		GetWithName(variable);
+		lstrcat(variable,NameBuffer);
+	}
+	else lstrcpy(variable,NameBuffer);
+
+	// 名前空間を分離
+	char namespaceStr[VN_SIZE]="", simpleName[VN_SIZE];
+	Smoothie::meta.namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName );
+
+	// 先頭オブジェクトまたはクラス名と入れ子メンバに分割
+	CClass::RefType refType;
+	char member[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE];
+	GetVarFormatString(simpleName,array,lpPtrOffset,member,refType);
+
+	// 名前空間を分離していた場合は結合
+	char VarName[VN_SIZE];
+	if( namespaceStr[0] ){
+		sprintf( VarName, "%s.%s", namespaceStr, simpleName );
+	}
+	else{
+		lstrcpy( VarName, simpleName );
+	}
+
+	const int *pSubScripts;
+	bool bConst = false;
+
+
+	if( UserProc::IsLocalAreaCompiling() ){
+		//////////////////
+		// ローカル変数
+		//////////////////
+
+		const Variable *pVar = UserProc::CompilingUserProc().localVars.BackSearch( VarName );
+		if( pVar ){
+			//ポインタ変数の場合
+			if( pVar->IsPointer() ){
+				if( !pVar->IsArray() ){
+					lstrcpy(lpPtrOffset,array);
+					array[0]=0;
+				}
+			}
+			else{
+				if(lpPtrOffset[0]){
+					SetError(16,variable,cp);
+					pRelativeVar->dwKind=NON_VAR;
+					return false;
+				}
+			}
+
+			pRelativeVar->offset=-pVar->offset;
+			pRelativeVar->bOffsetOffset=0;
+			if( pVar->IsRef() ){
+				// 参照型
+				pRelativeVar->dwKind = VAR_REFLOCAL;
+			}
+			else pRelativeVar->dwKind=VAR_LOCAL;
+			resultType = *pVar;
+			pSubScripts=pVar->GetSubScriptsPtr();
+			bConst = pVar->IsConst();
+
+			goto ok;
+		}
+	}
+
+
+	if(pobj_CompilingClass){
+		//////////////////////
+		// クラスメンバの参照
+		//////////////////////
+
+		if(lstrcmpi(variable,"This")==0){
+			//自身のオブジェクトのThisポインタをr11にコピー
+			SetThisPtrToReg(REG_R11);
+
+			pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+			resultType.SetType( DEF_OBJECT, pobj_CompilingClass );
+			return true;
+		}
+
+		if(memicmp(variable,"This.",5)==0){
+			//Thisオブジェクトのメンバを参照するとき
+			SlideString(variable+5,-5);
+			lstrcpy(VarName,variable);
+		}
+		else{
+			//クラス内メンバを参照するとき（通常）
+
+			bool isFound = false;
+			BOOST_FOREACH( CMember *pMember, pobj_CompilingClass->GetDynamicMembers() ){
+				if( pMember->GetName() == VarName ){
+					isFound = true;
+					break;
+				}
+			}
+			if( !isFound ) goto NonClassMember;
+		}
+
+		//Const修飾子のメソッド内でメンバ書き込みアクセスが発生したとき
+		//（コンストラクタ、デストラクタ内を除く）
+		const CMethod *pMethod = pobj_DBClass->GetNowCompilingMethodInfo();
+		if( isWriteAccess &&
+			pMethod->IsConst() &&
+			pobj_CompilingClass->IsCompilingConstructor() == false &&
+			pobj_CompilingClass->IsCompilingDestructor() == false
+			){
+				SetError(131, NULL, cp );
+		}
+
+		//自身のオブジェクトのThisポインタをr11にコピー
+		SetThisPtrToReg(REG_R11);
+
+		pRelativeVar->dwKind=VAR_DIRECTMEM;
+		if(!_member_offset(
+			isErrorEnabled,
+			isWriteAccess,
+			*pobj_CompilingClass,
+			variable,
+			pRelativeVar,
+			resultType,1)) return false;
+		return true;
+	}
+
+NonClassMember:
+
+	{
+		const Variable *pVar;
+
+		//////////////////////////
+		// 静的ローカル変数
+		// ※"Static.Object.Method.Variable"
+		//////////////////////////
+
+		char temporary[VN_SIZE];
+		if( UserProc::IsLocalAreaCompiling() ){
+			GetNowStaticVarFullName(VarName,temporary);
+
+			pVar = globalVars.Find( temporary );
+			if( pVar ){
+				goto GlobalOk;
+			}
+		}
+
+
+		//////////////////////////
+		// クラスの静的メンバ
+		//////////////////////////
+
+		if(member[0]){
+			lstrcpy(temporary,member);
+
+			// TODO: 名前空間を考慮したコードになっていない
+
+			char tempMember[VN_SIZE];
+			char tempArray[VN_SIZE];
+			{
+				CClass::RefType refType;
+				GetVarFormatString(temporary,tempArray,lpPtrOffset,tempMember, refType );
+			}
+
+			int typeDefIndex = Smoothie::meta.typeDefs.GetIndex( VarName );
+			if( typeDefIndex != -1 ){
+				// TypeDef後の型名だったとき
+				lstrcpy( VarName, Smoothie::meta.typeDefs[typeDefIndex].GetBaseName().c_str() );
+			}
+
+			char temp2[VN_SIZE];
+			sprintf(temp2,"%s.%s",VarName,temporary);
+			pVar = globalVars.Find( temp2 );
+			if( pVar ){
+				lstrcpy(member,tempMember);
+				lstrcpy(array,tempArray);
+				goto GlobalOk;
+			}
+		}
+
+		if(pobj_CompilingClass){
+			//自身のクラスから静的メンバを参照する場合
+			char temp2[VN_SIZE];
+			sprintf(temp2,"%s.%s",pobj_CompilingClass->GetName().c_str(),VarName);
+			pVar = globalVars.Find( temp2 );
+			if( pVar ){
+				goto GlobalOk;
+			}
+		}
+
+		/////////////////////
+		// グローバル変数
+		/////////////////////
+
+		pVar = globalVars.BackSearch( VarName );
+		if( pVar ){
+			goto GlobalOk;
+		}
+
+		if(isErrorEnabled) SetError(3,variable,cp);
+		pRelativeVar->dwKind=NON_VAR;
+		return false;
+
+
+
+GlobalOk:
+		//ポインタ変数の場合
+		if( pVar->IsPointer() ){
+			if( !pVar->IsArray() ){
+				lstrcpy(lpPtrOffset,array);
+				array[0]=0;
+			}
+		}
+		else{
+			if(lpPtrOffset[0]){
+				SetError(16,variable,cp);
+				pRelativeVar->dwKind=NON_VAR;
+				return false;
+			}
+		}
+
+		pRelativeVar->offset=pVar->offset;
+		pRelativeVar->bOffsetOffset=0;
+		if( pVar->IsRef() ){
+			// 参照型
+			pRelativeVar->dwKind = VAR_REFGLOBAL;
+		}
+		else pRelativeVar->dwKind=VAR_GLOBAL;
+		resultType = *pVar;
+		pSubScripts=pVar->GetSubScriptsPtr();
+		bConst = pVar->IsConst();
+	}
+
+
+
+ok:
+
+	if( bConst && isWriteAccess ){
+		//Const定義の変数に書き込みアクセスをしようとした場合
+		if( resultType.IsObject() ){
+			//オブジェクト定数
+			SetError(130, VarName, cp );
+		}
+		else{
+			//一般のConst変数
+			SetError(61,VarName,cp);
+		}
+	}
+
+	if(array[0]==0&&pSubScripts[0]!=-1){
+		//配列の先頭ポインタを示す場合
+		resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR );
+		if(pss) memcpy(pss,pSubScripts,MAX_ARRAYDIM);
+		return true;
+	}
+
+	if( array[0] || member[0] ){
+		//xor r11,r11（r11を0に初期化する）
+		//※r11は変数ベースアドレスからの相対オフセットを示す
+		op_zero_reg(REG_R11);
+
+		pRelativeVar->bOffsetOffset=1;
+	}
+	if(array[0]){
+		if(!GetArrayOffset(pSubScripts,array,resultType)){
+			SetError(14,variable,cp);
+			pRelativeVar->dwKind=NON_VAR;
+			return false;
+		}
+	}
+	if(member[0]){
+		if( resultType.IsObject() || resultType.IsStruct() ){
+			//実態オブジェクトのメンバを参照（obj.member）
+			if( refType != CClass::Dot ){
+				SetError(104,VarName,cp);
+				pRelativeVar->dwKind=NON_VAR;
+				return false;
+			}
+
+			if( resultType.IsObject() ){
+				// 参照内容へのポインタを抽出
+				SetRelativeOffset( *pRelativeVar );
+			}
+		}
+		else if( resultType.IsObjectPtr() || resultType.IsStructPtr() ){
+			//ポインタオブジェクトが示すメンバを参照
+			if(lpPtrOffset[0]){
+				//pObj[n].member
+				if( refType != CClass::Dot ){
+					SetError(104,VarName,cp);
+					pRelativeVar->dwKind=NON_VAR;
+					return false;
+				}
+				SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+			}
+			else{
+				//pObj->member
+				if( refType != CClass::Pointer ){
+					SetError(104,VarName,cp);
+					pRelativeVar->dwKind=NON_VAR;
+					return false;
+				}
+
+				SetVarPtrToReg(REG_R12,pRelativeVar);
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+				//mov r11,qword ptr[r12]
+				op_mov_RM(sizeof(_int64),REG_R11,REG_R12,0,MOD_BASE);
+			}
+		}
+		else if( resultType.GetBasicType()==MAKE_PTR_TYPE(DEF_OBJECT,2) || resultType.GetBasicType()==MAKE_PTR_TYPE(DEF_STRUCT,2)){
+			//ポインタオブジェクトが示すメンバを参照
+			if(lpPtrOffset[0]){
+				//ppObj[n]->member
+				if( refType != CClass::Pointer ){
+					SetError(104,VarName,cp);
+					pRelativeVar->dwKind=NON_VAR;
+					return false;
+				}
+
+				SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+
+				SetVarPtrToReg(REG_R12,pRelativeVar);
+
+				//mov r11,qword ptr[r12]
+				op_mov_RM(sizeof(_int64),REG_R11,REG_R12,0,MOD_BASE);
+			}
+			else{
+				SetError(104,VarName,cp);
+				pRelativeVar->dwKind=NON_VAR;
+				return false;
+			}
+		}
+		else{
+			SetError(102,VarName,cp);
+			pRelativeVar->dwKind=NON_VAR;
+			return false;
+		}
+
+		if(!_member_offset(
+			isErrorEnabled,
+			isWriteAccess,
+			resultType.GetClass(),
+			member,pRelativeVar,resultType,0)) return false;
+
+		return true;
+	}
+
+	if(lpPtrOffset[0]){
+		SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+		pRelativeVar->dwKind=VAR_DIRECTMEM;
+	}
+
+	return true;
+}
+
+bool SetInitGlobalData(int offset,const Type &type,const int *SubScripts,const char *lpszInitBuf){
+	extern BYTE *initGlobalBuf;
+	int i,i2,i3;
+	char temporary[VN_SIZE];
+	char InitBuf[VN_SIZE];
+	lstrcpy( InitBuf, lpszInitBuf );
+
+	if(InitBuf[0]=='['){
+		SlideString(InitBuf+1,-1);
+		InitBuf[lstrlen(InitBuf)-1]=0;
+
+		int typeSize = type.GetSize();
+
+		if(SubScripts[0]!=-1){
+			typeSize*=JumpSubScripts(SubScripts+1);
+			i=0;
+			i2=0;
+			while(1){
+				if(SubScripts[0]<i2){
+					SetError(41,0,cp);
+					return 0;
+				}
+				i=GetOneParameter(InitBuf,i,temporary);
+				if(!SetInitGlobalData(
+					offset+i2*typeSize,
+					type,
+					SubScripts+1,
+					temporary)) return false;
+				i2++;
+				if(InitBuf[i]=='\0') break;
+			}
+			return true;
+		}
+
+		if(type.IsStruct()){
+			const CClass &objClass = type.GetClass();
+
+			int i = 0;
+			BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){
+				if(InitBuf[i]=='\0'){
+					SetError(41,0,cp);
+					return false;
+				}
+
+				i=GetOneParameter(InitBuf,i,temporary);
+
+				i3=objClass.GetMemberOffset( pMember->GetName().c_str(), NULL );
+
+				if(!SetInitGlobalData(offset+i3,
+					pMember->GetType(),
+					pMember->SubScripts,
+					temporary)) return false;
+			}
+			return true;
+		}
+
+		SetError(41,0,cp);
+		return false;
+	}
+
+
+	///////////////////////////////////////
+	// 単発式（[]で囲まれていない）
+	///////////////////////////////////////
+
+	if( type.IsObject() || type.IsStruct() ){
+		//オブジェクトまたは構造体の場合はありえない
+		SetError(300,NULL,cp);
+		return false;
+	}
+
+	if(SubScripts[0]!=-1){
+		SetError(41,0,cp);
+		return false;
+	}
+
+	double dbl;
+	_int64 i64data;
+	Type calcType;
+
+	if( !StaticCalculation(false, InitBuf,type.GetBasicType(),&i64data,calcType) ){
+		//動的データだった場合
+		return false;
+	}
+	if( calcType.IsReal() ){
+		memcpy(&dbl,&i64data,sizeof(double));
+		i64data=(_int64)dbl;
+	}
+	else dbl=(double)i64data;
+
+	//型チェック
+	CheckDifferentType(
+		type,
+		calcType,
+		0,0);
+
+	if( type.IsDouble() ){
+		*(double *)(initGlobalBuf+offset)=(double)dbl;
+	}
+	else if( type.IsSingle() ){
+		*(float *)(initGlobalBuf+offset)=(float)dbl;
+	}
+	else if( type.Is64() || type.IsPointer() ){
+		if(type.GetBasicType()==typeOfPtrChar){
+			//文字列定数のとき
+
+			char *temp;
+			temp=(char *)i64data;
+			i2=dataTable.AddString( temp );
+			HeapDefaultFree(temp);
+
+			//mov rax,DataPos
+			op_mov_RV(sizeof(_int64),REG_RAX,i2);
+			obp-=sizeof(long);
+			pobj_DataTableSchedule->add();
+			obp+=sizeof(long);
+
+			//mov qword ptr[offset],rax
+			op_mov_MR(sizeof(_int64),REG_RAX,0,offset,MOD_DISP32);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			*(_int64 *)(initGlobalBuf+offset)=i64data;
+		}
+	}
+	else if( type.IsDWord() || type.IsLong() ){
+		*(DWORD *)(initGlobalBuf+offset)=(DWORD)i64data;
+	}
+	else if( type.IsWord() || type.IsInteger() ){
+		*(WORD *)(initGlobalBuf+offset)=(WORD)i64data;
+	}
+	else if( type.IsSByte() || type.IsByte() || type.IsBoolean() ){
+		*(BYTE *)(initGlobalBuf+offset)=(BYTE)i64data;
+	}
+
+	return true;
+}
+bool InitLocalVar(int offset,const Type &type,const int *SubScripts,const char *lpszInitBuf){
+	int i,i2,i3;
+	char temporary[VN_SIZE];
+	char InitBuf[VN_SIZE];
+	lstrcpy( InitBuf, lpszInitBuf );
+
+	if(InitBuf[0]=='['){
+		SlideString(InitBuf+1,-1);
+		InitBuf[lstrlen(InitBuf)-1]=0;
+
+		int typeSize = type.GetSize();
+
+		if(SubScripts[0]!=-1){
+			typeSize*=JumpSubScripts(SubScripts+1);
+			i=0;
+			i2=0;
+			while(1){
+				if(SubScripts[0]<i2){
+					SetError(41,0,cp);
+					return false;
+				}
+				i=GetOneParameter(InitBuf,i,temporary);
+				if(!InitLocalVar(
+					offset+i2*typeSize,
+					type,
+					SubScripts+1,
+					temporary)) return false;
+				i2++;
+				if(InitBuf[i]=='\0') break;
+			}
+			return true;
+		}
+
+		if(type.IsStruct()){
+			const CClass &objClass = type.GetClass();
+
+			int i = 0;
+			BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){
+				if(InitBuf[i]=='\0'){
+					SetError(41,0,cp);
+					return false;
+				}
+
+				i=GetOneParameter(InitBuf,i,temporary);
+
+				i3=objClass.GetMemberOffset( pMember->GetName().c_str(), NULL );
+
+				if(!InitLocalVar(offset+i3,
+					pMember->GetType(),
+					pMember->SubScripts,
+					temporary)) return false;
+
+				if(InitBuf[i]=='\0') break;
+			}
+			return true;
+		}
+
+		SetError(41,0,cp);
+		return false;
+	}
+
+
+	///////////////////////////////////////
+	// 単発式（[]で囲まれていない）
+	///////////////////////////////////////
+
+	if(SubScripts[0]!=-1){
+		SetError(41,0,cp);
+		return false;
+	}
+
+	double dbl;
+	_int64 i64data;
+	Type calcType;
+
+	if( !StaticCalculation(false, InitBuf,type.GetBasicType(),&i64data,calcType) ){
+		//動的データだった場合
+		return false;
+	}
+	if( calcType.IsReal() ){
+		memcpy(&dbl,&i64data,sizeof(double));
+		i64data=(_int64)dbl;
+	}
+	else dbl=(double)i64data;
+
+	//型チェック
+	CheckDifferentType(
+		type,
+		calcType,
+		0,0);
+
+	if( type.IsDouble() ){
+		memcpy(&i64data,&dbl,sizeof(double));
+
+		//mov rax,i64data
+		op_mov64_ToReg(REG_RAX,i64data);
+
+		//mov qword ptr[rsp+offset],rax
+		op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32);
+		obp-=sizeof(long);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long);
+	}
+	else if( type.IsSingle() ){
+		float flt;
+		flt=(float)dbl;
+
+		//mov dword ptr[rsp+offset],value
+		op_mov_MV(sizeof(long),REG_RSP,offset,USE_OFFSET,*(int *)&flt);
+		obp-=sizeof(long)+sizeof(long);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long)+sizeof(long);
+	}
+	else if( type.Is64() || type.IsPointer() ){
+		if(type.GetBasicType()==typeOfPtrChar ){
+			//文字列定数のとき
+
+			char *temp;
+			temp=(char *)i64data;
+			i2=dataTable.AddString( temp );
+			HeapDefaultFree(temp);
+
+			//mov rax,i2
+			op_mov_RV(sizeof(_int64),REG_RAX,i2);
+			obp-=sizeof(long);
+			pobj_DataTableSchedule->add();
+			obp+=sizeof(long);
+
+			//mov qword ptr[rsp+offset],rax
+			op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			if(i64data&0xFFFFFFFF00000000){
+				//mov rax,i64data
+				op_mov64_ToReg(REG_RAX,i64data);
+
+				//mov qword ptr[rsp+offset],rax
+				op_mov_MR(sizeof(_int64),REG_RAX,REG_RSP,offset,MOD_BASE_DISP32);
+				obp-=sizeof(long);
+				AddLocalVarAddrSchedule();
+				obp+=sizeof(long);
+			}
+			else{
+				//mov qword ptr[rsp+offset],value
+				op_mov_MV(sizeof(_int64),REG_RSP,offset,USE_OFFSET,(int)i64data);
+				obp-=sizeof(long)+sizeof(long);
+				AddLocalVarAddrSchedule();
+				obp+=sizeof(long)+sizeof(long);
+			}
+		}
+	}
+	else if( type.IsDWord() || type.IsLong() ){
+		//mov dword ptr[rsp+offset],value
+		op_mov_MV(sizeof(long),REG_RSP,offset,USE_OFFSET,(int)i64data);
+		obp-=sizeof(long)+sizeof(long);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long)+sizeof(long);
+	}
+	else if( type.IsWord() || type.IsInteger() ){
+		//mov word ptr[rsp+offset],value
+		op_mov_MV(sizeof(short),REG_RSP,offset,USE_OFFSET,(int)i64data);
+		obp-=sizeof(long)+sizeof(short);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long)+sizeof(short);
+	}
+	else if( type.IsSByte() || type.IsByte() || type.IsBoolean() ){
+		//mov byte ptr[rsp+offset],value
+		op_mov_MV(sizeof(char),REG_RSP,offset,USE_OFFSET,(int)i64data);
+		obp-=sizeof(long)+sizeof(char);
+		AddLocalVarAddrSchedule();
+		obp+=sizeof(long)+sizeof(char);
+	}
+	return true;
+}
+
+void dim( char *VarName,int *SubScripts,Type &type,const char *InitBuf,const char *ConstractParameter,DWORD dwFlags){
+	if( UserProc::IsGlobalAreaCompiling() ){
+		/////////////////////////
+		// グローバル変数
+		/////////////////////////
+
+		//OpcodeOthers( ( (string)"OutputDebugString(Ex\"" + VarName + "\r\n\")" ).c_str() );
+		AddGlobalVariable(VarName,SubScripts,type,InitBuf,ConstractParameter,dwFlags);
+	}
+	else{
+		/////////////////
+		// ローカル変数
+		/////////////////
+
+		if( UserProc::CompilingUserProc().localVars.DuplicateCheck( VarName ) ){
+			//２重定義のエラー
+			SetError(15,VarName,cp);
+			return;
+		}
+
+		bool isConst = ( dwFlags & DIMFLAG_CONST ) ? true:false;
+
+		Variable *pVar = new Variable( VarName, type, isConst );
+
+		if( SubScripts[0] != -1 ){
+			//配列あり
+			pVar->SetArray( SubScripts );
+		}
+
+		//コンストラクタ用パラメータ
+		pVar->paramStrForConstructor = ConstractParameter;
+
+		//レキシカルスコープ
+		pVar->ScopeLevel=obj_LexScopes.GetNowLevel();
+		pVar->ScopeStartAddress=obj_LexScopes.GetStartAddress();
+		pVar->bLiving=TRUE;
+
+		//エラー用
+		pVar->source_code_address=cp;
+
+		// 変数を追加
+		UserProc::CompilingUserProc().localVars.push_back( pVar );
+
+		//アラインメントを考慮
+		if( pVar->IsStruct() ){
+			int alignment = pVar->GetClass().iAlign;
+
+			if( alignment ){
+				if( AllLocalVarSize % alignment ){
+					AllLocalVarSize += alignment - (AllLocalVarSize % alignment);
+				}
+			}
+
+			if( alignment == PTR_SIZE*2 ){
+				// ポインタに要するサイズよりも一回り大きなアラインメントが指定されているとき
+				// （例:CONTEXT構造体など）
+				// 呼び出し側のオフセットズレを考慮する
+
+				if( 0 == ( UserProc::CompilingUserProc().RealParams().GetMemorySize() + PTR_SIZE/*ret分*/ ) % alignment ){
+					AllLocalVarSize += PTR_SIZE;
+				}
+			}
+		}
+
+		AllLocalVarSize += pVar->GetMemorySize();
+		pVar->offset = AllLocalVarSize;
+
+		//レキシカルスコープ
+		pVar->ScopeLevel=obj_LexScopes.GetNowLevel();
+		pVar->ScopeStartAddress=obj_LexScopes.GetStartAddress();
+		pVar->bLiving=TRUE;
+
+		if(InitBuf[0]){
+			//初期代入時のみ、書き込みアクセスを許可する
+			if( isConst ){
+				pVar->ConstOff();
+			}
+
+			int result = 0;
+			if( !pVar->IsObject() ){
+				result = InitLocalVar(-pVar->offset,
+					*pVar,
+					pVar->GetSubScriptsPtr(),
+					InitBuf);
+			}
+
+			if(!result){
+				//動的な式だった場合は代入演算を行う
+				char temporary[8192];
+				sprintf(temporary,"%s=%s",VarName,InitBuf);
+				OpcodeCalc(temporary);
+			}
+
+			if( isConst ){
+				pVar->ConstOn();
+			}
+		}
+		else{
+			//0初期化
+
+			//mov r8, 0
+			op_zero_reg( REG_R8 );
+
+			//mov rdx, VarSize
+			op_mov_RV( sizeof(_int64), REG_RDX, pVar->GetMemorySize() );
+
+			//mov rcx, rsp
+			op_mov_RR( REG_RCX, REG_RSP );
+
+			//add rcx, offset
+			op_add_RV( REG_RCX, -pVar->offset );
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//call FillMemory
+			DllProc *pDllProc;
+			pDllProc=GetDeclareHash("FillMemory");
+			op_call( pDllProc );
+		}
+	}
+
+	//コンストラクタ呼び出し
+	if( type.IsObject() &&(dwFlags&DIMFLAG_NONCALL_CONSTRACTOR)==0&&InitBuf[0]=='\0'){
+		char objectSize[255];
+		if( SubScripts[0] == -1 ){
+			objectSize[0] = 0;
+		}
+		else{
+			if( SubScripts[1] != -1 ){
+				SetError(300,NULL,cp);
+			}
+			sprintf( objectSize, "%d", SubScripts[0] );
+		}
+		Operator_New( type.GetClass(), objectSize, ConstractParameter, type );
+
+		Type tempType;
+		RELATIVE_VAR RelativeVar;
+		GetVarOffset( true, false, VarName, &RelativeVar, tempType );
+		if( RelativeVar.dwKind == VAR_DIRECTMEM ){
+			SetError();
+		}
+		SetVariableFromRax( DEF_OBJECT, DEF_OBJECT, &RelativeVar );
+	}
+}
+void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar){
+	if(!IsGeneralReg(reg)) SetError(300,NULL,cp);
+
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add r11,offset
+			OpBuffer[obp++]=(char)0x49;
+			OpBuffer[obp++]=(char)0x81;
+			OpBuffer[obp++]=(char)0xC3;
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+
+			//mov reg,r11
+			op_mov_RR(reg,REG_R11);
+		}
+		else{
+			//mov reg,offset
+			op_mov64_ToReg(reg,(int)pRelativeVar->offset);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if( pRelativeVar->dwKind == VAR_REFGLOBAL ){
+		if(pRelativeVar->bOffsetOffset){
+			//add r11,qword ptr[offset]
+			op_add_RM( sizeof(_int64), REG_R11, REG_NON, (int)pRelativeVar->offset, MOD_DISP32 );
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov r11,qword ptr[offset]
+			op_mov_RM(sizeof(_int64),REG_R11,REG_NON,(int)pRelativeVar->offset,MOD_DISP32);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+		}
+
+		goto directmem;
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		if(pRelativeVar->bOffsetOffset){
+			//add r11,offset
+			OpBuffer[obp++]=(char)0x49;
+			OpBuffer[obp++]=(char)0x81;
+			OpBuffer[obp++]=(char)0xC3;
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//add r11,rsp
+			op_add64_reg(REG_R11,REG_RSP);
+
+			//mov reg,r11
+			op_mov_RR(reg,REG_R11);
+		}
+		else{
+			//mov reg,rsp
+			op_mov_RR(reg,REG_RSP);
+
+			//add reg,offset
+			op_add_RV(reg,(int)pRelativeVar->offset);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+	}
+	else if( pRelativeVar->dwKind == VAR_REFLOCAL ){
+		if(pRelativeVar->bOffsetOffset){
+			//add r11,qword ptr[rsp+offset]
+			OpBuffer[obp++]=(char)0x4C;
+			OpBuffer[obp++]=(char)0x03;
+			OpBuffer[obp++]=(char)0x9C;
+			OpBuffer[obp++]=(char)0x24;
+			*((long *)(OpBuffer+obp))=(int)pRelativeVar->offset;
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+		else{
+			//mov r11,qword ptr[rsp+offset]
+			op_mov_RM(sizeof(_int64),REG_R11,REG_RSP,(int)pRelativeVar->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+		}
+
+		goto directmem;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+directmem:
+		//mov reg,r11
+		op_mov_RR(reg,REG_R11);
+	}
+}
+
+bool Compile_AddGlobalRootsForGc(){
+	UserProc *pUserProc_AddGlobalRootPtr = GetClassMethod( "_System_CGarbageCollection", "AddGlobalRootPtr" );
+	if( !pUserProc_AddGlobalRootPtr ){
+		SetError(3, "_System_CGarbageCollection.AddGlobalRootPtr", -1 );
+		return false;
+	}
+
+	BOOST_FOREACH( const Variable *pVar, globalVars ){
+		if( pVar->IsObject() || pVar->IsPointer() || pVar->IsStruct() ){
+			// オブジェクトまたはポインタだったとき
+			// ※構造体も含む（暫定対応）
+
+			// 変数領域に要するLONG_PTR単位の個数を引き渡す
+			//mov r8,count
+			op_mov_RV(sizeof(_int64), REG_R8,pVar->GetMemorySize()/PTR_SIZE);
+
+			// ルートポインタを引き渡す
+			//mov rdx,offset
+			op_mov_RV(sizeof(_int64), REG_RDX,(int)pVar->offset);
+			obp-=sizeof(long);
+			pobj_GlobalVarSchedule->add();
+			obp+=sizeof(long);
+
+			// Thisポインタを引き渡す
+			SetThisPtrToReg(REG_RCX);
+
+			// call AddGlobalRootPtr
+			op_call( pUserProc_AddGlobalRootPtr );
+
+			ReallocNativeCodeBuffer();
+		}
+	}
+
+	return true;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/Debug.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Debug.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Debug.cpp	(revision 178)
@@ -0,0 +1,677 @@
+#include "../BasicCompiler_Common/common.h"
+#include "opcode.h"
+
+ULONG_PTR rva_to_real(DWORD p){
+	extern DWORD ImageBase;
+	extern int MemPos_CodeSection;
+	return p+ImageBase+MemPos_CodeSection;
+}
+
+void ShowVarList(DEBUG_EVENT *pde,BOOL bExit){
+	extern DWORD ImageBase;
+	extern DWORD _DebugSys_dwThreadID[256];
+	extern HANDLE hDebugProcess;
+	extern int MemPos_RWSection;
+	SIZE_T stAccBytes;
+	ReadProcessMemory(hDebugProcess,
+		(void *)(LONG_PTR)(ImageBase+MemPos_RWSection),
+		_DebugSys_dwThreadID,sizeof(DWORD)*256,&stAccBytes);
+
+	//デバッグダイアログを表示
+	extern HINSTANCE hInst;
+	extern HWND hMainDlg;
+	extern HWND hDebugWnd;
+	extern DWORD dwStepRun;
+	dwStepRun=0;
+	if(!hDebugWnd) SendMessage(hMainDlg,WM_SHOWVARLIST,0,pde->dwThreadId);
+	else InitVarList(pde->dwThreadId);
+
+	if(bExit){
+		//"中断"
+		SetDlgItemText(hMainDlg,IDOK,STRING_CLOSE);
+
+		extern HWND hDebuggerToolbar;
+		SendMessage(hDebuggerToolbar,TB_SETSTATE,IDC_DEBUG_START,TBSTATE_INDETERMINATE);
+		SendMessage(hDebuggerToolbar,TB_SETSTATE,IDC_DEBUG_STEPOVER,TBSTATE_INDETERMINATE);
+		SendMessage(hDebuggerToolbar,TB_SETSTATE,IDC_DEBUG_STEPIN,TBSTATE_INDETERMINATE);
+	}
+	else{
+		//"継続"
+		SetDlgItemText(hDebugWnd,IDCANCEL,STRING_CONTINUE);
+	}
+	while(hDebugWnd&&dwStepRun==0) Sleep(1);
+}
+void DebugMessage(char *buffer){
+	extern HWND hMainDlg;
+	int pos;
+
+	if(!IsWindowEnabled(GetDlgItem(hMainDlg,IDC_DEBUGLIST))){
+		SetDlgItemText(hMainDlg,IDC_DEBUGLIST,"");
+		EnableWindow(GetDlgItem(hMainDlg,IDC_DEBUGLIST),1);
+	}
+
+	pos=GetWindowTextLength(GetDlgItem(hMainDlg,IDC_DEBUGLIST));
+	SendDlgItemMessage(hMainDlg,IDC_DEBUGLIST,EM_SETSEL,pos,pos);
+	SendDlgItemMessage(hMainDlg,IDC_DEBUGLIST,EM_REPLACESEL,0,(LPARAM)buffer);
+}
+SUBINFO *GetSubFromObp(ULONG_PTR pos){
+	extern SUBINFO **ppSubHash;
+	SUBINFO *psi;
+	int i2;
+
+	for(i2=0;i2<MAX_HASH;i2++){
+		psi=ppSubHash[i2];
+		while(psi){
+			if(rva_to_real(psi->CompileAddress) <= pos  &&
+				pos < rva_to_real(psi->EndOpAddr))
+				return psi;
+
+			psi=psi->pNextData;
+		}
+	}
+	return 0;
+}
+void ReleaseSingleStep(HANDLE hThread,CONTEXT *pContext){
+	//以前にシングルステップ実行をした場合
+	extern HANDLE hDebugProcess;
+	extern DWORD *lpdwDebugThreadID;
+	extern HANDLE *lphDebugThread;
+	extern int DebugThreadNum;
+	extern DWORD ImageBase;
+	extern int MemPos_CodeSection;
+	extern int FileSize_CodeSection;
+	extern char *OpBuffer;
+	int i2;
+	SIZE_T stAccBytes;
+
+	//シングルステップOFF
+	WriteProcessMemory(hDebugProcess,
+		(void *)(LONG_PTR)(ImageBase+MemPos_CodeSection),
+		OpBuffer,FileSize_CodeSection,&stAccBytes);
+
+	if(ImageBase+MemPos_CodeSection <= pContext->Rip &&
+		pContext->Rip < ImageBase+MemPos_CodeSection+FileSize_CodeSection){
+		//オリジナルコード内のみ、シングルステップ用の"int 3"を考慮
+		pContext->Rip--;
+		SetThreadContext(hThread,pContext);
+	}
+
+	//他のスレッドのサスペンドを解除
+	for(i2=0;i2<DebugThreadNum;i2++){
+		if(hThread!=lphDebugThread[i2])
+			ResumeThread(lphDebugThread[i2]);
+	}
+}
+void SetThreadId_ToProcessMemory(DWORD dwThreadId,BOOL bReset){
+	extern DWORD ImageBase;
+	extern int MemPos_RWSection;
+	extern HANDLE hDebugProcess;
+
+	DWORD array_dwData[256];
+	SIZE_T stAccBytes;
+
+	ReadProcessMemory(hDebugProcess,
+		(void *)(LONG_PTR)(ImageBase+MemPos_RWSection),
+		array_dwData,sizeof(DWORD)*256,&stAccBytes);
+
+	int i2;
+	for(i2=0;i2<256;i2++){
+		if(bReset==0){
+			if(array_dwData[i2]==0){
+				array_dwData[i2]=dwThreadId;
+				break;
+			}
+		}
+		else{
+			if(array_dwData[i2]==dwThreadId){
+				array_dwData[i2]=0;
+				break;
+			}
+		}
+	}
+
+	WriteProcessMemory(hDebugProcess,
+		(void *)(LONG_PTR)(ImageBase+MemPos_RWSection),
+		array_dwData,sizeof(DWORD)*256,&stAccBytes);
+}
+void AddThread(DWORD dwThreadId, HANDLE hThread){
+	extern HANDLE hDebugProcess;
+	extern DWORD ImageBase;
+	extern int MemPos_RWSection;
+
+	//プロセスIDをターゲットアプリのメモリに書き込む
+	SetThreadId_ToProcessMemory(dwThreadId,0);
+
+	extern int DebugThreadNum;
+
+	//デバッグID
+	extern DWORD *lpdwDebugThreadID;
+	lpdwDebugThreadID=(DWORD *)HeapReAlloc(hHeap,0,lpdwDebugThreadID,(DebugThreadNum+1)*sizeof(DWORD));
+	lpdwDebugThreadID[DebugThreadNum]=dwThreadId;
+
+	//デバッグハンドル
+	extern HANDLE *lphDebugThread;
+	lphDebugThread=(HANDLE *)HeapReAlloc(hHeap,0,lphDebugThread,(DebugThreadNum+1)*sizeof(HANDLE));
+	lphDebugThread[DebugThreadNum]=hThread;
+
+	//カウンタ
+	DebugThreadNum++;
+}
+void ReadOpBuffer(){
+	extern int FileSize_CodeSection;
+
+	extern char *OpBuffer;
+	if(OpBuffer) HeapDefaultFree(OpBuffer);
+	OpBuffer=(char *)HeapAlloc(hHeap,0,FileSize_CodeSection);
+
+	extern HANDLE hDebugProcess;
+	extern DWORD ImageBase;
+	extern int MemPos_CodeSection;
+	SIZE_T stAccByte;
+	ReadProcessMemory(hDebugProcess,(void *)(LONG_PTR)(ImageBase+MemPos_CodeSection),OpBuffer,FileSize_CodeSection,&stAccByte);
+}
+char *MakeSingleStepCode(){
+	extern DWORD ImageBase;
+	extern int MemPos_CodeSection;
+
+	extern int FileSize_CodeSection;
+	char *buffer;
+	buffer=(char *)HeapAlloc(hHeap,0,FileSize_CodeSection);
+
+	extern char *OpBuffer;
+	memcpy(buffer,OpBuffer,FileSize_CodeSection);
+
+	extern int MaxLineInfoNum;
+	extern LINEINFO *pLineInfo;
+	int i2;
+	for(i2=0;i2<MaxLineInfoNum;i2++){
+		if(!(
+			pLineInfo[i2].dwCodeType&CODETYPE_SYSTEMPROC||
+			pLineInfo[i2].dwCodeType&CODETYPE_DEBUGPROC
+			)){
+			//int 3
+			buffer[pLineInfo[i2].TopObp]=(char)0xCC;
+		}
+	}
+
+	return buffer;
+}
+void DeleteDebugInfo(void);
+void DebugProgram(void){
+	extern HWND hMainDlg;
+	extern char OutputFileName[MAX_PATH];
+	extern DWORD ImageBase;
+	extern int MemPos_CodeSection;
+	extern int MemPos_RWSection;
+	extern int FileSize_CodeSection;
+	extern char *OpBuffer;
+	int i2,i3,i4;
+	char temporary[VN_SIZE];
+	DWORD dwData[256];
+	SIZE_T stAccBytes;
+
+	extern BOOL bDll;
+	char ExeFilePathForDll[MAX_PATH];
+	if(bDll){
+		//DLLをデバッグする場合
+		extern char szDebugExeForDll[1024];
+		if(szDebugExeForDll[0]){
+			//指定済み
+			lstrcpy(ExeFilePathForDll,szDebugExeForDll);
+		}
+		else{
+			//ユーザーに実行ファイルを選択させる
+			extern HWND hOwnerEditor;
+			extern LPSTR ExeFileFilter;
+			if(!GetFilePathDialog(hOwnerEditor,ExeFilePathForDll,ExeFileFilter,"デバッグ用の実行可能ファイルを指定してください。",1)) return;
+		}
+	}
+
+	//"中断"
+	SetDlgItemText(hMainDlg,IDOK,STRING_STOP);
+
+	//スレッド情報
+	extern DWORD *lpdwDebugThreadID;
+	extern HANDLE *lphDebugThread;
+	extern int DebugThreadNum;
+	lpdwDebugThreadID=(DWORD *)HeapAlloc(hHeap,0,1);
+	lphDebugThread=(HANDLE *)HeapAlloc(hHeap,0,1);
+	DebugThreadNum=0;
+
+	//カレントディレクトリを設定
+	extern char BasicCurDir[MAX_PATH];
+	SetCurrentDirectory(BasicCurDir);
+
+	SendDlgItemMessage(hMainDlg,IDC_SHOWERROR,BM_SETCHECK,BST_UNCHECKED,0);
+	SendDlgItemMessage(hMainDlg,IDC_SHOWDEBUG,BM_SETCHECK,BST_CHECKED,0);
+	SendMessage(hMainDlg,WM_COMMAND,IDC_SHOWDEBUG,0);
+
+
+
+	extern BOOL bAttach;
+	if(bAttach){
+		extern DWORD dwAttachProcessId;
+
+		//プロセスIDを元にハンドルを取得
+		HANDLE hProcess;
+		hProcess=OpenProcess(PROCESS_ALL_ACCESS,0,dwAttachProcessId);
+		if(!hProcess) goto AttachError;
+
+		//そのプロセスにおける実行モジュールのインスタンスハンドルを取得
+		HINSTANCE hModule;
+		DWORD cbReturned;
+		if(!EnumProcessModules( hProcess, &hModule, sizeof(HINSTANCE), &cbReturned )) goto AttachError;
+
+		//実行ファイル名を取得
+		GetModuleFileNameEx(hProcess,hModule,OutputFileName,MAX_PATH);
+
+		CloseHandle(hProcess);
+
+
+		//デバッグ用の拡張情報を取得
+		ReadDebugFile();
+
+		if(!DebugActiveProcess(dwAttachProcessId)){
+AttachError:
+			DebugMessage("アタッチに失敗しました。");
+			return;
+		}
+	}
+	else{
+		if(!ReadDebugFile()){
+			extern BOOL bDebugCompile;
+			bDebugCompile=1;
+			OutputExe();
+			ReadDebugFile();
+		}
+
+		//スレッドを生成
+		STARTUPINFO si;
+		PROCESS_INFORMATION pi;
+		memset(&si,0,sizeof(STARTUPINFO));
+		si.cb=sizeof(STARTUPINFO);
+		if(!bDll){
+			//EXEファイルをデバッグ
+			CreateProcess(OutputFileName,"",NULL,NULL,0,NORMAL_PRIORITY_CLASS|DEBUG_ONLY_THIS_PROCESS,NULL,NULL,&si,&pi);
+		}
+		else{
+			//DLLファイルをデバッグ
+			CreateProcess(ExeFilePathForDll,"",NULL,NULL,0,NORMAL_PRIORITY_CLASS|DEBUG_ONLY_THIS_PROCESS,NULL,NULL,&si,&pi);
+		}
+
+		CloseHandle(pi.hProcess);
+		CloseHandle(pi.hThread);
+	}
+
+
+
+	extern BOOL bClipCompileView;
+	//"プログラムを実行しています（デバッグ中）"
+	MakeMessageText(temporary,STRING_DEBUGGING,0);
+	SetDlgItemText(hMainDlg,IDC_MESSAGE,temporary);
+	if(bClipCompileView) InvalidateRect(GetDlgItem(hMainDlg,IDC_PROGRESS),NULL,1);
+
+	char *SingleStepCodeBuffer;
+	SingleStepCodeBuffer=0;
+
+	SUBINFO *psi;
+
+	extern DWORD dwStepRun;
+	BOOL bFirstBreak=1;
+	CONTEXT Context;
+	HANDLE hMainThread;
+	extern HANDLE hDebugProcess;
+
+	DEBUG_EVENT de;
+	memset(&de,0,sizeof(DEBUG_EVENT));
+
+	while(WaitForDebugEvent(&de,INFINITE)){
+		if(de.dwDebugEventCode==LOAD_DLL_DEBUG_EVENT){
+			WCHAR wcBuf[MAX_PATH];
+			LONG_PTR lpData;
+
+			wcBuf[0]=0;
+			temporary[0]=0;
+
+			if(de.u.LoadDll.lpImageName){
+				if(!ReadProcessMemory(hDebugProcess,de.u.LoadDll.lpImageName,&lpData,sizeof(LONG_PTR),&stAccBytes)){
+					sprintf(temporary,"ロードされたDLLの名前取得（アドレス:&H%08x）に失敗しました。\r\n",(DWORD)(LONG_PTR)de.u.LoadDll.lpImageName);
+					DebugMessage(temporary);
+					goto NextContinue;
+				}
+				if(!ReadProcessMemory(hDebugProcess,(void *)lpData,wcBuf,sizeof(WCHAR)*MAX_PATH,&stAccBytes)){
+					sprintf(temporary,"ロードされたDLLの名前取得（アドレス:&H%08x）に失敗しました。\r\n",lpData);
+					DebugMessage(temporary);
+					goto NextContinue;
+				}
+
+				if(de.dwThreadId,de.u.LoadDll.fUnicode)
+					WideCharToMultiByte(CP_ACP,0,wcBuf,-1,temporary,255,NULL,NULL);
+				else lstrcpy(temporary,(char *)wcBuf);
+			}
+			else{
+				//アタッチした場合
+				GetModuleFileNameEx(hDebugProcess,(HINSTANCE)de.u.LoadDll.lpBaseOfDll,temporary,MAX_PATH);
+			}
+
+			char temp2[1024];
+			sprintf(temp2,"\"%s\" をロードしました。\r\n",temporary);
+			DebugMessage(temp2);
+
+			if(lstrcmpi(temporary, OutputFileName)==0){
+				ImageBase=(DWORD)(LONG_PTR)de.u.LoadDll.lpBaseOfDll;
+				AddThread(de.dwThreadId,hMainThread);
+
+				//実行用コードバッファを読み取る
+				ReadOpBuffer();
+
+				//シングルステップ用のコードバッファを作成
+				SingleStepCodeBuffer=MakeSingleStepCode();
+			}
+		}
+
+		else if(de.dwDebugEventCode==CREATE_PROCESS_DEBUG_EVENT){
+			hDebugProcess=de.u.CreateProcessInfo.hProcess;
+			hMainThread=de.u.CreateProcessInfo.hThread;
+			if(bDll) goto NextContinue;
+
+			//実行用コードバッファを読み取る
+			ReadOpBuffer();
+
+			//シングルステップ用のコードバッファを作成
+			SingleStepCodeBuffer=MakeSingleStepCode();
+
+			AddThread(de.dwThreadId,de.u.CreateProcessInfo.hThread);
+		}
+		else if(de.dwDebugEventCode==CREATE_THREAD_DEBUG_EVENT){
+			AddThread(de.dwThreadId,de.u.CreateThread.hThread);
+		}
+		else if(de.dwDebugEventCode==EXIT_PROCESS_DEBUG_EVENT){
+			//プロセスIDをターゲットアプリのメモリから消去
+			SetThreadId_ToProcessMemory(de.dwThreadId,1);
+
+			//"スレッド(&H%X)はコード &H%X で終了しました。\r\n"
+			sprintf(temporary,STRING_DEBUG_THREADFINISH,de.dwThreadId,de.u.ExitProcess.dwExitCode);
+			DebugMessage(temporary);
+
+			//"デバッグは正常に終了しました。"
+			MakeMessageText(temporary,STRING_DEBUG_FINISH,0);
+			SetDlgItemText(hMainDlg,IDC_MESSAGE,temporary);
+			if(bClipCompileView) InvalidateRect(GetDlgItem(hMainDlg,IDC_PROGRESS),NULL,1);
+
+			//"プログラムはコード &H%X で終了しました。\r\n"
+			sprintf(temporary,STRING_DEBUG_PROCESSFINISH,de.u.ExitProcess.dwExitCode);
+			DebugMessage(temporary);
+			break;
+		}
+		else if(de.dwDebugEventCode==EXIT_THREAD_DEBUG_EVENT){
+			//プロセスIDをターゲットアプリのメモリから消去
+			SetThreadId_ToProcessMemory(de.dwThreadId,1);
+
+			//"スレッド(&H%X)はコード &H%X で終了しました。\r\n"
+			sprintf(temporary,STRING_DEBUG_THREADFINISH,de.dwThreadId,de.u.ExitThread.dwExitCode);
+			DebugMessage(temporary);
+
+			//以前にシングルステップ実行をした場合
+			//ステップ実行を解除
+			if(dwStepRun){
+				extern HWND hDebugWnd;
+				if(hDebugWnd) SendMessage(hDebugWnd,WM_VARLIST_CLOSE,0,0);
+
+				for(i4=0;i4<DebugThreadNum;i4++){
+					if(de.dwThreadId==lpdwDebugThreadID[i4]) break;
+				}
+				Context.ContextFlags=CONTEXT_CONTROL;
+				GetThreadContext(lphDebugThread[i4],&Context);
+
+				ReleaseSingleStep(lphDebugThread[i4],&Context);
+			}
+
+			for(i2=0;i2<DebugThreadNum;i2++){
+				if(lpdwDebugThreadID[i2]==de.dwThreadId){
+					DebugThreadNum--;
+					for(;i2<DebugThreadNum;i2++){
+						lpdwDebugThreadID[i2]=lpdwDebugThreadID[i2+1];
+						lphDebugThread[i2]=lphDebugThread[i2+1];
+					}
+					break;
+				}
+			}
+		}
+		else if(de.dwDebugEventCode==OUTPUT_DEBUG_STRING_EVENT){
+			ReadProcessMemory(hDebugProcess,(void *)de.u.DebugString.lpDebugStringData,temporary,de.u.DebugString.nDebugStringLength,&stAccBytes);
+			DebugMessage(temporary);
+		}
+		else if(de.dwDebugEventCode==EXCEPTION_DEBUG_EVENT){
+
+			//初回例外は無視
+			if(bFirstBreak){
+				bFirstBreak=0;
+				goto NextContinue;
+			}
+
+			if(de.u.Exception.ExceptionRecord.ExceptionCode==STATUS_INVALID_HANDLE){
+
+				//"スレッド(&H%X)でハンドル違反がありました(EPI=&H%08X)。\r\n"
+				sprintf(temporary,STRING_DEBUG_THREAD_INVALID_HANDLE,de.dwThreadId,(LONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress);
+				DebugMessage(temporary);
+
+				MessageBeep(MB_ICONEXCLAMATION);
+				ShowVarList(&de,1);
+				break;
+			}
+			if(de.u.Exception.ExceptionRecord.ExceptionCode==EXCEPTION_ACCESS_VIOLATION){
+
+				//"スレッド(&H%X)でアクセス違反がありました(EPI=&H%08X)。\r\n"
+				sprintf(temporary,STRING_DEBUG_THREAD_ACCESSVIOLATION,de.dwThreadId,(LONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress);
+				DebugMessage(temporary);
+
+				MessageBeep(MB_ICONEXCLAMATION);
+				ShowVarList(&de,1);
+				break;
+			}
+			else if(de.u.Exception.ExceptionRecord.ExceptionCode==EXCEPTION_BREAKPOINT){
+				i3=dwStepRun;
+
+				for(i4=0;i4<DebugThreadNum;i4++){
+					if(de.dwThreadId==lpdwDebugThreadID[i4]) break;
+				}
+				Context.ContextFlags=CONTEXT_CONTROL;
+				GetThreadContext(lphDebugThread[i4],&Context);
+
+				if(i3==0||
+					i3&&(!(ImageBase+MemPos_CodeSection<=Context.Rip&&Context.Rip<ImageBase+MemPos_CodeSection+FileSize_CodeSection))
+					){
+					//"スレッド(&H%X)のブレーク ポイント(EPI=&H%08X)。\r\n"
+					sprintf(temporary,STRING_DEBUG_BREAKPOINT,de.dwThreadId,(LONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress);
+					DebugMessage(temporary);
+				}
+
+				ShowVarList(&de,0);
+
+				//以前にシングルステップ実行をした場合
+				//ステップ実行を解除
+				if(i3) ReleaseSingleStep(lphDebugThread[i4],&Context);
+
+				if(dwStepRun){
+					//新たにシングルステップを行う場合
+
+					if(ImageBase+MemPos_CodeSection <= Context.Rip &&
+						Context.Rip < ImageBase+MemPos_CodeSection+FileSize_CodeSection){
+						//Debug命令語が続く場合はシングルステップは不要になるので、無効にする
+						//（オリジナルコード内のみ）
+						if(OpBuffer[Context.Rip-ImageBase-MemPos_CodeSection]==(char)0xCC)
+							dwStepRun=0;
+					}
+					if(dwStepRun==1){
+						//ステップイン
+StepIn:
+						//シングルステップON
+						WriteProcessMemory(hDebugProcess,
+							(void *)(LONG_PTR)(ImageBase+MemPos_CodeSection),
+							SingleStepCodeBuffer,FileSize_CodeSection,&stAccBytes);
+
+						//次の命令語のブレーク命令は解除しておく（シングルステップ実行後のみ）
+						//（オリジナルコード内のみ）
+						if(i3&&ImageBase+MemPos_CodeSection<=Context.Rip&&Context.Rip<ImageBase+MemPos_CodeSection+FileSize_CodeSection)
+							WriteProcessMemory(hDebugProcess,(void *)Context.Rip,&OpBuffer[Context.Rip-ImageBase-MemPos_CodeSection],1,&stAccBytes);
+
+						//他のスレッドを一時中断
+						for(i4=0;i4<DebugThreadNum;i4++){
+							if(de.dwThreadId!=lpdwDebugThreadID[i4])
+								SuspendThread(lphDebugThread[i4]);
+						}
+					}
+					else if(dwStepRun==2){
+						//ステップオーバー
+
+						BOOL bRet;
+						bRet=ReadProcessMemory(hDebugProcess,
+							(void *)Context.Rip,
+							temporary,
+							5,
+							&stAccBytes);
+						if(!bRet) MessageBox(hMainDlg,"プロセスメモリーの読み込みに失敗","error",MB_OK);
+
+						extern SUBINFO *pSub_DebugSys_EndProc;
+						if((BYTE)temporary[0]==0xE8&&
+							*((long *)(temporary+1))+5==(long)rva_to_real(pSub_DebugSys_EndProc->CompileAddress)-(long)Context.Rip){
+							//プロシージャの終端位置の場合はステップインを行う
+							goto StepIn;
+						}
+
+						//スレッドのプロシージャ実行状況を取得
+						bRet=ReadProcessMemory(hDebugProcess,
+							(void *)(LONG_PTR)(ImageBase+MemPos_RWSection),
+							dwData,sizeof(DWORD)*256,&stAccBytes);
+						if(!bRet) MessageBox(hMainDlg,"プロセスメモリーの読み込みに失敗","error",MB_OK);
+						for(i2=0;;i2++){
+							if(dwData[i2]==de.dwThreadId) break;
+						}
+						GetDebugThreadInfo(i2);
+
+						extern int GlobalOpBufferSize;
+						extern DEBUG_PROCINFO dpi;
+						if(ImageBase+MemPos_CodeSection<=dpi.lpqwObp[dpi.num]&&
+							dpi.lpqwObp[dpi.num]<ImageBase+MemPos_CodeSection+GlobalOpBufferSize){
+							//シングルステップON
+							WriteProcessMemory(hDebugProcess,
+								(void *)(LONG_PTR)(ImageBase+MemPos_CodeSection),
+								SingleStepCodeBuffer,
+								GlobalOpBufferSize,
+								&stAccBytes);
+						}
+						else{
+							//プロシージャを識別
+							psi=GetSubFromObp(dpi.lpqwObp[dpi.num]);
+
+							//シングルステップON
+							WriteProcessMemory(hDebugProcess,
+								(void *)(LONG_PTR)rva_to_real(psi->CompileAddress),
+								SingleStepCodeBuffer+psi->CompileAddress,
+								psi->EndOpAddr-psi->CompileAddress,
+								&stAccBytes);
+						}
+						DeleteDebugThreadInfo();
+
+						//次の命令語のブレーク命令は解除しておく（シングルステップ実行後のみ）
+						//（オリジナルコード内のみ）
+						if(i3&&ImageBase+MemPos_CodeSection<=Context.Rip&&Context.Rip<ImageBase+MemPos_CodeSection+FileSize_CodeSection)
+							WriteProcessMemory(hDebugProcess,(void *)Context.Rip,&OpBuffer[Context.Rip-ImageBase-MemPos_CodeSection],1,&stAccBytes);
+
+						//他のスレッドを一時中断
+						for(i4=0;i4<DebugThreadNum;i4++){
+							if(de.dwThreadId!=lpdwDebugThreadID[i4])
+								SuspendThread(lphDebugThread[i4]);
+						}
+					}
+				}
+			}
+			else if(de.u.Exception.ExceptionRecord.ExceptionCode==STATUS_INTEGER_DIVIDE_BY_ZERO){
+				//"0による除算が行われました。スレッド(&H%X) ブレーク ポイント(EPI=&H%08X)。\r\n"
+				sprintf(temporary,STRING_DEBUG_DIVIDE_BY_ZERO,de.dwThreadId,(LONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress);
+				DebugMessage(temporary);
+
+				ShowVarList(&de,1);
+				break;
+			}
+			else{
+				//"例外処理\ncode:%X"
+				sprintf(temporary,STRING_DEBUG_ERROR,de.u.Exception.ExceptionRecord.ExceptionCode);
+				MessageBox(0,temporary,"ActiveBasic Debug",0);
+			}
+		}
+NextContinue:
+		ContinueDebugEvent(de.dwProcessId,de.dwThreadId,DBG_CONTINUE);
+	}
+
+	//シングルステップ用のコードバッファを解放
+	if(SingleStepCodeBuffer) HeapDefaultFree(SingleStepCodeBuffer);
+
+	extern HWND hDebugWnd;
+	if(hDebugWnd) SendMessage(hDebugWnd,WM_COMMAND,IDCANCEL,0);
+
+	//スレッド情報を解放
+	HeapDefaultFree(lpdwDebugThreadID);
+	HeapDefaultFree(lphDebugThread);
+
+	//デバッグに利用した情報を解放（ReadDebugで確保した情報）
+	DeleteDebugInfo();
+
+	//"閉じる"
+	SetDlgItemText(hMainDlg,IDOK,STRING_CLOSE);
+}
+void DeleteDebugInfo(void){
+	int i2;
+
+	//インクルード情報を解放
+	extern INCLUDEFILEINFO IncludeFileInfo;
+	for(i2=0;i2<IncludeFileInfo.FilesNum;i2++)
+		HeapDefaultFree(IncludeFileInfo.ppFileNames[i2]);
+	HeapDefaultFree(IncludeFileInfo.ppFileNames);
+
+	//グローバル変数に関する情報を解放
+	extern VARIABLE *GlobalVar;
+	HeapDefaultFree(GlobalVar);
+
+	//ローカル変数に関する情報を解放
+	extern SUBINFO **ppSubHash;
+	SUBINFO *psi;
+	for(i2=0;i2<MAX_HASH;i2++){
+		psi=ppSubHash[i2];
+		while(psi){
+			if(psi->bCompile)
+				HeapDefaultFree(psi->pVar);
+
+			psi=psi->pNextData;
+		}
+	}
+
+	//列挙型に関するメモリを解放
+	DeleteEnumInfo();
+
+	//クラスに関するメモリを解放
+	delete pobj_DBClass;
+	pobj_DBClass=0;
+
+	//サブルーチン情報のメモリ解放
+	DeleteSubInfo();
+
+	//定数に関する情報を解放
+	DeleteConstInfo();
+
+	//ソースコードを解放
+	extern char *pBaseBuffer;
+	HeapDefaultFree(pBaseBuffer);
+
+	//コードと行番号の関係を解放
+	extern LINEINFO *pLineInfo;
+	HeapDefaultFree(pLineInfo);
+
+	//コードバッファを解放
+	extern char *OpBuffer;
+	if(OpBuffer){
+		HeapDefaultFree(OpBuffer);
+		OpBuffer=0;
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/FunctionValue.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/FunctionValue.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/FunctionValue.h	(revision 178)
@@ -0,0 +1,23 @@
+/* 関数定数 */
+
+//データ型変換
+#define FUNC_CUDBL	0x0210
+
+//文字列
+#define FUNC_LEN	0x031D
+
+//メモリ操作
+#define FUNC_VARPTR		0x0591
+#define FUNC_OBJPTR		0x0592
+
+//その他
+#define FUNC_ADDRESSOF	0x0619
+#define FUNC_SIZEOF		0x0620
+
+//ポインタ
+#define FUNC_GETDOUBLE	0x0630
+#define FUNC_GETSINGLE	0x0631
+#define FUNC_GETQWORD	0x0632
+#define FUNC_GETDWORD	0x0634
+#define FUNC_GETWORD	0x0635
+#define FUNC_GETBYTE	0x0636
Index: tag/abdev(2007.06.20)/BasicCompiler64/MakePeHdr.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/MakePeHdr.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/MakePeHdr.cpp	(revision 178)
@@ -0,0 +1,1718 @@
+#include <jenga/include/common/Environment.h>
+
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+
+////////////////////////////
+// 特殊関数の構造体ポインタ
+////////////////////////////
+
+// グローバル関数、静的メソッド
+UserProc
+	*pSub_System_StartupProgram,
+	*pSub_DebugSys_StartProc,
+	*pSub_DebugSys_EndProc,
+	*pSub_DebugSys_SaveContext,
+	*pSub_System_GetEip,
+	*pSub_System_InitDllGlobalVariables,
+	*pSub_System_InitStaticLocalVariables,
+	*pSub_System_Call_Destructor_of_GlobalObject,
+	*pSub_System_GetSp,
+	*pSub_pow,
+	*pSub_calloc,
+	*pSub_realloc,
+	*pSub_free,
+	*pSub_System_GC_malloc_ForObject,
+	*pSub_System_GC_malloc_ForObjectPtr,
+	*pSub_System_GC_free_for_SweepingDelete,
+	*pSubStaticMethod_System_TypeBase_InitializeUserTypes;
+
+// 動的メソッド
+UserProc
+	*pUserProc_System_CGarbageCollection_RegisterGlobalRoots;
+
+
+//////////////////////////////
+// 各セクションの位置とサイズ
+int FileSize_CodeSection,
+	FileSize_ExportSection,
+	FileSize_ImportSection,
+	FileSize_DataSection,
+	FileSize_RWSection,
+	FileSize_RSrcSection,
+	FileSize_RelocSection,
+	FileSize_DebugSection;
+int FilePos_CodeSection,
+	FilePos_ExportSection,
+	FilePos_ImportSection,
+	FilePos_DataSection,
+	FilePos_RWSection,
+	FilePos_RSrcSection,
+	FilePos_RelocSection,
+	FilePos_DebugSection;
+int MemSize_CodeSection,
+	MemSize_ExportSection,
+	MemSize_ImportSection,
+	MemSize_DataSection,
+	MemSize_RWSection,
+	MemSize_RSrcSection,
+	MemSize_RelocSection,
+	MemSize_DebugSection;
+int MemPos_CodeSection,
+	MemPos_ExportSection,
+	MemPos_ImportSection,
+	MemPos_DataSection,
+	MemPos_RWSection,
+	MemPos_RSrcSection,
+	MemPos_RelocSection,
+	MemPos_DebugSection;
+int bUse_CodeSection,
+	bUse_ExportSection,
+	bUse_ImportSection,
+	bUse_DataSection,
+	bUse_RWSection,
+	bUse_RSrcSection,
+	bUse_RelocSection,
+	bUse_DebugSection;
+
+
+void DebugVariable(void){
+	char temporary[255];
+	sprintf(temporary,"_DebugSys_dwThreadID[255]%c%cDWord",1,ESC_AS);
+	OpcodeDim(temporary,DIMFLAG_INITDEBUGVAR);
+	sprintf(temporary,"_DebugSys_ProcNum[255]%c%cDWord",1,ESC_AS);
+	OpcodeDim(temporary,DIMFLAG_INITDEBUGVAR);
+	sprintf(temporary,"_DebugSys_lplpObp[255]%c%c*ULONG_PTR",1,ESC_AS);
+	OpcodeDim(temporary,DIMFLAG_INITDEBUGVAR);
+	sprintf(temporary,"_DebugSys_lplpSpBase[255]%c%c*ULONG_PTR",1,ESC_AS);
+	OpcodeDim(temporary,DIMFLAG_INITDEBUGVAR);
+}
+
+void Compile(void){
+	extern HWND hMainDlg;
+	extern HWND hOwnerEditor;
+	extern HANDLE hHeap;
+	extern BOOL bDebugCompile;
+	extern BOOL bDll;
+	extern DWORD ImageBase;
+	extern int obp_AllocSize;
+	extern char *basbuf;
+	extern char OutputFileName[MAX_PATH];
+	int i,i2,i3,i4,i5;
+	char temporary[MAX_PATH],*temp2;
+	HANDLE hFile;
+
+
+	//コードセクションのメモリ上の位置
+	MemPos_CodeSection=		0x1000;
+
+	//データセクションのメモリ上の位置（仮定）
+	MemPos_DataSection=		0x10000000;
+
+
+	//エクスポート セクションを利用するかどうか
+	if(bDll) bUse_ExportSection=1;
+	else bUse_ExportSection=0;
+
+
+	//////////////////
+	// データテーブル
+	dataTable.Init();
+	if(bDebugCompile){
+		dataTable.Add( (long)0x00000002 );
+	}
+
+
+	//////////////////////
+	// コード生成前の準備
+	//////////////////////
+
+	//重複エラー情報管理のメモリを確保（グローバル領域コンパイル用）
+	extern char **SynonymErrorWords;
+	extern int SynonymErrorNum;
+	SynonymErrorNum=0;
+	SynonymErrorWords=(char **)HeapAlloc(hHeap,0,1);
+
+	//列挙体に関する情報の初期化
+	CEnumParent::InitEnum();
+
+	//列挙体からクラスコードを生成
+	char *temp;
+	temp=CEnumParent::GenerateCodes();
+	AddSourceCode(temp);
+	HeapDefaultFree(temp);
+
+	//関数ポインタ情報を初期化
+	Smoothie::meta.procPointers.clear();
+
+	// 名前空間情報を取得
+	NamespaceScopesCollection::CollectNamespaces(
+		Smoothie::Lexical::source.GetBuffer(),
+		Smoothie::meta.namespaceScopesCollection
+	);
+
+	//クラス名を取得（詳細情報はGetAllClassInfoで取得）
+	//   GetSubInfo関数の中で参照されるオブジェクト名を事前に取得する。
+	//     ※オブジェクトの内容までは取得しない
+	pobj_DBClass=new Classes();
+	pobj_DBClass->InitNames();
+
+	//TypeDef情報を初期化
+	Smoothie::meta.typeDefs.Init();
+
+	//定数情報を取得
+	GetConstInfo();
+
+	//サブルーチン（ユーザー定義、DLL関数）の識別子、アドレスを取得
+	pobj_CompilingClass=0;
+	GetSubInfo();
+
+	//クラス情報を取得（※注 - GetSubInfoの後に呼び出す）
+	pobj_DBClass->GetAllClassInfo();
+
+	//コードと行番号の関係
+	extern LINEINFO *pLineInfo;
+	extern int MaxLineInfoNum;
+	pLineInfo=(LINEINFO *)HeapAlloc(hHeap,0,1);
+	MaxLineInfoNum=0;
+
+
+	///////////////////////////
+	// 最低限必要な関数を取得
+	///////////////////////////
+	cp=-1;
+
+	if(pSub_System_StartupProgram=GetSubHash("_System_StartupProgram",1))
+		pSub_System_StartupProgram->Using();
+
+	if(pSub_DebugSys_StartProc=GetSubHash("_DebugSys_StartProc",1))
+		pSub_DebugSys_StartProc->Using();
+
+	if(pSub_DebugSys_EndProc=GetSubHash("_DebugSys_EndProc",1))
+		pSub_DebugSys_EndProc->Using();
+
+	if(pSub_DebugSys_SaveContext=GetSubHash("_DebugSys_SaveContext",1))
+		pSub_DebugSys_SaveContext->Using();
+
+	if(pSub_System_GetEip=GetSubHash("_System_GetEip",1)){
+		pSub_System_GetEip->Using();
+		pSub_System_GetEip->ThisIsSystemProc();
+	}
+
+	if(pSub_System_InitDllGlobalVariables=GetSubHash("_System_InitDllGlobalVariables",1)){
+		pSub_System_InitDllGlobalVariables->Using();
+		pSub_System_InitDllGlobalVariables->ThisIsSystemProc();
+	}
+
+	if(pSub_System_InitStaticLocalVariables=GetSubHash("_System_InitStaticLocalVariables",1)){
+		pSub_System_InitStaticLocalVariables->Using();
+		pSub_System_InitStaticLocalVariables->ThisIsSystemProc();
+	}
+
+	if(pSub_System_Call_Destructor_of_GlobalObject=GetSubHash("_System_Call_Destructor_of_GlobalObject",1)){
+		pSub_System_Call_Destructor_of_GlobalObject->Using();
+		pSub_System_Call_Destructor_of_GlobalObject->ThisIsSystemProc();
+	}
+
+	if(pSub_System_GetSp=GetSubHash("_System_GetSp",1)){
+		pSub_System_GetSp->Using();
+		pSub_System_GetSp->ThisIsSystemProc();
+	}
+
+	if(pSub_pow=GetSubHash("pow",1))
+		pSub_pow->Using();
+
+	if(pSub_calloc=GetSubHash("calloc",1))
+		pSub_calloc->Using();
+
+	if(pSub_realloc=GetSubHash("realloc",1))
+		pSub_realloc->Using();
+
+	if(pSub_free=GetSubHash("free",1))
+		pSub_free->Using();
+
+	if( pSub_System_GC_malloc_ForObject = GetSubHash( "_System_GC_malloc_ForObject",1 ) )
+		pSub_System_GC_malloc_ForObject->Using();
+
+	if( pSub_System_GC_malloc_ForObjectPtr = GetSubHash( "_System_GC_malloc_ForObjectPtr",1 ) )
+		pSub_System_GC_malloc_ForObjectPtr->Using();
+
+	if( pSub_System_GC_free_for_SweepingDelete = GetSubHash( "_System_GC_free_for_SweepingDelete",1 ) )
+		pSub_System_GC_free_for_SweepingDelete->Using();
+
+	if( pSubStaticMethod_System_TypeBase_InitializeUserTypes = GetSubHash( "ActiveBasic.Core._System_TypeBase.InitializeUserTypes",1 ) ){
+		pSubStaticMethod_System_TypeBase_InitializeUserTypes->Using();
+		pSubStaticMethod_System_TypeBase_InitializeUserTypes->ThisIsAutoGenerationProc();
+	}
+
+	if( pUserProc_System_CGarbageCollection_RegisterGlobalRoots = GetClassMethod( "_System_CGarbageCollection", "RegisterGlobalRoots" ) ){
+		pUserProc_System_CGarbageCollection_RegisterGlobalRoots->Using();
+		pUserProc_System_CGarbageCollection_RegisterGlobalRoots->ThisIsAutoGenerationProc();
+	}
+
+
+
+	//データテーブルスケジュール
+	pobj_DataTableSchedule=new CSchedule();
+	pobj_DataTableSchedule->SetFlag(SCHEDULE_FLAG_RELOC);
+
+	//インポートテーブルスケジュール
+	//※x64はRPI（実行中アドレス）からのオフセットになるため、再配置が不要
+	pobj_ImportAddrSchedule=new CImportAddrSchedule();
+
+	//プロシージャポインタスケジュール
+	pobj_SubAddrSchedule=new CSubAddrSchedule();
+
+	//グローバル変数アドレススケジュール
+	pobj_GlobalVarSchedule=new CSchedule();
+	pobj_GlobalVarSchedule->SetFlag(SCHEDULE_FLAG_RELOC);
+
+	//グローバル変数の初期バッファ
+	extern BYTE *initGlobalBuf;
+	initGlobalBuf=(BYTE *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+
+	//リロケーション情報
+	pobj_Reloc=new CReloc();
+
+	//一時スケジューリングポインタ
+	pobj_TempSchedule=new CTempSchedule();
+
+	obp_AllocSize=8192*2;
+	OpBuffer=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,obp_AllocSize);
+	obp=0;
+
+	//レジスタのブロッキングを管理するためのオブジェクトを生成
+	pobj_BlockReg=new CBlockReg;
+
+	//レキシカルスコープ情報を初期化
+	obj_LexScopes.Init(obp);
+
+
+	/////////////////////////////////////////////////////////////////
+	// デバッグコンパイル用のログを生成する
+	/////////////////////////////////////////////////////////////////
+#ifdef _DEBUG
+	{
+		ofstream ofs("middle_code.txt");
+		ofs << basbuf << endl;
+		ofs.close();
+	}
+#endif
+
+
+	//////////////////////
+	// グローバル実行領域
+	//////////////////////
+
+	cp=-1;
+	UserProc::CompileStartForGlobalArea();
+
+	if(!bDll){
+		// 名前空間が初期化されているかをチェック
+		if( Smoothie::Lexical::liveingNamespaceScopes.size() ){
+			SetError();
+		}
+
+		//ラベル用のメモリを確保
+		extern LABEL *pLabelNames;
+		extern int MaxLabelNum;
+		pLabelNames=(LABEL *)HeapAlloc(hHeap,0,1);
+		MaxLabelNum=0;
+
+		//Gotoラベルスケジュール
+		extern GOTOLABELSCHEDULE *pGotoLabelSchedule;
+		extern int GotoLabelScheduleNum;
+		pGotoLabelSchedule=(GOTOLABELSCHEDULE *)HeapAlloc(hHeap,0,1);
+		GotoLabelScheduleNum=0;
+
+		//With情報のメモリを確保
+		extern WITHINFO WithInfo;
+		WithInfo.ppName=(char **)HeapAlloc(hHeap,0,1);
+		WithInfo.pWithCp=(int *)HeapAlloc(hHeap,0,1);
+		WithInfo.num=0;
+
+		//Continueアドレスを初期化
+		extern DWORD dwContinueAddress;
+		dwContinueAddress=-1;
+
+		//スタックフレーム管理用クラスを初期化
+		extern CStackFrame *pobj_sf;
+		pobj_sf=new CStackFrame();
+
+
+		//未完成
+		//OpBuffer[obp++]=(char)0xCC;
+
+		//sub rsp,スタックフレームサイズ
+		int StackFrameSchedule;
+		op_sub_rsp(0xFFFFFFFF);
+		StackFrameSchedule=obp-sizeof(long);
+
+		if(bDebugCompile){
+			//デバッグ用の変数を定義
+			DebugVariable();
+		}
+
+		//GC用の変数を定義
+		InitGCVariables();
+
+		//_System_StartupProgramの呼び出し
+		op_call(pSub_System_StartupProgram);
+
+		//クラスに属する静的メンバを定義
+		CMember::InitStaticMember();
+
+		//グローバル実行領域をコンパイル開始
+		CompileBuffer(0,0);
+
+		//ラベル用のメモリを解放
+		for(i=0;i<MaxLabelNum;i++){
+			if(pLabelNames[i].pName) HeapDefaultFree(pLabelNames[i].pName);
+		}
+		HeapDefaultFree(pLabelNames);
+
+		//Goto未知ラベルスケジュールを解放
+		for(i=0;i<GotoLabelScheduleNum;i++){
+			if(pGotoLabelSchedule[i].pName){
+				SetError(6,pGotoLabelSchedule[i].pName,pGotoLabelSchedule[i].now_cp);
+				HeapDefaultFree(pGotoLabelSchedule[i].pName);
+			}
+			else{
+				sprintf(temporary,"%d",pGotoLabelSchedule[i].line);
+				SetError(6,temporary,pGotoLabelSchedule[i].now_cp);
+			}
+		}
+		HeapDefaultFree(pGotoLabelSchedule);
+
+
+		///////////////////////////////////////
+		// グローバル文字列変数の解放処理
+		///////////////////////////////////////
+
+		//call _System_Call_Destructor_of_GlobalObject
+		extern UserProc *pSub_System_Call_Destructor_of_GlobalObject;
+		op_call(pSub_System_Call_Destructor_of_GlobalObject);
+
+
+		//add rsp,スタックフレームサイズ
+		op_add_RV(REG_RSP,pobj_sf->GetFrameSize());
+
+		//xor rax,rax（raxを0に初期化する）
+		op_zero_reg(REG_RAX);
+
+		//ret
+		op_ret();
+
+		//グローバル実行領域のコードサイズ
+		extern int GlobalOpBufferSize;
+		GlobalOpBufferSize=obp;
+
+		//スタックフレームスケジュール（subコマンドに渡す値）
+		*((long *)(OpBuffer+StackFrameSchedule))=pobj_sf->GetFrameSize();
+
+		//スタックフレームスケジュールを実行
+		pobj_sf->RunningSchedule();
+		delete pobj_sf;
+		pobj_sf=0;
+
+		//With情報のメモリを解放
+		for(i=0;i<WithInfo.num;i++){
+			SetError(22,"With",WithInfo.pWithCp[i]);
+			HeapDefaultFree(WithInfo.ppName[i]);
+		}
+		HeapDefaultFree(WithInfo.ppName);
+		HeapDefaultFree(WithInfo.pWithCp);
+
+		// 名前空間が正しく閉じられているかをチェック
+		if( Smoothie::Lexical::liveingNamespaceScopes.size() ){
+			SetError(63,NULL,-1);
+		}
+
+	}
+	else{
+		////////////////
+		// DLLの場合
+		////////////////
+
+
+	}
+
+	//重複エラー情報管理のメモリを解放（グローバル領域用）
+	for(i=0;i<SynonymErrorNum;i++) HeapDefaultFree(SynonymErrorWords[i]);
+	HeapDefaultFree(SynonymErrorWords);
+
+
+	StepCompileProgress();
+
+
+	/////////////////////
+	// ローカル実行領域
+	/////////////////////
+
+	//プロシージャをコンパイル開始
+	cp=0;
+	CompileLocal();
+
+	// 終了
+	///////////////////////
+
+	StepCompileProgress();
+
+
+	//レジスタのブロッキングを管理するためのオブジェクトを破棄
+	delete pobj_BlockReg;
+
+	//ネイティブコード生成はここまで
+	//////////////////////////////////////////////////////////
+
+
+
+	////////////////////////////////
+	// ここで一旦ログを取る
+	////////////////////////////////
+	Diagnose();
+
+
+
+	////////////////////////////////
+	// 使用するDLL関数のチェック
+	////////////////////////////////
+	for(i=0;i<MAX_HASH;i++){
+		extern DllProc **ppDeclareHash;
+		const DllProc *pDllProc = ppDeclareHash[i];
+		while(pDllProc){
+			if( !pDllProc->IsUsing() ){
+				pDllProc=pDllProc->pNextData;
+				continue;
+			}
+/*
+			//エラーチェック
+			HINSTANCE hLib;
+			hLib=LoadLibrary( pDllProc->GetDllFileName().c_str() );
+			if(!hLib){
+				extern char OutputFileName[MAX_PATH];
+				char temp2[MAX_PATH],temp3[MAX_PATH];
+				_splitpath(OutputFileName,temp2,temp3,NULL,NULL);
+				lstrcat(temp2,temp3);
+				lstrcpy(temp3,pDllProc->GetDllFileName().c_str());
+				GetFullPath(temp3,temp2);
+				hLib=LoadLibrary(temp3);
+
+				if(!hLib){
+					SetError(-106,pDllProc->GetDllFileName().c_str(),pDllProc->GetCodePos());
+				}
+			}
+
+			if(hLib){
+				if(!GetProcAddress(hLib,pDllProc->GetAlias().c_str())){
+					FreeLibrary(hLib);
+					SetError(-107,pDllProc->GetAlias(),pDllProc->GetCodePos());
+				}
+				FreeLibrary(hLib);
+			}
+*/
+			pDllProc=pDllProc->pNextData;
+		}
+	}
+
+
+
+	/////////////////////////////
+	// リソースデータを読み込む
+	/////////////////////////////
+	extern char ResourceFileName[MAX_PATH];
+	GetResourceData(ResourceFileName);
+
+
+	//////////////////////////////
+	// エクスポート情報（DLLのみ）
+	//////////////////////////////
+	IMAGE_EXPORT_DIRECTORY ImageExportDirectory;
+	DWORD *lpdwExportAddressTable;
+	DWORD *lpdwExportNamePointerTable;
+	WORD *lpwExportOrdinalTable;
+	char lpExportNames[8192];
+	int ExportNamesLength;
+	int ExportNum;
+	int DllMain_EntryPoint;
+
+	DllMain_EntryPoint=-1;
+	ExportNum=0;
+	ExportNamesLength=0;
+	lpdwExportAddressTable=(DWORD *)HeapAlloc(hHeap,0,1);
+	lpdwExportNamePointerTable=(DWORD *)HeapAlloc(hHeap,0,1);
+	lpwExportOrdinalTable=(WORD *)HeapAlloc(hHeap,0,1);
+
+	if(bUse_ExportSection){
+		_splitpath(OutputFileName,NULL,NULL,lpExportNames,temporary);
+		lstrcat(lpExportNames,temporary);
+		ExportNamesLength=lstrlen(lpExportNames)+1;
+
+		extern GlobalProc **ppSubHash;
+		GlobalProc *pUserProc,*psi2;
+		while(1){
+			//辞書順にサーチ
+			temporary[0]=0;
+			for(i=0,psi2=0;i<MAX_HASH;i++){
+				pUserProc=ppSubHash[i];
+				while(pUserProc){
+					if(pUserProc->IsExport()){
+						if(temporary[0]=='\0'){
+							lstrcpy(temporary,pUserProc->GetName().c_str());
+							psi2=pUserProc;
+						}
+						else{
+							i3=lstrlen(temporary);
+							i4=(int)pUserProc->GetName().size();
+							if(i3<i4) i3=i4;
+							if(memcmp(temporary,pUserProc->GetName().c_str(),i3)>0){
+								lstrcpy(temporary,pUserProc->GetName().c_str());
+								psi2=pUserProc;
+							}
+						}
+					}
+					pUserProc=pUserProc->pNextData;
+				}
+			}
+			if(psi2==0) break;
+			pUserProc=psi2;
+
+			pUserProc->ExportOff();
+
+			if( pUserProc->GetName() == "DllMain" ){
+				DllMain_EntryPoint=pUserProc->beginOpAddress;
+			}
+
+			lpdwExportAddressTable=(DWORD *)HeapReAlloc(hHeap,0,lpdwExportAddressTable,(ExportNum+1)*sizeof(DWORD));
+			lpdwExportAddressTable[ExportNum]=pUserProc->beginOpAddress;
+
+			lpdwExportNamePointerTable=(DWORD *)HeapReAlloc(hHeap,0,lpdwExportNamePointerTable,(ExportNum+1)*sizeof(DWORD));
+			lpdwExportNamePointerTable[ExportNum]=ExportNamesLength;
+
+			lpwExportOrdinalTable=(WORD *)HeapReAlloc(hHeap,0,lpwExportOrdinalTable,(ExportNum+1)*sizeof(WORD));
+			lpwExportOrdinalTable[ExportNum]=ExportNum;
+
+			lstrcpy(lpExportNames+ExportNamesLength,pUserProc->GetName().c_str());
+			ExportNamesLength+=lstrlen(lpExportNames+ExportNamesLength)+1;
+
+			ExportNum++;
+		}
+		for(i=0;i<ExportNum;i++){
+			lpdwExportNamePointerTable[i]+=
+				sizeof(IMAGE_EXPORT_DIRECTORY)+	//エクスポートディレクトリテーブルを飛び越す
+				ExportNum*sizeof(DWORD)+		//エクスポート アドレス テーブルを飛び越す
+				ExportNum*sizeof(DWORD)+		//エクスポート名ポインタ テーブルを飛び越す
+				ExportNum*sizeof(WORD);			//エクスポート序数テーブルを飛び越す
+		}
+
+		ImageExportDirectory.Characteristics=0;
+		ImageExportDirectory.TimeDateStamp=(DWORD)time(NULL);
+		ImageExportDirectory.MajorVersion=0;
+		ImageExportDirectory.MinorVersion=0;
+		ImageExportDirectory.Name=sizeof(IMAGE_EXPORT_DIRECTORY)+
+			ExportNum*sizeof(DWORD)+	//エクスポート アドレス テーブルを飛び越す
+			ExportNum*sizeof(DWORD)+	//エクスポート名ポインタ テーブルを飛び越す
+			ExportNum*sizeof(WORD);		//エクスポート序数テーブルを飛び越す
+		ImageExportDirectory.Base=1;
+		ImageExportDirectory.NumberOfFunctions=ExportNum;
+		ImageExportDirectory.NumberOfNames=ExportNum;
+		ImageExportDirectory.AddressOfFunctions=sizeof(IMAGE_EXPORT_DIRECTORY);
+		ImageExportDirectory.AddressOfNames=ImageExportDirectory.AddressOfFunctions+ExportNum*sizeof(DWORD);
+		ImageExportDirectory.AddressOfNameOrdinals=ImageExportDirectory.AddressOfNames+ExportNum*sizeof(DWORD);
+	}
+
+
+	/////////////////////
+	//インポートDLL情報
+	/////////////////////
+	extern DllProc **ppDeclareHash;
+	DllProc *pDllProc;
+	char **ppDllNames;
+	int ImportDllNum;
+
+	/*
+	インポート アドレス テーブル（ルックアップと同じ内容だが、プログラム実行時に実行アドレスに書き換えられる）
+	ルックアップ テーブル（ヒントを示すRVA）
+	IMAGE_IMPORT_DESCRIPTOR1[size=0x14]	インポートヘッダ
+	IMAGE_IMPORT_DESCRIPTOR2[size=0x14]
+	IMAGE_IMPORT_DESCRIPTOR3[size=0x14]
+	...
+	Dll名1[size=0x10]
+	Dll名2[size=0x10]
+	Dll名3[size=0x10]
+	...
+	ヒントテーブル（関数名を羅列したもの）
+	*/
+
+	/*
+	IMAGE_IMPORT_DESCRIPTOR1[size=0x14]	インポートヘッダ
+	IMAGE_IMPORT_DESCRIPTOR2[size=0x14]
+	IMAGE_IMPORT_DESCRIPTOR3[size=0x14]
+	...
+	Dll名1[size=0x10]
+	Dll名2[size=0x10]
+	Dll名3[size=0x10]
+	...
+	ルックアップ テーブル（ヒントを示すRVA）
+	ヒントテーブル
+	インポート アドレス テーブル（ルックアップと同じ内容だが、プログラム実行時に実行アドレスに書き換えられる）
+	*/
+
+	ppDllNames=(char **)HeapAlloc(hHeap,0,1);
+
+	ImportDllNum=0;
+	for(i=0;i<MAX_HASH;i++){
+		const DllProc *pDllProc=ppDeclareHash[i];
+		while(pDllProc){
+			if( !pDllProc->IsUsing() ){
+				pDllProc=pDllProc->pNextData;
+				continue;
+			}
+
+			if( pDllProc->GetDllFileName().size() > 16 ){
+				SetError(7,NULL,cp);
+				break;
+			}
+			for(i2=0;i2<ImportDllNum;i2++){
+				if( pDllProc->GetDllFileName() == ppDllNames[i2] ){
+					break;
+				}
+			}
+			if(i2==ImportDllNum){
+				ppDllNames=(char **)HeapReAlloc(hHeap,0,ppDllNames,(ImportDllNum+1)*sizeof(char **));
+				ppDllNames[ImportDllNum]=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,16);
+				lstrcpy(ppDllNames[ImportDllNum],pDllProc->GetDllFileName().c_str());
+				ImportDllNum++;
+			}
+
+			pDllProc=pDllProc->pNextData;
+		}
+	}
+
+	//IMAGE_IMPORT_DESCRIPTOR、及びルックアップ テーブル サイズの計算
+	IMAGE_IMPORT_DESCRIPTOR *pImportDescriptor;
+	int LookupSize;
+	LookupSize=0;
+	pImportDescriptor=(IMAGE_IMPORT_DESCRIPTOR *)HeapAlloc(hHeap,0,(ImportDllNum+1)*sizeof(IMAGE_IMPORT_DESCRIPTOR));
+	for(i=0;i<ImportDllNum;i++){
+		//IMAGE_IMPORT_DESCRIPTOR
+		pImportDescriptor[i].OriginalFirstThunk=LookupSize;	//※すぐ下で再計算
+		pImportDescriptor[i].TimeDateStamp=0;
+		pImportDescriptor[i].ForwarderChain=0;
+		pImportDescriptor[i].Name=i*0x10;	//※すぐ下で再計算
+		for(i2=0;i2<MAX_HASH;i2++){
+			pDllProc=ppDeclareHash[i2];
+			while(pDllProc){
+				if( !pDllProc->IsUsing() ){
+					pDllProc=pDllProc->pNextData;
+					continue;
+				}
+
+				if( pDllProc->GetDllFileName() == ppDllNames[i] ){
+					//ルックアップデータのサイズを追加
+					LookupSize+=sizeof(_int64);
+				}
+
+				pDllProc=pDllProc->pNextData;
+			}
+		}
+		LookupSize+=sizeof(_int64);	//NULL用
+	}
+	memset(&pImportDescriptor[i],0,sizeof(IMAGE_IMPORT_DESCRIPTOR));
+	for(i=0;i<ImportDllNum;i++){
+		//インポートアドレステーブル分の差分を追加
+		pImportDescriptor[i].OriginalFirstThunk+=LookupSize;
+
+		//DLL名への差分を追加
+		pImportDescriptor[i].Name+=
+			LookupSize+			//インポート アドレス テーブル
+			LookupSize+			//ルックアップテーブル
+			(ImportDllNum+1)*sizeof(IMAGE_IMPORT_DESCRIPTOR);	//IMAGE_IMPORT_DESCRIPTOR
+	}
+
+	//ルックアップ テーブル、ヒント テーブル
+	unsigned _int64 *pLookupTable;
+	pLookupTable=(unsigned _int64 *)HeapAlloc(hHeap,0,LookupSize*sizeof(_int64)+1);
+	char *pHintTable;
+	int HintSize,HintAllocSize;
+	HintSize=0;
+	HintAllocSize=128*2;
+	pHintTable=(char *)HeapAlloc(hHeap,0,HintAllocSize);
+	for(i=0,i5=0;i<ImportDllNum;i++){
+		for(i2=0;i2<MAX_HASH;i2++){
+			pDllProc=ppDeclareHash[i2];
+			while(pDllProc){
+				if( !pDllProc->IsUsing() ){
+					pDllProc=pDllProc->pNextData;
+					continue;
+				}
+
+				if( pDllProc->GetDllFileName() == ppDllNames[i] ){
+					//ルックアップの位置をセット（後にインポート アドレス テーブルにセットしなおされる）
+					pDllProc->SetLookupAddress( i5*sizeof(_int64) );
+
+					//ルックアップ テーブルの値をセット
+					pLookupTable[i5++]=
+						LookupSize+			//インポート アドレス テーブル
+						LookupSize+			//ルックアップテーブル
+						(ImportDllNum+1)*sizeof(IMAGE_IMPORT_DESCRIPTOR)+	//IMAGE_IMPORT_DESCRIPTOR
+						ImportDllNum*0x10+	//DLL名の羅列
+						HintSize;			//ヒント名へのオフセット
+
+					//ヒント テーブル
+					pHintTable[HintSize++]=0;
+					pHintTable[HintSize++]=0;
+					lstrcpy(pHintTable+HintSize,pDllProc->GetAlias().c_str());
+					i4=(int)pDllProc->GetAlias().size();
+					HintSize+=i4+1;
+					if(i4%2==0) pHintTable[HintSize++]=0;
+
+					if(HintAllocSize<HintSize+128){
+						HintAllocSize+=128;
+						pHintTable=(char *)HeapReAlloc(hHeap,0,pHintTable,HintAllocSize);
+					}
+				}
+
+				pDllProc=pDllProc->pNextData;
+			}
+		}
+		pLookupTable[i5++]=0;
+	}
+
+
+	if(bDll){
+		//DLLの場合はリロケーション情報を仮生成
+		//※正式な生成は各セクションのメモリ上のサイズが決定してから再度行う。
+		pobj_Reloc->ResetRelocBuffer();
+	}
+
+
+
+	//グローバル変数情報を扱う構造体も初期バッファの有無による配置を行う
+	//（デバッグ情報で利用される）
+	extern int AllInitGlobalVarSize;
+	foreach( Variable *pVar, globalVars ){
+		if(pVar->offset&0x80000000){
+			pVar->offset=(pVar->offset&0x7FFFFFFF)+AllInitGlobalVarSize;
+		}
+	}
+
+
+
+	////////////////////////////////////
+	// デバッグセクションを生成
+	////////////////////////////////////
+
+	//機械語コードとBasicコードの関係を整理
+	extern LINEINFO *pLineInfo;
+	extern int MaxLineInfoNum;
+	int MinObp,MaxObp;
+	LINEINFO *pTempLineInfo;
+	pTempLineInfo=(LINEINFO *)HeapAlloc(hHeap,0,MaxLineInfoNum*sizeof(LINEINFO));
+	i2=0;
+	MaxObp=0;
+	while(1){
+		for(i3=0,MinObp=0x0FFFFFFF;i3<MaxLineInfoNum;i3++){
+			if(pLineInfo[i3].TopObp<MinObp&&MaxObp<pLineInfo[i3].TopObp){
+				MinObp=pLineInfo[i3].TopObp;
+				i4=i3;
+			}
+		}
+		if(MinObp==0x0FFFFFFF) break;
+		pTempLineInfo[i2]=pLineInfo[i4];
+		MaxObp=pTempLineInfo[i2].TopObp;
+		i2++;
+	}
+	HeapDefaultFree(pLineInfo);
+	pLineInfo=(LINEINFO *)HeapAlloc(hHeap,0,i2*sizeof(LINEINFO));
+	memcpy(pLineInfo,pTempLineInfo,i2*sizeof(LINEINFO));
+	MaxLineInfoNum=i2;
+	HeapDefaultFree(pTempLineInfo);
+
+	//デバッグセクションを生成
+	CDebugSection *pobj_DebugSection;
+	pobj_DebugSection=new CDebugSection();
+	extern BOOL bDebugCompile;
+	extern BOOL bError;
+	if(bDebugCompile&&bError==0){
+		pobj_DebugSection->make();
+	}
+
+
+
+	/////////////////////////////////////
+	// 各セクションの位置とサイズを計算
+	/////////////////////////////////////
+
+	//コードセッションのファイル上のサイズ
+	if(obp%FILE_ALIGNMENT) FileSize_CodeSection=obp+(FILE_ALIGNMENT-obp%FILE_ALIGNMENT);
+	else FileSize_CodeSection=obp;
+	if(FileSize_CodeSection) bUse_CodeSection=1;
+	else bUse_CodeSection=0;
+
+	//エクスポートセクションのファイル上のサイズ
+	i=	sizeof(IMAGE_EXPORT_DIRECTORY)+	//エクスポートディレクトリテーブルを飛び越す
+		ExportNum*sizeof(DWORD)+		//エクスポート アドレス テーブルを飛び越す
+		ExportNum*sizeof(DWORD)+		//エクスポート名ポインタ テーブルを飛び越す
+		ExportNum*sizeof(WORD)+			//エクスポート序数テーブルを飛び越す
+		ExportNamesLength;				//シンボル名バッファ
+	if(bUse_ExportSection){
+		if(i%FILE_ALIGNMENT) FileSize_ExportSection=i+(FILE_ALIGNMENT-i%FILE_ALIGNMENT);
+		else FileSize_ExportSection=i;
+	}
+	else FileSize_ExportSection=0;
+
+	//インポートセクションのファイル上のサイズ
+	i=
+		LookupSize+			//インポート アドレス テーブル
+		LookupSize+			//ルックアップテーブル
+		(ImportDllNum+1)*sizeof(IMAGE_IMPORT_DESCRIPTOR)+	//IMAGE_IMPORT_DESCRIPTOR
+		ImportDllNum*0x10+	//DLL名の羅列
+		HintSize;			//ヒント名
+	if(i%FILE_ALIGNMENT) FileSize_ImportSection=i+(FILE_ALIGNMENT-i%FILE_ALIGNMENT);
+	else FileSize_ImportSection=i;
+	bUse_ImportSection=1;	//インポートセクションは必ず存在する
+
+	//データセクションのファイル上のサイズ
+	if(dataTable.GetSize()%FILE_ALIGNMENT) FileSize_DataSection=dataTable.GetSize()+(FILE_ALIGNMENT-dataTable.GetSize()%FILE_ALIGNMENT);
+	else FileSize_DataSection=dataTable.GetSize();
+	if(FileSize_DataSection) bUse_DataSection=1;
+	else bUse_DataSection=0;
+
+	//リライタブルセクションのファイル上のサイズ（グローバル変数の初期情報のみを格納）
+	extern int AllInitGlobalVarSize;
+	if(AllInitGlobalVarSize%FILE_ALIGNMENT) FileSize_RWSection=AllInitGlobalVarSize+(FILE_ALIGNMENT-AllInitGlobalVarSize%FILE_ALIGNMENT);
+	else{
+		if(AllInitGlobalVarSize) FileSize_RWSection=AllInitGlobalVarSize;
+		else FileSize_RWSection=FILE_ALIGNMENT;
+	}
+	bUse_RWSection=1;
+
+	//リソースセクションのファイル上のサイズ
+	char *RSrcSectionBuffer;
+	int RSrcSectionSize;
+	RSrcSectionBuffer=GetRSrcSectionBuffer(&RSrcSectionSize);
+	if(RSrcSectionSize%FILE_ALIGNMENT) FileSize_RSrcSection=RSrcSectionSize+(FILE_ALIGNMENT-RSrcSectionSize%FILE_ALIGNMENT);
+	else FileSize_RSrcSection=RSrcSectionSize;
+	if(FileSize_RSrcSection) bUse_RSrcSection=1;
+	else bUse_RSrcSection=0;
+
+	//リロケーションセクションのファイル上のサイズ
+	if(pobj_Reloc->length%FILE_ALIGNMENT) FileSize_RelocSection=pobj_Reloc->length+(FILE_ALIGNMENT-pobj_Reloc->length%FILE_ALIGNMENT);
+	else FileSize_RelocSection=pobj_Reloc->length;
+	if(FileSize_RelocSection) bUse_RelocSection=1;
+	else bUse_RelocSection=0;
+
+	//デバッグセクションのファイル上のサイズ
+	if(pobj_DebugSection->length%FILE_ALIGNMENT) FileSize_DebugSection=pobj_DebugSection->length+(FILE_ALIGNMENT-pobj_DebugSection->length%FILE_ALIGNMENT);
+	else FileSize_DebugSection=pobj_DebugSection->length;
+	if(FileSize_DebugSection) bUse_DebugSection=1;
+	else bUse_DebugSection=0;
+
+
+	//各セッションのファイル上の位置
+	FilePos_CodeSection=	EXE_HEADER_SIZE;
+	FilePos_ExportSection=	FilePos_CodeSection+
+							FileSize_CodeSection;
+	FilePos_ImportSection=	FilePos_ExportSection+
+							FileSize_ExportSection;
+	FilePos_DataSection=	FilePos_ImportSection+
+							FileSize_ImportSection;
+	FilePos_RWSection=		FilePos_DataSection+
+							FileSize_DataSection;
+	FilePos_RSrcSection=	FilePos_RWSection+
+							FileSize_RWSection;
+	FilePos_RelocSection=	FilePos_RSrcSection+
+							FileSize_RSrcSection;
+	FilePos_DebugSection=	FilePos_RelocSection+
+							FileSize_RelocSection;
+
+	//コードセッションのメモリ上のサイズ
+	if(FileSize_CodeSection%MEM_ALIGNMENT) MemSize_CodeSection=FileSize_CodeSection+(MEM_ALIGNMENT-FileSize_CodeSection%MEM_ALIGNMENT);
+	else MemSize_CodeSection=FileSize_CodeSection;
+
+	//エクスポートセクションのメモリ上のサイズ
+	if(FileSize_ExportSection%MEM_ALIGNMENT) MemSize_ExportSection=FileSize_ExportSection+(MEM_ALIGNMENT-FileSize_ExportSection%MEM_ALIGNMENT);
+	else MemSize_ExportSection=FileSize_ExportSection;
+
+	//インポートセクションのメモリ上のサイズ
+	if(FileSize_ImportSection%MEM_ALIGNMENT) MemSize_ImportSection=FileSize_ImportSection+(MEM_ALIGNMENT-FileSize_ImportSection%MEM_ALIGNMENT);
+	else MemSize_ImportSection=FileSize_ImportSection;
+
+	//データセクションのメモリ上のサイズ
+	if(FileSize_DataSection%MEM_ALIGNMENT) MemSize_DataSection=FileSize_DataSection+(MEM_ALIGNMENT-FileSize_DataSection%MEM_ALIGNMENT);
+	else MemSize_DataSection=FileSize_DataSection;
+
+	//リライタブルセクションのメモリ上のサイズ
+	extern int AllGlobalVarSize;
+	i=AllInitGlobalVarSize+AllGlobalVarSize;
+	if(i%MEM_ALIGNMENT) MemSize_RWSection=i+(MEM_ALIGNMENT-i%MEM_ALIGNMENT);
+	else MemSize_RWSection=i;
+
+	//リソースセクションのメモリ上のサイズ
+	if(FileSize_RSrcSection%MEM_ALIGNMENT) MemSize_RSrcSection=FileSize_RSrcSection+(MEM_ALIGNMENT-FileSize_RSrcSection%MEM_ALIGNMENT);
+	else MemSize_RSrcSection=FileSize_RSrcSection;
+
+	//リロケーションセクションのメモリ上のサイズ
+	if(FileSize_RelocSection%MEM_ALIGNMENT) MemSize_RelocSection=FileSize_RelocSection+(MEM_ALIGNMENT-FileSize_RelocSection%MEM_ALIGNMENT);
+	else MemSize_RelocSection=FileSize_RelocSection;
+
+	//デバッグセクションのメモリ上のサイズ
+	if(FileSize_DebugSection%MEM_ALIGNMENT) MemSize_DebugSection=FileSize_DebugSection+(MEM_ALIGNMENT-FileSize_DebugSection%MEM_ALIGNMENT);
+	else MemSize_DebugSection=FileSize_DebugSection;
+
+
+	//各セッションのメモリ上の位置
+	if(bUse_ExportSection)	MemPos_ExportSection=	0x1000+
+													MemSize_CodeSection;
+	else					MemPos_ExportSection=0;
+	if(bUse_ImportSection)	MemPos_ImportSection=	0x1000+
+													MemSize_CodeSection+
+													MemSize_ExportSection;
+	else					MemPos_ImportSection=0;
+	if(bUse_DataSection)	MemPos_DataSection=		0x1000+
+													MemSize_CodeSection+
+													MemSize_ExportSection+
+													MemSize_ImportSection;
+	else					MemPos_DataSection=0;
+	if(bUse_RWSection)		MemPos_RWSection=		0x1000+
+													MemSize_CodeSection+
+													MemSize_ExportSection+
+													MemSize_ImportSection+
+													MemSize_DataSection;
+	else					MemPos_RWSection=0;
+	if(bUse_RSrcSection)	MemPos_RSrcSection=		0x1000+
+													MemSize_CodeSection+
+													MemSize_ExportSection+
+													MemSize_ImportSection+
+													MemSize_DataSection+
+													MemSize_RWSection;
+	else					MemPos_RSrcSection=0;
+	if(bUse_RelocSection)	MemPos_RelocSection=	0x1000+
+													MemSize_CodeSection+
+													MemSize_ExportSection+
+													MemSize_ImportSection+
+													MemSize_DataSection+
+													MemSize_RWSection+
+													MemSize_RSrcSection;
+	else					MemPos_RelocSection=0;
+	if(bUse_DebugSection)	MemPos_DebugSection=	0x1000+
+													MemSize_CodeSection+
+													MemSize_ExportSection+
+													MemSize_ImportSection+
+													MemSize_DataSection+
+													MemSize_RWSection+
+													MemSize_RSrcSection+
+													MemSize_RelocSection;
+	else					MemPos_DebugSection=0;
+
+
+
+	/////////////////////////////
+	// GC用の変数スケジュール
+	/////////////////////////////
+	PerformedGcVarSchedule();
+
+
+	////////////////////////////
+	// エクスポート情報の再配置
+	////////////////////////////
+	if(bUse_ExportSection){
+		for(i=0;i<ExportNum;i++){
+			lpdwExportAddressTable[i]+=MemPos_CodeSection;
+			lpdwExportNamePointerTable[i]+=MemPos_ExportSection;
+		}
+
+		ImageExportDirectory.Name+=						MemPos_ExportSection;
+		ImageExportDirectory.AddressOfFunctions+=		MemPos_ExportSection;
+		ImageExportDirectory.AddressOfNames+=			MemPos_ExportSection;
+		ImageExportDirectory.AddressOfNameOrdinals+=	MemPos_ExportSection;
+	}
+
+
+	////////////////////////////
+	// インポート情報の再配置
+	////////////////////////////
+	for(i=0,i5=0;i<ImportDllNum;i++){
+		//IMAGE_IMPORT_DESCRIPTOR
+		pImportDescriptor[i].OriginalFirstThunk+=MemPos_ImportSection;
+		pImportDescriptor[i].Name+=MemPos_ImportSection;
+
+		//インポート アドレス テーブル（ルックアップ テーブルを差し引く）
+		pImportDescriptor[i].FirstThunk=pImportDescriptor[i].OriginalFirstThunk-
+			LookupSize;			//ルックアップテーブル
+
+		for(i2=0;i2<MAX_HASH;i2++){
+			const DllProc *pDllProc=ppDeclareHash[i2];
+			while(pDllProc){
+				if( !pDllProc->IsUsing() ){
+					pDllProc=pDllProc->pNextData;
+					continue;
+				}
+
+				if( pDllProc->GetDllFileName() == ppDllNames[i] ){
+					//ルックアップ テーブル
+					pLookupTable[i5++]+=MemPos_ImportSection;
+				}
+
+				pDllProc=pDllProc->pNextData;
+			}
+		}
+		i5++;
+	}
+
+
+	////////////////////////////////////////
+	//仮想関数データテーブルスケジュール
+	pobj_DBClass->ActionVtblSchedule(ImageBase,MemPos_CodeSection);
+
+
+	//////////////////////////////
+	// データテーブルスケジュール
+	for(i=0;i<pobj_DataTableSchedule->num;i++){
+		*((long *)(OpBuffer+pobj_DataTableSchedule->pObpValues[i]))+=ImageBase+MemPos_DataSection;
+	}
+	delete pobj_DataTableSchedule;
+
+
+	//////////////////////////////////
+	// インポートテーブルスケジュール（インポート アドレス テーブルを指し示させる）
+	// ※x86はRVAからのオフセット。x64はRPI（実行中アドレス）からのオフセット
+	for(i=0;i<pobj_ImportAddrSchedule->num;i++){
+		DllProc *pDllProc;
+		pDllProc=pobj_ImportAddrSchedule->ppdi[i];
+		*((long *)(OpBuffer+pobj_ImportAddrSchedule->pObpValues[i]))=
+			MemPos_ImportSection+
+			pDllProc->GetLookupAddress()
+			-(MemPos_CodeSection+pobj_ImportAddrSchedule->pObpValues[i]+sizeof(long));
+	}
+	delete pobj_ImportAddrSchedule;
+
+
+	////////////////////////////////////
+	// プロシージャポインタスケジュール
+	for(i=0;i<pobj_SubAddrSchedule->num;i++){
+		if(pobj_SubAddrSchedule->ppsi[i]->beginOpAddress==0
+			&&pobj_SubAddrSchedule->ppsi[i]->endOpAddress==0){
+			SetError(300,NULL,-1);
+		}
+
+		if(pobj_SubAddrSchedule->pbCall[i]){
+			*((long *)(OpBuffer+pobj_SubAddrSchedule->pObpValues[i]))=
+				pobj_SubAddrSchedule->ppsi[i]->beginOpAddress-(pobj_SubAddrSchedule->pObpValues[i]+sizeof(long));
+		}
+		else{
+			*((long *)(OpBuffer+pobj_SubAddrSchedule->pObpValues[i]))=
+				pobj_SubAddrSchedule->ppsi[i]->beginOpAddress+ImageBase+MemPos_CodeSection;
+		}
+	}
+	delete pobj_SubAddrSchedule;
+
+
+	if(bDll){
+		//DLLの場合はリロケーション情報を生成
+		pobj_Reloc->ResetRelocBuffer();
+	}
+
+	delete pobj_TempSchedule;
+
+
+
+	//////////////////////////////////////
+	// グローバル変数アドレススケジュール
+	//////////////////////////////////////
+
+	/*
+	GlobalArea1 - 初期バッファあり
+	GlobalArea2 - 初期バッファなし
+	*/
+	for(i=0;i<pobj_GlobalVarSchedule->num;i++){
+		if(*((long *)(OpBuffer+pobj_GlobalVarSchedule->pObpValues[i])) & 0x80000000){
+			//初期バッファなし
+			*((long *)(OpBuffer+pobj_GlobalVarSchedule->pObpValues[i]))=
+				AllInitGlobalVarSize+
+				(*((long *)(OpBuffer+pobj_GlobalVarSchedule->pObpValues[i])) & 0x7FFFFFFF)+
+				ImageBase+MemPos_RWSection;
+		}
+		else{
+			//初期バッファあり
+			*((long *)(OpBuffer+pobj_GlobalVarSchedule->pObpValues[i]))+=
+				ImageBase+MemPos_RWSection;
+		}
+	}
+	delete pobj_GlobalVarSchedule;
+
+
+	////////////////////////////////
+	// リソースアドレススケジュール
+	extern DWORD *lpdwRSrcAddrSchedule;
+	extern int RSrcAddrScheduleNum;
+	for(i=0;i<RSrcAddrScheduleNum;i++){
+		*(DWORD *)(RSrcSectionBuffer+lpdwRSrcAddrSchedule[i])+=MemPos_RSrcSection;
+	}
+	HeapDefaultFree(lpdwRSrcAddrSchedule);
+
+
+	//Dosスタブ
+	char *DosStubBuffer;
+	int DosStubSize;
+	hFile=CreateFile(
+		( Jenga::Common::Environment::GetAppDir() + "\\SubOperation\\dosstub.pgm" ).c_str(),
+		GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE){
+		MessageBox(hOwnerEditor,"dosstub.pgmの読み込みに失敗","error",MB_OK);
+		goto EndWriteOpcode;
+	}
+	DosStubSize=GetFileSize(hFile,NULL);
+	DosStubBuffer=(char *)HeapAlloc(hHeap,0,DosStubSize);
+	ReadFile(hFile,DosStubBuffer,DosStubSize,(DWORD *)&i2,NULL);
+	CloseHandle(hFile);
+
+
+	extern BOOL bError;
+	if(bError) goto EndWriteOpcode;
+
+
+	////////////////////////////
+	// EXEファイルのヘッダ情報
+	////////////////////////////
+
+	IMAGE_DOS_HEADER ImageDosHeader;
+	ImageDosHeader.e_magic=	0x5A4D;
+	ImageDosHeader.e_cblp=	0x0090;
+	ImageDosHeader.e_cp=	0x0003;
+	ImageDosHeader.e_crlc=	0;
+	ImageDosHeader.e_cparhdr=4;
+	ImageDosHeader.e_minalloc=0x0000;
+	ImageDosHeader.e_maxalloc=0xFFFF;
+	ImageDosHeader.e_ss=	0x0000;
+	ImageDosHeader.e_sp=	0x00B8;
+	ImageDosHeader.e_csum=	0x0000;
+	ImageDosHeader.e_ip=	0x0000;
+	ImageDosHeader.e_cs=	0x0000;
+	ImageDosHeader.e_lfarlc=0x0040;
+	ImageDosHeader.e_ovno=	0x0000;
+	ImageDosHeader.e_res[0]=0;
+	ImageDosHeader.e_res[1]=0;
+	ImageDosHeader.e_res[2]=0;
+	ImageDosHeader.e_res[3]=0;
+	ImageDosHeader.e_oemid=	0x0000;
+	ImageDosHeader.e_oeminfo=0x0000;
+	ImageDosHeader.e_res2[0]=0;
+	ImageDosHeader.e_res2[1]=0;
+	ImageDosHeader.e_res2[2]=0;
+	ImageDosHeader.e_res2[3]=0;
+	ImageDosHeader.e_res2[4]=0;
+	ImageDosHeader.e_res2[5]=0;
+	ImageDosHeader.e_res2[6]=0;
+	ImageDosHeader.e_res2[7]=0;
+	ImageDosHeader.e_res2[8]=0;
+	ImageDosHeader.e_res2[9]=0;
+	ImageDosHeader.e_lfanew=0x0100;	//PEヘッダの位置
+
+
+	/////////////////////////////////////////////
+	// PEヘッダ
+	/////////////////////////////////////////////
+
+	IMAGE_NT_HEADERS64 ImagePeHdr;
+	ImagePeHdr.Signature=IMAGE_NT_SIGNATURE;
+
+	//マシンタイプ
+	ImagePeHdr.FileHeader.Machine=				IMAGE_FILE_MACHINE_AMD64;
+
+	ImagePeHdr.FileHeader.NumberOfSections=		bUse_CodeSection+
+												bUse_ExportSection+
+												bUse_ImportSection+
+												bUse_DataSection+
+												bUse_RWSection+
+												bUse_RSrcSection+
+												bUse_RelocSection+
+												bUse_DebugSection;	//セクション数
+	ImagePeHdr.FileHeader.TimeDateStamp=		(DWORD)time(NULL);
+	ImagePeHdr.FileHeader.PointerToSymbolTable=	0x00000000;
+	ImagePeHdr.FileHeader.NumberOfSymbols=		0x00000000;
+	ImagePeHdr.FileHeader.SizeOfOptionalHeader=	IMAGE_SIZEOF_NT_OPTIONAL64_HEADER;
+	if(bDll){
+		ImagePeHdr.FileHeader.Characteristics=	IMAGE_FILE_EXECUTABLE_IMAGE|
+												IMAGE_FILE_DLL|
+												IMAGE_FILE_LARGE_ADDRESS_AWARE;
+	}
+	else{
+		ImagePeHdr.FileHeader.Characteristics=	IMAGE_FILE_RELOCS_STRIPPED|
+												IMAGE_FILE_EXECUTABLE_IMAGE|
+												IMAGE_FILE_LARGE_ADDRESS_AWARE;
+	}
+
+	ImagePeHdr.OptionalHeader.Magic=				IMAGE_NT_OPTIONAL_HDR64_MAGIC;
+	ImagePeHdr.OptionalHeader.MajorLinkerVersion=	5;
+	ImagePeHdr.OptionalHeader.MinorLinkerVersion=	0;
+	ImagePeHdr.OptionalHeader.SizeOfCode=			FileSize_CodeSection;	//コードサイズ（.textのセッションサイズ）
+	ImagePeHdr.OptionalHeader.SizeOfInitializedData=FileSize_DataSection;	//データサイズ（.dataのセッションサイズ）
+	ImagePeHdr.OptionalHeader.SizeOfUninitializedData=0;					//未初期化データのサイズ（なし）
+	if(bDll){
+		if(DllMain_EntryPoint==-1)
+			ImagePeHdr.OptionalHeader.AddressOfEntryPoint=0;
+		else
+			ImagePeHdr.OptionalHeader.AddressOfEntryPoint=MemPos_CodeSection+DllMain_EntryPoint;
+	}
+	else ImagePeHdr.OptionalHeader.AddressOfEntryPoint=	MemPos_CodeSection;
+	ImagePeHdr.OptionalHeader.BaseOfCode=			MemPos_CodeSection;	//.textのアドレス
+
+	ImagePeHdr.OptionalHeader.ImageBase=			ImageBase;		//イメージベース
+	ImagePeHdr.OptionalHeader.SectionAlignment=		MEM_ALIGNMENT;		//セクションアラインメント
+	ImagePeHdr.OptionalHeader.FileAlignment=		FILE_ALIGNMENT;
+	ImagePeHdr.OptionalHeader.MajorOperatingSystemVersion=4;
+	ImagePeHdr.OptionalHeader.MinorOperatingSystemVersion=0;
+	ImagePeHdr.OptionalHeader.MajorImageVersion=	0;
+	ImagePeHdr.OptionalHeader.MinorImageVersion=	0;
+	ImagePeHdr.OptionalHeader.MajorSubsystemVersion=4;
+	ImagePeHdr.OptionalHeader.MinorSubsystemVersion=0;
+	ImagePeHdr.OptionalHeader.Win32VersionValue=	0;
+	ImagePeHdr.OptionalHeader.SizeOfImage=			EXE_HEADER_SIZE+
+													MemSize_CodeSection+
+													MemSize_ExportSection+
+													MemSize_ImportSection+
+													MemSize_DataSection+
+													MemSize_RWSection+
+													MemSize_RSrcSection+
+													MemSize_RelocSection+
+													MemSize_DebugSection;//すべてのイメージサイズ
+	ImagePeHdr.OptionalHeader.SizeOfHeaders=		EXE_HEADER_SIZE;//ヘッダサイズ
+	ImagePeHdr.OptionalHeader.CheckSum=				0;
+	extern unsigned short TypeOfSubSystem;
+	ImagePeHdr.OptionalHeader.Subsystem=			TypeOfSubSystem;
+	ImagePeHdr.OptionalHeader.DllCharacteristics=	0;
+	ImagePeHdr.OptionalHeader.SizeOfStackReserve=	0x00100000;
+	ImagePeHdr.OptionalHeader.SizeOfStackCommit=	0x00001000;
+	ImagePeHdr.OptionalHeader.SizeOfHeapReserve=	0x00100000;
+	ImagePeHdr.OptionalHeader.SizeOfHeapCommit=		0x00001000;
+	ImagePeHdr.OptionalHeader.LoaderFlags=			0;
+	ImagePeHdr.OptionalHeader.NumberOfRvaAndSizes=	IMAGE_NUMBEROF_DIRECTORY_ENTRIES;
+
+	//データ ディクショナリ
+	ImagePeHdr.OptionalHeader.DataDirectory[0].VirtualAddress=MemPos_ExportSection;
+	ImagePeHdr.OptionalHeader.DataDirectory[0].Size=FileSize_ExportSection;
+	ImagePeHdr.OptionalHeader.DataDirectory[1].VirtualAddress=	//IMAGE_IMPORT_DESCRIPTORを指す
+		MemPos_ImportSection+
+		LookupSize+	//インポート アドレス テーブル
+		LookupSize;	//ルックアップ テーブル
+	ImagePeHdr.OptionalHeader.DataDirectory[1].Size=(ImportDllNum+1)*sizeof(IMAGE_IMPORT_DESCRIPTOR);
+	ImagePeHdr.OptionalHeader.DataDirectory[2].VirtualAddress=MemPos_RSrcSection;
+	ImagePeHdr.OptionalHeader.DataDirectory[2].Size=RSrcSectionSize;
+	ImagePeHdr.OptionalHeader.DataDirectory[3].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[3].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[4].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[4].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[5].VirtualAddress=MemPos_RelocSection;
+	ImagePeHdr.OptionalHeader.DataDirectory[5].Size=pobj_Reloc->length;
+	ImagePeHdr.OptionalHeader.DataDirectory[6].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[6].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[7].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[7].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[8].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[8].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[9].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[9].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[10].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[10].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[11].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[11].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[12].VirtualAddress=MemPos_ImportSection;//インポート アドレス テーブル
+	ImagePeHdr.OptionalHeader.DataDirectory[12].Size=LookupSize;
+	ImagePeHdr.OptionalHeader.DataDirectory[13].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[13].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[14].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[14].Size=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[15].VirtualAddress=0;
+	ImagePeHdr.OptionalHeader.DataDirectory[15].Size=0;
+
+
+	//コードセクションヘッダ
+	IMAGE_SECTION_HEADER CodeSectionHeader;
+	memset((char *)CodeSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)CodeSectionHeader.Name,".text");
+	CodeSectionHeader.Misc.VirtualSize=			obp;
+	CodeSectionHeader.VirtualAddress=			MemPos_CodeSection;	//開始アドレス
+	CodeSectionHeader.SizeOfRawData=			FileSize_CodeSection;
+	CodeSectionHeader.PointerToRawData=			FilePos_CodeSection;	//ファイル上の開始アドレス
+	CodeSectionHeader.PointerToRelocations=		0;
+	CodeSectionHeader.PointerToLinenumbers=		0;
+	CodeSectionHeader.NumberOfRelocations=		0;
+	CodeSectionHeader.NumberOfLinenumbers=		0;
+	CodeSectionHeader.Characteristics=			IMAGE_SCN_MEM_EXECUTE|
+												IMAGE_SCN_MEM_READ|
+												IMAGE_SCN_CNT_CODE;
+
+	//エクスポートセクションヘッダ
+	IMAGE_SECTION_HEADER ExportSectionHeader;
+	memset((char *)ExportSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)ExportSectionHeader.Name,".edata");
+	ExportSectionHeader.Misc.VirtualSize=		MemSize_ExportSection;
+	ExportSectionHeader.VirtualAddress=			MemPos_ExportSection;	//開始アドレス
+	ExportSectionHeader.SizeOfRawData=			FileSize_ExportSection;	//サイズ
+	ExportSectionHeader.PointerToRawData=		FilePos_ExportSection;	//ファイル上の開始アドレス
+	ExportSectionHeader.PointerToRelocations=	0;
+	ExportSectionHeader.PointerToLinenumbers=	0;
+	ExportSectionHeader.NumberOfRelocations=	0;
+	ExportSectionHeader.NumberOfLinenumbers=	0;
+	ExportSectionHeader.Characteristics=		IMAGE_SCN_CNT_INITIALIZED_DATA|
+												IMAGE_SCN_MEM_READ;
+
+	//インポートセクションヘッダ
+	IMAGE_SECTION_HEADER ImportSectionHeader;
+	memset((char *)ImportSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)ImportSectionHeader.Name,".idata");
+	ImportSectionHeader.Misc.VirtualSize=
+		LookupSize+			//インポートアドレステーブル
+		LookupSize+			//ルックアップテーブル
+		(ImportDllNum+1)*sizeof(IMAGE_IMPORT_DESCRIPTOR)+
+		16*ImportDllNum+	//DLL名
+		HintSize;			//ヒント名（関数名）テーブル
+	ImportSectionHeader.VirtualAddress=			MemPos_ImportSection;	//開始アドレス
+	ImportSectionHeader.SizeOfRawData=			FileSize_ImportSection;	//サイズ
+	ImportSectionHeader.PointerToRawData=		FilePos_ImportSection;	//ファイル上の開始アドレス
+	ImportSectionHeader.PointerToRelocations=	0;
+	ImportSectionHeader.PointerToLinenumbers=	0;
+	ImportSectionHeader.NumberOfRelocations=	0;
+	ImportSectionHeader.NumberOfLinenumbers=	0;
+	ImportSectionHeader.Characteristics=		IMAGE_SCN_CNT_INITIALIZED_DATA|
+												IMAGE_SCN_MEM_READ;
+
+	//データセクションヘッダ
+	IMAGE_SECTION_HEADER DataSectionHeader;
+	memset((char *)DataSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)DataSectionHeader.Name,".sdata");
+	DataSectionHeader.Misc.VirtualSize=			MemSize_DataSection;
+	DataSectionHeader.VirtualAddress=			MemPos_DataSection;
+	DataSectionHeader.SizeOfRawData=			FileSize_DataSection;
+	DataSectionHeader.PointerToRawData=			FilePos_DataSection;
+	DataSectionHeader.PointerToRelocations=		0;
+	DataSectionHeader.PointerToLinenumbers=		0;
+	DataSectionHeader.NumberOfRelocations=		0;
+	DataSectionHeader.NumberOfLinenumbers=		0;
+	DataSectionHeader.Characteristics=			IMAGE_SCN_CNT_INITIALIZED_DATA|
+												IMAGE_SCN_MEM_READ|
+												IMAGE_SCN_MEM_WRITE;
+
+	//リライタブルセクションヘッダ
+	IMAGE_SECTION_HEADER RWSectionHeader;
+	memset((char *)RWSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)RWSectionHeader.Name,".data");
+	RWSectionHeader.Misc.VirtualSize=			AllInitGlobalVarSize+AllGlobalVarSize;
+	RWSectionHeader.VirtualAddress=				MemPos_RWSection;
+	RWSectionHeader.SizeOfRawData=				FileSize_RWSection;
+	RWSectionHeader.PointerToRawData=			FilePos_RWSection;
+	RWSectionHeader.PointerToRelocations=		0;
+	RWSectionHeader.PointerToLinenumbers=		0;
+	RWSectionHeader.NumberOfRelocations=		0;
+	RWSectionHeader.NumberOfLinenumbers=		0;
+	RWSectionHeader.Characteristics=			IMAGE_SCN_CNT_INITIALIZED_DATA|
+												IMAGE_SCN_MEM_READ|
+												IMAGE_SCN_MEM_WRITE;
+
+	//リソースセクションヘッダ
+	IMAGE_SECTION_HEADER RSrcSectionHeader;
+	memset((char *)RSrcSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)RSrcSectionHeader.Name,".rsrc");
+	RSrcSectionHeader.Misc.VirtualSize=			RSrcSectionSize;
+	RSrcSectionHeader.VirtualAddress=			MemPos_RSrcSection;
+	RSrcSectionHeader.SizeOfRawData=			FileSize_RSrcSection;
+	RSrcSectionHeader.PointerToRawData=			FilePos_RSrcSection;
+	RSrcSectionHeader.PointerToRelocations=		0;
+	RSrcSectionHeader.PointerToLinenumbers=		0;
+	RSrcSectionHeader.NumberOfRelocations=		0;
+	RSrcSectionHeader.NumberOfLinenumbers=		0;
+	RSrcSectionHeader.Characteristics=			IMAGE_SCN_CNT_INITIALIZED_DATA|
+												IMAGE_SCN_MEM_READ;
+
+	//リロケーションセクションヘッダ
+	IMAGE_SECTION_HEADER RelocSectionHeader;
+	memset((char *)RelocSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)RelocSectionHeader.Name,".reloc");
+	RelocSectionHeader.Misc.VirtualSize=		pobj_Reloc->length;
+	RelocSectionHeader.VirtualAddress=			MemPos_RelocSection;	//開始アドレス
+	RelocSectionHeader.SizeOfRawData=			FileSize_RelocSection;	//サイズ
+	RelocSectionHeader.PointerToRawData=		FilePos_RelocSection;	//ファイル上の開始アドレス
+	RelocSectionHeader.PointerToRelocations=	0;
+	RelocSectionHeader.PointerToLinenumbers=	0;
+	RelocSectionHeader.NumberOfRelocations=		0;
+	RelocSectionHeader.NumberOfLinenumbers=		0;
+	RelocSectionHeader.Characteristics=			IMAGE_SCN_CNT_INITIALIZED_DATA|
+												IMAGE_SCN_MEM_DISCARDABLE|
+												IMAGE_SCN_MEM_READ;
+
+	//デバッグセクションヘッダ
+	IMAGE_SECTION_HEADER DebugSectionHeader;
+	memset((char *)DebugSectionHeader.Name,0,IMAGE_SIZEOF_SHORT_NAME);
+	lstrcpy((char *)DebugSectionHeader.Name,".debug");
+	DebugSectionHeader.Misc.VirtualSize=		pobj_DebugSection->length;
+	DebugSectionHeader.VirtualAddress=			MemPos_DebugSection;	//開始アドレス
+	DebugSectionHeader.SizeOfRawData=			FileSize_DebugSection;	//サイズ
+	DebugSectionHeader.PointerToRawData=		FilePos_DebugSection;	//ファイル上の開始アドレス
+	DebugSectionHeader.PointerToRelocations=	0;
+	DebugSectionHeader.PointerToLinenumbers=	0;
+	DebugSectionHeader.NumberOfRelocations=		0;
+	DebugSectionHeader.NumberOfLinenumbers=		0;
+	DebugSectionHeader.Characteristics=			IMAGE_SCN_MEM_DISCARDABLE|
+												IMAGE_SCN_MEM_READ;
+
+
+	hFile=CreateFile(OutputFileName,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE){
+		SetError(53,OutputFileName,-1);
+		goto EndWriteOpcode;
+	}
+
+	//ヘッダ
+	WriteFile(hFile,(void *)&ImageDosHeader,sizeof(IMAGE_DOS_HEADER),(DWORD *)&i2,NULL);
+	i=i2;
+
+	//Dosスタブ
+	WriteFile(hFile,DosStubBuffer,DosStubSize,(DWORD *)&i2,NULL);
+	i+=i2;
+
+	//0x0100までNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,0x0100-i);
+	WriteFile(hFile,temp2,0x0100-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	//PEヘッダ
+	WriteFile(hFile,&ImagePeHdr,sizeof(IMAGE_NT_HEADERS64),(DWORD *)&i2,NULL);
+	i+=i2;
+
+	//コード セクション ヘッダ
+	WriteFile(hFile,&CodeSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+	i+=i2;
+
+	if(bUse_ExportSection){
+		//エクスポート セクション ヘッダ
+		WriteFile(hFile,&ExportSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+	if(bUse_ImportSection){
+		//インポート セクション ヘッダ
+		WriteFile(hFile,&ImportSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+	if(bUse_DataSection){
+		//データ セクション ヘッダ
+		WriteFile(hFile,&DataSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+	if(bUse_RWSection){
+		//リライタブルセクションヘッダ
+		WriteFile(hFile,&RWSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+	if(bUse_RSrcSection){
+		//リソースセクションヘッダ
+		WriteFile(hFile,&RSrcSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+	if(bUse_RelocSection){
+		//リロケーションセクションヘッダ
+		WriteFile(hFile,&RelocSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+	if(bUse_DebugSection){
+		//デバッグセクションヘッダ
+		WriteFile(hFile,&DebugSectionHeader,sizeof(IMAGE_SECTION_HEADER),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//EXE_HEADER_SIZEまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,EXE_HEADER_SIZE-i);
+	WriteFile(hFile,temp2,EXE_HEADER_SIZE-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	//コード
+	WriteFile(hFile,OpBuffer,obp,(DWORD *)&i2,NULL);
+	i+=i2;
+
+	//FilePos_ExportSectionまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FilePos_ExportSection-i);
+	WriteFile(hFile,temp2,FilePos_ExportSection-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	if(bUse_ExportSection){
+		//エクスポート ディレクトリ テーブル
+		WriteFile(hFile,&ImageExportDirectory,sizeof(IMAGE_EXPORT_DIRECTORY),(DWORD *)&i2,NULL);
+		i+=i2;
+
+		//エクスポート アドレス テーブル
+		WriteFile(hFile,lpdwExportAddressTable,ExportNum*sizeof(DWORD),(DWORD *)&i2,NULL);
+		i+=i2;
+
+		//エクスポート名ポインタ テーブル
+		WriteFile(hFile,lpdwExportNamePointerTable,ExportNum*sizeof(DWORD),(DWORD *)&i2,NULL);
+		i+=i2;
+
+		//エクスポート序数テーブル
+		WriteFile(hFile,lpwExportOrdinalTable,ExportNum*sizeof(WORD),(DWORD *)&i2,NULL);
+		i+=i2;
+
+		//シンボル名
+		WriteFile(hFile,lpExportNames,ExportNamesLength,(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//FilePos_ImportSectionまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FilePos_ImportSection-i);
+	WriteFile(hFile,temp2,FilePos_ImportSection-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	if(bUse_ImportSection){
+		//インポート アドレス テーブル
+		WriteFile(hFile,pLookupTable,LookupSize,(DWORD *)&i2,NULL);
+		i+=i2;
+
+		//ルックアップ テーブル
+		WriteFile(hFile,pLookupTable,LookupSize,(DWORD *)&i2,NULL);
+		i+=i2;
+
+		//インポート ディレクトリ テーブル（Nullディレクトリ テーブルを含む）
+		for(i3=0;i3<(ImportDllNum+1);i3++){
+			WriteFile(hFile,&pImportDescriptor[i3],sizeof(IMAGE_IMPORT_DESCRIPTOR),(DWORD *)&i2,NULL);
+			i+=i2;
+		}
+
+		//DLL名
+		for(i3=0;i3<ImportDllNum;i3++){
+			WriteFile(hFile,ppDllNames[i3],16,(DWORD *)&i2,NULL);
+			i+=i2;
+		}
+
+		//ヒント テーブル
+		WriteFile(hFile,pHintTable,HintSize,(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//FilePos_DataSectionまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FilePos_DataSection-i);
+	WriteFile(hFile,temp2,FilePos_DataSection-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	if(bUse_DataSection){
+		//データ テーブル
+		WriteFile(hFile,dataTable.GetPtr(),dataTable.GetSize(),(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//FilePos_RWSectionまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FilePos_RWSection-i);
+	WriteFile(hFile,temp2,FilePos_RWSection-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	if(bUse_RWSection){
+		//リライタブル データ テーブル（グローバル変数の初期バッファ）
+		initGlobalBuf=(BYTE *)HeapReAlloc(hHeap,
+			HEAP_ZERO_MEMORY,
+			initGlobalBuf,
+			FileSize_RWSection);
+		WriteFile(hFile,initGlobalBuf,FileSize_RWSection,(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//FilePos_RSrcSectionまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FilePos_RSrcSection-i);
+	WriteFile(hFile,temp2,FilePos_RSrcSection-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	if(bUse_RSrcSection){
+		//リソースバッファ
+		WriteFile(hFile,RSrcSectionBuffer,RSrcSectionSize,(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//FilePos_RelocSectionまでNULLを並べる
+	temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FilePos_RelocSection-i);
+	WriteFile(hFile,temp2,FilePos_RelocSection-i,(DWORD *)&i2,NULL);
+	HeapDefaultFree(temp2);
+	i+=i2;
+
+	if(bUse_RelocSection){
+		//リロケーション情報
+		WriteFile(hFile,pobj_Reloc->buffer,pobj_Reloc->length,(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//ファイルアラインメントを考慮
+	if(i%FILE_ALIGNMENT){
+		temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FILE_ALIGNMENT-i%FILE_ALIGNMENT);
+		WriteFile(hFile,temp2,FILE_ALIGNMENT-i%FILE_ALIGNMENT,(DWORD *)&i2,NULL);
+		HeapDefaultFree(temp2);
+		i+=i2;
+	}
+
+	if(bUse_DebugSection){
+		//デバッグセクション
+		WriteFile(hFile,pobj_DebugSection->buffer,pobj_DebugSection->length,(DWORD *)&i2,NULL);
+		i+=i2;
+	}
+
+	//ファイルアラインメントを考慮
+	if(i%FILE_ALIGNMENT){
+		temp2=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,FILE_ALIGNMENT-i%FILE_ALIGNMENT);
+		WriteFile(hFile,temp2,FILE_ALIGNMENT-i%FILE_ALIGNMENT,(DWORD *)&i2,NULL);
+		HeapDefaultFree(temp2);
+		i+=i2;
+	}
+
+	//書き込み終了
+	CloseHandle(hFile);
+
+
+EndWriteOpcode:
+
+	//Dosスタブ用のメモリを解放
+	HeapDefaultFree(DosStubBuffer);
+
+	//エクスポート テーブル情報を解放
+	HeapDefaultFree(lpdwExportAddressTable);
+	HeapDefaultFree(lpdwExportNamePointerTable);
+	HeapDefaultFree(lpwExportOrdinalTable);
+
+	//インポートDLL情報を解放
+	HeapDefaultFree(pImportDescriptor);
+	for(i=0;i<ImportDllNum;i++)
+		HeapDefaultFree(ppDllNames[i]);
+	HeapDefaultFree(ppDllNames);
+
+	//ルックアップテーブルに関する情報を解放
+	HeapDefaultFree(pLookupTable);
+
+	//ヒントテーブルに関する情報を解放
+	HeapDefaultFree(pHintTable);
+
+	//グローバル変数の初期バッファを解放
+	HeapDefaultFree(initGlobalBuf);
+
+	//コードバッファを解放
+	HeapDefaultFree(OpBuffer);
+	OpBuffer=0;
+
+	//リソースセクションバッファを解放
+	HeapDefaultFree(RSrcSectionBuffer);
+
+	//デバッグセクションを開放
+	delete pobj_DebugSection;
+
+	//リロケーション情報を解放
+	delete pobj_Reloc;
+
+	//列挙体に関する情報の破棄
+	CEnumParent::DestroyEnum();
+
+	//クラスに関するメモリを解放
+	delete pobj_DBClass;
+	pobj_DBClass=0;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/NumOpe.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/NumOpe.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/NumOpe.cpp	(revision 178)
@@ -0,0 +1,1249 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void NewStringObject(int reg, const char *str){
+	///////////////////////////////////////////////////////
+	// lpszTextを元にStringオブジェクトを生成し、
+	// オブジェクトポインタをregに格納する
+	///////////////////////////////////////////////////////
+
+
+	//////////////////////////////////////////////////////
+	/////    レジスタ資源のバックアップ
+	{	BACKUP_REGISTER_RESOURCE
+	//////////////////////////////////////////////////////
+
+		char *parameter = (char *)malloc( lstrlen( str ) + 32 );
+		sprintf( parameter, "\"%s\"%c%c*Char", str, 1, ESC_AS );
+		SetStringQuotes( parameter );
+
+		Operator_New( *pobj_DBClass->GetStringClassPtr(), "", parameter, Type( DEF_OBJECT, *pobj_DBClass->GetStringClassPtr() ) );
+
+		free( parameter );
+
+		//mov reg,rax
+		op_mov_RR( reg, REG_RAX );
+
+	/////////////////////////////////////////////
+	//////   レジスタ資源を復元
+		RESTORE_REGISTER_RESOURCE
+	}////////////////////////////////////////////
+}
+
+void SetUseRegFromRax(int type,int UseReg,int XmmReg){
+	if(IsRealNumberType(type)){
+		//実数型
+		if(XmmReg==REG_XMM4){
+			if(type==DEF_DOUBLE){
+				//movsd qword ptr[rsp+offset],xmm0	※スタックフレームを利用
+				pobj_sf->push(REG_XMM0,sizeof(double));
+			}
+			if(type==DEF_SINGLE){
+				//movss dword ptr[rsp+offset],xmm0	※スタックフレームを利用
+				pobj_sf->push(REG_XMM0,sizeof(float));
+			}
+		}
+		else{
+			if(type==DEF_DOUBLE){
+				//movsd xmm_reg,xmm0
+				op_movsd_RR(XmmReg,REG_XMM0);
+			}
+			else if(type==DEF_SINGLE){
+				//movss xmm_reg,xmm0
+				op_movss_RR(XmmReg,REG_XMM0);
+			}
+		}
+	}
+	else{
+		//整数型
+		if(UseReg==REG_R14){
+			//mov qword ptr[rsp+offset],rax     ※スタックフレームを利用
+			pobj_sf->push(REG_RAX);
+		}
+		else{
+			//mov reg,rax
+			op_mov_RR(UseReg,REG_RAX);
+		}
+	}
+}
+
+void ExtendRegToBigType( int reg, int bigBasicType, int baseBasicType ){
+	switch( Type::GetBasicSize( bigBasicType ) ){
+		case sizeof(_int64):
+			ExtendTypeTo64(baseBasicType,reg);
+			break;
+		case sizeof(long):
+			ExtendTypeTo32(baseBasicType,reg);
+			break;
+		case sizeof(short):
+			ExtendTypeTo16(baseBasicType,reg);
+			break;
+	}
+}
+
+
+bool VarToReg( RELATIVE_VAR &relativeVar, const Type &baseType, Type &resultType ){
+	int UseReg=pobj_reg->GetNextReg();
+	int XmmReg=pobj_reg->GetNextXmmReg();
+
+	//大きな型への暗黙の変換
+	int bigType = AutoBigCast(baseType.GetBasicType(),resultType.GetBasicType());
+
+	if(resultType.GetBasicType()&FLAG_PTR){
+		//配列ポインタ
+		resultType.SetBasicType( GetPtrType(resultType.GetBasicType()^FLAG_PTR) );
+
+		SetVarPtrToReg(UseReg,&relativeVar);
+	}
+	else if(resultType.IsReal()){
+		//実数型
+		if( resultType.IsDouble() )
+			SetXmmReg_DoubleVariable(&relativeVar,XmmReg);
+		if( resultType.IsSingle() )
+			SetXmmReg_SingleVariable(&relativeVar,XmmReg);
+	}
+	else if( resultType.IsWhole() || resultType.IsObject()){
+		//整数型
+		SetReg_WholeVariable(resultType.GetBasicType(),&relativeVar,UseReg);
+	}
+	else if( resultType.IsStruct() ){
+		//構造体ポインタをUseRegへ格納（構造体は値型）
+		SetVarPtrToReg(UseReg,&relativeVar);
+	}
+	else{
+		return false;
+	}
+
+	if( resultType.GetBasicType() != bigType ){
+		// 大きな型へ変換された場合
+		// ※レジスタの値をキャストする
+		ExtendRegToBigType( UseReg, bigType, resultType.GetBasicType() );
+
+		resultType.SetBasicType( bigType );
+	}
+
+	return true;
+}
+bool TermMemberOpe( const CClass &objClass, const Type &baseType, Type &resultType, const char *termFull, const char *termLeft, const char *member ){
+
+	int UseReg=pobj_reg->GetNextReg();
+	int XmmReg=pobj_reg->GetNextXmmReg();
+
+
+	if( GetMemberType( objClass, member, resultType, 0, false ) ){
+		// メンバが見つかったとき
+
+		//オブジェクトポインタをr11にコピー
+		op_mov_RR( REG_R11, UseReg );
+
+		RELATIVE_VAR relativeVar;
+		relativeVar.dwKind=VAR_DIRECTMEM;
+
+		if( !_member_offset(
+			true,	//エラー表示あり
+			false,	//読み込み専用
+			objClass,
+			member,&relativeVar,resultType,0)){
+				return false;
+		}
+
+		if( !VarToReg( relativeVar, baseType, resultType ) ){
+			SetError(11,termFull,cp);
+		}
+
+		return true;
+	}
+
+
+	///////////////////////////////////////////////////////////////////
+	// 動的メソッドを検索
+	///////////////////////////////////////////////////////////////////
+	vector<UserProc *> userProcs;
+
+	char methodName[VN_SIZE], lpPtrOffset[VN_SIZE], parameter[VN_SIZE], dummy[1];
+	CClass::RefType refType;
+	lstrcpy( methodName, member );
+	GetVarFormatString(methodName,parameter,lpPtrOffset,dummy,refType);
+
+	objClass.GetMethods().Enum( methodName, userProcs );
+	UserProc *pUserProc;
+	if(userProcs.size()){
+		//オーバーロードを解決
+		pUserProc=OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft);
+
+		if( pUserProc ){
+
+			resultType = pUserProc->ReturnType();
+
+
+			//////////////////////////////////////////////////////
+			/////    レジスタ資源のバックアップ
+			{	BACKUP_REGISTER_RESOURCE
+			//////////////////////////////////////////////////////
+
+				//オブジェクトポインタをスタックに入れておく
+				//mov qword ptr[rsp+offset],reg     ※スタックフレームを利用
+				pobj_sf->push( UseReg );
+
+				if( !Opcode_CallProc(parameter,pUserProc,PROCFLAG_NEW,termLeft,0 ) ){
+					//レジスタ資源を復元
+					RESTORE_REGISTER_RESOURCE
+
+					return false;
+				}
+
+				pobj_sf->pop();
+
+				/////////////////////
+				// 戻り値の処理
+				/////////////////////
+
+				//大きな型への暗黙の変換
+				int bigType = AutoBigCast(baseType.GetBasicType(), resultType.GetBasicType() );
+
+				if( resultType.GetBasicType() != bigType ){
+					// 大きな型へ変換された場合
+					// ※レジスタの値をキャストする
+					ExtendRegToBigType( REG_RAX, bigType, resultType.GetBasicType() );
+
+					resultType.SetBasicType( bigType );
+				}
+
+				SetUseRegFromRax(resultType.GetBasicType(),UseReg,XmmReg);
+
+
+			/////////////////////////////////////////////
+			//////   レジスタ資源を復元
+				RESTORE_REGISTER_RESOURCE
+			}////////////////////////////////////////////
+			
+			return true;
+		}
+	}
+
+	return false;
+}
+bool TermOpe( const char *term, const Type &baseType, Type &resultType, bool &isLiteral, BOOL *pbUseHeap, bool isWantObject, bool *pIsClassName, bool isProcedureCallOnly ){
+	char parameter[VN_SIZE];
+
+	// Withを解決
+	char termFull[VN_SIZE];
+	if(term[0]=='.'){
+		GetWithName(termFull);
+		lstrcat(termFull,term);
+	}
+	else lstrcpy(termFull,term);
+
+	char termLeft[VN_SIZE];
+	lstrcpy(termLeft,termFull);
+
+	// パース
+	char member[VN_SIZE];
+	CClass::RefType refType;
+	if( SplitMemberName( termFull, termLeft, member, refType ) ){
+		///////////////////////////////////////////////////////////////////
+		// オブジェクトとメンバに分解できるとき
+		// termLeft.member
+		///////////////////////////////////////////////////////////////////
+
+		isLiteral = false;
+
+		// オブジェクト側の型を取得
+		bool isClassName = false;
+		Type leftType;
+		if( GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){
+			if( isClassName == false && Smoothie::meta.blittableTypes.IsExist( leftType ) ){
+				// 左側のオブジェクト部分がBlittable型のとき
+
+				char temporary[VN_SIZE];
+				lstrcpy( temporary, termLeft );
+				sprintf( termLeft, "%s(%s)",
+					Smoothie::meta.blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(),
+					temporary );
+			}
+		}
+
+		if( !TermOpe( termLeft, baseType, leftType, isLiteral, pbUseHeap, true, &isClassName ) ){
+			goto globalArea;
+		}
+
+		if( isClassName ){
+			// 静的メンバ/メソッドの場合
+			goto globalArea;
+		}
+
+		if( !leftType.HasMember() ){
+			// メンバを持たない型の場合
+			return false;
+		}
+
+		return TermMemberOpe( leftType.GetClass(), baseType, resultType, termFull, termLeft, member );
+	}
+globalArea:
+
+	//////////////////////////////////////////////
+	// クラス名かどうかをチェック（静的メンバ用）
+	//////////////////////////////////////////////
+
+	if( pIsClassName ){
+		if( pobj_DBClass->Find( termFull ) ){
+			*pIsClassName = true;
+			return true;
+		}
+	}
+
+
+	/////////////////////////////////////////////////////////////////
+	// グローバル属性エリア
+	/////////////////////////////////////////////////////////////////
+
+	int UseReg=pobj_reg->GetNextReg();
+	int XmmReg=pobj_reg->GetNextXmmReg();
+
+
+	if(lstrcmpi(termFull,"This")==0 && isProcedureCallOnly == false ){
+		//Thisオブジェクト
+		resultType.SetType( DEF_OBJECT, pobj_CompilingClass );
+
+		SetThisPtrToReg( UseReg );
+
+		isLiteral = false;
+
+		return true;
+	}
+
+
+	//////////////////////////////////////
+	// 関数（DLL、ユーザー定義、組み込み）
+	//////////////////////////////////////
+	char procName[VN_SIZE];
+	char temporary[8192];
+
+	int i2=GetCallProcName(termFull,procName);
+	if(termFull[i2]=='('){
+		int i4=GetStringInPare_RemovePare(parameter,termFull+i2+1);
+
+		void *pInfo;
+		int idProc=GetProc(procName,(void **)&pInfo);
+
+		if(idProc){
+			//閉じカッコ")"に続く文字がNULLでないとき
+			if(termFull[i2+1+i4+1]!='\0'){
+				SetError(42,NULL,cp);
+			}
+
+
+			//////////////////////////////////////////////////////
+			/////    レジスタ資源のバックアップ
+			{	BACKUP_REGISTER_RESOURCE
+			//////////////////////////////////////////////////////
+
+
+				////////////////
+				// 呼び出し
+				////////////////
+
+				CallProc(idProc,pInfo,procName,parameter,resultType);
+
+
+				/////////////////////
+				// 戻り値の処理
+				/////////////////////
+
+				//大きな型への暗黙の変換
+				int bigType = AutoBigCast(baseType.GetBasicType(), resultType.GetBasicType() );
+
+				if( resultType.GetBasicType() != bigType ){
+					// 大きな型へ変換された場合
+					// ※レジスタの値をキャストする
+					ExtendRegToBigType( REG_RAX, bigType, resultType.GetBasicType() );
+
+					resultType.SetBasicType( bigType );
+				}
+
+				SetUseRegFromRax(resultType.GetBasicType(),UseReg,XmmReg);
+
+			/////////////////////////////////////////////
+			//////   レジスタ資源を復元
+				RESTORE_REGISTER_RESOURCE
+			}////////////////////////////////////////////
+
+			if(resultType.IsStruct()){
+				//構造体が戻ったときはヒープ領域にインスタンスが格納されている
+				//※後にfreeする必要あり
+				// TODO: 解放はGCに任せる
+				*pbUseHeap = 1;
+			}
+
+			isLiteral = false;
+
+			return true;
+		}
+		else if(GetConstCalcBuffer(procName,parameter,temporary)){
+			/////////////////////////
+			// マクロ関数
+			/////////////////////////
+
+			//閉じカッコ")"に続く文字がNULLでないときはエラーにする
+			if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
+
+			//マクロ関数の場合
+			NumOpe(&UseReg,temporary,Type(),resultType);
+
+			if(!IS_LITERAL(resultType.GetIndex())){
+				//リテラル値ではなかったとき
+				isLiteral = false;
+			}
+
+			return true;
+		}
+	}
+	else if( isProcedureCallOnly ){
+		// 関数呼び出し以外は受け付けない
+		return false;
+	}
+
+
+	////////////////////////////////
+	// インデクサ（getアクセサ）
+	////////////////////////////////
+
+	char VarName[VN_SIZE],ArrayElements[VN_SIZE];
+	GetArrayElement(termFull,VarName,ArrayElements);
+	if(ArrayElements[0]){
+		GetVarType(VarName,resultType,false);
+		if( resultType.IsObject() ){
+			CallIndexerGetterProc(UseReg,&resultType.GetClass(),VarName,ArrayElements,resultType);
+
+			isLiteral = false;
+
+			return true;
+		}
+	}
+
+
+	////////////////////////////////
+	// 変数
+	////////////////////////////////
+
+	RELATIVE_VAR relativeVar;
+	if(GetVarOffset(
+		false,	//エラー表示なし
+		false,	//読み込み専用
+		termFull,
+		&relativeVar,resultType)){
+		//////////
+		// 変数
+		//////////
+
+		if( !VarToReg( relativeVar, baseType, resultType ) ){
+			SetError(11,termFull,cp);
+		}
+
+		isLiteral = false;
+
+		return true;
+	}
+
+/*
+	////////////////////////////////
+	// 型名
+	////////////////////////////////
+
+	if( Type::StringToType( termFull, resultType ) ){
+		resultType.SetBasicType( resultType.GetBasicType() | FLAG_CAST );
+		return true;
+	}*/
+
+
+	/////////////////////////////////
+	// プロパティ用のメソッド
+	/////////////////////////////////
+
+	//配列要素を排除
+	GetArrayElement(termFull,VarName,ArrayElements);
+
+	if(GetSubHash(VarName,0)){
+
+		//////////////////////////////////////////////////////
+		/////    レジスタ資源のバックアップ
+		{	BACKUP_REGISTER_RESOURCE
+		//////////////////////////////////////////////////////
+
+			CallPropertyMethod(termFull,NULL,resultType);
+
+			//大きな型への暗黙の変換
+			int bigType = AutoBigCast(baseType.GetBasicType(), resultType.GetBasicType() );
+
+			if( resultType.GetBasicType() != bigType ){
+				// 大きな型へ変換された場合
+				// ※レジスタの値をキャストする
+				ExtendRegToBigType( REG_RAX, bigType, resultType.GetBasicType() );
+
+				resultType.SetBasicType( bigType );
+			}
+
+			SetUseRegFromRax(resultType.GetBasicType(),UseReg,XmmReg);
+
+		/////////////////////////////////////////////
+		//////   レジスタ資源を復元
+			RESTORE_REGISTER_RESOURCE
+		}////////////////////////////////////////////
+
+		if(resultType.IsStruct()){
+			//構造体が戻ったときはヒープ領域にインスタンスが格納されている
+			//※後にfreeする必要あり
+			// TODO: 解放はGCに任せる
+			*pbUseHeap = 1;
+		}
+
+		isLiteral = false;
+
+		return true;
+	}
+
+
+	return false;
+}
+
+bool NumOpe( int *pReg,
+			const char *expression,
+			const Type &baseType,
+			Type &resultType,
+			BOOL *pbUseHeap ){
+
+	int i,i2,i3;
+	char temporary[1024],temp2[1024];
+
+	if(expression[0]=='\0'){
+		SetError(1,NULL,cp);
+		return false;
+	}
+
+	if(expression[0]==1&& expression[1]==ESC_NEW ){
+		//New演算子（オブジェクト生成）
+
+		if( pobj_BlockReg->check(REG_RAX) ){
+			SetError();
+		}
+
+		//////////////////////////////////////////////////////
+		/////    レジスタ資源のバックアップ
+		{	BACKUP_REGISTER_RESOURCE
+		//////////////////////////////////////////////////////
+
+			if( !Operator_New( expression+2, baseType, resultType ) ){
+				return false;
+			}
+
+		/////////////////////////////////////////////
+		//////   レジスタ資源を復元
+			RESTORE_REGISTER_RESOURCE
+		}////////////////////////////////////////////
+
+		//mov reg,rax
+		op_mov_RR( *pReg, REG_RAX );
+
+		return true;
+	}
+
+	if( !baseType.IsNull() && expression[0] == '[' ){
+		// リテラル配列の場合
+
+		if( !baseType.IsPointer() ){
+			SetError(1,NULL,cp);
+			return false;
+		}
+		Type tempBaseType( baseType );
+		tempBaseType.PtrLevelDown();
+
+		char *buffer = (char *)malloc( lstrlen( expression ) + 1 );
+		lstrcpy( buffer, expression );
+		RemoveStringBracket( buffer );
+
+		void *binary = malloc( 1 );
+		int num = 0;
+
+		i = 0;
+		while( buffer[i] ){
+			i = GetOneParameter( buffer, i, temporary );
+			if( buffer[i] == ',' ){
+				i++;
+			}
+
+			Type resultType;
+			_int64 i64data;
+			if( !StaticCalculation( true, temporary, tempBaseType.GetBasicType(), &i64data, resultType ) ){
+				return false;
+			}
+			if( !resultType.IsWhole() ){
+				// TODO: 実数に未対応
+				SetError();
+				return false;
+			}
+
+			binary = realloc( binary, ( num + 1 ) * tempBaseType.GetSize() );
+			memcpy( (char *)binary + (num * tempBaseType.GetSize()), &i64data, tempBaseType.GetSize() );
+			num++;
+		}
+
+		i2 = dataTable.AddBinary( binary, num * tempBaseType.GetSize() );
+
+		//mov reg,i2
+		op_mov_RV(sizeof(_int64),*pReg,i2);
+		obp-=sizeof(long);
+		pobj_DataTableSchedule->add();
+		obp+=sizeof(long);
+
+		free( buffer );
+
+		resultType = baseType;
+
+		return true;
+	}
+
+
+	/////////////////////////////////
+	// 式要素を逆ポーランド式で取得
+	/////////////////////////////////
+
+	char *values[255];
+	long calc[255];
+	long stack[255];
+	int pnum;
+	if(!GetNumOpeElements(expression,&pnum,values,calc,stack)){
+		for(i=0;i<pnum;i++){
+			if(values[i]) HeapDefaultFree(values[i]);
+		}
+		return 0;
+	}
+
+
+	BOOL bInitRegSwitch=0;
+	if(!pobj_reg){
+		bInitRegSwitch=1;
+
+		//作業用レジスタを取得
+		pobj_reg=new CRegister(*pReg);
+	}
+
+	//エラー時の復旧用
+	CRegister objReg_Backup;
+	objReg_Backup=*pobj_reg;
+
+
+
+	////////////////////////////////
+	// 演算部分のコード生成を開始
+	////////////////////////////////
+
+	BOOL bError;
+	bError=0;
+
+	//リテラル値のみの計算かどうかを判別するためのフラグ
+	BOOL bLiteralCalculation=1;
+
+	//リテラル演算の場合を考慮した演算前のバッファ位置
+	int BeforeObp;
+	BeforeObp=obp;
+
+	//リテラル演算の場合を考慮した演算前のプロシージャスケジュール位置
+	//※64ビットの掛け算、除算などで特殊関数が呼ばれるため
+	int Before_ProcAddrScheduleNum;
+	Before_ProcAddrScheduleNum=pobj_SubAddrSchedule->num;
+
+	//リテラル演算の場合を考慮した演算前のデータテーブルスケジュール位置
+	int Before_DataTableScheduleNum;
+	Before_DataTableScheduleNum=pobj_DataTableSchedule->num;
+
+	//リテラル演算の場合を考慮した演算前の再配置スケジュール
+	CReloc *pobj_BackReloc;
+	pobj_BackReloc=new CReloc();
+	pobj_BackReloc->copy(pobj_Reloc);
+
+	//リテラル演算の場合を考慮した演算前のスタックフレームスケジュール位置
+	int Before_StackFrameScheduleNum;
+	Before_StackFrameScheduleNum=pobj_sf->num;
+
+	double dbl;
+	int sp;
+	int type_stack[255];
+	LONG_PTR index_stack[255];
+	bool isNothing_stack[255];
+	BOOL bUseHeap[255];
+	_int64 i64data;
+	int UseReg,XmmReg;
+	BOOL bXmm;
+	for(i=0,sp=0;i<pnum;i++){
+		int idCalc;
+		idCalc=calc[i]%100;
+
+		if(idCalc){
+			if(type_stack[sp-2]==DEF_OBJECT){
+				if( idCalc == CALC_AS
+					&& type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST )
+					&& index_stack[sp-1] == index_stack[sp-2]
+					|| isNothing_stack[sp-2] ){
+						// 同一の型、またはNothingに対するAsはAs演算子を呼び出さない
+				}
+				else if( idCalc == CALC_AS
+					&& type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST )
+					&& ( ((CClass *)index_stack[sp-1])->IsEqualsOrSubClass( (CClass *)index_stack[sp-2] ) || ((CClass *)index_stack[sp-2])->IsEqualsOrSubClass( (CClass *)index_stack[sp-1] )
+					)){
+						// ダウンキャストを許可する
+				}
+				else if( idCalc == CALC_AS
+					&& type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST ) && ((CClass *)index_stack[sp-1])->IsInterface()
+					){
+						// インターフェイスへのキャスト
+						// TODO: 実装
+						CastToInterface( pobj_reg->GetLockingReg(), REG_R15, *(CClass *)index_stack[sp-2], *(CClass *)index_stack[sp-1] );
+				}
+				else{
+					//オーバーロードされたオペレータを呼び出す
+					i2=CallOperatorProc(idCalc,baseType,type_stack,index_stack,bUseHeap,sp);
+					if(i2==0){
+						if(idCalc==CALC_EQUAL) lstrcpy(temp2,"==");
+						else GetCalcName(idCalc,temp2);
+						sprintf(temporary,"Operator %s",temp2);
+						SetError(27,temporary,cp);
+						goto error;
+					}
+					else if(i2==-1) goto error;
+
+					continue;
+				}
+			}
+
+			if(!CheckCalcType(idCalc,type_stack,sp)) goto error;
+		}
+
+		switch(idCalc){
+			//数値
+			case 0:
+				index_stack[sp]=-1;
+				isNothing_stack[sp] = false;
+				bUseHeap[sp]=0;
+
+				UseReg=pobj_reg->GetNextReg();
+				XmmReg=pobj_reg->GetNextXmmReg();
+
+				bXmm=0;
+
+				char *term;
+				term=values[i];
+
+				if( calc[i+1]%100 == CALC_AS ){
+					// As演算子の右辺値
+					//型名
+					if( Type::StringToType( term, resultType ) ){
+						resultType.SetBasicType( resultType.GetBasicType() | FLAG_CAST );
+					}
+					else{
+						SetError(3, term, cp );
+						goto error;
+					}
+
+					type_stack[sp] = resultType.GetBasicType();
+					index_stack[sp] = resultType.GetIndex();
+					sp++;
+
+					break;
+				}
+
+				if(term[0]=='\"'){
+					//リテラル文字列
+					if(!RemoveStringQuotes(term)){
+						SetError(43,NULL,cp);
+						goto error;
+					}
+					i3=lstrlen(term);
+StrLiteral:
+
+					if( baseType.IsObject() || baseType.IsNull() ){
+						//要求タイプがオブジェクト、または未定のとき
+
+						//String型オブジェクトを生成
+						NewStringObject(UseReg,term);
+
+						type_stack[sp]=DEF_OBJECT;
+						index_stack[sp]=(LONG_PTR)pobj_DBClass->GetStringClassPtr();
+						bLiteralCalculation=0;
+
+						if(bXmm) pobj_reg->LockXmmReg();
+						else pobj_reg->LockReg();
+
+						sp++;
+						break;
+					}
+
+					type_stack[sp]=typeOfPtrChar;
+					bLiteralCalculation=0;
+
+					i2 = dataTable.AddString( term, i3 );
+
+					//mov reg,i2
+					op_mov_RV(sizeof(_int64),UseReg,i2);
+					obp-=sizeof(long);
+					pobj_DataTableSchedule->add();
+					obp+=sizeof(long);
+
+					if(UseReg==REG_R14){
+						//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+						pobj_sf->push(REG_R14);
+					}
+				}
+				else if((term[0]=='e'||term[0]=='E')&&
+					(term[1]=='x'||term[1]=='X')&&
+					term[2]=='\"'){
+					//拡張版リテラル文字列（エスケープシーケンス可能）
+					if(!RemoveStringQuotes(term+2)){
+						SetError(43,NULL,cp);
+						goto error;
+					}
+					i3=FormatString_EscapeSequence(term+2);
+					term+=2;
+
+					goto StrLiteral;
+				}
+				else if(IsVariableTopChar(term[0])||
+					term[0]=='*'||
+					(term[0]=='.'&&IsVariableTopChar(term[1]))){
+					//////////////////
+					// 何らかの識別子
+
+					bool isLiteral;
+					if( TermOpe( term, baseType, resultType, isLiteral, &bUseHeap[sp] ) ){
+						if(resultType.IsNull()){
+							//戻り値が存在しないとき
+							for(i2=0;;i2++){
+								if(term[i2]=='('||term[i2]=='\0'){
+									term[i2]=0;
+									break;
+								}
+							}
+							SetError(38,term,cp);
+
+							goto error;
+						}
+
+						type_stack[sp] = resultType.GetBasicType();
+						index_stack[sp] = resultType.GetIndex();
+
+						if( !isLiteral ){
+							bLiteralCalculation=0;
+						}
+
+						if( resultType.GetBasicType() & FLAG_CAST ){
+							// 型名のみ
+							SetError();
+						}
+						else{
+							if( resultType.IsReal() == false && UseReg==REG_R14 ){
+								//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+								pobj_sf->push(REG_R14);
+							}
+							if( resultType.IsReal() && XmmReg==REG_XMM4 ){
+								if(resultType.IsDouble()){
+									//movsd qword ptr[rsp+offset],xmm4	※スタックフレームを利用
+									pobj_sf->push(REG_XMM4,sizeof(double));
+								}
+								if(resultType.IsSingle()){
+									//movss dword ptr[rsp+offset],xmm4	※スタックフレームを利用
+									pobj_sf->push(REG_XMM4,sizeof(float));
+								}
+							}
+
+							if( resultType.IsReal() ){
+								pobj_reg->LockXmmReg();
+							}
+							else{
+								pobj_reg->LockReg();
+							}
+						}
+
+						sp++;
+						break;
+					}
+
+
+					// Nothing
+					if( lstrcmp( term, "Nothing" ) == 0 ){
+						isNothing_stack[sp] = true;
+
+						type_stack[sp] = DEF_OBJECT;
+						if( baseType.IsObject() ){
+							index_stack[sp] = baseType.GetIndex();
+						}
+						else{
+							index_stack[sp] = (LONG_PTR)pobj_DBClass->GetObjectClassPtr();
+						}
+
+						bLiteralCalculation = 0;
+
+						//xor reg,reg
+						op_zero_reg( UseReg );
+
+						if(UseReg==REG_R14){
+							//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+							pobj_sf->push(REG_R14);
+						}
+
+						pobj_reg->LockReg();
+						sp++;
+						break;
+					}
+
+
+					//////////////
+					// 定数の場合
+					//////////////
+
+					i3 = CDBConst::obj.GetBasicType(term);
+					if(i3){
+						if( CDBConst::obj.IsStringPtr( term ) ){
+							//リテラル文字列
+
+							double dbl = CDBConst::obj.GetDoubleData(term);
+							memcpy(&i64data,&dbl,sizeof(double));
+
+							//バイト数
+							i3=lstrlen((char *)i64data);
+
+							memcpy(term,(char *)i64data,i3);
+							term[i3]=0;
+							goto StrLiteral;
+						}
+
+						type_stack[sp] = i3;
+						if(IsRealNumberType(i3)){
+							//実数
+							double dbl = CDBConst::obj.GetDoubleData(term);
+							memcpy(&i64data,&dbl,sizeof(double));
+							goto Literal;
+						}
+						else if(IsWholeNumberType(i3)){
+							//整数
+							i64data = CDBConst::obj.GetWholeData(term);
+							goto Literal;
+						}
+						/*else if(i3==DEF_STRING){
+							//リテラル文字列
+
+							//バイト数
+							i3=(int)dbl;
+
+							memcpy(term,temporary,i3);
+							goto StrLiteral;
+						}*/
+						else{
+							SetError(1,NULL,0);
+							goto error;
+						}
+					}
+
+
+					//該当する識別子が見当たらないときはエラー扱いにする
+					bError=1;
+					SetError(3,term,cp);
+					type_stack[sp]=DEF_DOUBLE;
+				}
+				else{
+					//リテラル値
+					type_stack[sp]=GetLiteralValue(term,&i64data,baseType.GetBasicType());
+Literal:
+					if(type_stack[sp]==DEF_DOUBLE){
+						//64ビット浮動小数型
+						bXmm=1;
+
+						if(XmmReg==REG_XMM4){
+							//mov r14,i64data
+							op_mov64_ToReg(REG_R14,i64data);
+
+
+							//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+							pobj_sf->push(REG_R14);
+						}
+						else{
+							i3 = dataTable.Add( i64data );
+
+							//movlpd xmm_reg,qword ptr[data table offset]
+							OpBuffer[obp++]=(char)0x66;
+							OpBuffer[obp++]=(char)0x0F;
+							OpBuffer[obp++]=(char)0x12;
+							OpBuffer[obp++]=(char)(0x04 | REGISTER_OPERAND(XmmReg)<<3);
+							OpBuffer[obp++]=(char)0x25;
+							*((long *)(OpBuffer+obp))=i3;
+							pobj_DataTableSchedule->add();
+							obp+=sizeof(long);
+						}
+					}
+					else if(type_stack[sp]==DEF_SINGLE){
+						//32ビット浮動小数型
+						bXmm=1;
+
+						float flt;
+						int i32data;
+						memcpy(&dbl,&i64data,sizeof(double));
+						flt=(float)dbl;
+						memcpy(&i32data,&flt,sizeof(long));
+
+						if(XmmReg==REG_XMM4){
+							SetError();		// TODO: 未実装
+							//push term
+							op_push_value(i32data);
+						}
+						else{
+							i3=dataTable.Add( i32data );
+
+							//movss xmm_reg,dword ptr[data table offset]
+							OpBuffer[obp++]=(char)0xF3;
+							OpBuffer[obp++]=(char)0x0F;
+							OpBuffer[obp++]=(char)0x10;
+							OpBuffer[obp++]=(char)(0x04 | REGISTER_OPERAND(XmmReg)<<3);
+							OpBuffer[obp++]=(char)0x25;
+							*((long *)(OpBuffer+obp))=i3;
+							pobj_DataTableSchedule->add();
+							obp+=sizeof(long);
+						}
+					}
+					else{
+						//整数
+
+						index_stack[sp]=GetLiteralIndex(i64data);
+
+						//mov reg,i64data
+						op_mov64_ToReg(UseReg,i64data);
+
+						if(UseReg==REG_R14){
+							//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+							pobj_sf->push(REG_R14);
+						}
+					}
+				}
+
+				if(bXmm) pobj_reg->LockXmmReg();
+				else pobj_reg->LockReg();
+
+				sp++;
+				break;
+
+			//論理演算子
+			case CALC_XOR:
+			case CALC_OR:
+			case CALC_AND:
+				if(!CalcTwoTerm_Logical(idCalc,type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_NOT:
+				//value[sp-1]=Not value[sp-1]
+				//NOT演算子
+				if(!Calc_Not(type_stack,sp)) goto error;
+				break;
+
+			//比較演算子
+			case CALC_PE:		//value[sp-2] <= value[sp-1]
+			case CALC_QE:		//value[sp-2] >= value[sp-1]
+			case CALC_P:		//value[sp-2] <  value[sp-1]
+			case CALC_Q:		//value[sp-2] >  value[sp-1]
+			case CALC_NOTEQUAL:	//value[sp-2] <> value[sp-1]
+			case CALC_EQUAL:	//value[sp-2] =  value[sp-1]				
+				if(!CalcTwoTerm_Relational(idCalc,type_stack,index_stack,&sp)) goto error;
+				break;
+
+			//ビットシフト
+			case CALC_SHL:	//value[sp-2] << value[sp-1]
+			case CALC_SHR:	//value[sp-2] >> value[sp-1]
+				if(!Calc_Shift(idCalc,type_stack,&sp)) goto error;
+				break;
+
+			//算術演算
+			case CALC_ADDITION:
+			case CALC_SUBTRACTION:
+			case CALC_PRODUCT:
+				if(!CalcTwoTerm_Arithmetic(idCalc,type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_MOD:
+				//value[sp-2]%=value[sp-1]
+				//剰余演算
+				if(!Calc_Mod(type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_QUOTIENT:
+				//value[sp-2]/=value[sp-1];
+				//除算
+				if(!Calc_Divide(type_stack,&sp,baseType.GetBasicType())) goto error;
+				break;
+			case CALC_INTQUOTIENT:
+				//value[sp-2]/=value[sp-1]
+				//整数除算
+				if(!Calc_IntDivide(type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_MINUSMARK:
+				//value[sp-1]=-value[sp-1]
+				//符号反転
+				if(!Calc_MinusMark(type_stack,sp)) goto error;
+				break;
+			case CALC_POWER:
+				//べき乗演算（浮動小数点演算のみ）
+				if(!Calc_Power(type_stack,&sp)) goto error;
+				break;
+			case CALC_AS:
+				//キャスト
+				if(!Calc_Cast(type_stack,index_stack,&sp)) goto error;
+				break;
+			case CALC_BYVAL:
+				//ポインタ型→参照型
+				if( PTR_LEVEL( type_stack[sp-1] ) <= 0 ){
+					//ポインタ型ではないとき
+					SetError( 3, NULL, cp );
+					goto error;
+				}
+
+				type_stack[sp-1] = PTR_LEVEL_DOWN( type_stack[sp-1] );
+
+				break;
+
+			default:
+				SetError(300,NULL,cp);
+				goto error;
+		}
+	}
+
+	if(bError) goto error;
+
+	if(sp!=1){
+		SetError(1,NULL,cp);
+		goto error;
+	}
+
+	if(bLiteralCalculation){
+		//右辺値が数値の定数式の場合
+		Type resultType;
+		StaticCalculation(true, expression,baseType.GetBasicType(),&i64data,resultType);
+
+		obp=BeforeObp;
+		pobj_SubAddrSchedule->num=Before_ProcAddrScheduleNum;
+		pobj_DataTableSchedule->num=Before_DataTableScheduleNum;
+		pobj_Reloc->copy(pobj_BackReloc);
+		pobj_sf->num=Before_StackFrameScheduleNum;
+		*pobj_reg=objReg_Backup;
+
+		if(resultType.IsReal()){
+			if(baseType.IsReal()) resultType=baseType;
+
+			XmmReg=pobj_reg->LockXmmReg();
+
+			if(resultType.IsDouble()){
+				i3 = dataTable.Add( i64data );
+
+				//movlpd xmm_reg,qword ptr[data table offset]
+				OpBuffer[obp++]=(char)0x66;
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0x12;
+				OpBuffer[obp++]=(char)(0x04 | REGISTER_OPERAND(XmmReg)<<3);
+				OpBuffer[obp++]=(char)0x25;
+				*((long *)(OpBuffer+obp))=i3;
+				pobj_DataTableSchedule->add();
+				obp+=sizeof(long);
+			}
+			if(resultType.IsSingle()){
+				memcpy(&dbl,&i64data,sizeof(_int64));
+
+				float flt;
+				int i32data;
+				flt=(float)dbl;
+				memcpy(&i32data,&flt,sizeof(long));
+
+				i3 = dataTable.Add( i32data );
+
+				//movss xmm_reg,dword ptr[data table offset]
+				OpBuffer[obp++]=(char)0xF3;
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0x10;
+				OpBuffer[obp++]=(char)(0x04 | REGISTER_OPERAND(XmmReg)<<3);
+				OpBuffer[obp++]=(char)0x25;
+				*((long *)(OpBuffer+obp))=i3;
+				pobj_DataTableSchedule->add();
+				obp+=sizeof(long);
+			}
+		}
+		else{
+			if(!resultType.Is64()){
+				//整数（符号有り/無し）
+
+				i3=(long)i64data;
+
+				if(resultType.GetBasicSize()==sizeof(char)) i3=i3&0x000000FF;
+				if(resultType.GetBasicSize()==sizeof(short)) i3=i3&0x0000FFFF;
+
+				i64data=(_int64)i3;
+			}
+
+			UseReg=pobj_reg->LockReg();
+
+			//mov reg,i64data
+			op_mov64_ToReg(UseReg,i64data);
+		}
+
+		type_stack[0]=resultType.GetBasicType();
+		index_stack[0]=resultType.GetIndex();
+	}
+	else{
+		//右辺値が数値の定数式ではないとき
+		if(IS_LITERAL(index_stack[0])) index_stack[0]=-1;
+	}
+
+	if(pbUseHeap) *pbUseHeap=bUseHeap[0];
+
+	if(IsRealNumberType(type_stack[0]))
+		*pReg=pobj_reg->UnlockXmmReg();
+	else
+		*pReg=pobj_reg->UnlockReg();
+
+
+	if(bInitRegSwitch){
+		//整合性をチェック（バグ回避）
+		pobj_reg->bug_check();
+
+		//作業レジスタを解放
+		delete pobj_reg;
+		pobj_reg=0;
+	}
+
+	resultType.SetType( type_stack[0], index_stack[0] );
+
+	bool isSuccessful = true;
+	goto finish;
+
+
+
+	//////////////////
+	// エラー処理
+	//////////////////
+
+error:
+
+	*pobj_reg=objReg_Backup;
+
+	if(bInitRegSwitch){
+		//作業レジスタを解放
+		delete pobj_reg;
+		pobj_reg=0;
+	}
+
+	isSuccessful = false;
+	goto finish;
+
+
+
+
+finish:
+
+	for(i=0;i<pnum;i++){
+		if(values[i]) HeapDefaultFree(values[i]);
+	}
+
+	//再配置スケジュールバックアップ情報を解放
+	delete pobj_BackReloc;
+
+	return isSuccessful;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/NumOpe_Arithmetic.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/NumOpe_Arithmetic.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/NumOpe_Arithmetic.cpp	(revision 178)
@@ -0,0 +1,680 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+BOOL CalcTwoTerm_Arithmetic(int idCalc,int *type,LONG_PTR *index_stack,int *pStackPointer){
+	/*	value[sp-2] = value[sp-2] + value[sp-1]
+		value[sp-2] = value[sp-2] - value[sp-1]
+		value[sp-2] = value[sp-2] * value[sp-1]		*/
+
+	int reg1,reg2;
+
+	int sp;
+	sp=*pStackPointer;
+
+	int AnswerType;
+	AnswerType=NeutralizationType(type[sp-2],index_stack[sp-2],type[sp-1],index_stack[sp-1]);
+
+	if(type[sp-2]==DEF_DOUBLE||type[sp-2]==DEF_SINGLE||
+		type[sp-1]==DEF_DOUBLE||type[sp-1]==DEF_SINGLE){
+		/////////////
+		// 実数演算
+		/////////////
+
+		int xmm_reg1,xmm_reg2;
+
+		//2つの項を適切なレジスタにセット
+		SetTowTermToReg_RealCalc(AnswerType,type,sp,&xmm_reg1,&xmm_reg2);
+
+		if(AnswerType==DEF_DOUBLE){
+			///////////////////////
+			// Double演算
+			///////////////////////
+
+			if(idCalc==CALC_ADDITION){
+				//addsd xmm_reg1,xmm_reg2
+				OpBuffer[obp++]=(char)0xF2;
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0x58;
+				OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2));
+			}
+			else if(idCalc==CALC_SUBTRACTION){
+				//subsd xmm_reg1,xmm_reg2
+				OpBuffer[obp++]=(char)0xF2;
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0x5C;
+				OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2));
+			}
+			else if(idCalc==CALC_PRODUCT){
+				//mulsd xmm_reg1,xmm_reg2
+				OpBuffer[obp++]=(char)0xF2;
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0x59;
+				OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2));
+			}
+
+			if(xmm_reg1==REG_XMM4){
+				//movsd qword ptr[rsp+offset],xmm4		※スタックフレームを利用
+				pobj_sf->push(REG_XMM4,sizeof(double));
+			}
+		}
+		if(AnswerType==DEF_SINGLE){
+			///////////////////////
+			// Single演算
+			///////////////////////
+
+			if(idCalc==CALC_ADDITION){
+				//addss xmm_reg1,xmm_reg2
+				OpBuffer[obp++]=(char)0xF3;
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0x58;
+				OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2));
+			}
+			else if(idCalc==CALC_SUBTRACTION){
+				//subss xmm_reg1,xmm_reg2
+				OpBuffer[obp++]=(char)0xF3;
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0x5C;
+				OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2));
+			}
+			else if(idCalc==CALC_PRODUCT){
+				//mulss xmm_reg1,xmm_reg2
+				OpBuffer[obp++]=(char)0xF3;
+				OpBuffer[obp++]=(char)0x0F;
+				OpBuffer[obp++]=(char)0x59;
+				OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2));
+			}
+
+			if(xmm_reg1==REG_XMM4){
+				//movss dword ptr[rsp+offset],xmm4		※スタックフレームを利用
+				pobj_sf->push(REG_XMM4,sizeof(float));
+			}
+		}
+	}
+	else if(Is64Type(type[sp-2])||Is64Type(type[sp-1])){
+		//////////////////////
+		// 64ビット整数演算
+		//////////////////////
+
+		SetTowTermToReg_Whole64Calc(type,sp,&reg1,&reg2);
+
+		if(idCalc==CALC_ADDITION){
+			//add reg1,reg2
+			op_add64_reg(reg1,reg2);
+		}
+		else if(idCalc==CALC_SUBTRACTION){
+			//sub reg1,reg2
+			op_sub64_reg(reg1,reg2);
+		}
+		else if(idCalc==CALC_PRODUCT){
+			//mul reg1,reg2
+			op_imul_RR(sizeof(_int64),reg1,reg2);
+		}
+
+		if(reg1==REG_R14){
+			//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+			pobj_sf->push(REG_R14);
+		}
+	}
+	else{
+		//32ビット以下の整数演算
+
+		SetTowTermToReg_Whole32Calc(type,sp,&reg1,&reg2);
+
+		if(idCalc==CALC_ADDITION){
+			//add reg1,reg2
+			op_add32_reg(reg1,reg2);
+		}
+		else if(idCalc==CALC_SUBTRACTION){
+			//sub reg1,reg2
+			op_sub32_reg(reg1,reg2);
+		}
+		else if(idCalc==CALC_PRODUCT){
+			//mul reg1,reg2
+			op_imul_RR(sizeof(long),reg1,reg2);
+		}
+
+		if(reg1==REG_R14){
+			//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+			pobj_sf->push(REG_R14);
+		}
+	}
+
+	sp--;
+	type[sp-1]=AnswerType;
+
+	*pStackPointer=sp;
+
+	return 1;
+}
+
+
+
+BOOL Calc_Mod(int *type,LONG_PTR *index_stack,int *pStackPointer){
+	//value[sp-2]%=value[sp-1]
+	//剰余演算
+
+	int reg1,reg2;
+	int AnswerType;
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
+		//実数演算は行えないため、エラー扱い
+		SetError(45,"mod",cp);
+		return 0;
+	}
+
+	/////////////////////////
+	// 64ビット整数演算のみ
+	/////////////////////////
+
+	AnswerType=NeutralizationType(type[sp-2],index_stack[sp-2],type[sp-1],index_stack[sp-1]);
+
+	//2つの項を適切なレジスタにセット
+	SetTowTermToReg_Whole64Calc(type,sp,&reg1,&reg2);
+
+	if(reg2==REG_RAX||reg2==REG_RDX){
+		//mov r15,reg2
+		op_mov_RR(REG_R15,reg2);
+
+		reg2=REG_R15;
+	}
+
+	//raxまたはrdxが使用中かどうかを調べる( true/使用中, false/未使用 )
+	bool isUsingRax = pobj_reg->IsUsing( REG_RAX );
+	bool isUsingRdx = pobj_reg->IsUsing( REG_RDX );
+
+	if(reg1!=REG_RDX && isUsingRdx){
+		//結果レジスタがrdxでない場合（使用されている可能性があるとき）
+
+		//mov qword ptr[rsp+offset],rdx     ※スタックフレームを利用
+		pobj_sf->push(REG_RDX);
+	}
+
+	if(reg1!=REG_RAX && isUsingRax){
+		//結果レジスタがraxでない場合（使用されている可能性があるとき）
+
+		//mov qword ptr[rsp+offset],rax     ※スタックフレームを利用
+		pobj_sf->push(REG_RAX);
+	}
+
+	{
+
+		//mov rax,reg1
+		op_mov_RR(REG_RAX,reg1);
+
+		if(IsSignedType(type[sp-2])){
+			//符号拡張
+			//rdx:rax ← rax
+
+			//cqo
+			OpBuffer[obp++]=(char)0x48;
+			OpBuffer[obp++]=(char)0x99;
+		}
+		else{
+			//ビット拡張
+			//rdx:rax ← rax
+
+			//xor rdx,rdx
+			op_zero_reg(REG_RDX);
+		}
+
+		if(IsSignedType(AnswerType)){
+			//idiv reg2
+			op_idiv64_reg(reg2);
+		}
+		else{
+			//div reg2
+			op_div64_reg(reg2);
+		}
+
+		//mov reg1,rdx
+		op_mov_RR(reg1,REG_RDX);
+
+	}
+
+	if(reg1!=REG_RAX && isUsingRax){
+		//結果レジスタがraxでない場合（使用されている可能性があるとき）
+
+		//mov rax,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_RAX);
+	}
+
+	if(reg1!=REG_RDX && isUsingRdx){
+		//結果レジスタがrdxでない場合（使用されている可能性があるとき）
+
+		//mov rdx,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_RDX);
+	}
+
+
+	if(reg1==REG_R14){
+		//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+		pobj_sf->push(REG_R14);
+	}
+
+	sp--;
+	type[sp-1]=AnswerType;
+
+
+	*pStackPointer=sp;
+
+	return 1;
+}
+
+BOOL Calc_Divide(int *type,int *pStackPointer,int BaseType){
+	//value[sp-2]/=value[sp-1];
+	//除算
+
+	int sp;
+	sp=*pStackPointer;
+
+	///////////////////////
+	// 実数演算のみ
+	///////////////////////
+
+	int AnswerType;
+	if(type[sp-2]==DEF_SINGLE&&type[sp-1]==DEF_SINGLE&&BaseType==DEF_SINGLE) AnswerType=DEF_SINGLE;
+	else AnswerType=DEF_DOUBLE;
+
+	int xmm_reg1,xmm_reg2;
+
+	//2つの項を適切なレジスタにセット
+	SetTowTermToReg_RealCalc(AnswerType,type,sp,&xmm_reg1,&xmm_reg2);
+
+	if(AnswerType==DEF_DOUBLE){
+		///////////////////////
+		// Double演算
+		///////////////////////
+
+		//divsd xmm_reg1,xmm_reg2
+		OpBuffer[obp++]=(char)0xF2;
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x5E;
+		OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2));
+
+		if(xmm_reg1==REG_XMM4){
+			//movsd qword ptr[rsp+offset],xmm4		※スタックフレームを利用
+			pobj_sf->push(REG_XMM4,sizeof(double));
+		}
+	}
+	if(AnswerType==DEF_SINGLE){
+		///////////////////////
+		// Single演算
+		///////////////////////
+
+		//divss xmm_reg1,xmm_reg2
+		OpBuffer[obp++]=(char)0xF3;
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x5E;
+		OpBuffer[obp++]=(char)(0xC0 | REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2));
+
+		if(xmm_reg1==REG_XMM4){
+			//movss dword ptr[rsp+offset],xmm4		※スタックフレームを利用
+			pobj_sf->push(REG_XMM4,sizeof(float));
+		}
+	}
+
+	sp--;
+	type[sp-1]=AnswerType;
+
+
+	*pStackPointer=sp;
+
+	return 1;
+}
+
+BOOL Calc_IntDivide(int *type,LONG_PTR *index_stack,int *pStackPointer){
+	//value[sp-2]/=value[sp-1]
+	//除算（整数）
+
+	int reg1,reg2;
+	int AnswerType;
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
+		//実数演算は行えないため、エラー扱い
+		SetError(45,"mod",cp);
+		return 0;
+	}
+
+	/////////////////////////
+	// 64ビット整数演算のみ
+	/////////////////////////
+
+	AnswerType=NeutralizationType(type[sp-2],index_stack[sp-2],type[sp-1],index_stack[sp-1]);
+
+	//2つの項を適切なレジスタにセット
+	SetTowTermToReg_Whole64Calc(type,sp,&reg1,&reg2);
+
+	if(reg2==REG_RAX||reg2==REG_RDX){
+		//mov r15,reg2
+		op_mov_RR(REG_R15,reg2);
+
+		reg2=REG_R15;
+	}
+
+	//raxまたはrdxが使用中かどうかを調べる( true/使用中, false/未使用 )
+	bool isUsingRax = pobj_reg->IsUsing( REG_RAX );
+	bool isUsingRdx = pobj_reg->IsUsing( REG_RDX );
+
+	if(reg1!=REG_RDX && isUsingRdx){
+		//結果レジスタがrdxでない場合（使用されている可能性があるとき）
+
+		//mov qword ptr[rsp+offset],rdx     ※スタックフレームを利用
+		pobj_sf->push(REG_RDX);
+	}
+
+	if(reg1!=REG_RAX && isUsingRax){
+		//結果レジスタがraxでない場合（使用されている可能性があるとき）
+
+		//mov qword ptr[rsp+offset],rax     ※スタックフレームを利用
+		pobj_sf->push(REG_RAX);
+	}
+
+	{
+
+		//mov rax,reg1
+		op_mov_RR(REG_RAX,reg1);
+
+		if(IsSignedType(type[sp-2])){
+			//符号拡張
+			//rdx:rax ← rax
+
+			//cqo
+			OpBuffer[obp++]=(char)0x48;
+			OpBuffer[obp++]=(char)0x99;
+		}
+		else{
+			//ビット拡張
+			//rdx:rax ← rax
+
+			//xor rdx,rdx
+			op_zero_reg(REG_RDX);
+		}
+
+		if(IsSignedType(AnswerType)){
+			//idiv reg2
+			op_idiv64_reg(reg2);
+		}
+		else{
+			//div reg2
+			op_div64_reg(reg2);
+		}
+
+		//mov reg1,rax
+		op_mov_RR(reg1,REG_RAX);
+
+	}
+
+	if(reg1!=REG_RAX && isUsingRax){
+		//結果レジスタがraxでない場合（使用されている可能性があるとき）
+
+		//mov rax,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_RAX);
+	}
+
+	if(reg1!=REG_RDX && isUsingRdx){
+		//結果レジスタがrdxでない場合（使用されている可能性があるとき）
+
+		//mov rdx,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_RDX);
+	}
+
+
+	if(reg1==REG_R14){
+		//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+		pobj_sf->push(REG_R14);
+	}
+
+	sp--;
+	type[sp-1]=AnswerType;
+
+	*pStackPointer=sp;
+
+	return 1;
+}
+
+BOOL Calc_MinusMark(int *type,int sp){
+	//value[sp-1]=-value[sp-1]
+	//符号反転
+
+	int xmm_reg;
+	int reg;
+	int i32data;
+
+	if(type[sp-1]==DEF_DOUBLE){
+		SetOneTermToReg_RealCalc(type[sp-1],&xmm_reg);
+
+		double dbl;
+		dbl=-1;
+		i32data = dataTable.Add( dbl );
+
+		//mulsd xmm_reg,qword ptr[data table offset]   ※data = -1
+		OpBuffer[obp++]=(char)0xF2;
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x59;
+		OpBuffer[obp++]=(char)(0x04 | REGISTER_OPERAND(xmm_reg)<<3);
+		OpBuffer[obp++]=(char)0x25;
+		*((long *)(OpBuffer+obp))=i32data;
+		pobj_DataTableSchedule->add();
+		obp+=sizeof(long);
+
+		if(xmm_reg==REG_XMM4){
+			//movsd qword ptr[rsp+offset],xmm4		※スタックフレームを利用
+			pobj_sf->push(REG_XMM4,sizeof(double));
+		}
+	}
+	else if(type[sp-1]==DEF_SINGLE){
+		SetOneTermToReg_RealCalc(type[sp-1],&xmm_reg);
+
+		float flt;
+		flt=-1;
+		i32data = dataTable.Add( flt );
+
+		//mulss xmm_reg,dword ptr[data table offset]   ※data = -1
+		OpBuffer[obp++]=(char)0xF3;
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x59;
+		OpBuffer[obp++]=(char)(0x04 | REGISTER_OPERAND(xmm_reg)<<3);
+		OpBuffer[obp++]=(char)0x25;
+		*((long *)(OpBuffer+obp))=i32data;
+		pobj_DataTableSchedule->add();
+		obp+=sizeof(long);
+
+		if(xmm_reg==REG_XMM4){
+			//movss dword ptr[rsp+offset],xmm4		※スタックフレームを利用
+			pobj_sf->push(REG_XMM4,sizeof(float));
+		}
+	}
+	else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+		SetOneTermToReg_Whole64Calc(type[sp-1],&reg);
+
+		//imul reg,-1
+		op_imul_RV(sizeof(_int64),reg,-1);
+
+		if(reg==REG_R14){
+			//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+			pobj_sf->push(REG_R14);
+		}
+
+		type[sp-1]=DEF_INT64;	//QWordはInt64へ
+	}
+	else if(IsWholeNumberType(type[sp-1])){
+		SetOneTermToReg_Whole32Calc(type[sp-1],&reg);
+
+		//imul reg,-1
+		op_imul_RV(sizeof(long),reg,-1);
+
+		if(reg==REG_R14){
+			//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+			pobj_sf->push(REG_R14);
+		}
+
+		type[sp-1]=GetSignedType(type[sp-1]);
+	}
+
+	return 1;
+}
+
+BOOL Calc_Power(int *type,int *pStackPointer){
+	//べき乗（実数演算のみ）
+
+	int sp;
+	sp=*pStackPointer;
+
+
+	//2つの項を適切なレジスタにセット
+	int xmm_reg1,xmm_reg2;
+	SetTowTermToReg_RealCalc(DEF_DOUBLE,type,sp,&xmm_reg1,&xmm_reg2);
+
+
+	//////////////////////////////////////////////////////
+	/////    レジスタ資源のバックアップ
+	{	BACKUP_REGISTER_RESOURCE
+	//////////////////////////////////////////////////////
+
+
+		////////////////
+		// 呼び出し
+		////////////////
+
+		if(xmm_reg1==REG_XMM1){
+			//movsd xmm0,xmm_reg1
+			op_movsd_RR(REG_XMM0,xmm_reg1);
+
+			//movsd xmm1,xmm_reg2
+			op_movsd_RR(REG_XMM1,xmm_reg2);
+		}
+		else{
+			//movsd xmm1,xmm_reg2
+			op_movsd_RR(REG_XMM1,xmm_reg2);
+
+			//movsd xmm0,xmm_reg1
+			op_movsd_RR(REG_XMM0,xmm_reg1);
+		}
+
+		//call pow
+		extern UserProc *pSub_pow;
+		op_call(pSub_pow);
+
+		//movsd xmm4,xmm0
+		op_movsd_RR(REG_XMM4,REG_XMM0);
+
+
+	/////////////////////////////////////////////
+	//////   レジスタ資源を復元
+		RESTORE_REGISTER_RESOURCE
+	}////////////////////////////////////////////
+
+
+	//////////////////////////////////
+	// 戻り値を所定のレジスタへ格納
+	//////////////////////////////////
+
+	if(xmm_reg1==REG_XMM4){
+		//movsd qword ptr[rsp+offset],xmm4		※スタックフレームを利用
+		pobj_sf->push(REG_XMM0,sizeof(double));
+	}
+	else{
+		//movsd xmm_reg1,xmm4
+		op_movsd_RR(xmm_reg1,REG_XMM4);
+	}
+
+
+	sp--;
+	type[sp-1]=DEF_DOUBLE;
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_Shift(int idCalc,int *type,int *pStackPointer){
+	//ビットシフト
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
+		//いずれかの項が実数のとき
+		SetError(45,"<<",cp);
+		return 0;
+	}
+
+
+	/////////////////////////
+	// 64ビット整数演算のみ
+	/////////////////////////
+	int reg1,reg2;
+
+	//2つの項を適切なレジスタにセット
+	SetTowTermToReg_Whole64Calc(type,sp,&reg1,&reg2);
+
+	int sw=0;
+	if(reg1==REG_RCX){
+		//mov r15,rcx
+		op_mov_RR(REG_R15,REG_RCX);
+
+		reg1=REG_R15;
+	}
+	else if(reg2!=REG_RCX){
+		sw=1;
+
+		//mov qword ptr[rsp+offset],rcx     ※スタックフレームを利用
+		pobj_sf->push(REG_RCX);
+	}
+
+	//mov rcx,reg2
+	op_mov_RR(REG_RCX,reg2);
+
+	if(idCalc==CALC_SHL){
+		//左シフトは符号あり、なしは同様の動きをする
+
+		//32ビット型にする
+		if(!Is64Type(type[sp-2])){
+			ExtendTypeTo32(type[sp-2],reg1);
+
+			if(IsSignedType(type[sp-2])) type[sp-2]=DEF_LONG;
+			else type[sp-2]=DEF_DWORD;
+		}
+
+		//shl reg1,cl
+		op_shl_reg(GetTypeSize(type[sp-2],-1),reg1);
+	}
+	else if(idCalc==CALC_SHR){
+		if(IsSignedType(type[sp-2])){
+			//符号あり
+
+			//sar
+			op_sar_reg(GetTypeSize(type[sp-2],-1),reg1);
+		}
+		else{
+			//符号なし
+
+			//shr
+			op_shr_reg(GetTypeSize(type[sp-2],-1),reg1);
+		}
+	}
+
+	if(sw==0){
+		//mov rcx,r15
+		op_mov_RR(REG_RCX,REG_R15);
+	}
+	else{
+		//mov rcx,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_RCX);
+	}
+
+	if(reg1==REG_R14){
+		//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+		pobj_sf->push(REG_R14);
+	}
+
+	sp--;
+
+	*pStackPointer=sp;
+	return 1;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/NumOpe_Logical.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/NumOpe_Logical.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/NumOpe_Logical.cpp	(revision 178)
@@ -0,0 +1,153 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+BOOL CalcTwoTerm_Logical(int idCalc,int *type,LONG_PTR *index_stack,int *pStackPointer){
+	//value[sp-2] xor= value[sp-1]
+	//xor演算
+
+	int sp;
+	sp=*pStackPointer;
+
+	if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
+		//いずれかの項が実数のとき
+		SetError(45,"xor",cp);
+		return 0;
+	}
+
+	int reg1,reg2;
+
+	if(Is64Type(type[sp-2])||Is64Type(type[sp-1])){
+		//////////////////////
+		// 64ビット整数演算
+		//////////////////////
+
+		SetTowTermToReg_Whole64Calc(type,sp,&reg1,&reg2);
+
+		if(idCalc==CALC_XOR){
+			//xor reg1,reg2
+			op_xor_reg(sizeof(_int64),reg1,reg2);
+		}
+		else if(idCalc==CALC_OR){
+			//or reg1,reg2
+			op_or_reg(sizeof(_int64),reg1,reg2);
+		}
+		else if(idCalc==CALC_AND){
+			//and reg1,reg2
+			op_and_reg(sizeof(_int64),reg1,reg2);
+		}
+
+		if(reg1==REG_R14){
+			//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+			pobj_sf->push(REG_R14);
+		}
+
+		sp--;
+		type[sp-1]=NeutralizationType(type[sp-1],index_stack[sp-1],type[sp],index_stack[sp]);
+	}
+	else{
+		//32ビット以下の整数演算
+
+		SetTowTermToReg_Whole32Calc(type,sp,&reg1,&reg2);
+
+		if(idCalc==CALC_ADDITION){
+			//add reg1,reg2
+			op_xor_reg(sizeof(long),reg1,reg2);
+		}
+		else if(idCalc==CALC_OR){
+			//or reg1,reg2
+			op_or_reg(sizeof(long),reg1,reg2);
+		}
+		else if(idCalc==CALC_AND){
+			//and reg1,reg2
+			op_and_reg(sizeof(long),reg1,reg2);
+		}
+
+		if(reg1==REG_R14){
+			//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+			pobj_sf->push(REG_R14);
+		}
+
+		sp--;
+		type[sp-1]=NeutralizationType(type[sp-1],index_stack[sp-1],type[sp],index_stack[sp]);
+	}
+
+	*pStackPointer=sp;
+	return 1;
+}
+
+BOOL Calc_Not(int *type,int sp){
+	//value[sp-1]=Not value[sp-1]
+	//NOT演算子
+
+	if(IsRealNumberType(type[sp-1])){
+		//実数のとき
+		SetError(45,"Not",cp);
+		return 0;
+	}
+
+	int reg;
+
+	if( type[sp - 1] == DEF_BOOLEAN ){
+		SetOneTermToReg_Whole32Calc(type[sp-1],&reg);
+
+		if( reg != REG_RAX ){
+			//mov rax,qword ptr[rsp+offset]     ※スタックフレームを利用
+			pobj_sf->pop(REG_RAX);
+		}
+
+		//cmp reg,0
+		op_cmp_value(GetTypeSize(type[sp-1],-1),reg,0);
+
+		//setne al
+		op_setne( REG_RAX );
+
+		//and rax,000000FFh
+		op_and64_value(REG_RAX,(int)0xFF);
+
+		//neg
+		op_neg( REG_RAX );
+
+		//sbb rax, rax
+		op_sbb_RR( sizeof(_int64), REG_RAX, REG_RAX );
+
+		//add rax, 1
+		op_add_RV( REG_RAX, 1 );
+
+		if( reg != REG_RAX ){
+			//mov reg,rax
+			op_mov_RR( reg, REG_RAX );
+
+			//mov qword ptr[rsp+offset],rax     ※スタックフレームを利用
+			pobj_sf->push(REG_RAX);
+		}
+
+		if(reg==REG_R14){
+			//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+			pobj_sf->push(REG_R14);
+		}
+	}
+	else if(type[sp-1]==DEF_INT64||type[sp-1]==DEF_QWORD){
+		SetOneTermToReg_Whole64Calc(type[sp-1],&reg);
+
+		//not reg
+		op_not_reg(sizeof(_int64),reg);
+
+		if(reg==REG_R14){
+			//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+			pobj_sf->push(REG_R14);
+		}
+	}
+	else if(IsWholeNumberType(type[sp-1])){
+		SetOneTermToReg_Whole32Calc(type[sp-1],&reg);
+
+		//not reg
+		op_not_reg(sizeof(long),reg);
+
+		if(reg==REG_R14){
+			//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+			pobj_sf->push(REG_R14);
+		}
+	}
+
+	return 1;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/NumOpe_Relation.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/NumOpe_Relation.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/NumOpe_Relation.cpp	(revision 178)
@@ -0,0 +1,164 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+BOOL CalcTwoTerm_Relational(int idCalc,int *type,LONG_PTR *index_stack,int *pStackPointer){
+	int reg1,reg2;
+	int AnswerType;
+
+	int sp;
+	sp=*pStackPointer;
+
+	AnswerType=NeutralizationType(type[sp-2],index_stack[sp-2],type[sp-1],index_stack[sp-1]);
+
+	if(IsRealNumberType(AnswerType)){
+		////////////////
+		// 実数演算
+		////////////////
+		int xmm_reg1,xmm_reg2;
+
+		//2つの項を適切なレジスタにセット
+		SetTowTermToReg_RealCalc(AnswerType,type,sp,&xmm_reg1,&xmm_reg2);
+
+		if(AnswerType==DEF_DOUBLE){
+			//comisd xmm_reg1,xmm_reg2
+			op_comisd(xmm_reg1,xmm_reg2);
+		}
+		else if(AnswerType==DEF_SINGLE){
+			//comiss xmm_reg1,xmm_reg2
+			op_comiss(xmm_reg1,xmm_reg2);
+		}
+
+		//Xmmレジスタを解放
+		pobj_reg->UnlockXmmReg();
+
+		//汎用レジスタを確保
+		reg1=pobj_reg->LockReg();
+	}
+	else if(Is64Type(AnswerType)){
+		//////////////////////
+		// 64ビット整数演算
+		//////////////////////
+
+		//2つの項を適切なレジスタにセット
+		SetTowTermToReg_Whole64Calc(type,sp,&reg1,&reg2);
+
+		//cmp reg1,reg2
+		op_cmp_reg(sizeof(_int64),reg1,reg2);
+	}
+	else{
+		//////////////////////
+		// 32ビット整数演算
+		//////////////////////
+
+		//2つの項を適切なレジスタにセット
+		SetTowTermToReg_Whole32Calc(type,sp,&reg1,&reg2);
+
+		//cmp reg1,reg2
+		op_cmp_reg(sizeof(long),reg1,reg2);
+	}
+
+
+	////////////////////
+	// 条件分岐
+	////////////////////
+
+	if(idCalc==CALC_PE){
+		//	reg1 <= reg2
+		if(IsSignedType(AnswerType)&&IsWholeNumberType(AnswerType)){
+			//符号あり演算
+			//jle
+			OpBuffer[obp++]=(char)0x7E;
+		}
+		else{
+			//符号なし演算
+			//jbe
+			OpBuffer[obp++]=(char)0x76;
+		}
+	}
+	else if(idCalc==CALC_QE){
+		//  reg1 >= reg2
+		if(IsSignedType(AnswerType)&&IsWholeNumberType(AnswerType)){
+			//符号あり演算
+			//jge
+			OpBuffer[obp++]=(char)0x7D;
+		}
+		else{
+			//符号なし演算
+			//jae
+			OpBuffer[obp++]=(char)0x73;
+		}
+	}
+	else if(idCalc==CALC_P){
+		//	reg1 < reg2
+		if(IsSignedType(AnswerType)&&IsWholeNumberType(AnswerType)){
+			//符号あり演算
+			//jl
+			OpBuffer[obp++]=(char)0x7C;
+		}
+		else{
+			//符号なし演算
+			//jb
+			OpBuffer[obp++]=(char)0x72;
+		}
+	}
+	else if(idCalc==CALC_Q){
+		//  reg1 > reg2
+		if(IsSignedType(AnswerType)&&IsWholeNumberType(AnswerType)){
+			//符号あり演算
+			//jg
+			OpBuffer[obp++]=(char)0x7F;
+		}
+		else{
+			//符号なし演算
+			//ja
+			OpBuffer[obp++]=(char)0x77;
+		}
+	}
+	else if(idCalc==CALC_NOTEQUAL){
+		//  reg1 <> reg2
+
+		//jne
+		OpBuffer[obp++]=(char)0x75;
+	}
+	else if(idCalc==CALC_EQUAL){
+		//  reg1 = reg2
+
+		//je
+		OpBuffer[obp++]=(char)0x74;
+	}
+	OpBuffer[obp++]=(char)0x05;
+
+
+	//////////////////////
+	// FALSEをセット
+	//////////////////////
+
+	//xor reg1,reg1
+	op_zero_reg(reg1);
+
+	//jmp 7（次のmovを飛び越す）
+	OpBuffer[obp++]=(char)0xEB;
+	OpBuffer[obp++]=(char)0x07;
+
+
+	///////////////////
+	// Trueをセット
+	///////////////////
+
+	//mov reg1,1
+	op_mov_RV(sizeof(_int64),reg1,1);
+
+
+	if(reg1==REG_R14){
+		//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+		pobj_sf->push(REG_R14);
+	}
+
+	sp--;
+
+	*pStackPointer=sp;
+
+	type[sp-1]=DEF_BOOLEAN;
+
+	return 1;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/NumOpe_TypeOperation.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/NumOpe_TypeOperation.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/NumOpe_TypeOperation.cpp	(revision 178)
@@ -0,0 +1,561 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void ExtendTypeTo64(int type,int reg){
+	if(type==DEF_LONG){
+		//movsxd reg64,reg32
+		op_movsxd(reg,reg);
+	}
+	else if(type==DEF_DWORD){
+		//and reg,00000000FFFFFFFFh
+	}
+	else if(type==DEF_INTEGER || (isUnicode&&type==DEF_CHAR)){
+		//movsx reg64,reg16
+		op_movsx64_FromReg16(reg,reg);
+	}
+	else if(type==DEF_WORD){
+		//and reg,000000000000FFFFh
+		op_and64_value(reg,(int)0xFFFF);
+	}
+	else if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){
+		//movsx reg64,reg8
+		op_movsx64_FromReg8(reg,reg);
+	}
+	else if(type==DEF_BYTE || type==DEF_BOOLEAN){
+		//and reg,00000000000000FFh
+		op_and64_value(reg,(int)0x00FF);
+	}
+}
+void ExtendTypeTo32(int type,int reg){
+	if(type==DEF_INTEGER || (isUnicode&&type==DEF_CHAR)){
+		//movsx reg32,reg16
+		op_movsx32_FromReg16(reg,reg);
+	}
+	else if(type==DEF_WORD){
+		//and reg,0000FFFFh
+		op_and32_value(reg,(int)0xFFFF);
+	}
+	else if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){
+		//movsx reg32,reg8
+		op_movsx32_FromReg8(reg,reg);
+	}
+	else if(type==DEF_BYTE || type==DEF_BOOLEAN){
+		//and reg,000000FFh
+		op_and32_value(reg,(int)0xFF);
+	}
+}
+void ExtendTypeTo16(int type,int reg){
+	if(type==DEF_SBYTE || (isUnicode==false&&type==DEF_CHAR)){
+		//movsx reg16,reg8
+		op_movsx16_FromReg8(reg,reg);
+	}
+	else if(type==DEF_BYTE){
+		//and reg,000000FFh
+		op_and32_value(reg,(int)0xFF);
+	}
+}
+
+void ChangeTypeToXmm_Double(int type,int xmm_reg,int general_reg){
+	if(type==DEF_DOUBLE){
+		//なにもしない
+	}
+	else if(type==DEF_SINGLE){
+		//Single型
+
+		//cvtss2sd
+		op_cvtss2sd(xmm_reg,xmm_reg);
+	}
+	else if(Is64Type(type)){
+		//64ビット整数型
+
+		//cvtsi2sd xmm_reg,reg
+		op_cvtsi2sd_reg(sizeof(_int64),xmm_reg,general_reg);
+
+		if(type==DEF_QWORD){
+			//符号なし
+
+			//test reg,reg
+			op_test(general_reg,general_reg);
+
+			//jge 9
+			OpBuffer[obp++]=(char)0x7D;
+			OpBuffer[obp++]=(char)0x09;
+
+			//addsd xmm_reg,qword ptr[offset]	※offset value:43f0000000000000
+			int temp;
+			_int64 i64data=0x43f0000000000000;
+			temp=dataTable.Add( i64data );
+			OpBuffer[obp++]=(char)0xF2;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x58;
+			OpBuffer[obp++]=(char)(0x04 | REGISTER_OPERAND(xmm_reg)<<3);
+			OpBuffer[obp++]=(char)0x25;
+			*((long *)(OpBuffer+obp))=temp;
+			pobj_DataTableSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if(type==DEF_DWORD){
+		//符号なし32ビット値
+
+		//64ビットにレジスタ値を拡張
+		ExtendTypeTo64(type,general_reg);
+
+		//cvtsi2sd xmm_reg,reg
+		op_cvtsi2sd_reg(sizeof(_int64),xmm_reg,general_reg);
+	}
+	else{
+		//その他整数
+
+		//32ビットにレジスタ値を拡張
+		ExtendTypeTo32(type,general_reg);
+
+		//cvtsi2sd xmm_reg,reg
+		op_cvtsi2sd_reg(sizeof(long),xmm_reg,general_reg);
+	}
+}
+void ChangeTypeToXmm_Single(int type,int xmm_reg,int general_reg){
+	if(type==DEF_DOUBLE){
+		//Double型
+
+		//cvtsd2ss
+		op_cvtsd2ss(xmm_reg,xmm_reg);
+	}
+	else if(type==DEF_SINGLE){
+		//なにもしない
+	}
+	else if(Is64Type(type)){
+		//64ビット整数型
+
+		//cvtsi2ss xmm_reg,reg
+		op_cvtsi2ss_reg(sizeof(_int64),xmm_reg,general_reg);
+
+		if(type==DEF_QWORD){
+			//符号なし
+
+			//test reg,reg
+			op_test(general_reg,general_reg);
+
+			//jge 9
+			OpBuffer[obp++]=(char)0x7D;
+			OpBuffer[obp++]=(char)0x09;
+
+			//addss xmm_reg,dword ptr[offset]	※offset value:5f800000
+			int temp;
+			long i32data=0x5f800000;
+			temp=dataTable.Add( i32data );
+			OpBuffer[obp++]=(char)0xF3;
+			OpBuffer[obp++]=(char)0x0F;
+			OpBuffer[obp++]=(char)0x58;
+			OpBuffer[obp++]=(char)(0x04 | REGISTER_OPERAND(xmm_reg)<<3);
+			OpBuffer[obp++]=(char)0x25;
+			*((long *)(OpBuffer+obp))=temp;
+			pobj_DataTableSchedule->add();
+			obp+=sizeof(long);
+		}
+	}
+	else if(type==DEF_DWORD){
+		//符号なし32ビット値
+
+		//64ビットにレジスタ値を拡張
+		ExtendTypeTo64(type,general_reg);
+
+		//cvtsi2ss xmm_reg,reg
+		op_cvtsi2ss_reg(sizeof(_int64),xmm_reg,general_reg);
+	}
+	else{
+		//その他整数
+
+		//32ビットにレジスタ値を拡張
+		ExtendTypeTo32(type,general_reg);
+
+		//cvtsi2ss xmm_reg,reg
+		op_cvtsi2ss_reg(sizeof(long),xmm_reg,general_reg);
+	}
+}
+
+void ChangeTypeToWhole(int OldType,int NewType,int reg,int xmm_reg){
+	if(OldType==DEF_DOUBLE){
+		if(Is64Type(NewType)){
+			//cvttsd2si reg,xmm_reg
+			op_cvttsd2si_xmm(sizeof(_int64),reg,xmm_reg);
+		}
+		else{
+			//cvttsd2si reg,xmm_reg
+			op_cvttsd2si_xmm(sizeof(long),reg,xmm_reg);
+		}
+	}
+	else if(OldType==DEF_SINGLE){
+		if(Is64Type(NewType)){
+			//cvttss2si reg,xmm_reg
+			op_cvttss2si_xmm(sizeof(_int64),reg,xmm_reg);
+		}
+		else{
+			//cvttss2si reg,xmm_reg
+			op_cvttss2si_xmm(sizeof(long),reg,xmm_reg);
+		}
+	}
+	else{
+		//整数から整数へ変換
+
+		if(Is64Type(NewType)){
+			ExtendTypeTo64(OldType,reg);
+		}
+		else if(GetTypeSize(NewType,-1)==sizeof(long)){
+			ExtendTypeTo32(OldType,reg);
+		}
+		else if(GetTypeSize(NewType,-1)==sizeof(short)){
+			ExtendTypeTo16(OldType,reg);
+		}
+	}
+}
+
+
+
+/////////////////////////////////////////
+// 1つの項を適切なレジスタへセット
+/////////////////////////////////////////
+
+void SetOneTermToReg_RealCalc(int TermType,int *pXmmReg){
+	int xmm_reg;
+
+	if(IsRealNumberType(TermType)){
+		//実数型
+		xmm_reg=pobj_reg->GetLockingXmmReg();
+
+		if(xmm_reg==REG_XMM4){
+			if(TermType==DEF_DOUBLE){
+				//movlpd xmm4,qword ptr[rsp+offset]		※スタックフレームを利用
+				pobj_sf->pop(xmm_reg,sizeof(double));
+			}
+			if(TermType==DEF_SINGLE){
+				//movss xmm4,dword ptr[rsp+offset]		※スタックフレームを利用
+				pobj_sf->pop(xmm_reg,sizeof(float));
+			}
+		}
+	}
+	else{
+		SetError(300,NULL,cp);
+	}
+
+	*pXmmReg=xmm_reg;
+}
+void SetOneTermToReg_Whole64Calc(int TermType,int *pReg){
+	//1つの項を適切なレジスタへセット（64ビット整数演算用）
+	int reg;
+
+	reg=pobj_reg->GetLockingReg();
+
+	if(reg==REG_R14){
+		//mov r14,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_R14);
+	}
+
+	//レジスタ値を64ビットに拡張
+	ExtendTypeTo64(TermType,reg);
+
+	*pReg=reg;
+}
+void SetOneTermToReg_Whole32Calc(int TermType,int *pReg){
+	//1つの項を適切なレジスタへセット（32ビット整数演算用）
+	int reg;
+
+	reg=pobj_reg->GetLockingReg();
+
+	if(reg==REG_R14){
+		//mov r14,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_R14);
+	}
+
+	//レジスタ値を32ビットに拡張
+	ExtendTypeTo32(TermType,reg);
+
+	*pReg=reg;
+}
+
+
+
+/////////////////////////////////////////
+// 2つの項を適切なレジスタへセット
+/////////////////////////////////////////
+
+void SetTowTermToReg_RealCalc(int AnswerType,int *type,int sp,int *pXmmReg1,int *pXmmReg2){
+	//2つの項を適切なレジスタへセット（Double演算用）
+	int xmm_reg1,xmm_reg2,temp_reg;
+
+
+	///////////////////
+	// 第2項
+	///////////////////
+
+	if(IsRealNumberType(type[sp-1])){
+		//実数型
+		xmm_reg2=pobj_reg->UnlockXmmReg();
+
+		if(xmm_reg2==REG_XMM4){
+			xmm_reg2=REG_XMM5;
+
+			if(type[sp-1]==DEF_DOUBLE){
+				//movlpd xmm5,qword ptr[rsp+offset]		※スタックフレームを利用
+				pobj_sf->pop(xmm_reg2,sizeof(double));
+			}
+			if(type[sp-1]==DEF_SINGLE){
+				//movss xmm5,dword ptr[rsp+offset]		※スタックフレームを利用
+				pobj_sf->pop(xmm_reg2,sizeof(float));
+			}
+		}
+		else{
+			if(!IsRealNumberType(type[sp-2])){
+				if(type[sp-1]==DEF_DOUBLE){
+					//movsd xmm5,xmm_reg
+					OpBuffer[obp++]=(char)0xF2;
+					OpBuffer[obp++]=(char)0x0F;
+					OpBuffer[obp++]=(char)0x10;
+					OpBuffer[obp++]=(char)(0xE8 | REGISTER_OPERAND(xmm_reg2));
+				}
+				if(type[sp-1]==DEF_SINGLE){
+					//movss xmm5,xmm_reg
+					OpBuffer[obp++]=(char)0xF3;
+					OpBuffer[obp++]=(char)0x0F;
+					OpBuffer[obp++]=(char)0x10;
+					OpBuffer[obp++]=(char)(0xE8 | REGISTER_OPERAND(xmm_reg2));
+				}
+
+				xmm_reg2=REG_XMM5;
+			}
+		}
+	}
+	else{
+		//整数値
+
+		temp_reg=pobj_reg->UnlockReg();
+
+		if(temp_reg==REG_R14){
+			//mov r14,qword ptr[rsp+offset]     ※スタックフレームを利用
+			pobj_sf->pop(REG_R14);
+		}
+
+		xmm_reg2=REG_XMM5;
+	}
+
+	//汎用レジスタ（temp_reg）をXMMレジスタ（xmm_reg2）にコピー
+	if(AnswerType==DEF_DOUBLE)
+		ChangeTypeToXmm_Double(type[sp-1],xmm_reg2,temp_reg);
+	if(AnswerType==DEF_SINGLE)
+		ChangeTypeToXmm_Single(type[sp-1],xmm_reg2,temp_reg);
+
+
+	///////////////////
+	// 第1項
+	///////////////////
+
+	if(IsRealNumberType(type[sp-2])){
+		//実数
+		xmm_reg1=pobj_reg->GetLockingXmmReg();
+
+		if(xmm_reg1==REG_XMM4){
+			if(type[sp-2]==DEF_DOUBLE){
+				//movlpd xmm4,qword ptr[rsp+offset]		※スタックフレームを利用
+				pobj_sf->pop(xmm_reg1,sizeof(double));
+			}
+			if(type[sp-2]==DEF_SINGLE){
+				//movss xmm4,dword ptr[rsp+offset]		※スタックフレームを利用
+				pobj_sf->pop(xmm_reg1,sizeof(float));
+			}
+		}
+	}
+	else{
+		//整数
+
+		temp_reg=pobj_reg->UnlockReg();
+
+		if(temp_reg==REG_R14){
+			//mov r14,qword ptr[rsp+offset]     ※スタックフレームを利用
+			pobj_sf->pop(REG_R14);
+		}
+
+		xmm_reg1=pobj_reg->LockXmmReg();
+	}
+
+	//汎用レジスタ（temp_reg）をXMMレジスタ（xmm_reg1）にコピー
+	if(AnswerType==DEF_DOUBLE)
+		ChangeTypeToXmm_Double(type[sp-2],xmm_reg1,temp_reg);
+	if(AnswerType==DEF_SINGLE)
+		ChangeTypeToXmm_Single(type[sp-2],xmm_reg1,temp_reg);
+
+
+	*pXmmReg1=xmm_reg1;
+	*pXmmReg2=xmm_reg2;
+}
+void SetTowTermToReg_Whole64Calc(int *type,int sp,int *pReg1,int *pReg2){
+	//2つの項を適切なレジスタへセット（64ビット整数演算用）
+	int reg1,reg2;
+
+	//////////////////
+	// 第2項
+	//////////////////
+	reg2=pobj_reg->UnlockReg();
+
+	if(reg2==REG_R14){
+		//mov r15,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_R15);
+
+		reg2=REG_R15;
+	}
+
+	//レジスタ値を64ビットに拡張
+	ExtendTypeTo64(type[sp-1],reg2);
+
+
+	//////////////////
+	// 第1項
+	//////////////////
+	reg1=pobj_reg->GetLockingReg();
+
+	if(reg1==REG_R14){
+		//mov r14,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_R14);
+	}
+
+	//レジスタ値を64ビットに拡張
+	ExtendTypeTo64(type[sp-2],reg1);
+
+
+	*pReg1=reg1;
+	*pReg2=reg2;
+}
+void SetTowTermToReg_Whole32Calc(int *type,int sp,int *pReg1,int *pReg2){
+	//2つの項を適切なレジスタへセット（32ビット整数演算用）
+	int reg1,reg2;
+
+	//////////////////
+	// 第2項
+	//////////////////
+	reg2=pobj_reg->UnlockReg();
+
+	if(reg2==REG_R14){
+		//mov r15,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_R15);
+
+		reg2=REG_R15;
+	}
+
+	//レジスタ値を32ビットに拡張
+	ExtendTypeTo32(type[sp-1],reg2);
+
+
+	//////////////////
+	// 第1項
+	//////////////////
+	reg1=pobj_reg->GetLockingReg();
+
+	if(reg1==REG_R14){
+		//mov r14,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_R14);
+	}
+
+	//レジスタ値を32ビットに拡張
+	ExtendTypeTo32(type[sp-2],reg1);
+
+
+	*pReg1=reg1;
+	*pReg2=reg2;
+}
+
+
+
+////////////////////////////
+// As 演算子によるキャスト
+////////////////////////////
+
+BOOL Calc_Cast(int *type,LONG_PTR *index_stack,int *pStackPointer){
+	//キャスト
+
+	int sp;
+	sp=*pStackPointer;
+
+	int CastType;
+	CastType=type[sp-1];
+	if((CastType&FLAG_CAST)==0){
+		SetError(47,NULL,cp);
+		return 0;
+	}
+	CastType=CastType&(~FLAG_CAST);
+
+	int xmm_reg,reg;
+
+	if(IsRealNumberType(CastType)){
+		//実数型へキャスト
+
+		if(IsRealNumberType(type[sp-2])){
+			SetOneTermToReg_RealCalc(type[sp-2],&xmm_reg);
+		}
+		else{
+			if(Is64Type(type[sp-2]))
+				SetOneTermToReg_Whole64Calc(type[sp-2],&reg);
+			else if(IsWholeNumberType(type[sp-2]))
+				SetOneTermToReg_Whole32Calc(type[sp-2],&reg);
+
+			pobj_reg->UnlockReg();
+
+			xmm_reg=pobj_reg->LockXmmReg();
+		}
+
+		if(CastType==DEF_DOUBLE){
+			//Double型にデータ変換
+			ChangeTypeToXmm_Double(type[sp-2],xmm_reg,reg);
+		}
+		else if(CastType==DEF_SINGLE){
+			//Single型にデータ変換
+			ChangeTypeToXmm_Single(type[sp-2],xmm_reg,reg);
+		}
+
+		if(xmm_reg==REG_XMM4){
+			//movsd qword ptr[rsp+offset],xmm4		※スタックフレームを利用
+			pobj_sf->push(REG_XMM4,sizeof(double));
+		}
+	}
+	else{
+		//その他整数型へ変換
+
+		if(IsRealNumberType(type[sp-2])){
+			SetOneTermToReg_RealCalc(type[sp-2],&xmm_reg);
+
+			pobj_reg->UnlockXmmReg();
+
+			reg=pobj_reg->LockReg();
+
+			//整数型へデータ変換
+			ChangeTypeToWhole(type[sp-2],CastType,reg,xmm_reg);
+
+			if(reg==REG_R14){
+				//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+				pobj_sf->push(REG_R14);
+			}
+		}
+		else{
+			reg=pobj_reg->GetLockingReg();
+
+			if(reg==REG_R14){
+				//mov r14,qword ptr[rsp+offset]     ※スタックフレームを利用
+				pobj_sf->pop(REG_R14);
+			}
+
+			//整数型へデータ変換
+			ChangeTypeToWhole(type[sp-2],CastType,reg,0);
+
+			if(reg==REG_R14){
+				//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+				pobj_sf->push(REG_R14);
+			}
+		}
+	}
+
+	type[sp-2]=CastType;
+	index_stack[sp-2]=index_stack[sp-1];
+
+	sp--;
+
+	*pStackPointer=sp;
+	return 1;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/Opcode.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Opcode.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Opcode.h	(revision 178)
@@ -0,0 +1,516 @@
+//Opcode.h
+
+
+//レジスタを示す定数
+#define REG_EAX 1
+#define REG_EBX 2
+#define REG_ECX 3
+#define REG_EDX 4
+#define REG_ESP 5
+#define REG_EBP 6
+
+#define REGISTER_OPERAND(reg) (reg&0x07)
+
+#define REG_NON		-1
+#define REG_RAX		0x00	//reg:000
+#define REG_RCX		0x01	//reg:001
+#define REG_RDX		0x02	//reg:010
+#define REG_RBX		0x03	//reg:011
+#define REG_RSP		0x04	//reg:100
+#define REG_RBP		0x05	//reg:101
+#define REG_RSI		0x06	//reg:110
+#define REG_RDI		0x07	//reg:111
+#define REG_R8		0x08	//reg:000（REXプリフィックス）
+#define REG_R9		0x09	//reg:001（REXプリフィックス）
+#define REG_R10		0x0A	//reg:010（REXプリフィックス）
+#define REG_R11		0x0B	//reg:011（REXプリフィックス）
+#define REG_R12		0x0C	//reg:100（REXプリフィックス）
+#define REG_R13		0x0D	//reg:101（REXプリフィックス）
+#define REG_R14		0x0E	//reg:110（REXプリフィックス）
+#define REG_R15		0x0F	//reg:111（REXプリフィックス）
+
+#define REG_XMM0	0x10	//reg:000
+#define REG_XMM1	0x11	//reg:001
+#define REG_XMM2	0x12	//reg:010
+#define REG_XMM3	0x13	//reg:011
+#define REG_XMM4	0x14	//reg:100
+#define REG_XMM5	0x15	//reg:101
+#define REG_XMM6	0x16	//reg:110
+#define REG_XMM7	0x17	//reg:111
+#define REG_XMM8	0x18	//reg:000
+#define REG_XMM9	0x19	//reg:001
+#define REG_XMM10	0x1A	//reg:010
+#define REG_XMM11	0x1B	//reg:011
+#define REG_XMM12	0x1C	//reg:100
+#define REG_XMM13	0x1D	//reg:101
+#define REG_XMM14	0x1E	//reg:110
+#define REG_XMM15	0x1F	//reg:111
+
+#define IS_XMM_REG(reg) (reg&0x10)
+
+
+
+//変数の種類
+#define NON_VAR				0
+#define VAR_GLOBAL			1	// Global Variable
+#define VAR_REFGLOBAL		2	// Global Refference Variable
+#define VAR_LOCAL			3	// Local Variable
+#define VAR_REFLOCAL		4	// Local Refference Variable
+#define VAR_DIRECTMEM		5	// Direct memory
+
+
+extern int cp;
+extern int obp;
+extern char *OpBuffer;
+
+#define breakpoint OpBuffer[obp++]=(char)0xCC;
+
+
+//ラベルアドレス
+struct LABEL{
+	char *pName;
+	int line;
+	DWORD address;
+};
+
+//Goto未知ラベル
+struct GOTOLABELSCHEDULE{
+	char *pName;
+	int line;
+	DWORD pos;
+	DWORD now_cp;
+};
+
+
+//プロシージャの種類
+#define PROC_DEFAULT	1	//ユーザー定義関数
+#define PROC_DLL		2	//DLL関数
+#define PROC_BUILTIN	3	//コンパイラ埋め込み型
+#define PROC_PTR		4	//関数ポインタ
+
+//プロシージャ
+struct PROCEDURE{
+	char name[255];
+	int address;
+	int types[MAX_PARMS];
+	_int8 ByVal[MAX_PARMS];
+	BOOL ReturnType;
+};
+
+//With情報
+struct WITHINFO{
+	char **ppName;
+	int *pWithCp;
+	int num;
+};
+
+
+class CStackFrame:public CSchedule{
+	///////////////////////////
+	// スタックフレーム管理
+	///////////////////////////
+
+	int lowest_sp;			//スタックポインタの最下位位置
+	int now_sp;				//スタックポインタ
+	int max_parm_size;		//パラメータの最大サイズ
+	int local_parm_size;	//ローカル領域のパラメータサイズ
+
+public:
+	//コンストラクタ
+	CStackFrame();
+
+	//デストラクタ
+	~CStackFrame();
+
+	void SetLocalParmSize(int size);
+	int GetFrameSize();
+	int GetNowSp();
+	void mov_sp( int reg );
+	int push(int reg);
+	void push(int xmm_reg,int varSize);
+	void ref_offset_data( int reg, int sp_offset );
+	void ref(int reg);
+	void ref(int xmm_reg,int varSize);
+	void pop(int reg = REG_NON);
+	void pop(int xmm_reg,int varSize);
+	void parameter_allocate(int size);
+	void RunningSchedule(void);
+
+	void error_check(void);
+};
+extern CStackFrame *pobj_sf;
+
+
+class CBlockReg{
+	int array_BlockReg[256];
+	int num;
+
+public:
+	CBlockReg();
+	void lock(int reg);
+	void unlock(int reg);
+	BOOL check(int reg);
+	void clear(void);
+
+	//レジスタのバックアップと復旧
+	void backup();
+	void restore();
+};
+extern CBlockReg *pobj_BlockReg;
+class CRegister{
+	////////////////////
+	// レジスタ管理
+	////////////////////
+
+	//利用可能なレジスタを列挙する関数
+	void EnumRegister(int *pRegList,int nMaxList,int *array_reg,int *sp,int AnswerReg);
+
+	int array_UseReg[16],sp_UseReg;
+
+	int array_XmmReg[16];
+	int sp_XmmReg;
+
+	int init_sp_reg,init_sp_xmm_reg;
+
+public:
+	CRegister(){};
+	CRegister(int AnswerReg);
+	~CRegister(){};
+
+	//コンパイラにバグがないかをチェックする機構
+	void bug_check();
+
+	//汎用レジスタ
+	int GetNextReg();
+	int GetLockingReg();
+	int LockReg();
+	int UnlockReg();
+
+	//XMMレジスタ
+	int GetNextXmmReg();
+	int GetLockingXmmReg();
+	int LockXmmReg();
+	int UnlockXmmReg();
+
+	//レジスタが利用中かどうかを調べる
+	bool IsUsing( int reg );
+
+	//レジスタのバックアップと復旧
+	void backup();
+	void restore();
+};
+extern CRegister *pobj_reg;
+
+
+#define BACKUP_REGISTER_RESOURCE								\
+	/* レジスタをスタックフレームにバックアップ */				\
+	pobj_BlockReg->backup();									\
+	if(pobj_reg) pobj_reg->backup();							\
+																\
+	/* レジスタブロッキングオブジェクトを退避して再生成 */		\
+	CBlockReg *pobj_BlockReg_back;								\
+	pobj_BlockReg_back=pobj_BlockReg;							\
+	pobj_BlockReg=new CBlockReg;								\
+																\
+	/* レジスタ管理オブジェクトポインタを退避して0をセット */	\
+	CRegister *pobj_reg_back;									\
+	pobj_reg_back=pobj_reg;										\
+	pobj_reg=0;
+
+#define RESTORE_REGISTER_RESOURCE								\
+	/* レジスタブロッキングオブジェクトポインタを復元 */		\
+	delete pobj_BlockReg;										\
+	pobj_BlockReg=pobj_BlockReg_back;							\
+																\
+	/* レジスタ管理オブジェクトポインタを復元 */				\
+	delete pobj_reg;											\
+	pobj_reg=pobj_reg_back;										\
+																\
+	/* レジスタをスタックフレームから復元 */					\
+	if(pobj_reg) pobj_reg->restore();							\
+	pobj_BlockReg->restore();
+
+
+
+//RSrcSection.cpp
+char *GetRSrcSectionBuffer(int *pLen);
+
+//Compile.cpp
+void ChangeOpcode(char *Command);
+void GetGlobalDataForDll(void);
+DWORD CompileBuffer(char Return_Sequence,WORD Return_Command);
+
+//Register.cpp
+BOOL IsGeneralReg(int reg);
+BOOL IsXmmReg(int reg);
+BOOL IsVolatileReg(int reg);
+void IfR14Push( int reg );
+
+//Compile_Calc.cpp
+void SetVariableFromRax(int VarType,int CalcType,RELATIVE_VAR *pRelativeVar);
+void OpcodeCalc(const char *Command);
+
+//NumOpe.cpp
+bool TermOpe(
+			 const char *term,
+			 const Type &baseType,
+			 Type &resultType,
+			 bool &isLiteral,
+			 BOOL *pbUseHeap,
+			 bool isWantObject = false,
+			 bool *pIsClassName = NULL,
+			 bool isProcedureCallOnly = false );
+bool NumOpe( int *pReg,
+		   const char *Command,
+		   const Type &baseType,
+		   Type &resultType,
+		   BOOL *pbUseHeap = NULL );
+
+//NumOpe_Arithmetic.cpp
+BOOL CalcTwoTerm_Arithmetic(int idCalc,int *type,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_Mod(int *type,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_Divide(int *type,int *pStackPointer,int BaseType);
+BOOL Calc_IntDivide(int *type,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_MinusMark(int *type,int sp);
+BOOL Calc_Power(int *type,int *pStackPointer);
+BOOL Calc_Shift(int idCalc,int *type,int *pStackPointer);
+
+//NumOpe_Logical.cpp
+BOOL CalcTwoTerm_Logical(int idCalc,int *type,LONG_PTR *index_stack,int *pStackPointer);
+BOOL Calc_Not(int *type,int sp);
+
+//NumOpe_Relation.cpp
+BOOL CalcTwoTerm_Relational(int idCalc,int *type,LONG_PTR *index_stack,int *pStackPointer);
+
+//NumOpe_TypeOperation.cpp
+void ExtendTypeTo64(int type,int reg);
+void ExtendTypeTo32(int type,int reg);
+void ExtendTypeTo16(int type,int reg);
+void ChangeTypeToXmm_Double(int type,int xmm_reg,int general_reg);
+void ChangeTypeToXmm_Single(int type,int xmm_reg,int general_reg);
+void ChangeTypeToWhole(int OldType,int NewType,int reg,int xmm_reg);
+void SetOneTermToReg_RealCalc(int TermType,int *pXmmReg);
+void SetOneTermToReg_Whole64Calc(int TermType,int *pReg);
+void SetOneTermToReg_Whole32Calc(int TermType,int *pReg);
+void SetTowTermToReg_RealCalc(int AnswerType,int *type,int sp,int *pXmmReg1,int *pXmmReg2);
+void SetTowTermToReg_Whole64Calc(int *type,int sp,int *pReg1,int *pReg2);
+void SetTowTermToReg_Whole32Calc(int *type,int sp,int *pReg1,int *pReg2);
+BOOL Calc_Cast(int *type,LONG_PTR *index_stack,int *pStackPointer);
+
+//Compile_Set_Var.cpp
+BOOL IsUse_r11(RELATIVE_VAR *pRelativeVar);
+void SetStructVariableFromRax( const Type &varType, const Type &calcType, RELATIVE_VAR *pRelativeVar,BOOL bUseHeap);
+void SetRealVariable(int VarType, int CalcType, RELATIVE_VAR *pRelativeVar);
+void SetBooleanVariable(int type,RELATIVE_VAR *pRelative);
+void SetWholeVariable(int varSize,int type,RELATIVE_VAR *pRelative);
+
+//increment.cpp
+void IncDec(int idCalc, const char *lpszLeft, const char *lpszRight);
+
+//Compile_Calc_PushVar.cpp
+void SetXmmReg_DoubleVariable(RELATIVE_VAR *pRelativeVar,int xmm_reg);
+void SetXmmReg_SingleVariable(RELATIVE_VAR *pRelativeVar,int xmm_reg);
+void SetReg_WholeVariable(int type,RELATIVE_VAR *pRelativeVar,int reg);
+
+//Compile_Interface.cpp
+bool CastToInterface( int reg, int vtblReg, const CClass &baseClass, const CClass &interfaceClass );
+
+//Compile_Object.cpp
+void Operator_New( const CClass &classObj, const char *objectSizeStr, const char *parameter,const Type &baseTypeInfo );
+void OpcodeDelete(const char *Parameter, bool isSweeping);
+
+//Compile_Var.cpp
+bool _member_offset(bool isErrorEnabled, bool isWriteAccess, const CClass &objClass, const char *member, RELATIVE_VAR *pRelativeVar, Type &resultType, BOOL bPrivateAccess);
+void SetThisPtrToReg(int reg);
+bool GetVarOffset(bool isErrorEnabled,bool isWriteAccess,const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss = NULL);
+bool SetInitGlobalData(int offset,const Type &type,const int *SubScripts,const char *InitBuf);
+#define DIMFLAG_INITDEBUGVAR			0x01
+#define DIMFLAG_NONCALL_CONSTRACTOR		0x02
+#define DIMFLAG_STATIC					0x04
+#define DIMFLAG_CONST					0x08
+void dim( char *VarName,int *SubScripts,Type &type, const char *InitBuf,const char *ConstractParameter,DWORD dwFlags);
+void SetVarPtrToReg(int reg,RELATIVE_VAR *pRelativeVar);
+bool Compile_AddGlobalRootsForGc();
+
+//ParamImpl.cpp
+class ParamImpl{
+	char *Parms[255];
+	vector<Type> types;
+	int ParmsNum;
+
+	Type returnType;
+
+	//一時オブジェクト管理用
+	bool useTempObject;
+	bool useTempParameters[255];
+	int StackOffsetOfTempObject[255];
+
+public:
+	ParamImpl(const char *buffer);
+	ParamImpl(const Parameters &params);
+	~ParamImpl();
+	void SetReturnType( const Type &returnType );
+
+private:
+	bool EvaluateOverloadScore( int level, const Parameters &targetParms, const Type &targetResultType );
+
+public:
+	UserProc *_OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType = false );
+	UserProc *OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType = false );
+
+	void ApplyDefaultParameters( const Parameters &params );
+	bool ErrorCheck( const string &procName, const Parameters &params, int SecondParmNum = -1 );
+	void MacroParameterSupport( const Parameters &params );
+	void SetStructParameter( int reg, const Type &baseType, const char *expression );
+	void SetParameter( const string &procName, const Parameters &params, int SecondParmNum = -1 );
+
+	//一時オブジェクトパラメータの生成と破棄
+	int NewTempParameters( const string &procName, const Parameters &params, int SecondParmNum = -1 );
+	void DeleteTempParameters();
+
+	void BackupParameter(int pi_num);
+	void RestoreParameter(int pi_num);
+};
+
+//CLockParameter.cpp
+#define MAX_LOCKPARMS 255
+class CDBLockParms{
+public:
+	int array_LevelCount[MAX_LOCKPARMS];
+	CDBLockParms();
+	~CDBLockParms();
+
+	void lock(int level);
+	void unlock(int level);
+};
+
+//Compile_CallProc.cpp
+void AddLocalVarAddrSchedule();
+#define PROCFLAG_NEW	1
+bool Opcode_CallProcPtr(const char *variable, const char *lpszParms,ProcPointer *pProcPointer);
+bool Opcode_CallProc(const char *Parameter,UserProc *pUserProc,DWORD dwFlags,const char *ObjectName,int RefType);
+bool Opcode_CallDllProc( const char *lpszParms,DllProc *pDllProc);
+
+//Compile_ProcOp.cpp
+void CompileLocal();
+
+//Compile_Func.cpp
+int GetFunctionFromName(char *FuncName);
+bool Opcode_CallFunc( const char *Parameter, const int FuncNum, Type &ReturnTypeInfo, bool isCallOn = true );
+
+//OperatorProc.cpp
+void FreeTempObject(int reg,const CClass *pobj_c);
+int CallOperatorProc(int idCalc, const Type &baseType, int *type_stack,LONG_PTR *index_stack,BOOL *bUseHeap,int &sp);
+void CallCastOperatorProc(int reg,Type &calcType,BOOL bCalcUseHeap,const Type &toType);
+void CallIndexerGetterProc(int reg,const CClass *pobj_Class,char *ObjectName,char *Parameter,Type &resultType);
+
+//Compile_Statement.cpp
+void OpcodeOthers(const char *Command);
+void OpcodeIf(char *Parameter);
+void OpcodeGoto(char *Parameter);
+void OpcodeWhile(char *Parameter);
+void OpcodeFor(char *Parameter);
+void OpcodeDo(char *Parameter);
+void OpcodeContinue(void);
+void OpcodeExitSub(void);
+void OpcodeSelect( const char *Parameter );
+void OpcodeCase(char *Parameter);
+void OpcodeGosub(char *Parameter);
+void OpcodeReturn(char *Parameter);
+void OpcodeSetPtrData(char *Parameter,int type);
+
+
+//InsertOpcode.cpp
+void InsertDimStatement_ToProcHead(char *lpszCommand);
+
+
+
+////////////////////////////////
+// AMD64機械語生成に利用する関数郡
+////////////////////////////////
+
+//Mod（モード）
+#define MOD_BASE		(char)0x00
+#define MOD_DISP32		(char)0xFF
+#define MOD_BASE_DISP8	(char)0x40
+#define MOD_BASE_DISP32	(char)0x80
+#define MOD_REG				(char)0xC0
+
+#define USE_OFFSET 1
+#define NON_OFFSET 0
+
+//amd64_main.cpp
+BOOL IsSafeReg(int reg);
+void op_push(int reg);
+void op_push_value(long data);
+void op_pop(int reg);
+void op_mov_RV					(int op_size,int reg,int i32data);
+void op_mov_RV64				(int reg,_int64 i64data);
+void op_mov_RM					(int op_size,int reg,int base_reg,int offset,char mod);
+void op_mov_RM_ex				(int op_size,int reg,int base_reg1,int base_reg2,int offset,BOOL bUseOffset);
+void op_mov_MR					(int op_size,int reg,int base_reg,int offset,char mod);
+void op_mov_MR_ex				(int op_size,int reg,int base_reg1,int base_reg2,int offset,BOOL bUseOffset);
+void op_mov_MV					(int op_size,int base_reg,int offset,BOOL bUseOffset,int i32data);
+void op_mov_RR					(int reg1,int reg2);
+void op_mov64_ToReg				(int reg,_int64 i64data);
+void op_mov64_ToReg				(int reg,int i32data);
+void op_movsxd					(int reg64,int reg32);
+void op_movsx64_FromReg16		(int reg64,int reg16);
+void op_movsx64_FromReg8		(int reg64,int reg8);
+void op_movsx32_FromReg16		(int reg32,int reg16);
+void op_movsx32_FromReg8		(int reg32,int reg8);
+void op_movsx16_FromReg8		(int reg32,int reg8);
+void op_inc						(int reg);
+void op_dec						(int reg);
+void op_add_RM					(int op_size,int reg,int base_reg,int offset,char mod);
+void op_add_RV				(int reg,int offset);
+void op_add64_reg				(int reg1,int reg2);
+void op_add32_reg				(int reg1,int reg2);
+void op_sub_RV					(int op_size,int reg,int i32data);
+void op_sub64_reg				(int reg1,int reg2);
+void op_sub32_reg				(int reg1,int reg2);
+void op_sbb_RR					( int op_size, int reg1, int reg2 );
+void op_imul_RR				(int op_size,int reg1,int reg2);
+void op_imul_RV				(int op_size,int reg,int i32data);
+void op_div64_reg				(int reg);
+void op_idiv64_reg				(int reg);
+void op_shl_reg					(int op_size,int reg);
+void op_sar_reg					(int op_size,int reg);
+void op_shr_reg					(int op_size,int reg);
+void op_and_reg					(int op_size,int reg1,int reg2);
+void op_and64_value				(int reg,int offset);
+void op_and32_value				(int reg,int offset);
+void op_or_reg					(int op_size,int reg1,int reg2);
+void op_xor_reg					(int op_size,int reg1,int reg2);
+void op_not_reg					(int op_size,int reg);
+void op_neg						( int reg );
+void op_test					(int reg1,int reg2);
+void op_cmp_reg					(int op_size,int reg1,int reg2);
+void op_cmp_value				(int op_size,int reg,char byte_data);
+void op_setne					(int reg);
+void op_movlpd_MR				(int xmm_reg,int base_reg,int offset,char mod);
+void op_movlpd_RM				(int xmm_reg,int base_reg,int offset,char mod);
+void op_movsd_RR				(int xmm_reg1,int xmm_reg2);
+void op_movsd_MR				(int xmm_reg,int base_reg,int offset,char mod);
+void op_movss_RR				(int xmm_reg1,int xmm_reg2);
+void op_movss_RM				(int xmm_reg,int base_reg,int offset,char mod);
+void op_movss_MR				(int xmm_reg,int base_reg,int offset,char mod);
+void op_movd_RX					(int reg,int xmm_reg);
+void op_cvtsd2ss				(int xmm_reg1,int xmm_reg2);
+void op_cvtss2sd				(int xmm_reg1,int xmm_reg2);
+void op_cvttsd2si_xmm			(int op_size,int reg,int xmm_reg);
+void op_cvttss2si_xmm			(int op_size,int reg,int xmm_reg);
+void op_cvtsi2sd_reg			(int op_size,int xmm_reg,int reg);
+void op_cvtsi2ss_reg			(int op_size,int xmm_reg,int reg);
+void op_comisd					(int xmm_reg1,int xmm_reg2);
+void op_comiss					(int xmm_reg1,int xmm_reg2);
+void op_rep_movs				(int op_size);
+void op_add_rsp(int num);
+void op_sub_rsp(int num);
+void op_add_esp(int num);
+void op_sub_esp(int num);
+void op_fld_ptr_esp(int type);
+void op_zero_reg(int reg);
+void op_call( UserProc *pUserProc );
+void op_call( DllProc *pDllProc );
+void op_ret();
Index: tag/abdev(2007.06.20)/BasicCompiler64/OperatorProc.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/OperatorProc.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/OperatorProc.cpp	(revision 178)
@@ -0,0 +1,343 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void FreeTempObject(int reg,const CClass *pobj_c){
+	if(!IsSafeReg(reg)) SetError(300,NULL,cp);
+
+	////////////////////////////////////////////////
+	// 演算過程で利用した一時オブジェクトを破棄
+	// Thisポインタをr14レジスタを介して渡す
+	////////////////////////////////////////////////
+
+	const CMethod *method = pobj_c->GetDestructorMethod();
+	if( method ){
+		//mov rcx,reg
+		op_mov_RR(REG_RCX,reg);
+
+		//call DestructorProcAddr
+		op_call( method->pUserProc );
+	}
+
+	//mov rcx,reg
+	op_mov_RR(REG_RCX,reg);
+
+	//call free
+	extern UserProc *pSub_free;
+	op_call(pSub_free);
+}
+
+int CallOperatorProc(int idCalc, const Type &baseType, int *type_stack,LONG_PTR *index_stack,BOOL *bUseHeap,int &sp){
+	//オーバーロードされたオペレータ関数を呼び出す
+	CClass *pobj_c;
+	pobj_c=(CClass *)index_stack[sp-2];
+
+	std::vector<UserProc *> subs;
+	pobj_c->GetMethods().Enum( idCalc, subs );
+	if( subs.size() == 0 ){
+		return 0;
+	}
+
+
+	//項の数
+	BOOL bTwoTerm=1;
+	if(idCalc==CALC_AS) bTwoTerm=0;
+
+
+	/////////////////////////////////////////////
+	// オーバーロード解決用のパラメータを設定
+	/////////////////////////////////////////////
+
+	Parameters params;
+
+	if(bTwoTerm){
+		params.push_back( new Parameter( "", Type( type_stack[sp-1], index_stack[sp-1] ) ) );
+	}
+
+	//オーバーロードを解決
+	char temporary[255];
+	if(idCalc==CALC_EQUAL) lstrcpy(temporary,"==");
+	else GetCalcName(idCalc,temporary);
+	UserProc *pUserProc = OverloadSolution( temporary, subs, params, baseType );
+
+	if(!pUserProc){
+		if(bTwoTerm){
+			delete params[0];
+		}
+		return -1;
+	}
+	else{
+		//オーバーロードされていないが、パラメータ個数が一致しないとき
+		if(params.size()!=pUserProc->Params().size()){
+			if(bTwoTerm){
+				delete params[0];
+			}
+			return -1;
+		}
+	}
+
+	for(int i=0;i<(int)params.size();i++){
+		CheckDifferentType(
+			pUserProc->Params()[i]->GetBasicType(),
+			pUserProc->Params()[i]->GetIndex(),
+			params[i]->GetBasicType(),
+			params[i]->GetIndex(),
+			"",
+			i);
+	}
+
+	if(bTwoTerm){
+		delete params[0];
+	}
+
+	int right_side_size = GetTypeSize(type_stack[sp-1],index_stack[sp-1]);
+
+	if(bTwoTerm){
+		if( pUserProc->RealParams()[1]->IsStruct() &&pUserProc->RealParams()[1]->IsRef() == false ){
+			//一時オブジェクトはメソッド内で破棄される
+			bUseHeap[sp-1]=0;
+		}
+	}
+
+
+	if( pUserProc->ReturnType().IsStruct() ){
+		//////////////////////////////////////////////////////
+		// 戻り値に構造体インスタンスを持つ場合
+		// ※ByRef _System_ReturnValue パラメータ用領域を取得
+		//////////////////////////////////////////////////////
+
+
+		//////////////////////////////////////////////////////
+		/////    レジスタ資源のバックアップ
+		{	BACKUP_REGISTER_RESOURCE
+		//////////////////////////////////////////////////////
+
+			int object_size = pUserProc->ReturnType().GetClass().GetSize();
+
+			//mov rcx,object_size
+			op_mov_RV(sizeof(_int64),REG_RCX,object_size);
+
+			//call calloc
+			extern UserProc *pSub_calloc;
+			op_call(pSub_calloc);
+
+			//mov r13,rax
+			op_mov_RR(REG_R13,REG_RAX);
+
+		/////////////////////////////////////////////
+		//////   レジスタ資源を復元
+			RESTORE_REGISTER_RESOURCE
+		}////////////////////////////////////////////
+	}
+
+	int reg1,reg2;
+	if(bTwoTerm){
+		//右の項（実数の場合が未完成）
+		SetOneTermToReg_Whole64Calc(type_stack[sp-1],&reg2);
+		pobj_reg->UnlockReg();
+		if( !pUserProc->RealParams()[1]->IsRef() == false ){
+			//一時参照を作成
+			pobj_sf->push( reg2 );
+			pobj_sf->mov_sp( reg2 );
+		}
+	}
+
+	//左の項
+	SetOneTermToReg_Whole64Calc(DEF_INT64,&reg1);
+	pobj_reg->UnlockReg();
+
+	//ヒープ解放用に退避
+	if(bUseHeap[sp-1]){
+		//mov qword ptr[rsp+offset],reg2     ※スタックフレームを利用
+		pobj_sf->push(reg2);
+	}
+	if(bUseHeap[sp-2]){
+		//mov qword ptr[rsp+offset],reg1     ※スタックフレームを利用
+		pobj_sf->push(reg1);
+	}
+
+
+
+	//////////////////////////////////////////////////////
+	/////    レジスタ資源のバックアップ
+	{	BACKUP_REGISTER_RESOURCE
+	//////////////////////////////////////////////////////
+
+		if(reg1==REG_RDX||reg1==REG_R8){
+			//mov r14,reg1
+			op_mov_RR(REG_R14,reg1);
+			reg1=REG_R14;
+		}
+
+
+		if(bTwoTerm){
+			if( pUserProc->ReturnType().IsStruct() ){
+				//mov r8,reg2
+				op_mov_RR(REG_R8,reg2);
+			}
+			else{
+				//mov rdx,reg2
+				op_mov_RR(REG_RDX,reg2);
+			}
+		}
+
+		if( pUserProc->ReturnType().IsStruct() ){
+			//mov rdx,r13
+			op_mov_RR(REG_RDX,REG_R13);
+		}
+
+		//mov rcx,reg1
+		op_mov_RR(REG_RCX,reg1);
+
+		//call operator_proc
+		op_call(pUserProc);
+
+		if( !pUserProc->ReturnType().IsNull() ){
+			//戻り値を一時的に退避
+
+			//mov r13,rax
+			op_mov_RR(REG_R13,REG_RAX);
+		}
+
+
+	/////////////////////////////////////////////
+	//////   レジスタ資源を復元
+		RESTORE_REGISTER_RESOURCE
+	}////////////////////////////////////////////
+
+
+
+	if(bUseHeap[sp-2]||bUseHeap[sp-1]){
+
+		//////////////////////////////////////////////////////
+		/////    レジスタ資源のバックアップ
+		{	BACKUP_REGISTER_RESOURCE
+		//////////////////////////////////////////////////////
+
+			if(bUseHeap[sp-2]){
+				//mov r14,qword ptr[rsp+offset]     ※スタックフレームを利用
+				pobj_sf->pop(REG_R14);
+
+				FreeTempObject(REG_R14,(CClass *)index_stack[sp-2]);
+			}
+			if(bUseHeap[sp-1]){
+				//mov r14,qword ptr[rsp+offset]     ※スタックフレームを利用
+				pobj_sf->pop(REG_R14);
+
+				FreeTempObject(REG_R14,(CClass *)index_stack[sp-1]);
+			}
+
+		/////////////////////////////////////////////
+		//////   レジスタ資源を復元
+			RESTORE_REGISTER_RESOURCE
+		}////////////////////////////////////////////
+	}
+
+	if(bTwoTerm){
+		if( !pUserProc->RealParams()[1]->IsRef() == false ){
+			//一時参照を破棄
+			pobj_sf->pop();
+		}
+	}
+
+	if( !pUserProc->ReturnType().IsNull() ){
+		//戻り値をreg1にセット
+		reg1=pobj_reg->LockReg();
+
+		//mov reg1,r13
+		op_mov_RR(reg1,REG_R13);
+	}
+
+	sp--;
+	type_stack[sp-1]=pUserProc->ReturnType().GetBasicType();
+	index_stack[sp-1]=pUserProc->ReturnType().GetIndex();
+
+	if( pUserProc->ReturnType().IsStruct() ){
+		//構造体が戻ったときはヒープ領域にインスタンスが格納されている
+		//※後にfreeする必要あり
+		bUseHeap[sp-1]=1;
+	}
+	else bUseHeap[sp-1]=0;
+
+	return 1;
+}
+
+void CallCastOperatorProc(int reg,Type &calcType,BOOL bCalcUseHeap,const Type &toType){
+	int type_stack[10];
+	LONG_PTR index_stack[10];
+	BOOL array_bUseHeap[10];
+	int sp=2;
+	int iRet;
+
+
+	//////////////////////////////////////////////////////
+	/////    レジスタ資源のバックアップ
+	{	BACKUP_REGISTER_RESOURCE
+	//////////////////////////////////////////////////////
+
+		//regを第一項目としてロック
+		pobj_reg=new CRegister(reg);
+		pobj_reg->LockReg();
+
+		if(bCalcUseHeap){
+			//未解放のインスタンスが存在する旨を示す警告
+			SetError(-105,NULL,cp);
+		}
+
+		//左辺
+		type_stack[0]=calcType.GetBasicType();
+		index_stack[0]=calcType.GetIndex();
+		array_bUseHeap[0]=0;
+		type_stack[1]=toType.GetBasicType();
+		index_stack[1]=toType.GetIndex();
+		array_bUseHeap[1]=0;
+
+		iRet=CallOperatorProc(CALC_AS,toType,type_stack,index_stack,array_bUseHeap,sp);
+
+		pobj_reg->UnlockReg();
+
+	/////////////////////////////////////////////
+	//////   レジスタ資源を復元
+		RESTORE_REGISTER_RESOURCE
+	}////////////////////////////////////////////
+
+
+	if(iRet==1){
+		//成功したとき
+		calcType.SetType( type_stack[0], index_stack[0] );
+		return;
+	}
+	else if(iRet==-1){
+		//エラーが発行されたとき
+		return;
+	}
+
+	//エラーを発行
+	SetError(-1,"キャスト演算子がオーバーロードされていません。",cp);
+}
+
+//インデクサ（getter）を呼び出す
+void CallIndexerGetterProc(int reg,const CClass *pobj_Class,char *ObjectName,char *Parameter,Type &resultType ){
+
+	std::vector<UserProc *> subs;
+	pobj_Class->GetMethods().Enum( CALC_ARRAY_GET, subs );
+	if( subs.size() == 0 ){
+		return;
+	}
+
+	//////////////////////////////////////////////////////
+	/////    レジスタ資源のバックアップ
+	{	BACKUP_REGISTER_RESOURCE
+	//////////////////////////////////////////////////////
+
+		Opcode_CallProc(Parameter,subs[0],0,ObjectName,DEF_OBJECT);
+		resultType = subs[0]->ReturnType();
+
+		//mov reg,rax
+		op_mov_RR(reg,REG_RAX);
+
+	/////////////////////////////////////////////
+	//////   レジスタ資源を復元
+		RESTORE_REGISTER_RESOURCE
+	}////////////////////////////////////////////
+
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/Register.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/Register.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/Register.cpp	(revision 178)
@@ -0,0 +1,316 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+
+//エラー用
+extern int cp;
+
+
+////////////////////////////
+// レジスタのブロッキング
+////////////////////////////
+
+CBlockReg *pobj_BlockReg;
+
+CBlockReg::CBlockReg(){
+	num=0;
+}
+void CBlockReg::lock(int reg){
+	if(check(reg)){
+		SetError(300,NULL,cp);
+	}
+	array_BlockReg[num++]=reg;
+}
+void CBlockReg::unlock(int reg){
+	int i;
+	for(i=0;i<num;i++){
+		if(array_BlockReg[i]==reg) break;
+	}
+	if(i==num) return;
+
+	num--;
+	for(;i<num;i++){
+		array_BlockReg[i]=array_BlockReg[i+1];
+	}
+}
+BOOL CBlockReg::check(int reg){
+	int i;
+	for(i=0;i<num;i++){
+		if(array_BlockReg[i]==reg) return 1;
+	}
+	return 0;
+}
+void CBlockReg::clear(void){
+	num=0;
+}
+void CBlockReg::backup(){
+	int i;
+
+	for(i=num-1;i>=0;i--){
+		if(IS_XMM_REG(array_BlockReg[i])){
+			//movlpd qword ptr[rsp+offset],xmm_reg	※スタックフレームを利用
+			pobj_sf->push(array_BlockReg[i],sizeof(double));
+		}
+		else{
+			//mov qword ptr[rsp+offset],reg     ※スタックフレームを利用
+			pobj_sf->push(array_BlockReg[i]);
+		}
+	}
+}
+void CBlockReg::restore(){
+	int i;
+
+	for(i=0;i<num;i++){
+		if(IS_XMM_REG(array_BlockReg[i])){
+			//movlpd xmm_reg,qword ptr[rsp+offset]	※スタックフレームを利用
+			pobj_sf->pop(array_BlockReg[i],sizeof(double));
+		}
+		else{
+			//mov reg,qword ptr[rsp+offset]     ※スタックフレームを利用
+			pobj_sf->pop(array_BlockReg[i]);
+		}
+	}
+}
+
+
+///////////////////
+// レジスタ管理
+///////////////////
+
+const int CalculationRegister[]={
+	REG_RAX,
+	REG_RCX,
+	REG_RDX,
+	REG_RBX,
+	REG_RSI,
+	REG_RDI,
+	REG_R8,
+	REG_R9,
+	REG_R10
+};
+
+const int CalculationXmmRegister[]={
+	REG_XMM0,
+	REG_XMM1,
+	REG_XMM2,
+	REG_XMM3,
+	/*XMM4、XMM5は演算時に一時的に利用*/
+/*	REG_XMM6,
+	REG_XMM7,
+	REG_XMM8,
+	REG_XMM9,
+	REG_XMM10,
+	REG_XMM11,
+	REG_XMM12,
+	REG_XMM13,
+	REG_XMM14,
+	REG_XMM15		関数呼び出し時のレジスタ保持を未搭載のため、保留*/
+};
+
+CRegister *pobj_reg;
+
+void CRegister::EnumRegister(int *pRegList,int nMaxList,int *array_reg,int *sp,int AnswerReg){
+	int i,i2,sw=0;
+
+	i2=nMaxList-1;
+	for(i=0;i2>=0;i++,i2--){
+		if(AnswerReg==pRegList[i2]){
+			sw=1;
+			i--;
+			continue;
+		}
+
+		if(pobj_BlockReg->check(pRegList[i2])){
+			//レジスタがブロッキングされているとき
+			i--;
+			continue;
+		}
+
+		array_reg[i]=pRegList[i2];
+	}
+
+	if(sw){
+		array_reg[i++]=AnswerReg;
+
+		//エラーチェック
+		if(pobj_BlockReg->check(AnswerReg)) SetError(300,NULL,cp);
+	}
+
+	*sp=i-1;
+}
+
+CRegister::CRegister(int AnswerReg){
+	/* 例： AnswerReg=REG_RCX	※REG_RCXをスタックの最後尾へセット
+								※r15、r14は一時保存用として利用する
+								※r13は同一関数内の単発処理用の一時保存レジスタとして利用する
+								※r12、r11は配列計算用として利用する
+	array_UseReg[0]=REG_R10
+	array_UseReg[1]=REG_R9
+	array_UseReg[2]=REG_R8
+	array_UseReg[3]=REG_RBX
+	array_UseReg[4]=REG_RDX
+	array_UseReg[5]=REG_RAX
+	array_UseReg[6]=REG_RCX	*/
+
+
+	///////////////////////////////////////////////////////////
+	//array_UseRegに、計算に利用するレジスタリストを作成
+	///////////////////////////////////////////////////////////
+
+	EnumRegister(
+		(int *)CalculationRegister,
+		sizeof(CalculationRegister)/sizeof(int),
+		array_UseReg,
+		&sp_UseReg,
+		AnswerReg);
+
+
+
+	///////////////////////////////////////////////////////////
+	//array_XmmRegに、計算に利用するレジスタリストを作成
+	///////////////////////////////////////////////////////////
+
+	EnumRegister(
+		(int *)CalculationXmmRegister,
+		sizeof(CalculationXmmRegister)/sizeof(int),
+		array_XmmReg,
+		&sp_XmmReg,
+		AnswerReg);
+
+
+	init_sp_reg=sp_UseReg;
+	init_sp_xmm_reg=sp_XmmReg;
+}
+void CRegister::bug_check(){
+	if(init_sp_reg!=sp_UseReg||
+		init_sp_xmm_reg!=sp_XmmReg) SetError(300,NULL,cp);
+}
+int CRegister::GetNextReg(){
+	if(sp_UseReg<0) return REG_R14;
+	return array_UseReg[sp_UseReg];
+}
+int CRegister::GetLockingReg(){
+	UnlockReg();
+	return LockReg();
+}
+int CRegister::LockReg(){
+	int reg;
+	reg=GetNextReg();
+
+	sp_UseReg--;
+
+	return reg;
+}
+int CRegister::UnlockReg(){
+	sp_UseReg++;
+	return GetNextReg();
+}
+int CRegister::GetNextXmmReg(){
+	if(sp_XmmReg<0) return REG_XMM4;
+	return array_XmmReg[sp_XmmReg];
+}
+int CRegister::GetLockingXmmReg(){
+	UnlockXmmReg();
+	return LockXmmReg();
+}
+int CRegister::LockXmmReg(){
+	int xmm_reg;
+	xmm_reg=GetNextXmmReg();
+
+	sp_XmmReg--;
+
+	return xmm_reg;
+}
+int CRegister::UnlockXmmReg(){
+	sp_XmmReg++;
+	return GetNextXmmReg();
+}
+bool CRegister::IsUsing( int reg ){
+	int i;
+
+	//汎用レジスタを調べる
+	for(i=init_sp_reg;i>sp_UseReg;i--){
+		if( array_UseReg[i] == reg ) return true;
+	}
+
+	//XMMレジスタを調べる
+	for(i=init_sp_xmm_reg;i>sp_XmmReg;i--){
+		if( array_XmmReg[i] == reg ) return true;
+	}
+
+	//ブロックされている場合を考慮
+	if( pobj_BlockReg->check( reg ) ) return true;
+
+	//使用中でないとき
+	return false;
+}
+void CRegister::backup(){
+	int i;
+
+	//汎用レジスタを退避
+	for(i=init_sp_reg;i>sp_UseReg;i--){
+		//mov qword ptr[rsp+offset],reg     ※スタックフレームを利用
+		pobj_sf->push(array_UseReg[i]);
+	}
+
+	//XMMレジスタを退避
+	for(i=init_sp_xmm_reg;i>sp_XmmReg;i--){
+		//mov qword ptr[rsp+offset],reg     ※スタックフレームを利用
+		pobj_sf->push(array_XmmReg[i],sizeof(_int64));
+	}
+}
+void CRegister::restore(){
+	int i;
+
+	//XMMレジスタを復元
+	if(sp_XmmReg<0) i=0;
+	else i=sp_XmmReg+1;
+	for(;i<=init_sp_xmm_reg;i++){
+		//mov reg,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(array_XmmReg[i],sizeof(_int64));
+	}
+
+	//汎用レジスタを復元
+	if(sp_UseReg<0) i=0;
+	else i=sp_UseReg+1;
+	for(;i<=init_sp_reg;i++){
+		//mov reg,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(array_UseReg[i]);
+	}
+}
+
+
+
+////////////////////////
+// その他
+////////////////////////
+
+BOOL IsGeneralReg(int reg){
+	if(REG_RAX<=reg&&reg<=REG_R15) return 1;
+	return 0;
+}
+BOOL IsXmmReg(int reg){
+	if(REG_XMM0<=reg&&reg<=REG_XMM15) return 1;
+	return 0;
+}
+BOOL IsVolatileReg(int reg){
+	if(reg==REG_RAX||
+		reg==REG_RCX||
+		reg==REG_RDX||
+		REG_R8<=reg&&reg<=REG_R11||
+		REG_XMM0<=reg&&reg<=REG_XMM5){
+		//値を保持する必要なし
+		return 1;
+	}
+	else{
+		//値を保持する必要あり
+		return 0;
+	}
+}
+
+void IfR14Push( int reg ){
+	if( reg == REG_R14 ){
+		//mov qword ptr[rsp+offset],r14     ※スタックフレームを利用
+		pobj_sf->push( REG_R14 );
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/amd64_main.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/amd64_main.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/amd64_main.cpp	(revision 178)
@@ -0,0 +1,1809 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+
+BOOL IsSafeReg(int reg){
+	switch(reg){
+		case REG_RBX:
+		case REG_RSI:
+		case REG_RDI:
+		case REG_R12:
+		case REG_R13:
+		case REG_R14:
+		case REG_R15:
+			return 1;
+		default:
+			break;
+	}
+	return 0;
+}
+
+
+
+//////////////////////
+// rexプリフィックス
+//////////////////////
+void set_rex(int op_size,int reg,int index_reg,int base_reg){
+	char RexByte;
+
+	if(reg==REG_NON&&index_reg==REG_NON){
+		/////////////////////////////////////
+		// レジスタをr/mのみに指定するとき
+		/////////////////////////////////////
+
+		if((base_reg&0x08)==0){
+			if(op_size==sizeof(char)&&(base_reg&0x04)){
+				// r/m に spl,bpl,sil,dilを指定するとき
+				RexByte=0x40;
+			}
+			else RexByte=0;
+		}
+		else RexByte=(char)0x41;
+	}
+	else{
+		/////////////////
+		// 通常
+		/////////////////
+
+		if((reg&0x08)==0){
+			//reg … rax～rdi
+
+			if((index_reg&0x08)==0){
+				if((base_reg&0x08)==0) RexByte=0;
+				else RexByte=(char)0x41;
+			}
+			else{
+				if((base_reg&0x08)==0) RexByte=(char)0x42;
+				else RexByte=(char)0x43;
+			}
+		}
+		else{
+			//reg … r8～r15
+
+			if((index_reg&0x08)==0){
+				if((base_reg&0x08)==0) RexByte=(char)0x44;
+				else RexByte=(char)0x45;
+			}
+			else{
+				if((base_reg&0x08)==0) RexByte=(char)0x46;
+				else RexByte=(char)0x47;
+			}
+		}
+	}
+
+	if(op_size==sizeof(_int64)){
+		//64ビットオペランド
+		RexByte|=0x48;
+	}
+
+	if(RexByte) OpBuffer[obp++]=RexByte;
+}
+
+
+
+/////////////////////////////////////////////////
+// ModR/Mバイト、SIBバイト、ディスプレースメント
+/////////////////////////////////////////////////
+
+//スケール
+#define SCALE_NON	(char)0x00
+#define SCALE_2		(char)0x40
+#define SCALE_4		(char)0x80
+#define SCALE_8		(char)0xC0
+
+//インデックスなし
+#define INDEX_NON	0x04
+
+void set_mod_rm_sib_disp(char mod,int reg,int scale,int index_reg,int base_reg,int disp){
+	if(mod==MOD_DISP32){
+		//ModR/Mバイト
+		OpBuffer[obp++]=(char)(      REGISTER_OPERAND(reg)<<3 | REGISTER_OPERAND(0x04));
+
+		base_reg=0x05;
+		index_reg=INDEX_NON;
+	}
+	else{
+		//ModR/Mバイト
+		OpBuffer[obp++]=(char)(mod | REGISTER_OPERAND(reg)<<3 | REGISTER_OPERAND(base_reg));
+	}
+
+
+	//レジスタモードの場合は、ここで終了
+	if(mod==MOD_REG) return;
+
+
+	if(REGISTER_OPERAND(base_reg)==0x04||mod==MOD_DISP32){
+		//////////////////////
+		// SIBバイトを使う
+		//////////////////////
+
+		OpBuffer[obp++]=(char)(scale| REGISTER_OPERAND(index_reg)<<3 | REGISTER_OPERAND(base_reg));
+	}
+
+	//ディスプレースメントを必要としない場合は、ここで終了
+	if(mod==MOD_BASE) return;
+
+
+	//////////////////////////
+	// ディスプレースメント
+	//////////////////////////
+
+	if(mod==MOD_BASE_DISP8) OpBuffer[obp++]=(char)disp;
+	else{
+		*((long *)(OpBuffer+obp))=disp;
+		obp+=sizeof(long);
+	}
+}
+
+
+
+void __op_format(int op_size,char op_prefix,char opcode1,char opcode2,int reg,int base_reg,int offset,char mod){
+	//命令プリフィックス
+	if(op_prefix) OpBuffer[obp++]=op_prefix;
+
+	//rexプリフィックス
+	set_rex(op_size,reg,0,base_reg);
+
+	//オペコード
+	OpBuffer[obp++]=opcode1;
+	if(opcode2) OpBuffer[obp++]=opcode2;
+
+	//ModR/M, SIB, disp
+	set_mod_rm_sib_disp(mod,reg,SCALE_NON,INDEX_NON,base_reg,offset);
+}
+
+
+
+
+//////////////////////////
+// スタック関連
+//////////////////////////
+
+void op_push(int reg){
+	//スタックにレジスタの値をプッシュ
+
+	if(REG_RAX<=reg&&reg<=REG_RDI){
+		/*	rax～rdi
+			0101 0xxx	*/
+		OpBuffer[obp++]=(char)(0x50| REGISTER_OPERAND(reg) );
+	}
+	if(REG_R8<=reg&&reg<=REG_R15){
+		/*	r8～r15
+			0100 0001 0101 0xxx	*/
+		OpBuffer[obp++]=(char)0x41;
+		OpBuffer[obp++]=(char)(0x50| REGISTER_OPERAND(reg) );
+	}
+}
+void op_push_value(long data){
+	//スタックにリテラル値をプッシュ
+	if(-128<=data&&data<=127){
+		//push 8ビット値
+		OpBuffer[obp++]=(char)0x6A;
+		OpBuffer[obp++]=(char)data;
+	}
+	else{
+		//push 32ビット値
+		OpBuffer[obp++]=(char)0x68;
+		*((long *)(OpBuffer+obp))=data;
+		obp+=sizeof(long);
+	}
+}
+void op_pop(int reg){
+	//スタックの内容をレジスタにポップ
+	if(REG_RAX<=reg&&reg<=REG_RDI){
+		/*	rax～rdi
+			0101 1xxx	*/
+		OpBuffer[obp++]=(char)(0x58| REGISTER_OPERAND(reg) );
+	}
+	if(REG_R8<=reg&&reg<=REG_R15){
+		/*	r8～r15
+			0100 0001 0101 1xxx	*/
+		OpBuffer[obp++]=(char)0x41;
+		OpBuffer[obp++]=(char)(0x58| REGISTER_OPERAND(reg) );
+	}
+}
+
+
+
+///////////////////
+// mov関連
+///////////////////
+
+void op_mov_RV(int op_size,int reg,int i32data){
+	//mov reg,i32data
+
+	//rexプリフィックス
+	set_rex(op_size,REG_NON,REG_NON,reg);
+
+	if(op_size==sizeof(_int64)){
+		//オペコード
+		OpBuffer[obp++]=(char)0xC7;
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg) );
+	}
+	else{
+		//レジスタ
+		OpBuffer[obp++]=(char)(0xB8| REGISTER_OPERAND(reg) );
+	}
+
+	//即値
+	*((long *)(OpBuffer+obp))=i32data;
+	obp+=sizeof(long);
+}
+void op_mov_RV64(int reg,_int64 i64data){
+	//mov reg,i64data
+
+	//rexプリフィックス
+	set_rex(sizeof(_int64),REG_NON,REG_NON,reg);
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xB8| REGISTER_OPERAND(reg) );
+
+	//即値
+	*((_int64 *)(OpBuffer+obp))=i64data;
+	obp+=sizeof(_int64);
+}
+void op_mov_RM(int op_size,int reg,int base_reg,int offset,char mod){
+	//mov reg64,qword ptr[base_reg+offset]
+	//mov reg32,dword ptr[base_reg+offset]
+	//mov reg16,word ptr[base_reg+offset]
+	//mov reg8,byte ptr[base_reg+offset]
+
+	//16ビット演算の命令プリフィックス
+	char op_prefix=0;
+	if(op_size==sizeof(short)) op_prefix=(char)0x66;
+
+	//オペコード
+	char opcode;
+	if(op_size==sizeof(char)) opcode=(char)0x8A;
+	else opcode=(char)0x8B;
+
+	__op_format(op_size,op_prefix,opcode,0,reg,base_reg,offset,mod);
+}
+void op_mov_RM_ex(int op_size,int reg,int base_reg1,int base_reg2,int offset,BOOL bUseOffset){
+	//mov reg64,qword ptr[base_reg1+base_reg2+offset]
+	//mov reg32,dword ptr[base_reg1+base_reg2+offset]
+	//mov reg16,word ptr[base_reg1+base_reg2+offset]
+	//mov reg8,byte ptr[base_reg1+base_reg2+offset]
+
+	if(base_reg1==REG_RSP){
+		//SIBバイトのindex部にrspは指定できない
+		base_reg1=base_reg2;
+		base_reg2=REG_RSP;
+	}
+
+	//16ビット演算のプリフィックス
+	if(op_size==sizeof(short)) OpBuffer[obp++]=(char)0x66;
+
+	//rexプリフィックス
+	set_rex(op_size,reg,base_reg1,base_reg2);
+
+	//オペコード
+	if(op_size==sizeof(char)) OpBuffer[obp++]=(char)0x8A;
+	else OpBuffer[obp++]=(char)0x8B;
+
+	if(bUseOffset){
+		///////////////////////////
+		// オフセット値を使う
+		///////////////////////////
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0x84| REGISTER_OPERAND(reg)<<3);
+
+		//ベースレジスタ
+		OpBuffer[obp++]=(char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2));
+
+		//オフセット値
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+	else{
+		///////////////////////////
+		// オフセット値を使わない
+		///////////////////////////
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0x04| REGISTER_OPERAND(reg)<<3);
+
+		//ベースレジスタ
+		OpBuffer[obp++]=(char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2));
+	}
+}
+void op_mov_MR(int op_size,int reg,int base_reg,int offset,char mod){
+	//mov qword ptr[base_reg+offset],reg64
+	//mov dword ptr[base_reg+offset],reg32
+	//mov word ptr[base_reg+offset],reg16
+	//mov byte ptr[base_reg+offset],reg8
+
+	//16ビット演算の命令プリフィックス
+	char op_prefix=0;
+	if(op_size==sizeof(short)) op_prefix=(char)0x66;
+
+	//オペコード
+	char opcode;
+	if(op_size==sizeof(char)) opcode=(char)0x88;
+	else opcode=(char)0x89;
+
+	__op_format(op_size,op_prefix,opcode,0,reg,base_reg,offset,mod);
+}
+void op_mov_MR_ex(int op_size,int reg,int base_reg1,int base_reg2,int offset,BOOL bUseOffset){
+	//mov qword ptr[base_reg1+base_reg2+offset],reg64
+	//mov dword ptr[base_reg1+base_reg2+offset],reg32
+	//mov word ptr[base_reg1+base_reg2+offset],reg16
+	//mov byte ptr[base_reg1+base_reg2+offset],reg8
+
+	if(base_reg1==REG_RSP){
+		//SIBバイトのindex部にrspは指定できない
+		base_reg1=base_reg2;
+		base_reg2=REG_RSP;
+	}
+
+	//16ビット演算のプリフィックス
+	if(op_size==sizeof(short)) OpBuffer[obp++]=(char)0x66;
+
+	//rexプリフィックス
+	set_rex(op_size,reg,base_reg1,base_reg2);
+
+	//オペコード
+	if(op_size==sizeof(char)) OpBuffer[obp++]=(char)0x88;
+	else OpBuffer[obp++]=(char)0x89;
+
+	if(bUseOffset==USE_OFFSET){
+		//////////////////////////
+		//オフセット値を使う
+		//////////////////////////
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0x84| REGISTER_OPERAND(reg)<<3);
+
+		//ベースレジスタ
+		OpBuffer[obp++]=(char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2));
+
+		//オフセット値
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+	else{
+		//////////////////////////
+		//オフセット値を使わない
+		//////////////////////////
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0x04| REGISTER_OPERAND(reg)<<3);
+
+		//ベースレジスタ
+		OpBuffer[obp++]=(char)(REGISTER_OPERAND(base_reg1)<<3 | REGISTER_OPERAND(base_reg2));
+	}
+}
+
+void op_mov_MV(int op_size,int base_reg,int offset,BOOL bUseOffset,int i32data){
+	//mov ptr[base_reg+offset],i32data
+	//mov ptr[base_reg       ],i32data
+
+	//16ビット演算のプリフィックス
+	if(op_size==sizeof(short)) OpBuffer[obp++]=(char)0x66;
+
+	//rexプリフィックス
+	set_rex(op_size,0,0,base_reg);
+
+	//オペコード
+	if(op_size==sizeof(char)) OpBuffer[obp++]=(char)0xC6;
+	else OpBuffer[obp++]=(char)0xC7;
+
+	if(bUseOffset==USE_OFFSET){
+		//////////////////////////
+		//オフセット値を使う
+		//////////////////////////
+
+		//ModR/M, SIB, disp
+		set_mod_rm_sib_disp(MOD_BASE_DISP32,0,SCALE_NON,INDEX_NON,base_reg,offset);
+	}
+	else{
+		//ModR/M, SIB, disp
+		set_mod_rm_sib_disp(MOD_BASE,0,SCALE_NON,INDEX_NON,base_reg,0);
+	}
+
+	//即値
+	if(op_size==sizeof(_int64)||op_size==sizeof(long)){
+		//32/64ビット
+		*((long *)(OpBuffer+obp))=i32data;
+		obp+=sizeof(long);
+	}
+	else if(op_size==sizeof(short)){
+		//16ビット
+		*((short *)(OpBuffer+obp))=(short)i32data;
+		obp+=sizeof(short);
+	}
+	else if(op_size==sizeof(char)){
+		//16ビット
+		*((char *)(OpBuffer+obp))=(char)i32data;
+		obp++;
+	}
+}
+
+void op_mov_RR(int reg1,int reg2){
+	//mov reg1,reg2
+	char RexByte=-1;
+
+	if(reg1==reg2) return;
+
+	if(REG_RAX<=reg1&&reg1<=REG_RDI){
+		if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x48;
+		if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x49;
+	}
+	if(REG_R8<=reg1&&reg1<=REG_R15){
+		if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x4C;
+		if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x4D;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	// [8bit rex] 1000 1011 11xx xbbb
+	OpBuffer[obp++]=RexByte;
+	OpBuffer[obp++]=(char)0x8B;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+
+
+
+///////////////////
+// mov64関連
+///////////////////
+
+void op_mov64_ToReg(int reg,_int64 i64data){
+	//mov reg,i64data
+
+	if(REG_RAX<=reg&&reg<=REG_RDI){
+		/*	rax～rdi
+			0100 1000 1011 1xxx [64bit data]	*/
+		OpBuffer[obp++]=(char)0x48;
+		OpBuffer[obp++]=(char)(0xB8| REGISTER_OPERAND(reg) );
+		*((_int64 *)(OpBuffer+obp))=i64data;
+		obp+=sizeof(_int64);
+	}
+	if(REG_R8<=reg&&reg<=REG_R15){
+		/*	r8～r15
+			0100 1001 1011 1xxx [64bit data]	*/
+		OpBuffer[obp++]=(char)0x49;
+		OpBuffer[obp++]=(char)(0xB8| REGISTER_OPERAND(reg) );
+		*((_int64 *)(OpBuffer+obp))=i64data;
+		obp+=sizeof(_int64);
+	}
+}
+void op_mov64_ToReg(int reg,int i32data){
+	//mov reg,i32data
+
+	if(REG_RAX<=reg&&reg<=REG_RDI){
+		/*	rax～rdi
+			0100 1000 1100 0111 1100 0xxx [32bit data]	*/
+		OpBuffer[obp++]=(char)0x48;
+		OpBuffer[obp++]=(char)0xC7;
+		OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg) );
+		*((long *)(OpBuffer+obp))=i32data;
+		obp+=sizeof(long);
+	}
+	if(REG_R8<=reg&&reg<=REG_R15){
+		/*	r8～r15
+			0100 1001 1100 0111 1100 0xxx [32bit data]	*/
+		OpBuffer[obp++]=(char)0x49;
+		OpBuffer[obp++]=(char)0xC7;
+		OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg) );
+		*((long *)(OpBuffer+obp))=i32data;
+		obp+=sizeof(long);
+	}
+}
+void op_movsxd(int reg64,int reg32){
+	//movsxd reg64,reg32
+	char RexByte=-1;
+
+	if(REG_RAX<=reg64&&reg64<=REG_RDI){
+		if(REG_RAX<=reg32&&reg32<=REG_RDI) RexByte=(char)0x48;
+		if(REG_R8<=reg32&&reg32<=REG_R15) RexByte=(char)0x49;
+	}
+	if(REG_R8<=reg64&&reg64<=REG_R15){
+		if(REG_RAX<=reg32&&reg32<=REG_RDI) RexByte=(char)0x4C;
+		if(REG_R8<=reg32&&reg32<=REG_R15) RexByte=(char)0x4D;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//[8bit rex] 0110 0011 11rr rbbb
+	OpBuffer[obp++]=RexByte;
+	OpBuffer[obp++]=(char)0x63;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg64)<<3 | REGISTER_OPERAND(reg32));
+}
+void op_movsx64_FromReg16(int reg64,int reg16){
+	//movsx reg64,reg16
+	char RexByte=-1;
+
+	if(REG_RAX<=reg64&&reg64<=REG_RDI){
+		if(REG_RAX<=reg16&&reg16<=REG_RDI) RexByte=(char)0x48;
+		if(REG_R8<=reg16&&reg16<=REG_R15) RexByte=(char)0x49;
+	}
+	if(REG_R8<=reg64&&reg64<=REG_R15){
+		if(REG_RAX<=reg16&&reg16<=REG_RDI) RexByte=(char)0x4C;
+		if(REG_R8<=reg16&&reg16<=REG_R15) RexByte=(char)0x4D;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//[8bit rex] 0000 1111 1011 1111 11rr rbbb
+	OpBuffer[obp++]=RexByte;
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0xBF;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg64)<<3 | REGISTER_OPERAND(reg16));
+}
+void op_movsx64_FromReg8(int reg64,int reg8){
+	//movsx reg64,reg8
+	char RexByte=-1;
+
+	if(REG_RAX<=reg64&&reg64<=REG_RDI){
+		if(REG_RAX<=reg8&&reg8<=REG_RDI) RexByte=(char)0x48;
+		if(REG_R8<=reg8&&reg8<=REG_R15) RexByte=(char)0x49;
+	}
+	if(REG_R8<=reg64&&reg64<=REG_R15){
+		if(REG_RAX<=reg8&&reg8<=REG_RDI) RexByte=(char)0x4C;
+		if(REG_R8<=reg8&&reg8<=REG_R15) RexByte=(char)0x4D;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//[8bit rex] 0000 1111 1011 1110 11rr rbbb
+	OpBuffer[obp++]=RexByte;
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0xBE;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg64)<<3 | REGISTER_OPERAND(reg8));
+}
+
+
+
+//////////////////
+// mov32関連
+//////////////////
+
+void op_movsx32_FromReg16(int reg32,int reg16){
+	//movsx reg32,reg16
+	char RexByte=-1;
+
+	if(REG_RAX<=reg32&&reg32<=REG_RDI){
+		if(REG_RAX<=reg16&&reg16<=REG_RDI) RexByte=0;
+		if(REG_R8<=reg16&&reg16<=REG_R15) RexByte=(char)0x41;
+	}
+	if(REG_R8<=reg32&&reg32<=REG_R15){
+		if(REG_RAX<=reg16&&reg16<=REG_RDI) RexByte=(char)0x44;
+		if(REG_R8<=reg16&&reg16<=REG_R15) RexByte=(char)0x45;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//[8bit rex] 0000 1111 1011 1111 11rr rbbb
+	if(RexByte) OpBuffer[obp++]=RexByte;
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0xBF;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg32)<<3 | REGISTER_OPERAND(reg16));
+}
+void op_movsx32_FromReg8(int reg32,int reg8){
+	//movsx reg32,reg8
+	char RexByte=-1;
+
+	if(REG_RAX<=reg32&&reg32<=REG_RDI){
+		if(REG_RAX<=reg8&&reg8<=REG_RBX) RexByte=0;
+		if(REG_RSP<=reg8&&reg8<=REG_RDI) RexByte=(char)0x40;
+		if(REG_R8<=reg8&&reg8<=REG_R15) RexByte=(char)0x41;
+	}
+	if(REG_R8<=reg32&&reg32<=REG_R15){
+		if(REG_RAX<=reg8&&reg8<=REG_RDI) RexByte=(char)0x44;
+		if(REG_R8<=reg8&&reg8<=REG_R15) RexByte=(char)0x45;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//[8bit rex] 0000 1111 1011 1110 11rr rbbb
+	if(RexByte) OpBuffer[obp++]=RexByte;
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0xBE;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg32)<<3 | REGISTER_OPERAND(reg8));
+}
+
+
+
+/////////////////////
+// mov16関連
+/////////////////////
+
+void op_movsx16_FromReg8(int reg32,int reg8){
+	//movsx reg16,reg8
+	char RexByte=-1;
+
+	if(REG_RAX<=reg32&&reg32<=REG_RDI){
+		if(REG_RAX<=reg8&&reg8<=REG_RBX) RexByte=0;
+		if(REG_RSP<=reg8&&reg8<=REG_RDI) RexByte=(char)0x40;
+		if(REG_R8<=reg8&&reg8<=REG_R15) RexByte=(char)0x41;
+	}
+	if(REG_R8<=reg32&&reg32<=REG_R15){
+		if(REG_RAX<=reg8&&reg8<=REG_RDI) RexByte=(char)0x44;
+		if(REG_R8<=reg8&&reg8<=REG_R15) RexByte=(char)0x45;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//0110 0110 [8bit rex] 0000 1111 1011 1110 11rr rbbb
+	OpBuffer[obp++]=(char)0x66;
+	if(RexByte) OpBuffer[obp++]=RexByte;
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0xBE;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg32)<<3 | REGISTER_OPERAND(reg8));
+}
+
+
+
+//////////////////////////////////
+// インクリメント・デクリメント
+//////////////////////////////////
+
+void op_inc(int reg){
+	//inc reg
+
+	//16ビット演算の命令プリフィックス
+	char op_prefix=0;
+
+	//オペコード
+	char opcode=(char)0xFF;
+
+	__op_format(sizeof(_int64),op_prefix,opcode,0,0,reg,0,MOD_REG);
+}
+void op_dec(int reg){
+	op_inc(reg);
+	OpBuffer[obp-1]=OpBuffer[obp-1]|0x08;
+}
+
+
+
+/////////////////////
+// add関連
+/////////////////////
+
+void op_add_RM(int op_size,int reg,int base_reg,int offset,char mod){
+	//add reg64,qword ptr[base_reg+offset]
+	//add reg32,dword ptr[base_reg+offset]
+	//add reg16,word ptr[base_reg+offset]
+	//add reg8,byte ptr[base_reg+offset]
+
+	//16ビット演算の命令プリフィックス
+	char op_prefix=0;
+	if(op_size==sizeof(short)) op_prefix=(char)0x66;
+
+	//オペコード
+	char opcode;
+	if(op_size==sizeof(char)) opcode=(char)0x02;
+	else opcode=(char)0x03;
+
+	__op_format(op_size,op_prefix,opcode,0,reg,base_reg,offset,mod);
+}
+
+void op_add_RV(int reg,int offset){
+	//add reg,offset
+	char RexByte=-1;
+
+	if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=0x48;
+	if(REG_R8<=reg&&reg<=REG_R15) RexByte=0x49;
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	if(reg==REG_RAX){
+		//raxのみ特殊
+
+		// [8bit rex] 0000 0101 [32bit offset]
+		OpBuffer[obp++]=(char)RexByte;
+		OpBuffer[obp++]=(char)0x05;
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+	else{
+		//rax以外
+
+		//[8bit rex] 1000 0001 1100 0xxx [32bit offset]
+		OpBuffer[obp++]=(char)RexByte;
+		OpBuffer[obp++]=(char)0x81;
+		OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg));
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+}
+void op_add64_reg(int reg1,int reg2){
+	//add reg1,reg2
+	char RexByte=-1;
+
+	if(REG_RAX<=reg1&&reg1<=REG_RDI){
+		if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x48;
+		if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x49;
+	}
+	if(REG_R8<=reg1&&reg1<=REG_R15){
+		if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x4C;
+		if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x4D;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//[8bit rex] 0000 0011 11rr rbbb
+	OpBuffer[obp++]=(char)RexByte;
+	OpBuffer[obp++]=(char)0x03;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+void op_add32_reg(int reg1,int reg2){
+	//add reg1,reg2
+	char RexByte=-1;
+
+	if(REG_RAX<=reg1&&reg1<=REG_RDI){
+		if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=0;
+		if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x41;
+	}
+	if(REG_R8<=reg1&&reg1<=REG_R15){
+		if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x44;
+		if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x45;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//[8bit rex] 0000 0011 11rr rbbb
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+	OpBuffer[obp++]=(char)0x03;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+
+
+
+////////////////////////
+// sub関連
+////////////////////////
+
+void op_sub_RV(int op_size,int reg,int i32data){
+	//sub reg,i32data
+
+	//rexプリフィックス
+	set_rex(op_size,REG_NON,REG_NON,reg);
+
+	if(reg==REG_RAX){
+		//raxのみ特殊
+		OpBuffer[obp++]=(char)0x2D;
+	}
+	else{
+		//オペコード
+		OpBuffer[obp++]=(char)0x81;
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0xE8| REGISTER_OPERAND(reg) );
+	}
+
+	//即値
+	*((long *)(OpBuffer+obp))=i32data;
+	obp+=sizeof(long);
+}
+void op_sub64_reg(int reg1,int reg2){
+	//sub reg1,reg2
+	char RexByte=-1;
+
+	if(REG_RAX<=reg1&&reg1<=REG_RDI){
+		if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x48;
+		if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x49;
+	}
+	if(REG_R8<=reg1&&reg1<=REG_R15){
+		if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x4C;
+		if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x4D;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//[8bit rex] 0010 1011 11rr rbbb
+	OpBuffer[obp++]=(char)RexByte;
+	OpBuffer[obp++]=(char)0x2B;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+void op_sub32_reg(int reg1,int reg2){
+	//sub reg1,reg2
+	char RexByte=-1;
+
+	if(REG_RAX<=reg1&&reg1<=REG_RDI){
+		if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=0;
+		if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x41;
+	}
+	if(REG_R8<=reg1&&reg1<=REG_R15){
+		if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x44;
+		if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x45;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//[8bit rex] 0010 1011 11rr rbbb
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+	OpBuffer[obp++]=(char)0x2B;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+void op_sbb_RR( int op_size, int reg1, int reg2 ){
+	//sbb reg1,reg2
+
+	//rexプリフィックス
+	set_rex(0,reg1,0,reg2);
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x1B;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+
+
+
+////////////////////////
+// imul関連
+////////////////////////
+
+void op_imul_RR(int op_size,int reg1,int reg2){
+	//imul reg1,reg2
+	char RexByte=-1;
+
+	if(op_size==sizeof(_int64)){
+		if(REG_RAX<=reg1&&reg1<=REG_RDI){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x48;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x49;
+		}
+		if(REG_R8<=reg1&&reg1<=REG_R15){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x4C;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x4D;
+		}
+	}
+	else{
+		if(REG_RAX<=reg1&&reg1<=REG_RDI){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=0;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x41;
+		}
+		if(REG_R8<=reg1&&reg1<=REG_R15){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x44;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x45;
+		}
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+
+	//rexプリフィックス
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0xAF;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+void op_imul_RV(int op_size,int reg,int i32data){
+	//imul reg,i32data
+	char RexByte=-1;
+
+	if(op_size==sizeof(_int64)){
+		if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x48;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x4D;
+	}
+	else{
+		if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=0;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x45;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+
+	//rexプリフィックス
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+
+	if(-128<=i32data&&i32data<=127){
+		//オペコード
+		OpBuffer[obp++]=(char)0x6B;
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg)<<3 | REGISTER_OPERAND(reg));
+
+		//値
+		OpBuffer[obp++]=(char)i32data;
+	}
+	else{
+		//オペコード
+		OpBuffer[obp++]=(char)0x69;
+
+		//レジスタ
+		OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg)<<3 | REGISTER_OPERAND(reg));
+
+		//値
+		*((long *)(OpBuffer+obp))=i32data;
+		obp+=sizeof(long);
+	}
+}
+
+
+
+////////////////////////
+// div、idiv関連
+////////////////////////
+
+void op_div64_reg(int reg){
+	//div reg
+	char RexByte=-1;
+
+	if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x48;
+	if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x49;
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//rexプリフィックス
+	OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	OpBuffer[obp++]=(char)0xF7;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xF0| REGISTER_OPERAND(reg));
+}
+void op_idiv64_reg(int reg){
+	//idiv reg
+	char RexByte=-1;
+
+	if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x48;
+	if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x49;
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//rexプリフィックス
+	OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	OpBuffer[obp++]=(char)0xF7;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xF8| REGISTER_OPERAND(reg));
+}
+
+
+
+////////////////////
+// ビットシフト関連
+////////////////////
+
+void op_shl_reg(int op_size,int reg){
+	//shl reg,cl
+	char RexByte=-1;
+
+	if(op_size==sizeof(_int64)){
+		if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x48;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x49;
+	}
+	else if(op_size==sizeof(char)){
+		if(REG_RAX<=reg&&reg<=REG_RBX) RexByte=0;
+		if(REG_RSP<=reg&&reg<=REG_RDI) RexByte=(char)0x40;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x41;
+	}
+	else{
+		if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=0;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x41;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+
+	//16ビット演算のプリフィックス
+	if(op_size==sizeof(short)) OpBuffer[obp++]=(char)0x66;
+
+	//rexプリフィックス
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	if(op_size==sizeof(char)) OpBuffer[obp++]=(char)0xD2;
+	else OpBuffer[obp++]=(char)0xD3;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xE0| REGISTER_OPERAND(reg));
+}
+void op_sar_reg(int op_size,int reg){
+	//sar reg,cl
+	char RexByte=-1;
+
+	if(op_size==sizeof(_int64)){
+		if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x48;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x49;
+	}
+	else if(op_size==sizeof(char)){
+		if(REG_RAX<=reg&&reg<=REG_RBX) RexByte=0;
+		if(REG_RSP<=reg&&reg<=REG_RDI) RexByte=(char)0x40;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x41;
+	}
+	else{
+		if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=0;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x41;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+
+	//16ビット演算のプリフィックス
+	if(op_size==sizeof(short)) OpBuffer[obp++]=(char)0x66;
+
+	//rexプリフィックス
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	if(op_size==sizeof(char)) OpBuffer[obp++]=(char)0xD2;
+	else OpBuffer[obp++]=(char)0xD3;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xF8| REGISTER_OPERAND(reg));
+}
+void op_shr_reg(int op_size,int reg){
+	//shr reg,cl
+	char RexByte=-1;
+
+	if(op_size==sizeof(_int64)){
+		if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x48;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x49;
+	}
+	else if(op_size==sizeof(char)){
+		if(REG_RAX<=reg&&reg<=REG_RBX) RexByte=0;
+		if(REG_RSP<=reg&&reg<=REG_RDI) RexByte=(char)0x40;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x41;
+	}
+	else{
+		if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=0;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x41;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+
+	//16ビット演算のプリフィックス
+	if(op_size==sizeof(short)) OpBuffer[obp++]=(char)0x66;
+
+	//rexプリフィックス
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	if(op_size==sizeof(char)) OpBuffer[obp++]=(char)0xD2;
+	else OpBuffer[obp++]=(char)0xD3;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xE8| REGISTER_OPERAND(reg));
+}
+
+
+
+////////////////////
+// and 関連
+////////////////////
+
+void op_and_reg(int op_size,int reg1,int reg2){
+	//and reg1,reg2
+	char RexByte=-1;
+
+	if(op_size==sizeof(_int64)){
+		if(REG_RAX<=reg1&&reg1<=REG_RDI){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x48;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x49;
+		}
+		if(REG_R8<=reg1&&reg1<=REG_R15){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x4C;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x4D;
+		}
+	}
+	else{
+		if(REG_RAX<=reg1&&reg1<=REG_RDI){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=0;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x41;
+		}
+		if(REG_R8<=reg1&&reg1<=REG_R15){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x44;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x45;
+		}
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+
+	//rexプリフィックス
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x23;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+void op_and64_value(int reg,int offset){
+	//and reg,offset
+	char RexByte=-1;
+
+	if(REG_RAX<=reg&&reg<=REG_RDI) (char)RexByte=0x48;
+	if(REG_R8<=reg&&reg<=REG_R15) (char)RexByte=0x49;
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	if(reg==REG_RAX){
+		//raxのみ特殊
+
+		// [8bit rex] 0010 0101 [32bit offset]
+		OpBuffer[obp++]=(char)RexByte;
+		OpBuffer[obp++]=(char)0x25;
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+	else{
+		//rax以外
+
+		//[8bit rex] 1000 0001 1100 0xxx [32bit offset]
+		OpBuffer[obp++]=(char)RexByte;
+		OpBuffer[obp++]=(char)0x81;
+		OpBuffer[obp++]=(char)(0xE0| REGISTER_OPERAND(reg));
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+}
+void op_and32_value(int reg,int offset){
+	//and reg,offset
+	char RexByte=-1;
+
+	if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=0;
+	if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x41;
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	if(reg==REG_RAX){
+		//eaxのみ特殊
+
+		// [8bit rex] 0010 0101 [32bit offset]
+		OpBuffer[obp++]=(char)0x25;
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+	else{
+		//eax以外
+
+		//[8bit rex] 1000 0001 1100 0xxx [32bit offset]
+		if(RexByte) OpBuffer[obp++]=(char)RexByte;
+		OpBuffer[obp++]=(char)0x81;
+		OpBuffer[obp++]=(char)(0xE0| REGISTER_OPERAND(reg));
+		*((long *)(OpBuffer+obp))=offset;
+		obp+=sizeof(long);
+	}
+}
+
+
+
+////////////////////////
+// or 関連
+////////////////////////
+
+void op_or_reg(int op_size,int reg1,int reg2){
+	//or reg1,reg2
+	char RexByte=-1;
+
+	if(op_size==sizeof(_int64)){
+		if(REG_RAX<=reg1&&reg1<=REG_RDI){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x48;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x49;
+		}
+		if(REG_R8<=reg1&&reg1<=REG_R15){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x4C;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x4D;
+		}
+	}
+	else{
+		if(REG_RAX<=reg1&&reg1<=REG_RDI){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=0;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x41;
+		}
+		if(REG_R8<=reg1&&reg1<=REG_R15){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x44;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x45;
+		}
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+
+	//rexプリフィックス
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x0B;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+
+
+
+////////////////////////
+// xor 関連
+////////////////////////
+
+void op_xor_reg(int op_size,int reg1,int reg2){
+	//xor reg1,reg2
+	char RexByte=-1;
+
+	if(op_size==sizeof(_int64)){
+		if(REG_RAX<=reg1&&reg1<=REG_RDI){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x48;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x49;
+		}
+		if(REG_R8<=reg1&&reg1<=REG_R15){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x4C;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x4D;
+		}
+	}
+	else{
+		if(REG_RAX<=reg1&&reg1<=REG_RDI){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=0;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x41;
+		}
+		if(REG_R8<=reg1&&reg1<=REG_R15){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x44;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x45;
+		}
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+
+	//rexプリフィックス
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x33;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+
+
+
+///////////////////////
+// not 関連
+///////////////////////
+
+void op_not_reg(int op_size,int reg){
+	//not reg
+	char RexByte=-1;
+
+	if(op_size==sizeof(_int64)){
+		if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x48;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x49;
+	}
+	else{
+		if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=0;
+		if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x41;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+
+	//rexプリフィックス
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	OpBuffer[obp++]=(char)0xF7;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xD0| REGISTER_OPERAND(reg));
+}
+void op_neg( int reg ){
+	//neg reg
+
+	//オペコード
+	OpBuffer[obp++]=(char)0xF7;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xD8| REGISTER_OPERAND(reg));
+}
+
+
+
+////////////////////
+// test関連
+////////////////////
+
+void op_test(int reg1,int reg2){
+	//test reg1,reg2
+	char RexByte=-1;
+
+	if(REG_RAX<=reg1&&reg1<=REG_RDI){
+		if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x48;
+		if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x49;
+	}
+	if(REG_R8<=reg1&&reg1<=REG_R15){
+		if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x4C;
+		if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x4D;
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+	//[8bit rex] 1000 0101 11rr rbbb
+	OpBuffer[obp++]=(char)RexByte;
+	OpBuffer[obp++]=(char)0x85;
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+
+
+
+/////////////////////
+// cmp 関連
+/////////////////////
+
+void op_cmp_reg(int op_size,int reg1,int reg2){
+	//cmp reg1,reg2
+	char RexByte=-1;
+
+	if(op_size==sizeof(_int64)){
+		if(REG_RAX<=reg1&&reg1<=REG_RDI){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x48;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x49;
+		}
+		if(REG_R8<=reg1&&reg1<=REG_R15){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x4C;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x4D;
+		}
+	}
+	else{
+		if(REG_RAX<=reg1&&reg1<=REG_RDI){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=0;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x41;
+		}
+		if(REG_R8<=reg1&&reg1<=REG_R15){
+			if(REG_RAX<=reg2&&reg2<=REG_RDI) RexByte=(char)0x44;
+			if(REG_R8<=reg2&&reg2<=REG_R15) RexByte=(char)0x45;
+		}
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+
+	//rexプリフィックス
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x3B;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg1)<<3 | REGISTER_OPERAND(reg2));
+}
+void op_cmp_value(int op_size,int reg,char byte_data){
+	//cmp reg,byte_data
+
+	if(op_size==sizeof(char)&&reg==REG_RAX){
+		//alレジスタの場合は特殊
+		OpBuffer[obp++]=(char)0x3C;
+
+		//8ビット値
+		OpBuffer[obp++]=byte_data;
+
+		return;
+	}
+
+	//16ビット演算のプリフィックス
+	if(op_size==sizeof(short)) OpBuffer[obp++]=(char)0x66;
+
+	//rexプリフィックス
+	set_rex(op_size,REG_NON,REG_NON,reg);
+
+	//オペコード
+	if(op_size==sizeof(char)) OpBuffer[obp++]=(char)0x80;
+	else OpBuffer[obp++]=(char)0x83;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xF8| REGISTER_OPERAND(reg));
+
+	//8ビット値
+	OpBuffer[obp++]=byte_data;
+}
+void op_setne( int reg ){
+	//オペコード
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x95;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)( 0xC0 | REGISTER_OPERAND(reg) );
+}
+
+
+////////////////////
+// SSE2関連
+////////////////////
+
+void op_movlpd_MR(int xmm_reg,int base_reg,int offset,char mod){
+	//movlpd qword ptr[base_reg+offset],xmm_reg
+	__op_format(0,(char)0x66,(char)0x0F,(char)0x13,xmm_reg,base_reg,offset,mod);
+}
+void op_movlpd_RM(int xmm_reg,int base_reg,int offset,char mod){
+	//movlpd xmm_reg,qword ptr[base_reg+offset]
+	__op_format(0,(char)0x66,(char)0x0F,(char)0x12,xmm_reg,base_reg,offset,mod);
+}
+void op_movsd_RR(int xmm_reg1,int xmm_reg2){
+	if(xmm_reg1==xmm_reg2) return;
+
+	//movsd xmm_reg1,xmm_reg2
+	__op_format(0,(char)0xF2,(char)0x0F,(char)0x10,xmm_reg1,xmm_reg2,0,MOD_REG);
+}
+void op_movsd_MR(int xmm_reg,int base_reg,int offset,char mod){
+	//movsd qword ptr[reg+offset],xmm_reg
+	//movsd qword ptr[reg],xmm_reg
+	__op_format(0,(char)0xF2,(char)0x0F,(char)0x11,xmm_reg,base_reg,offset,mod);
+}
+void op_movss_RR(int xmm_reg1,int xmm_reg2){
+	if(xmm_reg1==xmm_reg2) return;
+
+	//movss xmm_reg1,xmm_reg2
+	__op_format(0,(char)0xF3,(char)0x0F,(char)0x10,xmm_reg1,xmm_reg2,0,MOD_REG);
+}
+void op_movss_RM(int xmm_reg,int base_reg,int offset,char mod){
+	//movss xmm_reg,dword ptr[base_reg+offset]
+	__op_format(0,(char)0xF3,(char)0x0F,(char)0x10,xmm_reg,base_reg,offset,mod);
+}
+void op_movss_MR(int xmm_reg,int base_reg,int offset,char mod){
+	//movss dword ptr[reg+offset],xmm_reg
+	//movss dword ptr[reg],xmm_reg
+	__op_format(0,(char)0xF3,(char)0x0F,(char)0x11,xmm_reg,base_reg,offset,mod);
+}
+
+void op_movd_RX(int reg,int xmm_reg){
+	__op_format(sizeof(_int64),(char)0x66,(char)0x0F,(char)0x7E,xmm_reg,reg,0,MOD_REG);
+}
+
+void op_cvtsd2ss(int xmm_reg1,int xmm_reg2){
+	//cvtsd2ss xmm_reg1,xmm_reg2
+
+	//オペコード
+	OpBuffer[obp++]=(char)0xF2;
+
+	//rexプリフィックス
+	set_rex(sizeof(long),xmm_reg1,0,xmm_reg2);
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x5A;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2));
+}
+void op_cvtss2sd(int xmm_reg1,int xmm_reg2){
+	//cvtss2sd xmm_reg1,xmm_reg2
+
+	//オペコード
+	OpBuffer[obp++]=(char)0xF3;
+
+	//rexプリフィックス
+	set_rex(0,xmm_reg1,0,xmm_reg2);
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x5A;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2));
+}
+void op_cvttsd2si_xmm(int op_size,int reg,int xmm_reg){
+	//cvttsd2si reg,xmm_reg
+
+	//オペコード
+	OpBuffer[obp++]=(char)0xF2;
+
+	//rexプリフィックス
+	set_rex(op_size,reg,0,xmm_reg);
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x2C;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg)<<3 | REGISTER_OPERAND(xmm_reg));
+}
+void op_cvttss2si_xmm(int op_size,int reg,int xmm_reg){
+	//cvttss2si reg,xmm_reg
+
+	//オペコード
+	OpBuffer[obp++]=(char)0xF3;
+
+	//rexプリフィックス
+	set_rex(op_size,reg,0,xmm_reg);
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x2C;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg)<<3 | REGISTER_OPERAND(xmm_reg));
+}
+void op_cvtsi2sd_reg(int op_size,int xmm_reg,int reg){
+	//cvtsi2sd xmm_reg,reg
+	char RexByte=-1;
+
+	if(op_size==sizeof(_int64)){
+		if(REG_XMM0<=xmm_reg&&xmm_reg<=REG_XMM7){
+			if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x48;
+			if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x49;
+		}
+		if(REG_XMM8<=xmm_reg&&xmm_reg<=REG_XMM15){
+			if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x4C;
+			if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x4D;
+		}
+	}
+	else{
+		if(REG_XMM0<=xmm_reg&&xmm_reg<=REG_XMM7){
+			if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=0;
+			if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x41;
+		}
+		if(REG_XMM8<=xmm_reg&&xmm_reg<=REG_XMM15){
+			if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x44;
+			if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x45;
+		}
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+
+	//オペコード
+	OpBuffer[obp++]=(char)0xF2;
+
+	//rexプリフィックス
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x2A;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(xmm_reg)<<3 | REGISTER_OPERAND(reg));
+}
+void op_cvtsi2ss_reg(int op_size,int xmm_reg,int reg){
+	//cvtsi2ss xmm_reg,reg
+	char RexByte=-1;
+
+	if(op_size==sizeof(_int64)){
+		if(REG_XMM0<=xmm_reg&&xmm_reg<=REG_XMM7){
+			if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x48;
+			if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x49;
+		}
+		if(REG_XMM8<=xmm_reg&&xmm_reg<=REG_XMM15){
+			if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x4C;
+			if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x4D;
+		}
+	}
+	else{
+		if(REG_XMM0<=xmm_reg&&xmm_reg<=REG_XMM7){
+			if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=0;
+			if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x41;
+		}
+		if(REG_XMM8<=xmm_reg&&xmm_reg<=REG_XMM15){
+			if(REG_RAX<=reg&&reg<=REG_RDI) RexByte=(char)0x44;
+			if(REG_R8<=reg&&reg<=REG_R15) RexByte=(char)0x45;
+		}
+	}
+
+	if(RexByte==-1) SetError(300,NULL,cp);
+
+
+	//オペコード
+	OpBuffer[obp++]=(char)0xF3;
+
+	//rexプリフィックス
+	if(RexByte) OpBuffer[obp++]=(char)RexByte;
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x2A;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(xmm_reg)<<3 | REGISTER_OPERAND(reg));
+}
+void op_comisd(int xmm_reg1,int xmm_reg2){
+	//comisd xmm_reg1,xmm_reg2
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x66;
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x2F;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2));
+}
+void op_comiss(int xmm_reg1,int xmm_reg2){
+	//comiss xmm_reg1,xmm_reg2
+
+	//オペコード
+	OpBuffer[obp++]=(char)0x0F;
+	OpBuffer[obp++]=(char)0x2F;
+
+	//レジスタ
+	OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(xmm_reg1)<<3 | REGISTER_OPERAND(xmm_reg2));
+}
+
+
+
+/////////////////////
+// ストリング関係
+/////////////////////
+
+void op_rep_movs(int op_size){
+	if(op_size==sizeof(BYTE)){
+		//rep movs byte ptr[edi],byte ptr[esi]
+		OpBuffer[obp++]=(char)0xF3;
+		OpBuffer[obp++]=(char)0xA4;
+	}
+	else if(op_size==sizeof(short)){
+		//rep movs word ptr[edi],word ptr[esi]
+		OpBuffer[obp++]=(char)0xF3;
+		OpBuffer[obp++]=(char)0x66;
+		OpBuffer[obp++]=(char)0xA5;
+	}
+	else if(op_size==sizeof(long)){
+		//rep movs dword ptr[edi],dword ptr[esi]
+		OpBuffer[obp++]=(char)0xF3;
+		OpBuffer[obp++]=(char)0xA5;
+	}
+}
+
+
+
+
+void op_add_rsp(int num){
+	//スタックポインタの加算（pop方向）
+
+	//add rsp,num
+	if(0xFFFFFF80&num){
+		OpBuffer[obp++]=(char)0x48;
+		OpBuffer[obp++]=(char)0x81;
+		OpBuffer[obp++]=(char)0xC4;
+		*((long *)(OpBuffer+obp))=num;
+		obp+=sizeof(long);
+	}
+	else{
+		//「-128 < num < 127」の場合
+		OpBuffer[obp++]=(char)0x48;
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)num;
+	}
+}
+void op_sub_rsp(int num){
+	//スタックポインタの減算（push方向）
+
+	//sub rsp,num
+	if(0xFFFFFF80&num){
+		OpBuffer[obp++]=(char)0x48;
+		OpBuffer[obp++]=(char)0x81;
+		OpBuffer[obp++]=(char)0xEC;
+		*((long *)(OpBuffer+obp))=num;
+		obp+=sizeof(long);
+	}
+	else{
+		//「-128 < num < 127」の場合
+		OpBuffer[obp++]=(char)0x48;
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xEC;
+		OpBuffer[obp++]=(char)num;
+	}
+}
+
+
+void op_add_esp(int num){
+	//スタックポインタの加算（pop方向）
+
+	//add esp,num
+	if(0xFFFFFF80&num){
+		OpBuffer[obp++]=(char)0x81;
+		OpBuffer[obp++]=(char)0xC4;
+		*((long *)(OpBuffer+obp))=num;
+		obp+=sizeof(long);
+	}
+	else{
+		//「-128 < num < 127」の場合
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xC4;
+		OpBuffer[obp++]=(char)num;
+	}
+}
+void op_sub_esp(int num){
+	//スタックポインタの減算（push方向）
+
+	//sub esp,num
+	if(0xFFFFFF80&num){
+		OpBuffer[obp++]=(char)0x81;
+		OpBuffer[obp++]=(char)0xEC;
+		*((long *)(OpBuffer+obp))=num;
+		obp+=sizeof(long);
+	}
+	else{
+		//「-128 < num < 127」の場合
+		OpBuffer[obp++]=(char)0x83;
+		OpBuffer[obp++]=(char)0xEC;
+		OpBuffer[obp++]=(char)num;
+	}
+}
+
+
+
+//////////////////////////////
+// 浮動小数点関連
+//////////////////////////////
+
+void op_fld_ptr_esp(int type){
+	//スタックポインタが示すバッファのデータを浮動小数点レジスタへロード
+
+	if(type==DEF_DOUBLE){
+		//fld qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDD;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(type==DEF_SINGLE){
+		//fld dword ptr[esp]
+		OpBuffer[obp++]=(char)0xD9;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(type==DEF_INT64){
+		//fild qword ptr[esp]
+		OpBuffer[obp++]=(char)0xDF;
+		OpBuffer[obp++]=(char)0x2C;
+		OpBuffer[obp++]=(char)0x24;
+	}
+	else if(type==DEF_LONG){
+		//fild dword ptr[esp]
+		OpBuffer[obp++]=(char)0xDB;
+		OpBuffer[obp++]=(char)0x04;
+		OpBuffer[obp++]=(char)0x24;
+	}
+}
+
+
+
+//////////////////////////////
+// レジスタ関連
+//////////////////////////////
+
+void op_zero_reg(int reg){
+	//レジスタに0をセット
+
+	if(REG_RAX<=reg&&reg<=REG_RDI){
+		/*	rax～rdi
+			0100 1000 0011 0011 11 xxx xxx	*/
+		OpBuffer[obp++]=(char)0x48;
+		OpBuffer[obp++]=(char)0x33;
+		OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg)<<3 | REGISTER_OPERAND(reg));
+	}
+	if(REG_R8<=reg&&reg<=REG_R15){
+		/*	r8～r15
+			0100 1101 0011 0011 11 xxx xxx	*/
+		OpBuffer[obp++]=(char)0x4D;
+		OpBuffer[obp++]=(char)0x33;
+		OpBuffer[obp++]=(char)(0xC0| REGISTER_OPERAND(reg)<<3 | REGISTER_OPERAND(reg));
+	}
+}
+
+
+
+/////////////////////////////
+// 関数呼び出し
+/////////////////////////////
+
+void op_call( UserProc *pUserProc ){
+	OpBuffer[obp++] = (char)0xE8;
+	pobj_SubAddrSchedule->add( pUserProc, 1 );
+	pUserProc->Using();
+	obp += sizeof(long);
+}
+void op_call( DllProc *pDllProc ){
+	OpBuffer[obp++] = (char)0xFF;
+	OpBuffer[obp++] = (char)0x15;
+	pobj_ImportAddrSchedule->add(pDllProc);
+	obp += sizeof(long);
+
+	pDllProc->Using();
+}
+void op_ret(){
+	OpBuffer[obp++]=(char)0xC3;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/increment.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/increment.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/increment.cpp	(revision 178)
@@ -0,0 +1,158 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+void IncDec(int idCalc, const char *lpszLeft, const char *lpszRight){
+
+	///////////////////////////
+	// 変数アドレスを取得
+	///////////////////////////
+
+	RELATIVE_VAR VarRelativeVar;
+	Type varType;
+	if(!GetVarOffsetReadWrite(
+		lpszLeft,
+		&VarRelativeVar,
+		varType)) return;
+
+	//変数オフセットを一時退避
+	if(IsUse_r11(&VarRelativeVar)){
+		//mov qword ptr[rsp+offset],r11     ※スタックフレームを利用
+		pobj_sf->push(REG_R11);
+	}
+
+
+	///////////////////////////////////
+	// レジスタへ変数の内容をコピー
+	///////////////////////////////////
+
+	int reg;
+	if( varType.IsDouble() ){
+		reg=REG_XMM0;
+		SetXmmReg_DoubleVariable(&VarRelativeVar,reg);
+	}
+	else if( varType.IsSingle() ){
+		reg=REG_XMM0;
+		SetXmmReg_SingleVariable(&VarRelativeVar,reg);
+	}
+	else{
+		reg=REG_RAX;
+		SetReg_WholeVariable(varType.GetBasicType(),&VarRelativeVar,reg);
+	}
+
+
+	if(varType.IsWhole()&&lstrcmp(lpszRight,"1")==0&&
+		(idCalc==CALC_ADDITION||idCalc==CALC_SUBTRACTION)){
+			if(idCalc==CALC_ADDITION){
+				//インクリメント
+				op_inc(REG_RAX);
+			}
+			else if(idCalc==CALC_SUBTRACTION){
+				//デクリメント
+				op_dec(REG_RAX);
+			}
+	}
+	else{
+		//結果を格納しているレジスタをブロッキング
+		pobj_BlockReg->lock(reg);
+
+		//右辺を計算
+		Type calcType;
+		if(reg==REG_RAX) reg=REG_RCX;
+		else reg=REG_RAX;
+		NumOpe(&reg,lpszRight,varType,calcType);
+
+		//レジスタのブロッキングを解除
+		pobj_BlockReg->clear();
+
+
+		if(varType.IsPointer()&&calcType.IsWhole()&&(!calcType.IsPointer())){
+			//左辺がポインタ型、右辺が整数型の場合は、エラーをださないようにする
+			calcType = varType;
+		}
+
+
+		/////////////////////////////////
+		// 右辺、左辺の型チェックを行う
+		/////////////////////////////////
+
+		CheckDifferentType(varType,calcType,0,0);
+
+
+		//レジスタ管理オブジェクトを生成
+		pobj_reg=new CRegister(REG_RAX);
+
+		//左辺用レジスタ
+		if(varType.IsReal())
+			pobj_reg->LockXmmReg();
+		else
+			pobj_reg->LockReg();
+
+		//右辺値レジスタ
+		if(varType.IsDouble())
+			ChangeTypeToXmm_Double(calcType.GetBasicType(),
+				pobj_reg->LockXmmReg(),
+				pobj_reg->GetNextReg());
+		else if(varType.IsSingle())
+			ChangeTypeToXmm_Single(calcType.GetBasicType(),
+				pobj_reg->LockXmmReg(),
+				pobj_reg->GetNextReg());
+		else
+			ChangeTypeToWhole(calcType.GetBasicType(),varType.GetBasicType(),
+				pobj_reg->LockReg(),
+				pobj_reg->GetNextXmmReg());
+
+		int type_stack[255],sp;
+		LONG_PTR index_stack[255];
+		type_stack[0]=varType.GetBasicType();
+		type_stack[1]=varType.GetBasicType();
+		index_stack[0]=varType.GetIndex();
+		index_stack[1]=varType.GetIndex();
+		sp=2;
+
+		switch(idCalc){
+			case CALC_XOR:
+			case CALC_OR:
+			case CALC_AND:
+				CalcTwoTerm_Logical(idCalc,type_stack,index_stack,&sp);
+				break;
+			case CALC_SHL:
+			case CALC_SHR:
+				Calc_Shift(idCalc,type_stack,&sp);
+				break;
+			case CALC_ADDITION:
+			case CALC_SUBTRACTION:
+			case CALC_PRODUCT:
+				CalcTwoTerm_Arithmetic(idCalc,type_stack,index_stack,&sp);
+				break;
+			case CALC_MOD:
+				Calc_Mod(type_stack,index_stack,&sp);
+				break;
+			case CALC_QUOTIENT:
+				Calc_Divide(type_stack,&sp,varType.GetBasicType());
+				break;
+			case CALC_INTQUOTIENT:
+				Calc_IntDivide(type_stack,index_stack,&sp);
+				break;
+			case CALC_POWER:
+				Calc_Power(type_stack,&sp);
+				break;
+		}
+
+		//レジスタ管理オブジェクトを解放
+		delete pobj_reg;
+		pobj_reg=0;
+	}
+
+
+	/////////////////////////////////////////////////
+	// rax（実数はxmm0）の内容を変数にコピー
+	/////////////////////////////////////////////////
+
+	//変数オフセットを復元
+	if(IsUse_r11(&VarRelativeVar)){
+		//mov r11,qword ptr[rsp+offset]     ※スタックフレームを利用
+		pobj_sf->pop(REG_R11);
+	}
+
+	SetVariableFromRax(varType.GetBasicType(),varType.GetBasicType(),&VarRelativeVar);
+}
Index: tag/abdev(2007.06.20)/BasicCompiler64/manifest.xml
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/manifest.xml	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/manifest.xml	(revision 178)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<assemblyIdentity
+version="1.0.0.0"
+processorArchitecture="amd64"
+name="BasicCompiler64.exe"
+type="win32"
+/>
+<description>Description</description>
+<dependency>
+<dependentAssembly>
+<assemblyIdentity
+type="win32"
+name="Microsoft.Windows.Common-Controls"
+version="6.0.0.0"
+processorArchitecture="amd64"
+publicKeyToken="6595b64144ccf1df"
+language="*"
+/>
+</dependentAssembly>
+</dependency>
+</assembly>
Index: tag/abdev(2007.06.20)/BasicCompiler64/resource.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/resource.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/resource.h	(revision 178)
@@ -0,0 +1,56 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by BasicCompiler.rc
+//
+#define IDD_MAIN                        101
+#define IDD_VARLIST                     103
+#define IDI_MAIN                        108
+#define IDI_VARSTRUCT                   109
+#define IDI_VARDATA                     110
+#define IDI_VARSTR                      111
+#define IDI_VARARRAY                    112
+#define IDI_VARPTRSTRUCT                113
+#define IDD_CLIPMAIN                    114
+#define IDD_DEBUGGER                    115
+#define IDR_DEBUGGERTOOLBAR             117
+#define IDD_DEBUGGER_TOOLBARBASE        120
+#define IDR_DEBUGGER_VARLIST_MENU       122
+#define IDR_DEBUGGERTOOLBAR_DISABLED    125
+#define IDC_EXEPATH                     1000
+#define IDC_PROGRESS                    1001
+#define IDC_ERRORLIST                   1002
+#define IDC_MESSAGE                     1003
+#define IDC_DEBUGLIST                   1005
+#define IDC_SHOWERROR                   1006
+#define IDC_SHOWDEBUG                   1007
+#define IDC_THREADCOMBO                 1014
+#define IDC_VARTREE                     1015
+#define IDC_GLOBAL                      1016
+#define IDC_LOCAL                       1017
+#define IDC_PROCCOMBO                   1018
+#define IDC_HIDESYSVAR                  1019
+#define IDC_STEPIN                      1021
+#define IDC_STEPOVER                    1022
+#define IDC_ESP                         1023
+#define IDC_DUMMYCANCEL                 1024
+#define IDC_TAB1                        1025
+#define IDC_VARPOS                      1029
+#define IDC_WATCHLIST                   1033
+#define IDC_STATIC_VERSION              1034
+#define IDC_DEBUG_START                 40003
+#define IDC_DEBUG_STEPOVER              40004
+#define IDC_DEBUG_STEPIN                40005
+#define IDM_SHOW_DEFAULTSYSTEM_VAR      40007
+#define IDM_SHOW_RAD_VAR                40008
+#define IDM_SHOW_GUID_VAR               40009
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        126
+#define _APS_NEXT_COMMAND_VALUE         40010
+#define _APS_NEXT_CONTROL_VALUE         1035
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
Index: tag/abdev(2007.06.20)/BasicCompiler64/resource_back.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/resource_back.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/resource_back.h	(revision 178)
@@ -0,0 +1,55 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by BasicCompiler.rc
+//
+#define IDD_MAIN                        101
+#define IDD_VARLIST                     103
+#define IDI_MAIN                        108
+#define IDI_VARSTRUCT                   109
+#define IDI_VARDATA                     110
+#define IDI_VARSTR                      111
+#define IDI_VARARRAY                    112
+#define IDI_VARPTRSTRUCT                113
+#define IDD_CLIPMAIN                    114
+#define IDD_DEBUGGER                    115
+#define IDR_DEBUGGERTOOLBAR             117
+#define IDD_DEBUGGER_TOOLBARBASE        120
+#define IDR_DEBUGGER_VARLIST_MENU       122
+#define IDC_EXEPATH                     1000
+#define IDC_PROGRESS                    1001
+#define IDC_ERRORLIST                   1002
+#define IDC_MESSAGE                     1003
+#define IDC_DEBUGLIST                   1005
+#define IDC_SHOWERROR                   1006
+#define IDC_SHOWDEBUG                   1007
+#define IDC_THREADCOMBO                 1014
+#define IDC_VARTREE                     1015
+#define IDC_GLOBAL                      1016
+#define IDC_LOCAL                       1017
+#define IDC_PROCCOMBO                   1018
+#define IDC_HIDESYSVAR                  1019
+#define IDC_STEPIN                      1021
+#define IDC_STEPOVER                    1022
+#define IDC_ESP                         1023
+#define IDC_DUMMYCANCEL                 1024
+#define IDC_TAB1                        1025
+#define IDC_VARPOS                      1029
+#define IDC_WATCHLIST                   1033
+#define IDC_STATIC_VERSION              1034
+#define IDC_DEBUG_START                 40003
+#define IDC_DEBUG_STEPOVER              40004
+#define IDC_DEBUG_STEPIN                40005
+#define IDM_SHOW_DEFAULTSYSTEM_VAR      40007
+#define IDM_SHOW_RAD_VAR                40008
+#define IDM_SHOW_GUID_VAR               40009
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        125
+#define _APS_NEXT_COMMAND_VALUE         40010
+#define _APS_NEXT_CONTROL_VALUE         1035
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
Index: tag/abdev(2007.06.20)/BasicCompiler64/stack_frame.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler64/stack_frame.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler64/stack_frame.cpp	(revision 178)
@@ -0,0 +1,158 @@
+#include "../BasicCompiler_Common/common.h"
+#include "Opcode.h"
+
+
+/////////////////////////
+// スタックフレーム管理
+/////////////////////////
+
+CStackFrame::CStackFrame(){
+	lowest_sp=0;
+	now_sp=0;
+	local_parm_size=0;
+	max_parm_size=0;
+}
+CStackFrame::~CStackFrame(){
+	//オブジェクト破棄時に不整合がないかをチェック（バグ回避）
+	error_check();
+}
+void CStackFrame::SetLocalParmSize(int size){
+	local_parm_size=size;
+}
+int CStackFrame::GetFrameSize(){
+	int answer_sp;
+
+	answer_sp=lowest_sp-max_parm_size;
+
+	if((local_parm_size%0x10)==0){
+		if((answer_sp%0x10)==0){
+			//関数のエントリポイントで128ビット境界ラインに合わせるため
+			return -(answer_sp-0x08);
+		}
+		return -(answer_sp-0x10);
+	}
+
+	if((answer_sp%0x10)==0){
+		//関数のエントリポイントで128ビット境界ラインに合わせるため
+		return -(answer_sp-0x10);
+	}
+	return -(answer_sp-0x08);
+}
+int CStackFrame::GetNowSp(){
+	return now_sp;
+}
+void CStackFrame::mov_sp( int reg ){
+	//mov reg,rsp
+	op_mov_RR( reg, REG_RSP );
+
+	//add reg,now_sp
+	op_add_RV( reg, now_sp );
+
+	//スケジュールをセット
+	obp-=sizeof(long);
+	add();
+	obp+=sizeof(long);
+}
+int CStackFrame::push(int reg){
+	now_sp-=sizeof(_int64);
+	if(lowest_sp>now_sp) lowest_sp=now_sp;
+
+	if(reg==REG_NON) return now_sp;
+
+	//mov qword ptr[rsp+offset],reg
+	op_mov_MR(sizeof(_int64),reg,REG_RSP,now_sp,MOD_BASE_DISP32);
+
+	//スケジュールをセット
+	obp-=sizeof(long);
+	add();
+	obp+=sizeof(long);
+
+	return now_sp;
+}
+void CStackFrame::push(int xmm_reg,int varSize){
+	now_sp-=sizeof(_int64);
+	if(lowest_sp>now_sp) lowest_sp=now_sp;
+
+	if(varSize==sizeof(double)){
+		//movlpd qword ptr[rsp+offset],xmm_reg
+		op_movlpd_MR(xmm_reg,REG_RSP,now_sp,MOD_BASE_DISP32);
+	}
+	if(varSize==sizeof(float)){
+		//movss dword ptr[rsp+offset],xmm_reg
+		OpBuffer[obp++]=(char)0xF3;
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x11;
+		OpBuffer[obp++]=(char)(0x84| REGISTER_OPERAND(xmm_reg)<<3 );
+		OpBuffer[obp++]=(char)0x24;
+		*((long *)(OpBuffer+obp))=now_sp;
+		obp+=sizeof(long);
+	}
+
+	//スケジュールをセット
+	obp-=sizeof(long);
+	add();
+	obp+=sizeof(long);
+}
+void CStackFrame::ref_offset_data( int reg, int sp_offset ){
+	//mov reg,qword ptr[rsp+offset]     ※スタックフレームを利用
+	op_mov_RM(sizeof(_int64),reg,REG_RSP,sp_offset,MOD_BASE_DISP32);
+
+	//スケジュールをセット
+	obp-=sizeof(long);
+	add();
+	obp+=sizeof(long);
+}
+void CStackFrame::ref(int reg){
+	ref_offset_data( reg, now_sp );
+}
+void CStackFrame::ref(int xmm_reg,int varSize){
+	if(varSize==sizeof(double)){
+		//movlpd xmm_reg,qword ptr[rsp+offset]
+		op_movlpd_RM(xmm_reg,REG_RSP,now_sp,MOD_BASE_DISP32);
+	}
+	if(varSize==sizeof(float)){
+		//movss xmm_reg,dword ptr[rsp+offset]
+		OpBuffer[obp++]=(char)0xF3;
+		OpBuffer[obp++]=(char)0x0F;
+		OpBuffer[obp++]=(char)0x10;
+		OpBuffer[obp++]=(char)(0x84| REGISTER_OPERAND(xmm_reg)<<3 );
+		OpBuffer[obp++]=(char)0x24;
+		*((long *)(OpBuffer+obp))=now_sp;
+		obp+=sizeof(long);
+	}
+
+	//スケジュールをセット
+	obp-=sizeof(long);
+	add();
+	obp+=sizeof(long);
+}
+void CStackFrame::pop(int reg){
+	if(reg!=REG_NON) ref(reg);
+
+	now_sp+=sizeof(_int64);
+}
+void CStackFrame::pop(int xmm_reg,int varSize){
+	ref(xmm_reg,varSize);
+
+	now_sp+=sizeof(_int64);
+}
+void CStackFrame::parameter_allocate(int size){
+	if(max_parm_size<size) max_parm_size=size;
+}
+void CStackFrame::RunningSchedule(void){
+	int i;
+	int all_size;
+	all_size=GetFrameSize();
+	for(i=0;i<num;i++){
+		*((long *)(OpBuffer+pObpValues[i]))+=all_size;
+	}
+}
+
+void CStackFrame::error_check(){
+	if(now_sp){
+		SetError(300,NULL,cp);
+	}
+}
+
+//スタックフレーム管理用オブジェクトポインタ
+CStackFrame *pobj_sf;
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/BasicCompiler.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/BasicCompiler.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/BasicCompiler.cpp	(revision 178)
@@ -0,0 +1,847 @@
+#include <Program.h>
+
+#include "BasicCompiler.h"
+
+#if defined HeapAlloc
+#define MEM_MAX 65536
+LPVOID pCheckMem[MEM_MAX];
+int now;
+#undef HeapAlloc
+#undef HeapReAlloc
+LPVOID CheckHeapAlloc(HANDLE hf,DWORD dwFlags,DWORD dwBytes){
+	LPVOID ret;
+	ret=HeapAlloc(hf,dwFlags,dwBytes);
+	pCheckMem[now]=ret;
+
+	//この部分にnowのチェックを挿入
+
+	now++;
+	if(now>=MEM_MAX){
+		MessageBox(0,"pCheckMemの最大値を超えました","Check - BasicCompiler.exe",0);
+	}
+	return ret;
+}
+LPVOID CheckHeapReAlloc(HANDLE hf,DWORD dwFlags,LPVOID lpMem,DWORD dwBytes){
+	int i;
+	LPVOID ret;
+	for(i=0;;i++){
+		if(lpMem==pCheckMem[i]) break;
+		if(i>=MEM_MAX){
+			MessageBox(0,"エラー","Check - BasicCompiler.exe",0);
+			break;
+		}
+	}
+	ret=HeapReAlloc(hf,dwFlags,lpMem,dwBytes);
+	pCheckMem[i]=ret;
+	return ret;
+}
+void HeapDefaultFree(LPVOID lpMem){
+	int i;
+	for(i=0;;i++){
+		if(lpMem==pCheckMem[i]) break;
+		if(i>=MEM_MAX||lpMem==0){
+			MessageBox(0,"エラー","Check - BasicCompiler.exe",0);
+			break;
+		}
+	}
+	pCheckMem[i]=0;
+	HeapFree(hHeap,0,lpMem);
+}
+void CheckHeapCheck(){
+	int i,i2;
+	char temp[100];
+	temp[0]=0;
+	for(i=0,i2=0;i<MEM_MAX;i++){
+		if(pCheckMem[i]){
+			sprintf(temp+lstrlen(temp),"%d\r\n",i);
+			i2++;
+			if(i2==10){
+				lstrcat(temp,"これ以上の未解放が確認されています");
+				break;
+			}
+		}
+	}
+	if(temp[0]) MessageBox(0,temp,"Check - BasicCompiler.exe",0);
+}
+#define HeapAlloc CheckHeapAlloc
+#define HeapReAlloc CheckHeapReAlloc
+#else
+void HeapDefaultFree(LPVOID lpMem){
+	HeapFree(hHeap,0,lpMem);
+}
+#endif
+
+void ts(int i){
+	char temporary[255];
+	sprintf(temporary,"0x%08x",i);
+	MessageBox(0,temporary,"TestMessage",0);
+}
+void ts(int i,int i2){
+	char temporary[255];
+	sprintf(temporary,"0x%08x\r\n0x%08x",i,i2);
+	MessageBox(0,temporary,"TestMessage",0);
+}
+void ts(char *msg){
+	MessageBox(0,msg,"TestMessage",0);
+}
+void ts(char *msg,char *title){
+	MessageBox(0,msg,title,0);
+}
+
+void epi_check(){
+	//この部分にobpのチェックを挿入
+	//※例 … epi=0x41999  →  obp>=0x0999
+
+	extern int obp;
+	if(obp==1115){
+	}
+}
+
+void GetRelationalPath(char *path,char *dir){
+	//相対パスを取得
+	int i,i2,i3,i4,i5;
+	char temporary[MAX_PATH],temp2[MAX_PATH],temp3[MAX_PATH],temp4[MAX_PATH];
+
+	//ドライブ名をチェック
+	_splitpath(path,temporary,0,0,0);
+	_splitpath(dir,temp2,0,0,0);
+	if(lstrcmpi(temporary,temp2)!=0) return;
+
+	_splitpath(path,0,temporary,0,0);
+	_splitpath(dir,0,temp2,0,0);
+	i=1;i2=1;
+	while(1){
+		i4=i;
+		if(temporary[i-1]=='\\'&&temporary[i]){	//path側
+			for(i3=0;;i++,i3++){
+				if(temporary[i]=='\\'){
+					temp3[i3]=0;
+					i++;
+					break;
+				}
+				temp3[i3]=temporary[i];
+			}
+		}
+		else temp3[0]=0;
+
+		i5=i2;
+		if(temp2[i2-1]=='\\'&&temp2[i2]){		//dir側
+			for(i3=0;;i2++,i3++){
+				if(temp2[i2]=='\\'){
+					temp4[i3]=0;
+					i2++;
+					break;
+				}
+				temp4[i3]=temp2[i2];
+			}
+		}
+		else temp4[0]=0;
+
+		if(temp3[0]=='\0'&&temp4[0]=='\0'){
+			lstrcpy(temp3,".\\");
+			break;
+		}
+
+		if(lstrcmpi(temp3,temp4)!=0){
+			for(i3=0;;i5++){
+				if(temp2[i5]=='\0') break;
+				if(temp2[i5]=='\\') i3++;
+			}
+			if(i3==0) lstrcpy(temp3,".\\");
+			else{
+				temp3[0]=0;
+				for(i2=0;i2<i3;i2++) lstrcat(temp3,"..\\");
+			}
+			lstrcat(temp3,temporary+i4);
+			break;
+		}
+	}
+	_splitpath(path,0,0,temporary,temp2);
+	lstrcat(temp3,temporary);
+	lstrcat(temp3,temp2);
+	lstrcpy(path,temp3);
+}
+void GetFullPath( char *path, const string &baseDirPath ){
+	int i,i2,i3,i4;
+	char temporary[MAX_PATH];
+
+	// '/'→'\'
+	for( i=0;path[i];i++ ){
+		if( path[i] == '/' ){
+			path[i]='\\';
+		}
+	}
+
+	if(strstr(path,":")||strstr(path,"\\\\")) return;
+
+	i=0;i2=0;
+	while(1){
+		if(path[i]=='.'&&path[i+1]=='\\') i+=2;
+		if(path[i]=='.'&&path[i+1]=='.'&&path[i+2]=='\\'){
+			i2++;
+			i+=3;
+		}
+		else break;
+	}
+
+	i3=baseDirPath.size();i4=0;
+	while(i4<i2){
+		for(i3--;;i3--){
+			if(baseDirPath[i3-1]=='\\'){
+				i4++;
+				break;
+			}
+		}
+	}
+	memcpy(temporary,baseDirPath.c_str(),i3);
+	temporary[i3]=0;
+	lstrcat(temporary,path+i);
+	lstrcpy(path,temporary);
+}
+
+void ShowErrorLine(int LineNum,char *FileName){
+	HANDLE hFile;
+	DWORD dw;
+	char temporary[MAX_PATH];
+
+	if(LineNum==-1) return;
+
+	if(IsWindow(hOwnerEditor)){
+		if(FileName){
+
+			while(!IsFile(FileName)){
+				char temp2[MAX_PATH],temp3[MAX_PATH];
+				_splitpath(FileName,NULL,NULL,temp2,temp3);
+				lstrcat(temp2,temp3);
+
+				sprintf(temporary,"\"%s\" が見つかりません。格納されているディレクトリを指定してください。",temp2);
+				if(!GetFolder(hOwnerEditor,temp3,temporary)) return;
+
+				if(temp3[lstrlen(temp3)-1]!='\\') lstrcat(temp3,"\\");
+
+				sprintf(FileName,"%s%s",temp3,temp2);
+			}
+
+			hFile=CreateFile(
+				( Jenga::Common::Environment::GetAppDir() + "\\pgm.tmp" ).c_str(),
+				GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_TEMPORARY,NULL);
+			WriteFile(hFile,FileName,lstrlen(FileName),&dw,NULL);
+			CloseHandle(hFile);
+
+			SendMessage(hOwnerEditor,WM_SHOWERROR,LineNum,0);
+		}
+	}
+}
+
+BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,BOOL bOpen){
+	OPENFILENAME ofstr;
+	filename[0]=0;
+	ofstr.lStructSize=sizeof(OPENFILENAME);
+	ofstr.hwndOwner=hwnd;
+	ofstr.hInstance=0;
+	ofstr.lpstrFilter=Filter;
+	ofstr.lpstrCustomFilter=NULL;
+	ofstr.nMaxCustFilter=0;
+	ofstr.nFilterIndex=1;
+	ofstr.lpstrFile=filename;
+	ofstr.nMaxFile=MAX_PATH;
+	ofstr.lpstrFileTitle=NULL;
+	ofstr.nMaxFileTitle=0;
+	ofstr.lpstrInitialDir=0;
+	ofstr.lpstrTitle=Title;
+	ofstr.Flags=OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_PATHMUSTEXIST;
+	ofstr.nFileOffset=0;
+	ofstr.nFileExtension=0;
+	ofstr.lpstrDefExt="*";
+	ofstr.lCustData=NULL;
+	ofstr.lpfnHook=NULL;
+	ofstr.lpTemplateName=NULL;
+	if(bOpen){
+		if(!GetOpenFileName(&ofstr)) return FALSE;
+	}
+	else{
+		if(!GetSaveFileName(&ofstr)) return FALSE;
+	}
+	return TRUE;
+}
+
+LRESULT CALLBACK ErrorListProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	int i,pos;
+	int StartPos,EndPos;
+
+	switch(message){
+		case WM_CHAR:
+			if(GetKeyState(VK_CONTROL)&0x8000){
+				//アクセラレータキーの場合を考慮
+				break;
+			}
+			return 0;
+		case WM_LBUTTONDBLCLK:
+			SendMessage(hwnd,EM_GETSEL,(WPARAM)&pos,0);
+			i=(int)SendMessage(hwnd,EM_LINEFROMCHAR,pos,0);
+			ShowErrorLine(pErrorInfo[i].line,pErrorInfo[i].FileName);
+
+			StartPos=(int)SendMessage(hwnd,EM_LINEINDEX,i,0);
+			EndPos=StartPos+(int)SendMessage(hwnd,EM_LINELENGTH,pos,0);
+			SendMessage(hwnd,EM_SETSEL,StartPos,EndPos);
+			return 0;
+	}
+	return CallWindowProc(OldErrorListProc,hwnd,message,wParam,lParam);
+}
+LRESULT CALLBACK DebugListProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	switch(message){
+		case WM_CHAR:
+			if(GetKeyState(VK_CONTROL)&0x8000){
+				//アクセラレータキーの場合を考慮
+				break;
+			}
+			return 0;
+	}
+	return CallWindowProc(OldDebugListProc,hwnd,message,wParam,lParam);
+}
+void MakeMessageText(char *buffer,char *msg,int flag){
+	extern BOOL bDll;
+	char temporary[MAX_PATH];
+	if(bClipCompileView){
+		//ProjectView埋め込みがたインターフェイスのとき
+
+		//生成するファイルの相対パスを取得
+		lstrcpy(temporary,OutputFileName);
+		GetRelationalPath(temporary,BasicCurDir);
+
+		//////////
+		// 合成
+
+#if defined(JPN)
+		//日本語
+		if(flag==0){
+			if(bDll) sprintf(buffer,"DLLファイル \"%s\"     [ %s ]",temporary,msg);
+			else sprintf(buffer,"実行ファイル \"%s\"     [ %s ]",temporary,msg);
+		}
+		if(flag==1) sprintf(buffer,"\"%s\" を生成しています     [ %s ]",temporary,msg);
+		if(flag==2) lstrcpy(buffer,msg);
+#else
+		//英語
+		if(flag==0){
+			if(bDll) sprintf(buffer,"DLL file \"%s\"     [ %s ]",temporary,msg);
+			else sprintf(buffer,"Execution file \"%s\"     [ %s ]",temporary,msg);
+		}
+		if(flag==1) sprintf(buffer,"Creating \"%s\"     [ %s ]",temporary,msg);
+		if(flag==2) lstrcpy(buffer,msg);
+#endif
+	}
+	else{
+		//通常ダイアログのとき
+		lstrcpy(buffer,msg);
+	}
+}
+
+void SetPosCenter(HWND hwnd){
+	RECT OwnerRect,rect;
+	int x,y;
+
+	if(IsWindow(hOwnerEditor)) GetWindowRect(hOwnerEditor,&OwnerRect);
+	else{
+		OwnerRect.left=0;
+		OwnerRect.top=0;
+		OwnerRect.right=ScreenX;
+		OwnerRect.bottom=ScreenY;
+	}
+	GetWindowRect(hwnd,&rect);
+
+	x=((OwnerRect.right-OwnerRect.left)-(rect.right-rect.left))/2+OwnerRect.left;
+	y=((OwnerRect.bottom-OwnerRect.top)-(rect.bottom-rect.top))/2+OwnerRect.top;
+	SetWindowPos(hwnd,0,x,y,0,0,SWP_NOSIZE);
+}
+BOOL CALLBACK DlgCompile(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hDebugProcess;
+	char temporary[MAX_PATH];
+	DWORD dw;
+	RECT rect;
+	POINT pos;
+	SIZE size;
+	static POINT pos_List,pos_Progress;
+	static int height_Progress;
+
+	switch(message){
+		case WM_INITDIALOG:
+			pos=pobj_nv->MainDlgPos;
+			GetWindowRect(hwnd,&rect);
+			size.cx=rect.right-rect.left;
+			size.cy=rect.bottom-rect.top;
+			MoveWindow(hwnd,pos.x,pos.y,size.cx,size.cy,1);
+
+			lstrcpy(temporary,OutputFileName);
+			GetRelationalPath(temporary,BasicCurDir);
+			SetDlgItemText(hwnd,IDC_EXEPATH,temporary);
+
+			//"エラー無し"
+			SetDlgItemText(hwnd,IDC_ERRORLIST,STRING_NOERROR);
+
+			//"デバッグ情報無し"
+			SetDlgItemText(hwnd,IDC_DEBUGLIST,STRING_NODEBUGMSG);
+
+			//リストボックスの初期位置
+			GetWindowRect(GetDlgItem(hwnd,IDC_ERRORLIST),&rect);
+			pos_List.x=rect.left;
+			pos_List.y=rect.top;
+			ScreenToClient(hwnd,&pos_List);
+
+			//プログレスバーの初期位置と高さ
+			GetWindowRect(GetDlgItem(hwnd,IDC_PROGRESS),&rect);
+			pos_Progress.x=rect.left;
+			pos_Progress.y=rect.top;
+			ScreenToClient(hwnd,&pos_Progress);
+			height_Progress=rect.bottom-rect.top;
+
+			//バージョン表記
+			sprintf(temporary,"Version %d.%02d.%02d %s",MAJOR_VER,MINOR_VER,REVISION_VER,VER_INFO);
+			SetDlgItemText(hwnd,IDC_STATIC_VERSION,temporary);
+
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					GetDlgItemText(hwnd,IDOK,temporary,MAX_PATH);
+
+					//STRING_COMPILE = "コンパイル"
+					if(lstrcmp(temporary,STRING_COMPILE)==0){
+						GetDlgItemText(hwnd,IDC_EXEPATH,OutputFileName,MAX_PATH);
+						GetFullPath(OutputFileName,BasicCurDir);
+						CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)MainThread,0,0,&dw);
+					}
+
+					//STRING_STOP = "中断"
+					else if(lstrcmp(temporary,STRING_STOP)==0){
+						if(hDebugProcess){
+							//デバッグ中のとき
+
+							//プロセスを終了
+							TerminateProcess(hDebugProcess,0);
+							hDebugProcess=0;
+
+							//デバッグダイアログを終了
+							if(hDebugWnd){
+								DestroyWindow(hDebugWnd);
+							}
+						}
+						else{
+							//コンパイル中のとき
+							bStopCompile=1;
+
+							/* メインスレッドで「閉じる」ボタンに変更することで、
+								コンパイルを中断中の早いタイミングでも終了することが可能 */
+							//"閉じる"
+							SetDlgItemText(hwnd,IDOK,STRING_CLOSE);
+						}
+					}
+
+					else{
+						SetFocus(hOwnerEditor);
+						DestroyWindow(hwnd);
+					}
+					return 1;
+				case IDCANCEL:
+					//×ボタン用
+
+					if(hDebugProcess){
+						//デバッグ中のとき
+
+						//プロセスを終了
+						TerminateProcess(hDebugProcess,0);
+						hDebugProcess=0;
+
+						//デバッグダイアログを終了
+						if(hDebugWnd){
+							DestroyWindow(hDebugWnd);
+						}
+					}
+
+					SetFocus(hOwnerEditor);
+					DestroyWindow(hwnd);
+					return 1;
+				case IDC_SHOWERROR:
+					ShowWindow(GetDlgItem(hwnd,IDC_ERRORLIST),SW_SHOW);
+					ShowWindow(GetDlgItem(hwnd,IDC_DEBUGLIST),SW_HIDE);
+					return 1;
+				case IDC_SHOWDEBUG:
+					ShowWindow(GetDlgItem(hwnd,IDC_ERRORLIST),SW_HIDE);
+					ShowWindow(GetDlgItem(hwnd,IDC_DEBUGLIST),SW_SHOW);
+					return 1;
+			}
+			break;
+		case WM_SHOWVARLIST:
+			if(bClipCompileView){
+				//埋め込み表示
+				CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_DEBUGGER),hOwnerEditor,(DLGPROC)DlgDebugger,lParam);
+				ShowWindow(hDebugWnd,SW_SHOW);
+
+				SendMessage(hOwnerEditor,WM_SETDEBUGGERVIEW,0,(LPARAM)hDebugWnd);
+			}
+			else{
+				//ポップアップ表示
+				CreateDialogParam(hInst,MAKEINTRESOURCE(IDD_VARLIST),hOwnerEditor,(DLGPROC)DlgVarList,lParam);
+				SetForegroundWindow(hDebugWnd);
+			}
+			return 1;
+		case WM_SIZE:
+			if(bClipCompileView){
+				//エラーリストの位置
+				MoveWindow(GetDlgItem(hwnd,IDC_ERRORLIST),
+					pos_List.x,
+					pos_List.y,
+					LOWORD(lParam)-pos_List.x,
+					HIWORD(lParam)-pos_List.y,
+					1);
+
+				//デバッグリストの位置
+				MoveWindow(GetDlgItem(hwnd,IDC_DEBUGLIST),
+					pos_List.x,
+					pos_List.y,
+					LOWORD(lParam)-pos_List.x,
+					HIWORD(lParam)-pos_List.y,
+					1);
+
+				//プログレスバーの位置
+				MoveWindow(GetDlgItem(hwnd,IDC_PROGRESS),
+					pos_Progress.x,
+					pos_Progress.y,
+					LOWORD(lParam)-pos_Progress.x,
+					height_Progress,
+					1);
+			}
+			return 1;
+		case WM_DESTROY:
+			GetWindowRect(hwnd,&rect);
+
+			if(!bClipCompileView){
+				pobj_nv->MainDlgPos.x=rect.left;
+				pobj_nv->MainDlgPos.y=rect.top;
+			}
+
+			PostQuitMessage(0);
+			return 1;
+
+
+
+		///////////////////////
+		// デバッグコマンド
+		///////////////////////
+
+		case WM_DEBUG_STOP:
+			Debugger_Stop();
+			return 1;
+		case WM_DEBUG_PAUSE:
+			Debugger_Pause();
+			return 1;
+
+
+		case WM_CLOSE_DEBUGGER:
+			if(hDebugWnd){
+				DestroyWindow(hDebugWnd);
+			}
+			return 1;
+	}
+	return 0;
+}
+
+int PASCAL WinMain(HINSTANCE hThisInst,HINSTANCE hPrevInst,LPSTR lpCmdLine,int nShowCmd){
+	int i,i2;
+	char temporary[1024],temp2[MAX_PATH];
+
+	//MessageBox(0,"starting compiler/debugger","ActiveBasic",MB_OK);
+	trace( "Start ActiveBasic Compiler!" );
+
+	//コモンコントロールを初期化
+	InitCommonControls();
+
+	hHeap=GetProcessHeap();
+	ScreenX=GetSystemMetrics(SM_CXSCREEN);
+	ScreenY=GetSystemMetrics(SM_CYSCREEN);
+
+	hInst=hThisInst;
+
+	//不揮発性データを取得
+	pobj_nv=new CNonVolatile;
+	pobj_nv->load();
+
+	//ソースファイル名を取得
+	i=0;
+	if(lpCmdLine[0]!='/'){
+		if(lpCmdLine[0]=='\"'){
+			for(i=1,i2=0;;i++,i2++){
+				if(lpCmdLine[i]=='\"'){
+					SourceFileName[i2]=0;
+					break;
+				}
+				SourceFileName[i2]=lpCmdLine[i];
+				if(lpCmdLine[i]=='\0') break;
+			}
+			i++;
+			while(lpCmdLine[i]==' ') i++;
+		}
+		else{
+			for(i=0;;i++){
+				if(lpCmdLine[i]==' '){
+					SourceFileName[i]=0;
+					break;
+				}
+				SourceFileName[i]=lpCmdLine[i];
+				if(lpCmdLine[i]=='\0') break;
+			}
+			while(lpCmdLine[i]==' ') i++;
+		}
+	}
+
+	BOOL bFromEditor=0;
+	bDll=0;
+	OutputFileName[0]=0;
+	if(lpCmdLine[i]&&lpCmdLine[i]!='/'){
+		if(lpCmdLine[i]=='\"'){
+			for(i++,i2=0;;i++,i2++){
+				if(lpCmdLine[i]=='\"'){
+					OutputFileName[i2]=0;
+					break;
+				}
+				OutputFileName[i2]=lpCmdLine[i];
+				if(lpCmdLine[i]=='\0') break;
+			}
+			i++;
+			while(lpCmdLine[i]==' ') i++;
+		}
+		else{
+			for(i2=0;;i++,i2++){
+				if(lpCmdLine[i]==' '){
+					OutputFileName[i2]=0;
+					break;
+				}
+				OutputFileName[i2]=lpCmdLine[i];
+				if(lpCmdLine[i]=='\0') break;
+			}
+			while(lpCmdLine[i]==' ') i++;
+		}
+	}
+
+	KillSpaces(lpCmdLine+i,temporary);
+	i=0;
+	while(temporary[i]=='/'){
+		for(i++,i2=0;;i++,i2++){
+			if(temporary[i]=='/'){
+				temp2[i2]=0;
+				break;
+			}
+			if(temporary[i]==':'){
+				temp2[i2]=0;
+				break;
+			}
+			temp2[i2]=temporary[i];
+			if(temporary[i]=='\0') break;
+		}
+
+		char temp3[MAX_PATH];
+		if(temporary[i]==':'){
+			i++;
+			if(temporary[i]=='\"'){
+				for(i++,i2=0;;i++,i2++){
+					if(temporary[i]=='\"'){
+						temp3[i2]=0;
+						RemoveStringQuotes(temp3);
+						i++;
+						break;
+					}
+					temp3[i2]=temporary[i];
+					if(temporary[i]=='\0') break;
+				}
+			}
+			else{
+				for(i2=0;;i++,i2++){
+					if(temporary[i]=='/'){
+						temp3[i2]=0;
+						break;
+					}
+					if(temporary[i]==':'){
+						temp3[i2]=0;
+						break;
+					}
+					temp3[i2]=temporary[i];
+					if(temporary[i]=='\0') break;
+				}
+			}
+		}
+		else temp3[0]=0;
+
+
+		/////////////////////////
+		// コマンドラインを調査
+		/////////////////////////
+
+		//ウィンドウハンドル
+		if(lstrcmp(temp2,"wnd")==0){
+			bFromEditor=1;
+
+			if(temp3[0]) sscanf(temp3,"%08x",&hOwnerEditor);
+		}
+
+		//デバッグコンパイル
+		else if(lstrcmp(temp2,"debug")==0) bDebugCompile=1;
+
+		//デバッグ実行
+		else if(lstrcmp(temp2,"run")==0) bDebugRun=1;
+
+		//デバッグ実行（アタッチする）
+		else if(lstrcmp(temp2,"attach")==0){
+			bDebugRun=1;
+			bAttach=1;
+
+			if(temp3[0]) sscanf(temp3,"%08x",&dwAttachProcessId);
+		}
+
+		//DLL生成
+		else if(lstrcmp(temp2,"dll")==0) bDll=1;
+
+		//Unicode
+		else if( lstrcmp( temp2, "unicode" ) ==0 ){
+			isUnicode = true;
+			typeOfPtrChar = MAKE_PTR_TYPE(DEF_WORD,1);
+			typeOfPtrUChar = MAKE_PTR_TYPE(DEF_WORD,1);
+		}
+
+		//埋め込み型コンパイラビュー
+		else if(lstrcmp(temp2,"clip_compile_view")==0) bClipCompileView=1;
+
+		//インクルードディレクトリ
+		else if(lstrcmp(temp2,"include_dir")==0){
+			lstrcpy(szIncludeDir,temp3);
+		}
+	}
+
+	//ソースファイル名が与えられなかったとき
+	if(SourceFileName[0]=='\0'){
+		if(!GetFilePathDialog(0,SourceFileName,BasicFileFilter,"コンパイルするファイルを指定して下さい",1))
+			return 0;
+	}
+
+	//出力ファイル名が与えられなかったとき
+	if(OutputFileName[0]=='\0'){
+		_splitpath(SourceFileName,OutputFileName,temporary,temp2,0);
+		lstrcat(OutputFileName,temporary);
+		lstrcat(OutputFileName,temp2);
+		if(bDebugCompile||bDebugRun) lstrcat(OutputFileName,"_debug.exe");
+		else lstrcat(OutputFileName,".exe");
+	}
+
+	//インクルードディレクトリが指定されなかったとき
+	if(szIncludeDir[0]=='\0'){
+		lstrcpy(szIncludeDir,".\\Include\\");
+	}
+
+	//インクルードディレクトリを絶対パスに変更
+	GetFullPath(szIncludeDir,(Jenga::Common::Environment::GetAppDir()+"\\").c_str());
+
+	if(bDll){
+		//DLLファイル名を取得
+		_splitpath(OutputFileName,NULL,NULL,szDllName,temporary);
+		lstrcat(szDllName,temporary);
+	}
+
+	if(bDebugRun){
+		//コマンドライン、DLLの実行可能アプリケーションを取得
+		HANDLE hFile;
+		DWORD dwAccessBytes;
+		hFile=CreateFile(
+			( Jenga::Common::Environment::GetAppDir() + "\\pgm.tmp" ).c_str(),
+			GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		if(hFile!=INVALID_HANDLE_VALUE){
+			ReadFile(hFile,temporary,MAX_PATH,&dwAccessBytes,NULL);
+			CloseHandle(hFile);
+			temporary[dwAccessBytes]=0;
+		}
+		else temporary[0]=0;
+
+		for(i=0;;i++){
+			if(temporary[i]=='\r'&&temporary[i+1]=='\n'||temporary[i]=='\0'){
+				szDebugExeForDll[i]=0;
+				break;
+			}
+			szDebugExeForDll[i]=temporary[i];
+		}
+		if(temporary[i]){
+			lstrcpy(szDebugCmdLine,temporary+i+2);
+		}
+	}
+
+	_splitpath(SourceFileName,BasicCurDir,temporary,NULL,NULL);
+	lstrcat(BasicCurDir,temporary);
+
+	//エラーリスト情報を初期化
+	pErrorInfo=(ERRORINFO *)HeapAlloc(hHeap,0,1);
+	ErrorNum=0;
+	CompileMsgNum=0;
+	WarningNum=0;
+	bError=0;
+
+	if(bClipCompileView){
+		//ProjectEditor埋め込み型インターフェイス
+		hMainDlg=CreateDialog(hInst,MAKEINTRESOURCE(IDD_CLIPMAIN),hOwnerEditor,(DLGPROC)DlgCompile);
+		ShowWindow(hMainDlg,SW_SHOW);
+		SendMessage(hOwnerEditor,WM_SETCOMPILEVIEW,0,(LPARAM)hMainDlg);
+
+		//プログレスバーの色をセットする
+		PostMessage(GetDlgItem(hMainDlg,IDC_PROGRESS),PBM_SETBARCOLOR,0,RGB(255,220,192));
+		PostMessage(GetDlgItem(hMainDlg,IDC_PROGRESS),PBM_SETBKCOLOR,0,RGB(255,255,255));
+	}
+	else{
+		//通常ダイアログインターフェイス
+		hMainDlg=CreateDialog(hInst,MAKEINTRESOURCE(IDD_MAIN),hOwnerEditor,(DLGPROC)DlgCompile);
+
+#ifdef _DEBUG
+		// VC++によるデバッグの場合は画面を出さない
+		// ※別スレッドのウィンドウ ループとの不整合性がデッドロックを生む場合がある（特にステップ実行時など）
+		PostMessage( hMainDlg, WM_COMMAND, IDOK, 0 );
+#else
+		ShowWindow(hMainDlg,SW_SHOW);
+#endif
+	}
+	SendDlgItemMessage(hMainDlg,IDC_SHOWERROR,BM_SETCHECK,BST_CHECKED,0);
+
+	//エラーリストをサブクラス化
+	OldErrorListProc=(WNDPROC)GetWindowLongPtr(GetDlgItem(hMainDlg,IDC_ERRORLIST),GWLP_WNDPROC);
+	SetWindowLongPtr(GetDlgItem(hMainDlg,IDC_ERRORLIST),GWLP_WNDPROC,(LONG_PTR)ErrorListProc);
+
+	//デバッグリストをサブクラス化
+	OldDebugListProc=(WNDPROC)GetWindowLongPtr(GetDlgItem(hMainDlg,IDC_DEBUGLIST),GWLP_WNDPROC);
+	SetWindowLongPtr(GetDlgItem(hMainDlg,IDC_DEBUGLIST),GWLP_WNDPROC,(LONG_PTR)DebugListProc);
+
+	if(bFromEditor) SendMessage(hMainDlg,WM_COMMAND,IDOK,0);
+
+	MSG msg;
+	while(GetMessage(&msg,0,0,0)){
+		if(IsDialogMessage(hMainDlg,&msg)) continue;
+		TranslateMessage(&msg);
+		DispatchMessage(&msg);
+	}
+
+	//エラーリスト情報を解放
+	for(i=0;i<ErrorNum;i++){
+		if(pErrorInfo[i].FileName) HeapDefaultFree(pErrorInfo[i].FileName);
+	}
+	HeapDefaultFree(pErrorInfo);
+
+	//不揮発性データを保存
+	pobj_nv->save();
+	delete pobj_nv;
+	pobj_nv=0;
+
+#if defined HeapAlloc
+	CheckHeapCheck();
+#endif
+
+	if(bClipCompileView){
+		SendMessage(hOwnerEditor,WM_DESTROYCOMPILEVIEW,0,0);
+	}
+
+	trace("Complete ActiveBasic Compiler!");
+
+
+	return 0;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/BasicCompiler.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/BasicCompiler.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/BasicCompiler.h	(revision 178)
@@ -0,0 +1,91 @@
+#include "../BasicCompiler_Common/common.h"
+
+LPSTR BasicFileFilter="プログラム ファイル(*.ab;*.bas;*.abp;*.sbp)\0*.ab;*.bas;*.abp;*sbp\0テキスト ファイル(*.txt)\0*.txt\0すべてのファイル(*.*)\0*\0\0";
+LPSTR ExeFileFilter="実行可能ファイル(*.exe)\0*.exe\0すべてのファイル(*.*)\0*\0\0";
+
+HINSTANCE hInst;
+HWND hOwnerEditor;
+HWND hMainDlg;
+HWND hDebugWnd;
+HANDLE hHeap;
+int ScreenX,ScreenY;
+WNDPROC OldErrorListProc,OldDebugListProc;
+WNDPROC OldThreadComboProc;
+WNDPROC OldProcComboProc;
+unsigned short TypeOfSubSystem;
+BOOL bClipCompileView;
+
+//不揮発性データ（レジストリに保存される）
+CNonVolatile *pobj_nv;
+
+//プログラム情報
+BOOL bStrict;
+DWORD ImageBase;
+INCLUDEFILEINFO IncludeFileInfo;
+GlobalProc **ppSubHash;
+int SubNum;
+char **ppMacroNames;
+int MacroNum;
+DllProc **ppDeclareHash;
+CONSTINFO **ppConstHash;
+
+ERRORINFO *pErrorInfo;
+int ErrorNum;
+int CompileMsgNum;
+int WarningNum;
+BOOL bError;
+char **SynonymErrorWords;
+int SynonymErrorNum;
+BOOL bStopCompile;
+
+//リソース情報
+char ResourceFileName[MAX_PATH];
+RESOURCEDATAINFO *pCursorResourceInfo;
+int CursorResourceNum;
+RESOURCEDATAINFO *pBitmapResourceInfo;
+int BitmapResourceNum;
+RESOURCEDATAINFO *pIconResourceInfo;
+int IconResourceNum;
+char szManifestPath[MAX_PATH];
+int XPManiResourceNum;
+
+//デバッグ
+BOOL bDebugCompile=0;
+BOOL bDebugRun=0;
+BOOL bAttach=0;
+DWORD dwAttachProcessId;
+BOOL bDebugSupportProc;
+BOOL bSystemProc;
+DWORD dwStepRun;
+double width_ratio_VarList=0.3;
+HWND hDebuggerToolbar;
+char szDebugCmdLine[1024];
+char szDebugExeForDll[1024];
+
+//デバッグ用行番号情報
+LINEINFO *pLineInfo;
+int MaxLineInfoNum;
+
+//ウォッチリスト
+int width_WatchColumn_Expression=200;
+int width_WatchColumn_Value=400;
+
+
+//関数ポインタのベース タイプ インデックス（左辺の関数ポインタのパラメータを参考に、オーバーロードを解決）
+LONG_PTR ProcPtr_BaseIndex;
+
+
+int cp;
+
+BOOL bDll;
+bool isUnicode = false;
+int typeOfPtrChar = MAKE_PTR_TYPE(DEF_SBYTE,1);
+int typeOfPtrUChar = MAKE_PTR_TYPE(DEF_BYTE,1);
+
+char *basbuf;
+
+char BasicCurDir[MAX_PATH];		//コンパイルするファイルが存在するディレクトリ
+char SourceFileName[MAX_PATH];
+char OutputFileName[MAX_PATH];
+char szDllName[MAX_PATH];
+char szIncludeDir[MAX_PATH]="";
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/BasicFixed.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/BasicFixed.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/BasicFixed.h	(revision 178)
@@ -0,0 +1,199 @@
+//BasicFixed.h
+
+
+////////////////
+// マシンタイプ
+////////////////
+
+#define MACHINE_X86		1
+#define MACHINE_AMD64	2
+
+
+////////////////
+// 型
+////////////////
+
+#define DEF_NON			-1
+
+/* basic\command.sbp内の "_System_Type_***" 定数と同期が必要 */
+#define FLAG_PTR		0x80000000
+#define FLAG_CAST		0x40000000
+
+//整数型
+#define DEF_SBYTE		0x00000001
+#define DEF_BYTE		0x00000002
+#define DEF_INTEGER		0x00000003
+#define DEF_WORD		0x00000004
+#define DEF_LONG		0x00000005
+#define DEF_DWORD		0x00000006
+#define DEF_INT64		0x00000007
+#define DEF_QWORD		0x00000008
+
+//実数型
+#define DEF_SINGLE		0x00000009
+#define DEF_DOUBLE		0x0000000A
+
+//文字型
+#define DEF_CHAR		0x0000000B
+
+//bool型
+#define DEF_BOOLEAN		0x0000000C
+
+//文字列型
+#define DEF_STRING		0x0000000D
+
+//ポインタ型
+#define DEF_PTR_VOID	0x0000000E
+#define DEF_PTR_PROC	0x0000000F
+
+//特殊型
+#define DEF_ANY			0x00000015
+#define DEF_OBJECT		0x00000016
+#define DEF_STRUCT		0x00000017
+#define DEF_ELLIPSE		0x00000018
+
+//ポインタ型
+#define MASK_PTR		0x0000ff00
+#define MASK_NATURAL	0x000000ff
+
+#define PTR_LEVEL(t)	(((t)&MASK_PTR)>>8)
+#define NATURAL_TYPE(t)	((t)&MASK_NATURAL)
+#define MAKE_PTR_TYPE(t,p)	((t)|((p)<<8))
+#define PTR_LEVEL_UP(t)		t = MAKE_PTR_TYPE(NATURAL_TYPE(t),PTR_LEVEL(t)+1)
+#define PTR_LEVEL_DOWN(t)	t = MAKE_PTR_TYPE(NATURAL_TYPE(t),PTR_LEVEL(t)-1)
+
+#define DEF_PTR_OBJECT	MAKE_PTR_TYPE(DEF_OBJECT,1)
+#define DEF_PTR_STRUCT	MAKE_PTR_TYPE(DEF_STRUCT,1)
+
+
+
+//NumOpe関数の結果がリテラル値の場合、その値の補助情報がindexに格納される
+#define LITERAL_NULL		-2
+#define LITERAL_M128_0		-3
+#define LITERAL_0_255		-4
+#define LITERAL_M32768_0	-5
+#define LITERAL_0_65535		-6
+#define LITERAL_OTHER_MINUS	-7
+#define LITERAL_OTHER_PLUS	-8
+
+#define LITERAL_STRING		-9
+
+#define IS_LITERAL(x) (x<=LITERAL_NULL&&x!=LITERAL_STRING)
+#define IS_MINUS_LITERAL(x) (x==LITERAL_M128_0||x==LITERAL_M32768_0||x==LITERAL_OTHER_MINUS)
+#define IS_POSITIVE_LITERAL(x) (x==LITERAL_NULL||x==LITERAL_0_255||x==LITERAL_0_65535||x==LITERAL_OTHER_PLUS)
+
+//////////////////////////////////////
+/* 演算子（優先順位が関係している） */
+//////////////////////////////////////
+
+//論理演算子
+#define CALC_XOR			3	// Xor
+#define CALC_OR				6	// Or
+#define CALC_AND			9	// And
+#define CALC_NOT			12	// Not
+
+//比較演算子
+#define CALC_PE				21	// <=
+#define CALC_QE				22	// >=
+#define CALC_NOTEQUAL		23	// <>
+#define CALC_EQUAL			24	// =
+#define CALC_P				25	// <
+#define CALC_Q				26	// >
+
+//算術演算子
+#define CALC_SHL			31	//<<
+#define CALC_SHR			32	//>>
+#define CALC_ADDITION		41	// +
+#define CALC_SUBTRACTION	42	// -
+#define CALC_STRPLUS		43	// &
+#define CALC_MOD			51	// Mod
+#define CALC_PRODUCT		61	// *
+#define CALC_QUOTIENT		62	// /
+#define CALC_INTQUOTIENT	63	//整数除算
+#define CALC_AS				71	// As
+#define CALC_BYVAL			72	// ByVal
+#define CALC_MINUSMARK		81	// -x
+#define CALC_POWER			91	// ^
+
+//代入演算子
+#define CALC_SUBSITUATION	200
+
+//添え字演算子
+#define CALC_ARRAY_GET		201
+#define CALC_ARRAY_SET		202
+
+
+//////////////////////////////////////////////////////////////////////
+// エスケープシーケンス用のバイトコードは0xA0～0xCFの範囲も利用できる
+//////////////////////////////////////////////////////////////////////
+
+//以下制御用エスケープシーケンス
+#define ESC_MOD				'1'		// MOD 演算子
+#define ESC_AND				'&'		// AND 演算子
+#define ESC_OR				'3'		// OR 演算子
+#define ESC_XOR				'4'		// XOR 演算子
+#define ESC_NOT				'5'		// NOT 演算子
+#define ESC_AS				'6'		// AS（区切り文字）
+#define ESC_THEN			2		// Then
+#define ESC_ELSE			3		// Else
+#define ESC_IF				'A'		// If
+#define ESC_ELSEIF			'B'		// ElseIf
+#define ESC_ENDIF			'C'		// End If
+#define ESC_DEF				'D'		// Def
+#define ESC_DECLARE			'E'		// Declare
+#define ESC_SUB				'F'		// Sub
+#define ESC_ENDSUB			'G'		// End Sub
+#define ESC_EXITSUB			'H'		// Exit Sub
+#define ESC_FUNCTION		'I'		// Function
+#define ESC_ENDFUNCTION		'J'		// End Function
+#define ESC_EXITFUNCTION	'K'		// Exit Function
+#define ESC_BYVAL			'L'		// ByVal
+#define ESC_BYREF			'M'		// ByRef
+#define ESC_TYPE			'N'		// Type
+#define ESC_ENDTYPE			'O'		// End Type
+#define ESC_EXITFOR			'P'		// Exit For
+#define ESC_EXITWHILE		'Q'		// Exit Wend
+#define ESC_EXITDO			'R'		// Exit Do
+#define ESC_SELECTCASE		'S'		// Select Case
+#define ESC_CASE			'T'		// Case
+#define ESC_CASEELSE		'U'		// Case Else
+#define ESC_ENDSELECT		'V'		// End Select
+#define ESC_CONST			'W'		// Const
+#define ESC_WITH			'X'		// With
+#define ESC_ENDWITH			'Y'		// End With
+#define ESC_CDECL			'Z'		// cdecl規約
+#define ESC_MACRO			'a'		// Macro
+#define ESC_ENDMACRO		'b'		// End Macro
+#define ESC_EXITMACRO		'c'		// Exit Macro
+#define ESC_EXPORT			'd'		// Export
+#define ESC_CONTINUE		'e'		// Continue
+#define ESC_PSMEM			'f'		// "->" Member of Pointer Struct（構造体ポインタのメンバ参照）
+#define ESC_STATIC			'g'		// Static
+#define ESC_TYPEDEF			'h'		// TypeDef
+#define ESC_TRY				'i'		// Try
+#define ESC_CATCH			'j'		// Catch
+#define ESC_FINALLY			'k'		// Finally
+#define ESC_THROW			'l'		// Throw
+#define ESC_ENDTRY			'm'		// End Try
+#define ESC_NAMESPACE		'o'		// Namespace
+#define ESC_ENDNAMESPACE	'p'		// End Namespace
+#define ESC_IMPORTS			'q'		// Imports
+#define ESC_CLEARNAMESPACEIMPORTED 'r'	// _ClearNamespaceImported
+//EXEファイル用制御エスケープシーケンス
+#define ESC_USING			's'		// Print命令語のUsing
+#define ESC_FOR				't'		// Open命令語のFor
+#define ESC_LINENUM			'u'		// 行番号を示す
+
+//オブジェクト指向エスケープシーケンス
+#define ESC_CLASS			(char)0xA0
+#define ESC_ENDCLASS		(char)0xA1
+#define ESC_ABSTRACT		(char)0xA2
+#define ESC_VIRTUAL			(char)0xA3
+#define ESC_OVERRIDE		(char)0xA4
+#define ESC_INHERITS		(char)0xA5
+#define ESC_ENUM			(char)0xA6
+#define ESC_ENDENUM			(char)0xA7
+#define ESC_NEW				(char)0xA8
+#define ESC_INTERFACE		(char)0xA9
+#define ESC_ENDINTERFACE	(char)0xAA
+#define ESC_OPERATOR		(char)0xAB
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/BreakPoint.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/BreakPoint.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/BreakPoint.cpp	(revision 178)
@@ -0,0 +1,187 @@
+#include <jenga/include/common/Environment.h>
+
+#include "common.h"
+
+//////////////////////////
+// ブレークポイント
+//////////////////////////
+
+CDBBreakPoint *pobj_DBBreakPoint;
+
+CFileBreakPoint::CFileBreakPoint(char *lpszFileName,int iLineNum){
+	this->lpszFileName=(char *)HeapAlloc(hHeap,0,lstrlen(lpszFileName)+1);
+	lstrcpy(this->lpszFileName,lpszFileName);
+
+	piLine=(int *)HeapAlloc(hHeap,0,sizeof(int));
+	piLine[0]=iLineNum;
+	num=1;
+}
+CFileBreakPoint::~CFileBreakPoint(){
+	HeapDefaultFree(lpszFileName);
+	HeapDefaultFree(piLine);
+}
+void CFileBreakPoint::add(int iLineNum){
+	piLine=(int *)HeapReAlloc(hHeap,0,piLine,(num+1)*sizeof(int));
+	piLine[num]=iLineNum;
+	num++;
+}
+void CFileBreakPoint::remove(int iLineNum){
+	int i;
+	for(i=0;i<num;i++){
+		if(iLineNum==piLine[i]) break;
+	}
+	if(i==num) return;
+
+	num--;
+	for(;i<num;i++){
+		piLine[i]=piLine[i+1];
+	}
+}
+
+void CFileBreakPoint::update(char *OpBuffer){
+	extern INCLUDEFILEINFO IncludeFileInfo;
+
+	int FileNum;
+	for(FileNum=0;FileNum<IncludeFileInfo.FilesNum;FileNum++){
+		if(lstrcmpi(IncludeFileInfo.ppFileNames[FileNum],lpszFileName)==0) break;
+	}
+	if(FileNum==IncludeFileInfo.FilesNum) return;
+
+	int i;
+	for(i=0;;i++){
+		if(IncludeFileInfo.LineOfFile[i]==FileNum||
+			IncludeFileInfo.LineOfFile[i]==-1) break;
+	}
+	if(IncludeFileInfo.LineOfFile[i]==-1) return;
+
+	int FileBaseLine;
+	FileBaseLine=i;
+
+	int i2,nCount=0;
+	for(i2=0;;i2++){
+		if(IncludeFileInfo.LineOfFile[FileBaseLine+i2]==-1){
+			//ソースコードの終端行
+			break;
+		}
+
+		if(i2==piLine[nCount]){
+			extern int MaxLineInfoNum;
+			extern LINEINFO *pLineInfo;
+
+loop:
+			int tempCp;
+			tempCp=GetCpFromLine(FileBaseLine+i2);
+
+			int i3;
+			for(i3=0;i3<MaxLineInfoNum-1;i3++){
+				if(pLineInfo[i3].TopCp==tempCp) break;
+			}
+			if(i3==MaxLineInfoNum-1){
+				i2--;
+				goto loop;
+			}
+
+			OpBuffer[pLineInfo[i3].TopObp]=(char)0xCC;
+
+			nCount++;
+			if(nCount>=num) break;
+		}
+	}
+}
+
+
+CDBBreakPoint::CDBBreakPoint(){
+	ppItem=(CFileBreakPoint **)HeapAlloc(hHeap,0,1);
+	num=0;
+
+	char *buffer;
+	buffer=(char *)HeapAlloc(hHeap,0,65535);
+
+	HANDLE hFile=CreateFile(
+		( Jenga::Common::Environment::GetAppDir() + "\\ab_breakpoint.tmp" ).c_str(),
+		GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile!=INVALID_HANDLE_VALUE){
+		DWORD dwAccBytes;
+		ReadFile(hFile,buffer,MAX_PATH,&dwAccBytes,NULL);
+		CloseHandle(hFile);
+		buffer[dwAccBytes]=0;
+	}
+	else buffer[0]=0;
+
+	int i=0,i2;
+	char szFilePath[MAX_PATH];
+	while(buffer[i]){
+		//ファイルパス
+		i=GetOneParameter(buffer,i,szFilePath);
+		RemoveStringQuotes(szFilePath);
+
+		while(buffer[i]!='\n'&&buffer[i]!='\0'){
+			//行番号
+			char temporary[1024];
+			i=GetOneParameter(buffer,i,temporary);
+			i2=atoi(temporary);
+
+			insert(szFilePath,i2);
+		}
+
+		while(buffer[i]=='\n') i++;
+
+		if(buffer[i]=='\0') break;
+	}
+
+	HeapDefaultFree(buffer);
+}
+CDBBreakPoint::~CDBBreakPoint(){
+	int i;
+	for(i=0;i<num;i++){
+		delete ppItem[i];
+	}
+	HeapDefaultFree(ppItem);
+}
+void CDBBreakPoint::insert(char *lpszFileName,int iLineNum){
+	int i;
+	for(i=0;i<num;i++){
+		if(lstrcmpi(ppItem[i]->lpszFileName,lpszFileName)==0){
+			ppItem[i]->add(iLineNum);
+			return;
+		}
+	}
+
+	if(i==num){
+		ppItem=(CFileBreakPoint **)HeapReAlloc(hHeap,0,ppItem,(num+1)*sizeof(CFileBreakPoint *));
+		ppItem[num]=new CFileBreakPoint(lpszFileName,iLineNum);
+		num++;
+	}
+}
+void CDBBreakPoint::remove(char *lpszFileName,int iLineNum){
+	int i;
+	for(i=0;i<num;i++){
+		if(lstrcmpi(lpszFileName,ppItem[i]->lpszFileName)==0){
+			ppItem[i]->remove(iLineNum);
+			break;
+		}
+	}
+	if(i==num) return;
+
+	if(ppItem[i]->num==0){
+		delete ppItem[i];
+
+		num--;
+		for(;i<num;i++){
+			ppItem[i]=ppItem[i+1];
+		}
+	}
+}
+
+char *CDBBreakPoint::update(char *OpBuffer,int SizeOf_CodeSection){
+	char *buffer;
+	buffer=(char *)HeapAlloc(hHeap,0,SizeOf_CodeSection);
+	memcpy(buffer,OpBuffer,SizeOf_CodeSection);
+
+	int i;
+	for(i=0;i<num;i++){
+		ppItem[i]->update(buffer);
+	}
+
+	return buffer;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/BreakPoint.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/BreakPoint.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/BreakPoint.h	(revision 178)
@@ -0,0 +1,34 @@
+
+
+class CFileBreakPoint{
+public:
+	char *lpszFileName;
+
+	int *piLine;
+	int num;
+
+	CFileBreakPoint(char *lpszFileName,int iLineNum);
+	~CFileBreakPoint();
+
+	void add(int iLineNum);
+	void remove(int iLineNum);
+
+	void update(char *OpBuffer);
+};
+
+class CDBBreakPoint{
+	CFileBreakPoint **ppItem;
+	int num;
+
+public:
+	CDBBreakPoint();
+	~CDBBreakPoint();
+
+	void insert(char *lpszFileName,int iLineNum);
+	void remove(char *lpszFileName,int iLineNum);
+
+	char *update(char *OpBuffer,int SizeOf_CodeSection);
+};
+
+
+extern CDBBreakPoint *pobj_DBBreakPoint;
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/CDebugThreadInfo.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/CDebugThreadInfo.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/CDebugThreadInfo.cpp	(revision 178)
@@ -0,0 +1,109 @@
+#include "common.h"
+
+
+//デバッグ用
+#include "../BasicCompiler_Common/debug.h"
+
+
+extern HANDLE hDebugProcess;
+
+CDebugThreadInfo *pobj_dti;
+
+CDebugThreadInfo::CDebugThreadInfo(){
+	memset(this,0,sizeof(CDebugThreadInfo));
+}
+CDebugThreadInfo::~CDebugThreadInfo(){
+	Free();
+}
+
+BOOL CDebugThreadInfo::Reflesh(int ThreadNum){
+	Free();
+
+	ULONG_PTR lpData;
+	ULONG_PTR lpAccBytes;
+
+	DWORD dwRWSectionPos;
+	dwRWSectionPos=pobj_DBDebugSection->ppobj_ds[0]->dwImageBase+
+						pobj_DBDebugSection->ppobj_ds[0]->dwRVA_RWSection;
+
+	ReadProcessMemory(hDebugProcess,
+		(void *)(dwRWSectionPos+sizeof(DWORD)*256+ThreadNum*sizeof(DWORD)),
+		&iProcLevel,
+		sizeof(DWORD),&lpAccBytes);
+	lplpObp=(ULONG_PTR *)HeapAlloc(hHeap,0,(iProcLevel+1)*sizeof(ULONG_PTR));
+	lplpSpBase=(ULONG_PTR *)HeapAlloc(hHeap,0,(iProcLevel+1)*sizeof(ULONG_PTR));
+	lpdwCp=(DWORD *)HeapAlloc(hHeap,0,(iProcLevel+1)*sizeof(DWORD));
+
+	//lplpObp
+	ReadProcessMemory(hDebugProcess,
+		(void *)(dwRWSectionPos+sizeof(DWORD)*256*2+ThreadNum*sizeof(DWORD)),
+		&lpData,
+		sizeof(ULONG_PTR),&lpAccBytes);
+	ReadProcessMemory(hDebugProcess,
+		(void *)lpData,
+		lplpObp,
+		(iProcLevel+1)*sizeof(ULONG_PTR),&lpAccBytes);
+
+	//lplpSpBase
+	ReadProcessMemory(hDebugProcess,
+		(void *)(dwRWSectionPos+sizeof(DWORD)*256*2+sizeof(ULONG_PTR)*256+ThreadNum*sizeof(ULONG_PTR)),
+		&lpData,
+		sizeof(ULONG_PTR),&lpAccBytes);
+	ReadProcessMemory(hDebugProcess,
+		(void *)lpData,
+		lplpSpBase,
+		(iProcLevel+1)*sizeof(ULONG_PTR),&lpAccBytes);
+
+	//現在の実行情報
+	CONTEXT Context;
+	Context.ContextFlags=CONTEXT_CONTROL;
+	GetThreadContext(array_hDebugThread[ThreadNum],&Context);
+
+
+	//マッピングされているモジュールのイメージベースを取得
+	HMODULE array_hModule[1024];
+	DWORD cbReturned;
+	if(!EnumProcessModules( hDebugProcess, array_hModule, sizeof(HMODULE)*1024, &cbReturned )) return 0;
+
+	int i;
+	HMODULE hTargetModule=0;
+	for(i=0;i<(int)(cbReturned/sizeof(HMODULE));i++){
+		if((LONG_PTR)array_hModule[i]<=(LONG_PTR)EIP_RIP(Context)){
+			if(hTargetModule<array_hModule[i]) hTargetModule=array_hModule[i];
+		}
+	}
+
+	extern DWORD ImageBase;
+	if((HMODULE)(ULONG_PTR)ImageBase!=hTargetModule){
+		for(i=0;i<pobj_DBDebugSection->num;i++){
+			if((HMODULE)(ULONG_PTR)pobj_DBDebugSection->ppobj_ds[i]->dwImageBase==hTargetModule){
+				pobj_DBDebugSection->choice(i);
+				break;
+			}
+		}
+	}
+
+
+
+	extern int MemPos_CodeSection;
+	extern int FileSize_CodeSection;
+
+	if(ImageBase+MemPos_CodeSection <= EIP_RIP(Context) &&
+		EIP_RIP(Context) < ImageBase+MemPos_CodeSection+FileSize_CodeSection){
+		lplpObp[iProcLevel]=EIP_RIP(Context);
+		lplpSpBase[iProcLevel]=SP_BASE(Context);
+	}
+	//else API関数内などの場合は既存の lplpObp[iProcLevel] を利用する
+
+	return 1;
+}
+
+void CDebugThreadInfo::Free(void){
+	if(lplpObp){
+		HeapDefaultFree(lplpObp);
+		HeapDefaultFree(lplpSpBase);
+		HeapDefaultFree(lpdwCp);
+	}
+
+	memset(this,0,sizeof(CDebugThreadInfo));
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Class.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Class.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Class.cpp	(revision 178)
@@ -0,0 +1,1696 @@
+#include "common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+Classes *pobj_DBClass;
+
+const CClass *pobj_CompilingClass;
+
+CMember *pCompilingMethod;
+
+
+CClass::CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name )
+	: isReady( false )
+	, Prototype( namespaceScopes, name )
+	, importedNamespaces( importedNamespaces )
+	, ConstructorMemberSubIndex( 0 )
+	, DestructorMemberSubIndex( 0 )
+	, classType( Class )
+	, pobj_InheritsClass( NULL )
+	, vtblNum( 0 )
+	, iAlign( 0 )
+	, vtbl_offset( -1 )
+	, isCompilingConstructor( false )
+	, isCompilingDestructor( false )
+	, pobj_NextClass( NULL )
+{
+}
+CClass::~CClass(){
+	// 動的メンバ
+	foreach( CMember *member, dynamicMembers ){
+		delete member;
+	}
+
+	// 静的メンバ
+	foreach( CMember *member, staticMembers ){
+		delete member;
+	}
+}
+
+bool CClass::IsInheritsInterface( const CClass *pInterfaceClass ) const
+{
+	BOOST_FOREACH( const InheritedInterface &objInterface, interfaces ){
+		if( pInterfaceClass == &objInterface.GetInterfaceClass() ){
+			return true;
+		}
+	}
+	return false;
+}
+
+bool CClass::IsClass() const
+{
+	return classType == CClass::Class;
+}
+bool CClass::IsInterface() const
+{
+	return classType == CClass::Interface;
+}
+bool CClass::IsEnum() const
+{
+	return classType == CClass::Enum;
+}
+bool CClass::IsDelegate() const
+{
+	return classType == CClass::Delegate;
+}
+bool CClass::IsStructure() const
+{
+	return classType == CClass::Structure;
+}
+
+bool CClass::Inherits( const char *inheritNames, int nowLine ){
+	int i = 0;
+	bool isInheritsClass = false;
+	while( true ){
+
+		char temporary[VN_SIZE];
+		for( int i2=0;; i++, i2++ ){
+			if( inheritNames[i] == '\0' || inheritNames[i] == ',' ){
+				temporary[i2] = 0;
+				break;
+			}
+			temporary[i2] = inheritNames[i];
+		}
+
+		//継承元クラスを取得
+		const CClass *pInheritsClass = pobj_DBClass->Find(temporary);
+		if( !pInheritsClass ){
+			SetError(106,temporary,nowLine);
+			return false;
+		}
+
+		if( pInheritsClass->IsInterface() ){
+			// インターフェイスはあとで継承する
+		}
+		else if( pInheritsClass->IsClass() ){
+			// クラスを継承する
+			isInheritsClass = true;
+
+			if( !InheritsClass( *pInheritsClass, nowLine ) ){
+				return false;
+			}
+		}
+		else{
+			SetError(135,NULL,nowLine);
+			return false;
+		}
+
+		if( inheritNames[i] == '\0' ){
+			break;
+		}
+		i++;
+	}
+
+	if( !isInheritsClass ){
+		// クラスを一つも継承していないとき
+		const CClass *pObjectClass = pobj_DBClass->Find("Object");
+		if( !pObjectClass ){
+			SetError(106,"Object",i);
+			return false;
+		}
+
+		if( !InheritsClass( *pObjectClass, nowLine ) ){
+			return false;
+		}
+	}
+
+	i=0;
+	while( true ){
+
+		char temporary[VN_SIZE];
+		for( int i2=0;; i++, i2++ ){
+			if( inheritNames[i] == '\0' || inheritNames[i] == ',' ){
+				temporary[i2] = 0;
+				break;
+			}
+			temporary[i2] = inheritNames[i];
+		}
+
+		//継承元クラスを取得
+		const CClass *pInheritsClass = pobj_DBClass->Find(temporary);
+		if( !pInheritsClass ){
+			SetError(106,temporary,nowLine);
+			return false;
+		}
+
+		if( pInheritsClass->IsInterface() ){
+			// インターフェイスを継承する
+			if( !InheritsInterface( *pInheritsClass, nowLine ) ){
+				return false;
+			}
+		}
+		else if( pInheritsClass->IsClass() ){
+			// クラスはさっき継承した
+		}
+		else{
+			SetError(135,NULL,nowLine);
+			return false;
+		}
+
+		if( inheritNames[i] == '\0' ){
+			break;
+		}
+		i++;
+	}
+
+	return true;
+}
+bool CClass::InheritsClass( const CClass &inheritsClass, int nowLine ){
+
+	//ループ継承でないかをチェック
+	if(pobj_LoopRefCheck->check(inheritsClass)){
+		SetError(123,inheritsClass.GetName(),nowLine);
+		return false;
+	}
+
+	if( !inheritsClass.IsReady() ){
+		//継承先が読み取られていないとき
+		pobj_LoopRefCheck->add(this->GetName().c_str());
+		pobj_DBClass->GetClass_recur(inheritsClass.GetName().c_str());
+		pobj_LoopRefCheck->del(this->GetName().c_str());
+	}
+
+	//メンバをコピー
+	BOOST_FOREACH( CMember *inheritsClassDynamicMember, inheritsClass.dynamicMembers ){
+		CMember *pMember = new CMember( *inheritsClassDynamicMember );
+
+		// アクセシビリティ
+		if( inheritsClassDynamicMember->IsPrivate() ){
+			pMember->SetAccessibility( Prototype::None );
+		}
+		else{
+			pMember->SetAccessibility( inheritsClassDynamicMember->GetAccessibility() );
+		}
+
+		dynamicMembers.push_back( pMember );
+	}
+
+	//メソッドをコピー
+	foreach( const CMethod *pBaseMethod, inheritsClass.methods ){
+		CMethod *pMethod = new DynamicMethod( *pBaseMethod );
+
+		// アクセシビリティ
+		if(pBaseMethod->GetAccessibility() == Prototype::Private){
+			pMethod->SetAccessibility( Prototype::None );
+		}
+		else{
+			pMethod->SetAccessibility( pBaseMethod->GetAccessibility() );
+		}
+
+		//pobj_Inherits
+		// ※継承元のClassIndexをセット（入れ子継承を考慮する）
+		if(pBaseMethod->GetInheritsClassPtr()==0){
+			pMethod->SetInheritsClassPtr( &inheritsClass );
+		}
+		else{
+			pMethod->SetInheritsClassPtr( pBaseMethod->GetInheritsClassPtr() );
+		}
+
+		methods.push_back( pMethod );
+	}
+
+	//仮想関数の数
+	AddVtblNum( inheritsClass.GetVtblNum() );
+
+	//継承先のクラスをメンバとして保持する
+	pobj_InheritsClass = &inheritsClass;
+
+	return true;
+}
+bool CClass::InheritsInterface( const CClass &inheritsInterface, int nowLine ){
+
+	//ループ継承でないかをチェック
+	if(pobj_LoopRefCheck->check(inheritsInterface)){
+		SetError(123,inheritsInterface.GetName(),nowLine);
+		return false;
+	}
+
+	if( !inheritsInterface.IsReady() ){
+		//継承先が読み取られていないとき
+		pobj_LoopRefCheck->add(this->GetName().c_str());
+		pobj_DBClass->GetClass_recur(inheritsInterface.GetName().c_str());
+		pobj_LoopRefCheck->del(this->GetName().c_str());
+	}
+
+	//メソッドをコピー
+	foreach( const CMethod *pBaseMethod, inheritsInterface.methods ){
+		CMethod *pMethod = new DynamicMethod( *pBaseMethod );
+
+		// アクセシビリティ
+		if(pBaseMethod->GetAccessibility() == Prototype::Private){
+			pMethod->SetAccessibility( Prototype::None );
+		}
+		else{
+			pMethod->SetAccessibility( pBaseMethod->GetAccessibility() );
+		}
+
+		//pobj_Inherits
+		// ※継承元のClassIndexをセット（入れ子継承を考慮する）
+		if(pBaseMethod->GetInheritsClassPtr()==0){
+			pMethod->SetInheritsClassPtr( &inheritsInterface );
+		}
+		else{
+			pMethod->SetInheritsClassPtr( pBaseMethod->GetInheritsClassPtr() );
+		}
+
+		methods.push_back( pMethod );
+	}
+
+	interfaces.push_back( InheritedInterface( const_cast<CClass *>(&inheritsInterface), vtblNum ) );
+
+	//仮想関数の数
+	AddVtblNum( inheritsInterface.GetVtblNum() );
+
+	return true;
+}
+void CClass::AddMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer ){
+	CMember *pMember = new CMember( this, accessibility, isConst, isRef, buffer );
+	dynamicMembers.push_back( pMember );
+}
+void CClass::AddStaticMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine ){
+	CMember *pMember = new CMember( this, accessibility, isConst, isRef, buffer, nowLine );
+	staticMembers.push_back( pMember );
+}
+BOOL CClass::DupliCheckAll(const char *name){
+	//重複チェック
+
+	//メンバ
+	if(DupliCheckMember(name)) return 1;
+
+	//メソッド
+	foreach( const CMethod *pMethod, methods ){
+		if( lstrcmp( name, pMethod->pUserProc->GetName().c_str() ) == 0 ){
+			return 1;
+		}
+	}
+
+	return 0;
+}
+BOOL CClass::DupliCheckMember(const char *name){
+	//重複チェック
+
+	// 動的メンバ
+	BOOST_FOREACH( CMember *pMember, dynamicMembers ){
+		if( GetName() == pMember->GetName() ){
+			return 1;
+		}
+	}
+
+	// 静的メンバ
+	foreach( CMember *pMember, staticMembers ){
+		if( GetName() == pMember->GetName() ){
+			return 1;
+		}
+	}
+
+	return 0;
+}
+
+//デフォルト コンストラクタ メソッドを取得
+const CMethod *CClass::GetConstructorMethod() const
+{
+	if( ConstructorMemberSubIndex == -1 ) return NULL;
+	return methods[ConstructorMemberSubIndex];
+}
+
+//デストラクタ メソッドを取得
+const CMethod *CClass::GetDestructorMethod() const
+{
+	if( DestructorMemberSubIndex == -1 ) return NULL;
+	return methods[DestructorMemberSubIndex];
+}
+
+//サイズを取得
+int CClass::GetSize() const
+{
+	return GetMemberOffset( NULL, NULL );
+}
+
+//メンバのオフセットを取得
+int CClass::GetMemberOffset( const char *memberName, int *pMemberNum ) const
+{
+	int i2;
+
+	//仮想関数が存在する場合は関数リストへのポインタのサイズを追加
+	int offset = IsExistVirtualFunctions() ? PTR_SIZE : 0;
+
+	int alignment;
+	if(iAlign) alignment=iAlign;
+	else alignment=1;
+
+	int iMaxAlign=0;
+	int i = -1;
+	BOOST_FOREACH( CMember *pMember, dynamicMembers ){
+		i++;
+
+		i2 = pMember->GetType().GetSize();
+
+		//アラインメントを算出
+		int member_size;
+		if( pMember->GetType().IsStruct() ){
+			//メンバクラスのアラインメントを取得
+			member_size=pMember->GetType().GetClass().GetAlignment();
+		}
+		else{
+			//メンバサイズを取得
+			member_size=i2;
+		}
+		if(iMaxAlign<member_size) iMaxAlign=member_size;
+
+		//アラインメントを考慮
+		if(iAlign&&iAlign<member_size){
+			if(offset%alignment) offset+=alignment-(offset%alignment);
+		}
+		else{
+			if(alignment<member_size) alignment=member_size;
+
+			if(member_size==0){
+				//メンバを持たないクラス
+				//※何もしない（オフセットの計算をしない）
+			}
+			else{
+				if(offset%member_size) offset+=member_size-(offset%member_size);
+			}
+		}
+
+		if(memberName){
+			//メンバ指定がある場合は、オフセットを返す
+			if( pMember->GetName() == memberName ){
+				if(pMemberNum) *pMemberNum=i;
+				return offset;
+			}
+		}
+
+		//配列を考慮したメンバサイズを取得
+		member_size=i2 * JumpSubScripts(pMember->SubScripts);
+
+		//メンバサイズを加算
+		offset+= member_size;
+	}
+
+	if(iMaxAlign<alignment) alignment=iMaxAlign;
+
+	//アラインメントを考慮
+	if(alignment){
+		if(offset%alignment) offset+=alignment-(offset%alignment);
+	}
+
+	if(pMemberNum) *pMemberNum=i;
+	return offset;
+}
+
+int CClass::GetAlignment() const
+{
+	//仮想関数が存在する場合は関数リストへのポインタのサイズを追加
+	int alignment = IsExistVirtualFunctions() ? PTR_SIZE : 0;
+
+	BOOST_FOREACH( CMember *pMember, dynamicMembers ){
+		int member_size;
+		if(pMember->GetType().IsStruct()){
+			//メンバクラスのアラインメントを取得
+			member_size=pMember->GetType().GetClass().GetAlignment();
+		}
+		else{
+			//メンバサイズを取得
+			member_size = pMember->GetType().GetSize();
+		}
+
+		//アラインメントをセット
+		if(alignment<member_size) alignment=member_size;
+	}
+
+	if(alignment==0) return 0;
+
+	if(iAlign) alignment=iAlign;
+
+	return alignment;
+}
+
+
+
+int CClass::GetFuncNumInVtbl( const UserProc *pUserProc ) const
+{
+	int n = 0;
+	foreach( const CMethod *pMethod, methods ){
+		if( pMethod->pUserProc == pUserProc ) break;
+		if( pMethod->IsVirtual() ) n++;
+	}
+	return n;
+}
+LONG_PTR CClass::GetVtblGlobalOffset(void) const
+{
+
+	//既に存在する場合はそれを返す
+	if(vtbl_offset!=-1) return vtbl_offset;
+
+
+
+	//////////////////////////////////////
+	// 存在しないときは新たに生成する
+	//////////////////////////////////////
+
+	UserProc **ppsi;
+	ppsi=(UserProc **)HeapAlloc(hHeap,0,GetVtblNum()*sizeof(GlobalProc *));
+
+	//関数テーブルに値をセット
+	int i2 = 0;
+	foreach( const CMethod *pMethod, methods ){
+		if(pMethod->IsVirtual()){
+			pMethod->pUserProc->Using();
+
+			if(pMethod->IsAbstract()){
+				extern int cp;
+				SetError(300,NULL,cp);
+
+				ppsi[i2]=0;
+			}
+			else{
+				ppsi[i2]=pMethod->pUserProc;
+			}
+			i2++;
+		}
+	}
+
+	vtbl_offset=dataTable.AddBinary((void *)ppsi,GetVtblNum()*sizeof(LONG_PTR));
+
+	for( int i=0; i < GetVtblNum(); i++ ){
+		pobj_Reloc->AddSchedule_DataSection(vtbl_offset+i*sizeof(LONG_PTR));
+	}
+
+	HeapDefaultFree(ppsi);
+
+	return vtbl_offset;
+}
+void CClass::ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection){
+	if(vtbl_offset==-1) return;
+
+	LONG_PTR *pVtbl;
+	pVtbl=(LONG_PTR *)((char *)dataTable.GetPtr()+vtbl_offset);
+
+	int i;
+	for(i=0;i<GetVtblNum();i++){
+		GlobalProc *pUserProc;
+		pUserProc=(GlobalProc *)pVtbl[i];
+		if(!pUserProc) continue;
+		pVtbl[i]=pUserProc->beginOpAddress+ImageBase+MemPos_CodeSection;
+	}
+}
+bool CClass::IsAbstract() const
+{
+	// 未実装(abstract)の仮想関数を持つ場合はtrueを返す
+
+	foreach( const CMethod *pMethod, methods ){
+		if(pMethod->IsVirtual()){
+			if(pMethod->IsAbstract()){
+				return true;
+			}
+		}
+	}
+
+	return false;
+}
+
+// コンストラクタのコンパイルを開始
+void CClass::NotifyStartConstructorCompile() const
+{
+	isCompilingConstructor = true;
+}
+
+//コンストラクタのコンパイルを終了
+void CClass::NotifyFinishConstructorCompile() const
+{
+	isCompilingConstructor = false;
+}
+
+//コンストラクタをコンパイル中かどうかを判別
+bool CClass::IsCompilingConstructor() const
+{
+	return isCompilingConstructor;
+}
+
+//デストラクタのコンパイルを開始
+void CClass::NotifyStartDestructorCompile() const{
+	isCompilingDestructor = true;
+}
+
+//デストラクタのコンパイルを終了
+void CClass::NotifyFinishDestructorCompile() const{
+	isCompilingDestructor = false;
+}
+
+//デストラクタをコンパイル中かどうかを判別
+bool CClass::IsCompilingDestructor() const
+{
+	return isCompilingDestructor;
+}
+
+//自身の派生クラスかどうかを確認
+bool CClass::IsSubClass( const CClass *pClass ) const
+{
+	pClass = pClass->pobj_InheritsClass;
+	while( pClass ){
+		if( this == pClass ) return true;
+		pClass = pClass->pobj_InheritsClass;
+	}
+	return false;
+}
+
+//自身と等しいまたは派生クラスかどうかを確認
+bool CClass::IsEqualsOrSubClass( const CClass *pClass ) const
+{
+	if( IsEquals( pClass ) ) return true;
+	return IsSubClass( pClass );
+}
+
+// 自身と等しいまたは派生クラス、基底クラスかどうかを確認
+bool CClass::IsEqualsOrSubClassOrSuperClass( const CClass &objClass ) const
+{
+	if( IsEquals( &objClass ) ) return true;
+	if( IsSubClass( &objClass ) ) return true;
+	if( objClass.IsSubClass( this ) ) return true;
+	return false;
+}
+
+
+
+int Classes::hash(const char *name) const{
+	int key;
+
+	for(key=0;*name!='\0';name++){
+		key=((key<<8)+ *name )%MAX_CLASS_HASH;
+	}
+
+	return key;
+}
+
+void Classes::DestroyClass(CClass *pobj_c){
+	if(pobj_c->pobj_NextClass){
+		DestroyClass(pobj_c->pobj_NextClass);
+	}
+
+	delete pobj_c;
+}
+
+Classes::Classes():
+	pStringClass( NULL ),
+	pObjectClass( NULL ),
+	pCompilingClass( NULL ),
+	pCompilingMethod( NULL ),
+	ppobj_IteClass( NULL ),
+	iIteMaxNum( 0 ),
+	iIteNextNum( 0 )
+{
+	memset( pobj_ClassHash, 0, MAX_CLASS_HASH * sizeof(CClass *) );
+}
+Classes::~Classes(){
+	int i;
+	for(i=0;i<MAX_CLASS_HASH;i++){
+		if(pobj_ClassHash[i]) DestroyClass(pobj_ClassHash[i]);
+	}
+
+	if(ppobj_IteClass) HeapDefaultFree(ppobj_IteClass);
+}
+
+void Classes::ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection){
+	int i;
+	for(i=0;i<MAX_CLASS_HASH;i++){
+		if(pobj_ClassHash[i]){
+			CClass *pobj_c;
+			pobj_c=pobj_ClassHash[i];
+			while(1){
+				pobj_c->ActionVtblSchedule(ImageBase,MemPos_CodeSection);
+
+				if(pobj_c->pobj_NextClass==0) break;
+				pobj_c=pobj_c->pobj_NextClass;
+			}
+		}
+	}
+}
+
+const CClass *Classes::Find( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	int key;
+	key=hash(name.c_str());
+
+	if( namespaceScopes.size() == 0 && name == "Object" ){
+		return GetObjectClassPtr();
+	}
+	else if( namespaceScopes.size() == 0 && name == "String" ){
+		return GetStringClassPtr();
+	}
+
+	if(pobj_ClassHash[key]){
+		CClass *pobj_c;
+		pobj_c=pobj_ClassHash[key];
+		while(1){
+			if( pobj_c->IsEqualSymbol( namespaceScopes, name ) ){
+				//名前空間とクラス名が一致した
+				return pobj_c;
+			}
+
+			if(pobj_c->pobj_NextClass==0) break;
+			pobj_c=pobj_c->pobj_NextClass;
+		}
+	}
+
+	// TypeDefも見る
+	int index = Smoothie::meta.typeDefs.GetIndex( namespaceScopes, name );
+	if( index != -1 ){
+		Type type = Smoothie::meta.typeDefs[index].GetBaseType();
+		if( type.IsObject() ){
+			return &type.GetClass();
+		}
+	}
+
+	return NULL;
+}
+const CClass *Classes::Find( const string &fullName ) const
+{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
+
+	return Find( NamespaceScopes( AreaName ), NestName );
+}
+
+CClass *Classes::AddClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine){
+	//////////////////////////////////////////////////////////////////////////
+	// クラスを追加
+	// ※名前のみを登録。その他の情報はSetClassメソッドで！
+	//////////////////////////////////////////////////////////////////////////
+
+	CClass *pobj_c;
+	pobj_c=new CClass(namespaceScopes, importedNamespaces, name);
+
+	if(lstrcmp(name,"String")==0){
+		//Stringクラス
+		pStringClass=pobj_c;
+	}
+	if( lstrcmp( name, "Object" ) == 0 ){
+		pObjectClass = pobj_c;
+	}
+
+
+	/////////////////////////////////
+	// ハッシュデータに追加
+	/////////////////////////////////
+
+	int key;
+	key=hash(name);
+
+	if(pobj_ClassHash[key]){
+		CClass *pobj_c2;
+		pobj_c2=pobj_ClassHash[key];
+		while(1){
+			if( pobj_c2->IsEqualSymbol( namespaceScopes, name ) ){
+				//名前空間及びクラス名が重複した場合
+				SetError(15,name,nowLine);
+				return 0;
+			}
+
+			if(pobj_c2->pobj_NextClass==0) break;
+			pobj_c2=pobj_c2->pobj_NextClass;
+		}
+		pobj_c2->pobj_NextClass=pobj_c;
+	}
+	else{
+		pobj_ClassHash[key]=pobj_c;
+	}
+
+	return pobj_c;	
+}
+
+void Classes::InitNames(void){
+	extern char *basbuf;
+	int i, i2;
+	char temporary[VN_SIZE];
+
+	// Blittable型管理オブジェクトを初期化
+	Smoothie::meta.blittableTypes.clear();
+
+	// 名前空間管理
+	NamespaceScopes &namespaceScopes = Smoothie::Lexical::liveingNamespaceScopes;
+	namespaceScopes.clear();
+
+	// Importsされた名前空間の管理
+	NamespaceScopesCollection &importedNamespaces = Smoothie::Temp::importedNamespaces;
+	importedNamespaces.clear();
+
+	for(i=0;;i++){
+		if(basbuf[i]=='\0') break;
+
+		if( basbuf[i] == 1 && basbuf[i+1] == ESC_NAMESPACE ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( basbuf[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+			}
+			namespaceScopes.push_back( temporary );
+
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
+			if( namespaceScopes.size() <= 0 ){
+				SetError(12, "End Namespace", i );
+			}
+			else{
+				namespaceScopes.pop_back();
+			}
+
+			i += 2;
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_IMPORTS ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( basbuf[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+			}
+			if( !importedNamespaces.Imports( temporary ) )
+			{
+				SetError(64,temporary,cp );
+			}
+
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_CLEARNAMESPACEIMPORTED ){
+			importedNamespaces.clear();
+			continue;
+		}
+
+		if(basbuf[i]==1&&(
+			basbuf[i+1]==ESC_CLASS||
+			basbuf[i+1]==ESC_TYPE||
+			basbuf[i+1]==ESC_INTERFACE
+			)){
+				int nowLine;
+				nowLine=i;
+
+				i+=2;
+				Type blittableType;
+				if(memicmp(basbuf+i,"Align(",6)==0){
+					//アラインメント修飾子
+					i+=6;
+					i=JumpStringInPare(basbuf,i)+1;
+				}
+				else if( memicmp( basbuf + i, "Blittable(", 10 ) == 0 ){
+					// Blittable修飾子
+					i+=10;
+					i+=GetStringInPare_RemovePare(temporary,basbuf+i)+1;
+					Type::StringToType( temporary, blittableType );
+				}
+
+				bool isEnum = false;
+				if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENUM ){
+					// 列挙型の場合
+					isEnum = true;
+
+					i+=2;
+				}
+
+				int i2;
+				char temporary[VN_SIZE];
+				for(i2=0;;i++,i2++){
+					if(!IsVariableChar(basbuf[i])){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=basbuf[i];
+				}
+
+				//クラスを追加
+				CClass *pClass = pobj_DBClass->AddClass(namespaceScopes, importedNamespaces, temporary,nowLine);
+				if( pClass ){
+					if( basbuf[nowLine+1] == ESC_CLASS ){
+						if( isEnum ){
+							pClass->classType = CClass::Enum;
+						}
+						else{
+							pClass->classType = CClass::Class;
+						}
+					}
+					else if( basbuf[nowLine+1] == ESC_INTERFACE ){
+						pClass->classType = CClass::Interface;
+					}
+					else{
+						pClass->classType = CClass::Structure;
+					}
+				}
+
+				// Blittable型の場合
+				if( !blittableType.IsNull() ){
+					pClass->SetBlittableType( blittableType );
+
+					// Blittable型として登録
+					Smoothie::meta.blittableTypes.push_back( BlittableType( blittableType, pClass ) );
+				}
+		}
+	}
+}
+
+
+void Classes::AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract,
+						 bool isVirtual, bool isOverride, char *buffer, int nowLine){
+	int i,i2;
+	char temporary[VN_SIZE];
+
+	i=2;
+	for(i2=0;;i++,i2++){
+		if(buffer[i]=='('||buffer[i]=='\0'){
+			temporary[i2]=0;
+			break;
+		}
+		temporary[i2]=buffer[i];
+	}
+
+
+	//関数ハッシュへ登録
+	GlobalProc *pUserProc;
+	pUserProc=AddSubData( NamespaceScopes(), NamespaceScopesCollection(), buffer,nowLine,isVirtual,pobj_c, (bStatic!=0) );
+	if(!pUserProc) return;
+
+
+	////////////////////////////////////////////////////////////
+	// コンストラクタ、デストラクタの場合の処理
+	////////////////////////////////////////////////////////////
+	BOOL fConstructor=0,bDestructor=0;
+
+	if(lstrcmp(temporary,pobj_c->GetName().c_str())==0){
+		//コンストラクタの場合
+
+		//標準コンストラクタ（引数なし）
+		if(pUserProc->Params().size()==0) fConstructor=1;
+
+		//強制的にConst修飾子をつける
+		isConst = true;
+	}
+	else if(temporary[0]=='~'){
+		//デストラクタの場合はその名前が正しいかチェックを行う
+		if(lstrcmp(temporary+1,pobj_c->GetName().c_str())!=0)
+			SetError(117,NULL,nowLine);
+		else
+			bDestructor=1;
+	}
+	if(fConstructor||bDestructor){
+		// コンストラクタ、デストラクタのアクセシビリティをチェック
+
+		//強制的にConst修飾子をつける
+		isConst = true;
+	}
+
+	if( fConstructor == 1 )
+		pobj_c->ConstructorMemberSubIndex = (int)pobj_c->methods.size();
+	else if( bDestructor )
+		pobj_c->DestructorMemberSubIndex = (int)pobj_c->methods.size();
+
+
+
+	//////////////////
+	// 重複チェック
+	//////////////////
+
+	if(pobj_c->DupliCheckMember(temporary)){
+		SetError(15,temporary,nowLine);
+		return;
+	}
+
+	//メソッド
+	foreach( const CMethod *pMethod, pobj_c->methods ){
+		//基底クラスと重複する場合はオーバーライドを行う
+		if( pMethod->GetInheritsClassPtr() ) continue;
+
+		if( pMethod->pUserProc->GetName() == temporary ){
+			if( pMethod->pUserProc->Params().Equals( pUserProc->Params() ) ){
+				//関数名、パラメータ属性が合致したとき
+				SetError(15,pUserProc->GetName().c_str(),nowLine);
+				return;
+			}
+		}
+	}
+
+	//仮想関数の場合
+	if( isAbstract ) pUserProc->CompleteCompile();
+
+	//メソッドのオーバーライド
+	foreach( CMethod *pMethod, pobj_c->methods ){
+		if( pMethod->pUserProc->GetName() == temporary ){
+			if( pMethod->pUserProc->Params().Equals( pUserProc->Params() ) ){
+
+				if(pMethod->IsVirtual()){
+					//メンバ関数を上書き
+					pMethod->pUserProc=pUserProc;
+					pMethod->Override();
+
+					if( !isOverride ){
+						SetError(127,NULL,nowLine);
+					}
+					if(pMethod->GetAccessibility() != accessibility ){
+						SetError(128,NULL,nowLine);
+					}
+
+					pUserProc->SetMethod( pMethod );
+					return;
+				}
+			}
+		}
+	}
+
+	if( isVirtual ){
+		pobj_c->AddVtblNum( 1 );
+	}
+
+	if( isOverride ){
+		SetError(12,"Override",nowLine);
+	}
+
+	if(bStatic){
+		pobj_c->staticMethods.AddStatic( pUserProc, accessibility );
+	}
+	else{
+		pobj_c->methods.Add(pUserProc, accessibility, isConst, isAbstract, isVirtual);
+	}
+}
+
+BOOL Classes::MemberVar_LoopRefCheck(const CClass &objClass){
+	int i2,bRet=1;
+	BOOST_FOREACH( CMember *pMember, objClass.dynamicMembers ){
+		if(pMember->GetType().IsStruct()){
+			//循環参照でないかをチェック
+			if(pobj_LoopRefCheck->check(pMember->GetType().GetClass())){
+				extern int cp;
+				SetError(124,pMember->GetType().GetClass().GetName(),cp);
+				return 0;
+			}
+
+			pobj_LoopRefCheck->add(objClass.GetName().c_str());
+
+			i2=MemberVar_LoopRefCheck(pMember->GetType().GetClass());
+			if(bRet==1) bRet=i2;
+
+			pobj_LoopRefCheck->del(objClass.GetName().c_str());
+		}
+	}
+
+	return bRet;
+}
+
+void Classes::GetClass_recur(const char *lpszInheritsClass){
+	extern char *basbuf;
+	int i,i2,i3,sub_address,top_pos;
+	char temporary[8192];
+
+	// 名前空間管理
+	NamespaceScopes backupNamespaceScopes = Smoothie::Lexical::liveingNamespaceScopes;
+	NamespaceScopes &namespaceScopes = Smoothie::Lexical::liveingNamespaceScopes;
+	namespaceScopes.clear();
+
+	for(i=0;;i++){
+		if(basbuf[i]=='\0') break;
+
+
+		// 名前空間
+		if( basbuf[i] == 1 && basbuf[i+1] == ESC_NAMESPACE ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( basbuf[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+			}
+			namespaceScopes.push_back( temporary );
+
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
+			if( namespaceScopes.size() <= 0 ){
+				SetError(12, "End Namespace", i );
+			}
+			else{
+				namespaceScopes.pop_back();
+			}
+
+			i += 2;
+			continue;
+		}
+
+
+
+		if(basbuf[i]==1&&basbuf[i+1]==ESC_INTERFACE){
+			//////////////////////////
+			// インターフェイス
+			//////////////////////////
+
+			top_pos=i;
+
+			i+=2;
+
+			//インターフェイス名を取得
+			GetIdentifierToken( temporary, basbuf, i );
+
+			CClass *pobj_c = const_cast<CClass *>( pobj_DBClass->Find(namespaceScopes, temporary) );
+			if(!pobj_c) continue;
+
+			if(lpszInheritsClass){
+				if(lstrcmp(lpszInheritsClass,pobj_c->GetName().c_str())!=0){
+					//継承先先読み用
+					continue;
+				}
+			}
+
+			if(pobj_c->IsReady()){
+				//既に先読みされているとき
+				continue;
+			}
+
+			pobj_c->Readed();
+
+			pobj_c->ConstructorMemberSubIndex=-1;
+			pobj_c->DestructorMemberSubIndex=-1;
+
+			if(basbuf[i+1]==1&&basbuf[i+2]==ESC_INHERITS){
+				//継承を行う場合
+				for(i+=3,i2=0;;i++,i2++){
+					if(IsCommandDelimitation(basbuf[i])){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=basbuf[i];
+				}
+
+				if(lstrcmpi(temporary,pobj_c->GetName().c_str())==0){
+					SetError(105,temporary,i);
+					goto Interface_InheritsError;
+				}
+
+				//継承元クラスを取得
+				const CClass *pInheritsClass = Find(temporary);
+				if( !pInheritsClass ){
+					SetError(106,temporary,i);
+					goto Interface_InheritsError;
+				}
+
+				//継承させる
+				if( !pobj_c->InheritsClass( *pInheritsClass, i ) ){
+					goto Interface_InheritsError;
+				}
+			}
+			else{
+				//継承無し
+				pobj_c->pobj_InheritsClass=0;
+
+				//仮想関数の数を初期化
+				pobj_c->SetVtblNum( 0 );
+			}
+Interface_InheritsError:
+
+			//メンバ変数、関数を取得
+			while(1){
+				i++;
+
+				//エラー
+				if(basbuf[i]==1&&(basbuf[i+1]==ESC_CLASS||basbuf[i+1]==ESC_TYPE||basbuf[i+1]==ESC_INTERFACE)){
+					SetError(22,"Interface",i);
+					i--;
+					break;
+				}
+
+				if(basbuf[i]==1&&basbuf[i+1]==ESC_INHERITS){
+					SetError(111,NULL,i);
+					break;
+				}
+
+				sub_address=i;
+
+				for(i2=0;;i++,i2++){
+					if(IsCommandDelimitation(basbuf[i])){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=basbuf[i];
+				}
+				if(temporary[0]=='\0'){
+					if(basbuf[i]=='\0'){
+						i--;
+						SetError(22,"Interface",top_pos);
+						break;
+					}
+					continue;
+				}
+
+				//End Interface記述の場合
+				if(temporary[0]==1&&temporary[1]==ESC_ENDINTERFACE) break;
+
+				if(!(temporary[0]==1&&(
+					temporary[1]==ESC_SUB||temporary[1]==ESC_FUNCTION
+					))){
+					SetError(1,NULL,i);
+					break;
+				}
+
+				//メンバ関数を追加
+				AddMethod(pobj_c,
+					Prototype::Public,	//Publicアクセス権
+					0,					//Static指定なし
+					false,				//Constではない
+					1,					//Abstract
+					1,					//Virtual
+					0,
+					temporary,
+					sub_address
+					);
+			}
+		}
+
+		if(basbuf[i]==1&&(basbuf[i+1]==ESC_CLASS||basbuf[i+1]==ESC_TYPE)){
+			//////////////////////////
+			// クラス
+			//////////////////////////
+
+			top_pos=i;
+
+			const DWORD dwClassType=basbuf[i+1];
+
+			i+=2;
+
+			int iAlign=0;
+			if(memicmp(basbuf+i,"Align(",6)==0){
+				//アラインメント修飾子
+				i+=6;
+				i+=GetStringInPare_RemovePare(temporary,basbuf+i)+1;
+				iAlign=atoi(temporary);
+
+				if(!(iAlign==1||iAlign==2||iAlign==4||iAlign==8||iAlign==16))
+					SetError(51,NULL,i);
+			}
+			else if( memicmp( basbuf + i, "Blittable(", 10 ) == 0 ){
+				// Blittable修飾子
+				i+=10;
+				i=JumpStringInPare(basbuf,i)+1;
+			}
+
+			if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENUM ){
+				// 列挙型の場合
+				i+=2;
+			}
+
+			//クラス名を取得
+			GetIdentifierToken( temporary, basbuf, i );
+
+			CClass *pobj_c =  const_cast<CClass *>( pobj_DBClass->Find(namespaceScopes, temporary) );
+			if(!pobj_c) continue;
+
+			if(lpszInheritsClass){
+				if( pobj_c->GetName() != lpszInheritsClass ){
+					//継承先先読み用
+					continue;
+				}
+			}
+
+			if(pobj_c->IsReady()){
+				//既に先読みされているとき
+				continue;
+			}
+
+			pobj_c->iAlign=iAlign;
+
+			pobj_c->Readed();
+
+			pobj_c->ConstructorMemberSubIndex=-1;
+			pobj_c->DestructorMemberSubIndex=-1;
+
+			//アクセス制限の初期値をセット
+			Prototype::Accessibility accessibility;
+			if(dwClassType==ESC_CLASS){
+				accessibility = Prototype::Private;
+			}
+			else{
+				accessibility = Prototype::Public;
+			}
+
+			if( pobj_c->GetName() == "Object" || dwClassType == ESC_TYPE ){
+				// 継承無し
+				pobj_c->pobj_InheritsClass = NULL;
+
+				// 仮想関数の数を初期化
+				pobj_c->SetVtblNum( 0 );
+			}
+			else{
+				bool isInherits = false;
+				if(basbuf[i+1]==1&&basbuf[i+2]==ESC_INHERITS){
+					//継承を行う場合
+					isInherits = true;
+
+					for(i+=3,i2=0;;i++,i2++){
+						if(IsCommandDelimitation(basbuf[i])){
+							temporary[i2]=0;
+							break;
+						}
+						temporary[i2]=basbuf[i];
+					}
+
+					if(lstrcmpi(temporary,pobj_c->GetName().c_str())==0){
+						SetError(105,temporary,i);
+						goto InheritsError;
+					}
+				}
+
+				if( !isInherits ){
+					//Objectを継承する
+					lstrcpy( temporary, "Object" );
+				}
+
+				pobj_c->Inherits( temporary, i );
+			}
+InheritsError:
+
+			//メンバとメソッドを取得
+			while(1){
+				i++;
+
+				//エラー
+				if(basbuf[i]==1&&(basbuf[i+1]==ESC_CLASS||basbuf[i+1]==ESC_TYPE)){
+					SetError(22,"Class",i);
+					i--;
+					break;
+				}
+
+				if(basbuf[i]==1&&basbuf[i+1]==ESC_INHERITS){
+					SetError(111,NULL,i);
+					break;
+				}
+
+				//Static修飾子
+				BOOL bStatic;
+				if(basbuf[i]==1&&basbuf[i+1]==ESC_STATIC){
+					bStatic=1;
+					i+=2;
+				}
+				else bStatic=0;
+
+				//Const修飾子
+				bool isConst = false;
+				if( basbuf[i] == 1 && basbuf[i + 1] == ESC_CONST ){
+					isConst = true;
+					i += 2;
+				}
+
+				if(basbuf[i]==1&&(
+					basbuf[i+1]==ESC_ABSTRACT||basbuf[i+1]==ESC_VIRTUAL||basbuf[i+1]==ESC_OVERRIDE||
+					basbuf[i+1]==ESC_SUB||basbuf[i+1]==ESC_FUNCTION
+					)){
+					i3=basbuf[i+1];
+					sub_address=i;
+				}
+				else i3=0;
+
+				bool isVirtual = false, isAbstract = false, isOverride = false;
+				if(i3==ESC_ABSTRACT){
+					isAbstract=1;
+					isVirtual=1;
+					i+=2;
+
+					i3=basbuf[i+1];
+				}
+				else if(i3==ESC_VIRTUAL){
+					isAbstract=0;
+					isVirtual=1;
+					i+=2;
+
+					i3=basbuf[i+1];
+				}
+				else if(i3==ESC_OVERRIDE){
+					isOverride=1;
+					isVirtual=1;
+
+					i+=2;
+
+					i3=basbuf[i+1];
+				}
+
+				for(i2=0;;i++,i2++){
+					if(IsCommandDelimitation(basbuf[i])){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=basbuf[i];
+				}
+				if(temporary[0]=='\0'){
+					if(basbuf[i]=='\0'){
+
+						if(dwClassType==ESC_CLASS)
+							SetError(22,"Class",top_pos);
+						else
+							SetError(22,"Type",top_pos);
+
+						i--;
+						break;
+					}
+					continue;
+				}
+
+				//End Class記述の場合
+				if(temporary[0]==1&&temporary[1]==ESC_ENDCLASS&&dwClassType==ESC_CLASS) break;
+				if(temporary[0]==1&&temporary[1]==ESC_ENDTYPE&&dwClassType==ESC_TYPE) break;
+
+				//アクセスを変更
+				if(lstrcmpi(temporary,"Private")==0){
+					accessibility = Prototype::Private;
+					continue;
+				}
+				if(lstrcmpi(temporary,"Public")==0){
+					accessibility = Prototype::Public;
+					continue;
+				}
+				if(lstrcmpi(temporary,"Protected")==0){
+					accessibility = Prototype::Protected;
+					continue;
+				}
+
+				extern int cp;
+				if(i3==0){
+					if(bStatic){
+						//静的メンバを追加
+						cp=i;	//エラー用
+						pobj_c->AddStaticMember( accessibility, isConst, false, temporary, i);
+					}
+					else{
+						//メンバを追加
+						cp=i;	//エラー用
+						pobj_c->AddMember( accessibility, isConst, false, temporary );
+
+
+						if(pobj_c->dynamicMembers[pobj_c->dynamicMembers.size()-1]->GetType().IsStruct()){
+							if( !pobj_c->dynamicMembers[pobj_c->dynamicMembers.size()-1]->GetType().GetClass().IsReady() ){
+								//参照先が読み取られていないとき
+								GetClass_recur(pobj_c->dynamicMembers[pobj_c->dynamicMembers.size()-1]->GetType().GetClass().GetName().c_str());
+							}
+						}
+
+
+						if(pobj_c->dynamicMembers[pobj_c->dynamicMembers.size()-1]->GetType().IsStruct()){
+							//循環参照のチェック
+							pobj_LoopRefCheck->add(pobj_c->GetName().c_str());
+							if(!MemberVar_LoopRefCheck(pobj_c->dynamicMembers[pobj_c->dynamicMembers.size()-1]->GetType().GetClass())){
+								//エラー回避
+								pobj_c->dynamicMembers[pobj_c->dynamicMembers.size()-1]->GetType().SetBasicType( DEF_PTR_VOID );
+							}
+							pobj_LoopRefCheck->del(pobj_c->GetName().c_str());
+						}
+					}
+				}
+				else{
+					//メソッドを追加
+					cp=i;	//エラー用
+					AddMethod(pobj_c,
+						accessibility,
+						bStatic,
+						isConst,
+						isAbstract,
+						isVirtual,
+						isOverride,
+						temporary,
+						sub_address);
+
+					if( isAbstract ) continue;
+
+					for(;;i++){
+						if(basbuf[i]=='\0'){
+							i--;
+							break;
+						}
+						if(basbuf[i-1]!='*'&&
+							basbuf[i]==1&&(
+							basbuf[i+1]==ESC_SUB||
+							basbuf[i+1]==ESC_FUNCTION||
+							basbuf[i+1]==ESC_MACRO||
+							basbuf[i+1]==ESC_TYPE||
+							basbuf[i+1]==ESC_CLASS||
+							basbuf[i+1]==ESC_INTERFACE||
+							basbuf[i+1]==ESC_ENUM)){
+							GetDefaultNameFromES(i3,temporary);
+							SetError(22,temporary,i);
+						}
+						if(basbuf[i]==1&&basbuf[i+1]==GetEndXXXCommand((char)i3)){
+							i+=2;
+							break;
+						}
+					}
+				}
+			}
+		}
+	}
+
+
+	// 名前空間を元に戻す
+	Smoothie::Lexical::liveingNamespaceScopes = backupNamespaceScopes;
+}
+
+void Classes::GetAllClassInfo(void){
+	//ループ継承チェック用のクラス
+	pobj_LoopRefCheck=new CLoopRefCheck();
+
+	//クラスを取得
+	GetClass_recur(0);
+
+	delete pobj_LoopRefCheck;
+	pobj_LoopRefCheck=0;
+
+	// イテレータ用のデータを作る
+	pobj_DBClass->Iterator_Init();
+}
+
+void Classes::Compile_System_InitializeUserTypes(){
+	char temporary[VN_SIZE];
+
+	////////////////////////////////////////////////////////////////////
+	// クラス登録
+	////////////////////////////////////////////////////////////////////
+
+	// イテレータをリセット
+	Iterator_Reset();
+
+	while( Iterator_HasNext() ){
+		const CClass &objClass = *Iterator_GetNext();
+
+		if( !objClass.IsUsing() ){
+			// 未使用のクラスは無視する
+			continue;
+		}
+
+		char referenceOffsetsBuffer[1024] = "";
+		int numOfReference = 0;
+		BOOST_FOREACH( CMember *pMember, objClass.dynamicMembers ){
+			if( pMember->GetType().IsObject() || pMember->GetType().IsPointer() ){
+				if( referenceOffsetsBuffer[0] ){
+					lstrcat( referenceOffsetsBuffer, "," );
+				}
+
+				sprintf( referenceOffsetsBuffer + lstrlen( referenceOffsetsBuffer ),
+					"%d",
+					objClass.GetMemberOffset( pMember->GetName().c_str() ) );
+
+				numOfReference++;
+			}
+		}
+
+		sprintf( temporary
+			, "Add(%c%c_System_TypeForClass(\"%s\",\"%s\",[%s],%d))"
+			, 1
+			, ESC_NEW
+			, ""							// 名前空間 (TODO: 実装)
+			, objClass.GetName().c_str()	// クラス名
+			, referenceOffsetsBuffer		// 参照メンバオフセット配列
+			, numOfReference				// 参照メンバの個数
+			);
+
+		// コンパイル
+		ChangeOpcode( temporary );
+
+		// ネイティブコードバッファの再確保
+		ReallocNativeCodeBuffer();
+	}
+
+
+	////////////////////////////////////////////////////////////////////
+	// 基底クラスを登録
+	////////////////////////////////////////////////////////////////////
+
+	sprintf(temporary, "%c%ctempType=Nothing%c%cTypeBaseImpl"
+		, HIBYTE( COM_DIM )
+		, LOBYTE( COM_DIM )
+		, 1
+		, ESC_AS
+		);
+	ChangeOpcode( temporary );
+
+	// イテレータをリセット
+	Iterator_Reset();
+
+	while( Iterator_HasNext() ){
+		const CClass &objClass = *Iterator_GetNext();
+
+		if( !objClass.IsUsing() ){
+			// 未使用のクラスは無視する
+			continue;
+		}
+
+		if( objClass.pobj_InheritsClass ){
+			sprintf( temporary
+				, "tempType=Search(\"%s\",\"%s\")"
+				, ""							// 名前空間 (TODO: 実装)
+				, objClass.GetName().c_str()	// クラス名
+				);
+
+			// コンパイル
+			ChangeOpcode( temporary );
+
+			sprintf( temporary
+				, "tempType.SetBaseType(Search(\"%s\",\"%s\"))"
+				, ""								// 名前空間 (TODO: 実装)
+				, objClass.pobj_InheritsClass->GetName().c_str()	// 基底クラス名
+				);
+
+			// コンパイル
+			ChangeOpcode( temporary );
+		}
+
+		// ネイティブコードバッファの再確保
+		ReallocNativeCodeBuffer();
+	}
+
+
+
+	////////////////////////////////////////////////////////////////////
+	// 継承関係登録
+	////////////////////////////////////////////////////////////////////
+	// TODO: 未完成
+	/*
+
+	// イテレータをリセット
+	Iterator_Reset();
+
+	while( Iterator_HasNext() ){
+		CClass *pClass = Iterator_GetNext();
+
+		sprintf( genBuffer + length
+			, "obj.Search( \"%s\" ).SetBaseType( Search( \"%s\" ) ):"
+			, ""				// クラス名
+			, pClass->name		// クラス名
+			);
+		length += lstrlen( genBuffer + length );
+
+		while( length + 8192 > max ){
+			max += 8192;
+			genBuffer = (char *)realloc( genBuffer, max );
+		}
+	}*/
+}
+
+
+
+CClass *Classes::GetStringClassPtr() const
+{
+	if( !pStringClass ){
+		SetError();
+		return NULL;
+	}
+	return pStringClass;
+}
+CClass *Classes::GetObjectClassPtr() const
+{
+	if( !pObjectClass ){
+		SetError();
+		return NULL;
+	}
+	return pObjectClass;
+}
+
+void Classes::StartCompile( UserProc *pUserProc ){
+	pCompilingClass = pUserProc->GetParentClassPtr();
+	if( pCompilingClass ){
+		pCompilingClass->Using();
+
+		pCompilingMethod = pCompilingClass->methods.GetMethodPtr( pUserProc );
+		if( !pCompilingMethod ){
+			pCompilingMethod = pCompilingClass->staticMethods.GetMethodPtr( pUserProc );
+			if( !pCompilingMethod ){
+				SetError(300,NULL,cp);
+			}
+		}
+	}
+	else{
+		pCompilingMethod = NULL;
+	}
+}
+const CClass *Classes::GetNowCompilingClass() const
+{
+	return pCompilingClass;
+}
+const CMethod *Classes::GetNowCompilingMethodInfo(){
+	return pCompilingMethod;
+}
+
+
+
+
+//////////////////////
+// イテレータ
+//////////////////////
+
+void Classes::Iterator_Init(void){
+	if(ppobj_IteClass) HeapDefaultFree(ppobj_IteClass);
+
+	iIteMaxNum=0;
+	iIteNextNum=0;
+	ppobj_IteClass=(CClass **)HeapAlloc(hHeap,0,1);
+
+	int i;
+	for(i=0;i<MAX_CLASS_HASH;i++){
+		if(pobj_ClassHash[i]){
+			CClass *pobj_c;
+			pobj_c=pobj_ClassHash[i];
+			while(1){
+				ppobj_IteClass=(CClass **)HeapReAlloc(hHeap,0,ppobj_IteClass,(iIteMaxNum+1)*sizeof(CClass *));
+				ppobj_IteClass[iIteMaxNum]=pobj_c;
+				iIteMaxNum++;
+
+				if(pobj_c->pobj_NextClass==0) break;
+				pobj_c=pobj_c->pobj_NextClass;
+			}
+		}
+	}
+}
+void Classes::Iterator_Reset(void){
+	iIteNextNum = 0;
+}
+BOOL Classes::Iterator_HasNext(void){
+	if(iIteNextNum<iIteMaxNum) return 1;
+	return 0;
+}
+CClass *Classes::Iterator_GetNext(void){
+	CClass *pobj_c;
+	pobj_c=ppobj_IteClass[iIteNextNum];
+	iIteNextNum++;
+	return pobj_c;
+}
+int Classes::Iterator_GetMaxCount(void){
+	return iIteMaxNum;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Class.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Class.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Class.h	(revision 178)
@@ -0,0 +1,304 @@
+#pragma once
+
+#include <vector>
+#include <string>
+
+#include <Prototype.h>
+#include <Method.h>
+#include <Member.h>
+#include "Procedure.h"
+
+class Classes;
+class CDebugSection;
+class CClass;
+class InheritedInterface
+{
+	CClass *pInterfaceClass;
+	int vtblOffset;
+public:
+	InheritedInterface( CClass *pInterfaceClass, int vtblOffset )
+		: pInterfaceClass( pInterfaceClass )
+		, vtblOffset( vtblOffset )
+	{
+	}
+
+	CClass &GetInterfaceClass() const{
+		return *pInterfaceClass;
+	}
+	int GetVtblOffset() const
+	{
+		return vtblOffset;
+	}
+};
+typedef vector<InheritedInterface> Interfaces;
+class CClass : public Prototype
+{
+	friend CMember;
+	friend Classes;
+	friend CDebugSection;
+
+	bool isReady;
+	void Readed(){
+		isReady = true;
+	}
+	bool IsReady() const{
+		return isReady;
+	}
+
+	// importされている名前空間
+	NamespaceScopesCollection importedNamespaces;
+
+	// 継承するインターフェイス
+	Interfaces interfaces;
+
+	// Blittable型情報
+	Type blittableType;
+
+	// 動的メンバ
+	Members dynamicMembers;
+
+	// 静的メンバ
+	Members staticMembers;
+
+	// 動的メソッド
+	Methods methods;
+	int ConstructorMemberSubIndex;
+	int DestructorMemberSubIndex;
+	int vtblNum;					// 仮想関数の数
+
+	// 静的メソッド
+	Methods staticMethods;
+
+	enum ClassType{
+		Class,
+		Interface,
+		Enum,
+		Delegate,
+		Structure,
+	};
+
+	ClassType classType;
+
+public:
+
+	//継承クラスへのポインタ
+	const CClass *pobj_InheritsClass;
+
+	//アラインメント値
+	int iAlign;
+
+	CClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name );
+	~CClass();
+
+	const NamespaceScopesCollection &GetImportedNamespaces() const
+	{
+		return importedNamespaces;
+	}
+
+	// インターフェイス
+	bool HasInterfaces() const
+	{
+		return ( interfaces.size() != 0 );
+	}
+	bool IsInheritsInterface( const CClass *pInterfaceClass ) const;
+
+	// Blittable型
+	bool IsBlittableType() const
+	{
+		return !blittableType.IsNull();
+	}
+	const Type &GetBlittableType() const
+	{
+		return blittableType;
+	}
+	void SetBlittableType( const Type &type ){
+		blittableType = type;
+	}
+
+	bool IsClass() const;
+	bool IsInterface() const;
+	bool IsEnum() const;
+	bool IsDelegate() const;
+	bool IsStructure() const;
+
+	//継承させる
+	bool Inherits( const char *inheritNames, int nowLine );
+	bool InheritsClass( const CClass &inheritsClass, int nowLine );
+	bool InheritsInterface( const CClass &inheritsClass, int nowLine );
+
+	//メンバ、メソッドの追加
+	void AddMember( Prototype::Accessibility accessibility, bool idConst, bool isRef, char *buffer );
+	void AddStaticMember( Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine );
+
+	//重複チェック
+	BOOL DupliCheckAll(const char *name);
+	BOOL DupliCheckMember(const char *name);
+
+	const Members &GetDynamicMembers() const
+	{
+		return dynamicMembers;
+	}
+
+	const Methods &GetMethods() const
+	{
+		return methods;
+	}
+	const Methods &GetStaticMethods() const
+	{
+		return staticMethods;
+	}
+
+	//デフォルト コンストラクタ メソッドを取得
+	const CMethod *GetConstructorMethod() const;
+
+	//デストラクタ メソッドを取得
+	const CMethod *GetDestructorMethod() const;
+
+	// vtblに存在する仮想関数の数
+	int GetVtblNum() const
+	{
+		return vtblNum;
+	}
+	void SetVtblNum( int vtblNum )
+	{
+		this->vtblNum = vtblNum;
+	}
+	void AddVtblNum( int vtblNum )
+	{
+		this->vtblNum += vtblNum;
+	}
+	bool IsExistVirtualFunctions() const
+	{
+		return ( vtblNum > 0 );
+	}
+
+	// メンバの総合サイズを取得
+	int GetSize() const;
+
+	// メンバのオフセットを取得
+	int GetMemberOffset( const char *memberName, int *pMemberNum = NULL ) const;
+
+private:
+	// アラインメント値を取得
+	int GetAlignment() const;
+
+
+	//vtbl
+private:
+	mutable long vtbl_offset;
+public:
+	int GetFuncNumInVtbl( const UserProc *pUserProc ) const;
+	LONG_PTR GetVtblGlobalOffset(void) const;
+	void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection);
+	bool IsAbstract() const;
+
+
+	//コンストラクタをコンパイルしているかどうかのチェックフラグ
+private:
+	mutable bool isCompilingConstructor;
+public:
+	void NotifyStartConstructorCompile() const;
+	void NotifyFinishConstructorCompile() const;
+	bool IsCompilingConstructor() const;
+
+	//デストラクタをコンパイルしているかどうかのチェックフラグ
+private:
+	mutable bool isCompilingDestructor;
+public:
+	void NotifyStartDestructorCompile() const;
+	void NotifyFinishDestructorCompile() const;
+	bool IsCompilingDestructor() const;
+
+
+	//自身の派生クラスかどうかを確認
+	bool IsSubClass( const CClass *pClass ) const;
+
+	//自身と等しいまたは派生クラスかどうかを確認
+	bool IsEqualsOrSubClass( const CClass *pClass ) const;
+
+	// 自身と等しいまたは派生クラス、基底クラスかどうかを確認
+	bool IsEqualsOrSubClassOrSuperClass( const CClass &objClass ) const;
+
+
+	//線形リスト用
+	CClass *pobj_NextClass;
+
+
+	//メンバの参照方法
+	enum RefType{
+		Non = 0,		// no reference member
+		Dot,			// obj.member
+		Pointer,		// obj->member
+	};
+};
+
+#define MAX_CLASS_HASH 65535
+class Classes{
+	int hash(const char *name) const;
+	void DestroyClass(CClass *pobj_c);
+public:
+	CClass *pobj_ClassHash[MAX_CLASS_HASH];
+
+	Classes();
+	~Classes();
+
+	const CClass *Find( const string &fullName ) const;
+	const CClass *Find( const NamespaceScopes &namespaceScopes, const string &name ) const;
+
+	CClass *AddClass( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const char *name,int nowLine);
+
+	void ActionVtblSchedule(LONG_PTR ImageBase, LONG_PTR MemPos_CodeSection);
+
+private:
+	void AddMethod(CClass *pobj_c, Prototype::Accessibility accessibility, BOOL bStatic, bool isConst, bool isAbstract,
+		bool isVirtual, bool isOverride, char *buffer, int nowLine);
+	BOOL MemberVar_LoopRefCheck(const CClass &objClass);
+public:
+	void InitNames(void);
+	void GetClass_recur(const char *lpszInheritsClass);
+	void GetAllClassInfo(void);
+	void Compile_System_InitializeUserTypes();
+
+
+	/////////////////////////////
+	// 特殊クラス
+	/////////////////////////////
+	CClass *pStringClass;
+	CClass *pObjectClass;
+	CClass *GetStringClassPtr() const;
+	CClass *GetObjectClassPtr() const;
+
+
+	/////////////////////////////
+	// 現在コンパイル中の情報
+	/////////////////////////////
+private:
+	const CClass *pCompilingClass;
+	const CMethod *pCompilingMethod;
+public:
+	//コンパイル開始の通知を受け取るメソッド
+	void StartCompile( UserProc *pUserProc );
+
+	//現在コンパイル中のメソッド情報を取得
+	const CClass *GetNowCompilingClass() const;
+	const CMethod *GetNowCompilingMethodInfo();
+
+
+	/////////////////////
+	// イテレータ
+	/////////////////////
+private:
+	CClass **ppobj_IteClass;
+	int iIteMaxNum;
+	int iIteNextNum;
+public:
+	void Iterator_Init(void);
+	void Iterator_Reset(void);
+	BOOL Iterator_HasNext(void);
+	CClass *Iterator_GetNext(void);
+	int Iterator_GetMaxCount(void);
+};
+
+
+extern Classes *pobj_DBClass;
+extern const CClass *pobj_CompilingClass;
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/CommandFormat.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/CommandFormat.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/CommandFormat.cpp	(revision 178)
@@ -0,0 +1,316 @@
+#include "common.h"
+
+void ComOpen(char *Parameter,char *buffer,int nowLine){
+	int i,i2,IsStr;
+	char temporary[255];
+
+	for(i=0,i2=0,IsStr=0;;i++,i2++){
+		if(Parameter[i]=='\"') IsStr^=1;
+		if((
+			((Parameter[i]==' '||Parameter[i]=='\t')&&(Parameter[i+1]=='f'||Parameter[i+1]=='F')&&(Parameter[i+2]=='o'||Parameter[i+2]=='O')&&(Parameter[i+3]=='r'||Parameter[i+3]=='R')&&(Parameter[i+4]==' '||Parameter[i+4]=='\t'))||
+			(Parameter[i]==1&&Parameter[i+1]==ESC_AS)
+			)&&IsStr==0){
+			buffer[i2]=0;
+			break;
+		}
+		buffer[i2]=Parameter[i];
+		if(Parameter[i]=='\0') return;
+	}
+
+	KillStringSpaces(buffer);
+
+	if(Parameter[i]==1&&Parameter[i+1]==ESC_AS) lstrcat(buffer,",0");
+	else{
+		i+=4;
+		while(Parameter[i]==' '||Parameter[i]=='\t') i++;
+		for(i2=0;;i++,i2++){
+			if(Parameter[i]=='\0'){
+				SetError(1,NULL,nowLine);
+				return;
+			}
+			if(Parameter[i]==' '||Parameter[i]=='\t'||(Parameter[i]==1&&Parameter[i+1]==ESC_AS)){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=Parameter[i];
+		}
+		if(lstrcmpi(temporary,"input")==0) lstrcat(buffer,",1");
+		else if(lstrcmpi(temporary,"output")==0) lstrcat(buffer,",2");
+		else if(lstrcmpi(temporary,"append")==0) lstrcat(buffer,",3");
+		else{
+			SetError(1,NULL,nowLine);
+			return;
+		}
+
+		while(Parameter[i]==' '||Parameter[i]=='\t') i++;
+		if(!(Parameter[i]==1&&Parameter[i+1]==ESC_AS)) return;
+	}
+
+	i+=2;
+	while(Parameter[i]==' '||Parameter[i]=='\t') i++;
+	if(Parameter[i]=='#') i++;
+
+	lstrcat(buffer,",");
+	lstrcat(buffer,Parameter+i);
+}
+void ComClose(char *Parameter,char *buffer){
+	if(Parameter[0]=='#') lstrcpy(buffer,Parameter+1);
+	else lstrcpy(buffer,Parameter);
+}
+void ComField(char *Parameter,char *buffer){
+	if(Parameter[0]=='#') KillSpaces(Parameter+1,buffer);
+	else KillSpaces(Parameter,buffer);
+}
+
+void ComLine(char *Parameter,char *buffer,int nowLine){
+	int i,i2,PareNum;
+	char temporary[VN_SIZE],temp2[VN_SIZE];
+
+	KillStringSpaces(Parameter);
+
+	if(Parameter[0]=='-'){
+		lstrcpy(buffer,"&H80000000,&H80000000");
+		i=0;
+	}
+	else{
+		if(Parameter[0]!='('){
+			SetError(10,"Line",nowLine);
+			return;
+		}
+		for(i=1,i2=0,PareNum=1;;i++,i2++){
+			if(Parameter[i]=='(') PareNum++;
+			if(Parameter[i]==')'){
+				PareNum--;
+				if(PareNum==0){
+					temporary[i2]=0;
+					break;
+				}
+			}
+			temporary[i2]=Parameter[i];
+		}
+
+		lstrcpy(buffer,temporary);
+
+		if(Parameter[i+1]!='-'){
+			SetError(10,"Line",nowLine);
+			return;
+		}
+		i++;
+	}
+
+	i++;
+	if((Parameter[i]=='s'||Parameter[i]=='S')&&(Parameter[i+1]=='t'||Parameter[i+1]=='T')&&(Parameter[i+2]=='e'||Parameter[i+2]=='E')&&(Parameter[i+3]=='p'||Parameter[i+3]=='P')){
+		lstrcat(buffer,",1,");
+		i+=4;
+	}
+	else lstrcat(buffer,",0,");
+
+	if(Parameter[i]!='('){
+		SetError(10,"Line",nowLine);
+		return;
+	}
+	for(i++,i2=0,PareNum=1;;i++,i2++){
+		if(Parameter[i]=='(') PareNum++;
+		if(Parameter[i]==')'){
+			PareNum--;
+			if(PareNum==0){
+				temporary[i2]=0;
+				break;
+			}
+		}
+		temporary[i2]=Parameter[i];
+	}
+
+	lstrcat(buffer,temporary);
+
+	if(Parameter[i+1]=='\0'){
+		lstrcat(buffer,",7");
+		return;
+	}
+	else if(Parameter[i+1]!=','){
+		SetError(10,"Line",nowLine);
+		return;
+	}
+	i+=2;
+
+	i=GetOneParameter(Parameter,i,temporary);	//第５パラメータ取得
+	if(temporary[0]=='\0')
+		lstrcpy(temporary,"7");
+	lstrcat(buffer,",");
+	lstrcat(buffer,temporary);
+	lstrcpy(temp2,temporary);
+
+	if(Parameter[i]=='\0') return;
+	i=GetOneParameter(Parameter,i,temporary);	//第６パラメータ取得
+	if(temporary[0]=='\0') lstrcat(buffer,",0");
+	else if(lstrcmpi(temporary,"b")==0) lstrcat(buffer,",1");
+	else if(lstrcmpi(temporary,"bf")==0) lstrcat(buffer,",2");
+	else{
+		SetError(10,"Line",nowLine);
+		return;
+	}
+
+	if(Parameter[i]=='\0'){
+		lstrcat(buffer,",");
+		lstrcat(buffer,temp2);
+		return;
+	}
+	i=GetOneParameter(Parameter,i,temporary);	//第７パラメータ取得
+	if(Parameter[i-1]==','){
+		SetError(10,"Line",nowLine);
+		return;
+	}
+	if(temporary[0]=='\0') lstrcpy(temporary,temp2);
+	lstrcat(buffer,",");
+	lstrcat(buffer,temporary);
+}
+void ComCircle(char *Parameter,char *buffer,int nowLine){
+	int i,i2,PareNum;
+	char temporary[VN_SIZE],temp2[VN_SIZE];
+
+	KillStringSpaces(Parameter);
+
+	if(Parameter[0]!='('){
+		SetError(10,"Circle",nowLine);
+		return;
+	}
+	for(i=1,i2=0,PareNum=1;;i++,i2++){
+		if(Parameter[i]=='(') PareNum++;
+		if(Parameter[i]==')'){
+			PareNum--;
+			if(PareNum==0){
+				buffer[i2]=0;
+				break;
+			}
+		}
+		buffer[i2]=Parameter[i];
+	}
+
+	i++;
+	if(Parameter[i]!=','){
+		SetError(10,"Circle",nowLine);
+		return;
+	}
+	i++;
+
+	i=GetOneParameter(Parameter,i,temporary);	//第３パラメータ取得(radius)
+	lstrcat(buffer,",");
+	lstrcat(buffer,temporary);
+	if(Parameter[i]=='\0'){
+		lstrcat(buffer,",7,0,0,1");
+		return;
+	}
+
+	i=GetOneParameter(Parameter,i,temporary);	//第４パラメータ取得(color)
+	if(temporary[0]=='\0') lstrcpy(temporary,"7");
+	lstrcat(buffer,",");
+	lstrcat(buffer,temporary);
+	lstrcpy(temp2,temporary);
+	if(Parameter[i]=='\0'){
+		lstrcat(buffer,",0,0,1");
+		return;
+	}
+
+	i=GetOneParameter(Parameter,i,temporary);	//第５パラメータ取得(start)
+	lstrcat(buffer,",");
+	lstrcat(buffer,temporary);
+	if(Parameter[i]=='\0'){
+		lstrcat(buffer,",0,1");
+		return;
+	}
+
+	i=GetOneParameter(Parameter,i,temporary);	//第６パラメータ取得(end)
+	lstrcat(buffer,",");
+	lstrcat(buffer,temporary);
+	if(Parameter[i]=='\0'){
+		lstrcat(buffer,",1");
+		return;
+	}
+
+	i=GetOneParameter(Parameter,i,temporary);	//第７パラメータ取得(aspect)
+	lstrcat(buffer,",");
+	if(temporary[0]=='\0')
+		lstrcat(buffer,"1");
+	else
+		lstrcat(buffer,temporary);
+	if(Parameter[i]=='\0') return;
+
+	i=GetOneParameter(Parameter,i,temporary);	//第８パラメータ取得(f)
+	if(lstrcmpi(temporary,"f")==0){
+		lstrcat(buffer,",1");
+	}
+	else{
+		SetError(10,"Circle",nowLine);
+		return;
+	}
+
+	if(Parameter[i]){
+		i=GetOneParameter(Parameter,i,temporary);	//第９パラメータ取得(BrushColor)
+		if(temporary[0]=='\0') lstrcpy(temporary,"7");
+		lstrcat(buffer,",");
+		lstrcat(buffer,temporary);
+		if(Parameter[i-1]==','){
+			SetError(10,"Circle",nowLine);
+			return;
+		}
+	}
+	else{
+		lstrcat(buffer,",");
+		lstrcat(buffer,temp2);
+	}
+}
+void ComPSet(char *Parameter,char *buffer,int nowLine){
+	int i,i2,PareNum;
+
+	KillStringSpaces(Parameter);
+
+	if(Parameter[0]!='('){
+		SetError(10,"PSet",nowLine);
+		return;
+	}
+	for(i=1,i2=0,PareNum=1;;i++,i2++){
+		if(Parameter[i]=='(') PareNum++;
+		if(Parameter[i]==')'){
+			PareNum--;
+			if(PareNum==0){
+				buffer[i2]=0;
+				break;
+			}
+		}
+		buffer[i2]=Parameter[i];
+	}
+
+	if(Parameter[i+1]==',')lstrcat(buffer,Parameter+i+1);
+	else if(Parameter[i+1]=='\0') lstrcat(buffer,",7");
+	else{
+		SetError(10,"PSet",nowLine);
+		return;
+	}
+}
+void ComPaint(char *Parameter,char *buffer,int nowLine){
+	int i,i2,PareNum;
+
+	KillStringSpaces(Parameter);
+
+	if(Parameter[0]!='('){
+		SetError(10,"Paint",nowLine);
+		return;
+	}
+	for(i=1,i2=0,PareNum=1;;i++,i2++){
+		if(Parameter[i]=='(') PareNum++;
+		if(Parameter[i]==')'){
+			PareNum--;
+			if(PareNum==0){
+				buffer[i2]=0;
+				break;
+			}
+		}
+		buffer[i2]=Parameter[i];
+	}
+	if(Parameter[i+1]!=','){
+		SetError(10,"Paint",nowLine);
+		return;
+	}
+
+	lstrcat(buffer,Parameter+i+1);
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Compile.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Compile.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Compile.cpp	(revision 178)
@@ -0,0 +1,694 @@
+#include "../BasicCompiler_Common/common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+//ラベルアドレス
+LABEL *pLabelNames;
+int MaxLabelNum;
+
+//Continueアドレス
+DWORD dwContinueAddress;
+
+//Caseスケジュール
+DWORD *pCaseSchedule;
+int CaseScheduleNum;
+int NowCaseSchedule;
+
+//プロシージャ抜け出しスケジュール（Exit Sub/Function）
+DWORD *pExitSubSchedule;
+int ExitSubScheduleNum;
+
+//Goto未知ラベル スケジュール
+GOTOLABELSCHEDULE *pGotoLabelSchedule;
+int GotoLabelScheduleNum;
+
+//グローバル変数初期バッファ
+BYTE *initGlobalBuf;
+
+//With情報
+WITHINFO WithInfo;
+
+
+int obp,obp_AllocSize;
+int GlobalOpBufferSize;
+char *OpBuffer;
+void ReallocNativeCodeBuffer(){
+	if(obp_AllocSize<obp+8192){
+		obp_AllocSize+=8192;
+		OpBuffer=(char *)HeapReAlloc(hHeap,0,OpBuffer,obp_AllocSize); //matea
+	}
+}
+
+
+///////////////////////////////////////////////////
+// トークンを取得
+///////////////////////////////////////////////////
+void GetIdentifierToken( char *token, const char *source, int &pos ){
+	for( int i=0; ; i++, pos++ ){
+		if( ! IsVariableChar( source[pos] ) ){
+			token[i] = 0;
+			break;
+		}
+		token[i] = source[pos];
+	}
+}
+
+
+///////////////////////////////////////////////////
+// 対になっているステートメントを飛び越す
+// ※グローバル領域用
+///////////////////////////////////////////////////
+int JumpStatement(const char *source, int &pos){
+	if( source[pos] != 1 ) return 0;
+
+	if( ! IsCommandDelimitation( source[pos - 1] ) ){
+		//直前がコマンド区切りではない場合
+		return 0;
+	}
+
+	char cStatement = source[pos + 1];
+
+	char cEnd = GetEndXXXCommand( cStatement );
+	if( cEnd == 0 ) return 0;
+
+	pos += 2;
+	while( ! ( source[pos] == 1 && source[pos + 1] == cEnd ) ){
+
+		if( source[pos] == '\0' ){
+			char temporary[64];
+			GetDefaultNameFromES( cStatement, temporary );
+			SetError( 22, temporary, pos );
+			return -1;
+		}
+
+		pos++;
+	}
+	if( ! ( source[pos] == '\0' || source[pos + 2] == '\0' ) ){
+		pos += 2;
+	}
+
+	return 1;
+}
+
+
+void NextLine(void){
+	extern HANDLE hHeap;
+	extern int MaxLineInfoNum;
+	extern LINEINFO *pLineInfo;
+	if(MaxLineInfoNum){
+		if(pLineInfo[MaxLineInfoNum-1].TopObp==obp){
+			pLineInfo[MaxLineInfoNum-1].TopCp=cp;
+			return;
+		}
+	}
+	pLineInfo=(LINEINFO *)HeapReAlloc(hHeap,0,pLineInfo,(MaxLineInfoNum+1)*sizeof(LINEINFO));
+	pLineInfo[MaxLineInfoNum].TopCp=cp;
+	pLineInfo[MaxLineInfoNum].TopObp=obp;
+
+	extern BOOL bDebugSupportProc;
+	extern BOOL bSystemProc;
+	pLineInfo[MaxLineInfoNum].dwCodeType=0;
+	if(bDebugSupportProc)
+		pLineInfo[MaxLineInfoNum].dwCodeType|=CODETYPE_DEBUGPROC;
+	if(bSystemProc)
+		pLineInfo[MaxLineInfoNum].dwCodeType|=CODETYPE_SYSTEMPROC;
+
+	MaxLineInfoNum++;
+}
+
+void ChangeOpcode(char *Command){
+	extern HANDLE hHeap;
+	int i,i2;
+
+	if(Command[0]=='\0') return;
+	if(Command[0]=='*'&&IsVariableTopChar(Command[1])){
+		//Goto先ラベル
+		pLabelNames=(LABEL *)HeapReAlloc(hHeap,0,pLabelNames,(MaxLabelNum+1)*sizeof(LABEL));
+		pLabelNames[MaxLabelNum].pName=(char *)HeapAlloc(hHeap,0,lstrlen(Command+1)+1);
+		lstrcpy(pLabelNames[MaxLabelNum].pName,Command+1);
+		pLabelNames[MaxLabelNum].address=obp;
+		MaxLabelNum++;
+
+		//書き込みスケジュール
+		for(i=0;i<GotoLabelScheduleNum;i++){
+			if(lstrcmp(pGotoLabelSchedule[i].pName,Command+1)==0){
+				*((long *)(OpBuffer+pGotoLabelSchedule[i].pos))=obp-(pGotoLabelSchedule[i].pos+sizeof(long));
+
+				HeapDefaultFree(pGotoLabelSchedule[i].pName);
+
+				//詰める
+				GotoLabelScheduleNum--;
+				for(i2=i;i2<GotoLabelScheduleNum;i2++){
+					pGotoLabelSchedule[i2].pName=pGotoLabelSchedule[i2+1].pName;
+					pGotoLabelSchedule[i2].line=pGotoLabelSchedule[i2+1].line;
+					pGotoLabelSchedule[i2].pos=pGotoLabelSchedule[i2+1].pos;
+				}
+				i--;
+				continue;
+			}
+		}
+		return;
+	}
+	if(Command[0]==1){
+		switch(Command[1]){
+			case ESC_CONST:
+				OpcodeDim(Command+2, DIMFLAG_CONST);
+				break;
+
+			case ESC_TYPEDEF:
+				if( UserProc::IsLocalAreaCompiling() ){
+					// ローカル領域をコンパイルしているとき
+					SetError(65,"TypeDef",cp );
+				}
+
+				//既に収集済み
+				break;
+
+			case ESC_STATIC:
+				OpcodeDim(Command+2,DIMFLAG_STATIC);
+				break;
+
+			case ESC_IF:
+				OpcodeIf(Command+2);
+				break;
+			case ESC_EXITWHILE:
+				obj_LexScopes.ExitWhile();
+				break;
+			case ESC_EXITFOR:
+				obj_LexScopes.ExitFor();
+				break;
+			case ESC_EXITDO:
+				obj_LexScopes.ExitDo();
+				break;
+			case ESC_CONTINUE:
+				OpcodeContinue();
+				break;
+
+			case ESC_EXITSUB:
+			case ESC_EXITFUNCTION:
+			case ESC_EXITMACRO:
+				OpcodeExitSub();
+				break;
+
+			case ESC_SELECTCASE:
+				OpcodeSelect(Command+2);
+				break;
+			case ESC_CASE:
+			case ESC_CASEELSE:
+				OpcodeCase(Command+2);
+				break;
+
+			case ESC_WITH:
+				extern WITHINFO WithInfo;
+
+				WithInfo.ppName=(char **)HeapReAlloc(hHeap,0,WithInfo.ppName,(WithInfo.num+1)*sizeof(char **));
+				WithInfo.ppName[WithInfo.num]=(char *)HeapAlloc(hHeap,0,lstrlen(Command+2)+1);
+				lstrcpy(WithInfo.ppName[WithInfo.num],Command+2);
+
+				WithInfo.pWithCp=(int *)HeapReAlloc(hHeap,0,WithInfo.pWithCp,(WithInfo.num+1)*sizeof(int));
+				WithInfo.pWithCp[WithInfo.num]=cp;
+
+				WithInfo.num++;
+				break;
+			case ESC_ENDWITH:
+				if(WithInfo.num<=0){
+					SetError(12,"End With",cp);
+					return;
+				}
+				WithInfo.num--;
+				HeapDefaultFree(WithInfo.ppName[WithInfo.num]);
+				break;
+			case ESC_DECLARE:
+				if( UserProc::IsLocalAreaCompiling() ){
+					// ローカル領域をコンパイルしているとき
+					SetError(65,"Declare",cp );
+				}
+				break;
+
+			case ESC_NAMESPACE:
+				Smoothie::Lexical::liveingNamespaceScopes.push_back( Command + 2 );
+				break;
+			case ESC_ENDNAMESPACE:
+				if( Smoothie::Lexical::liveingNamespaceScopes.size() <= 0 ){
+					SetError(12,"End Namespace",cp);
+				}
+				Smoothie::Lexical::liveingNamespaceScopes.pop_back();
+				break;
+			case ESC_IMPORTS:
+				Smoothie::Temp::importedNamespaces.Imports( Command + 2 );
+				break;
+			case ESC_CLEARNAMESPACEIMPORTED:
+				Smoothie::Temp::importedNamespaces.clear();
+				break;
+
+				//Tryによる例外処理
+			case ESC_TRY:
+				Exception::TryCommand();
+				break;
+			case ESC_CATCH:
+				Exception::CatchCommand();
+				break;
+			case ESC_FINALLY:
+				Exception::FinallyCommand();
+				break;
+			case ESC_ENDTRY:
+				Exception::EndTryCommand();
+				break;
+			case ESC_THROW:
+				Exception::ThrowCommand( Command + 2 );
+				break;
+
+			default:
+				char temporary[64];
+				GetDefaultNameFromES(Command[1],temporary);
+				SetError(30,temporary,cp);
+				break;
+		}
+		return;
+	}
+	switch(MAKEWORD(Command[1],Command[0])){
+		case COM_DIM:
+			OpcodeDim(Command+2,0);
+			break;
+		case COM_DELETE:
+			OpcodeDelete(Command+2, false);
+			break;
+		case COM_SWEEPINGDELETE:
+			OpcodeDelete(Command+2, true);
+			break;
+
+		case COM_GOTO:
+			OpcodeGoto(Command+2);
+			break;
+		case COM_WHILE:
+			OpcodeWhile(Command+2);
+			break;
+		case COM_FOR:
+			OpcodeFor(Command+2);
+			break;
+		case COM_DO:
+			OpcodeDo(Command+2);
+			break;
+
+		case COM_GOSUB:
+			OpcodeGosub(Command+2);
+			break;
+		case COM_RETURN:
+			OpcodeReturn(Command+2);
+			break;
+
+		case COM_SETDOUBLE:
+			OpcodeSetPtrData(Command+2,DEF_DOUBLE);
+			break;
+		case COM_SETSINGLE:
+			OpcodeSetPtrData(Command+2,DEF_SINGLE);
+			break;
+		case COM_SETQWORD:
+			OpcodeSetPtrData(Command+2,DEF_QWORD);
+			break;
+		case COM_SETDWORD:
+			OpcodeSetPtrData(Command+2,DEF_DWORD);
+			break;
+		case COM_SETWORD:
+			OpcodeSetPtrData(Command+2,DEF_WORD);
+			break;
+		case COM_SETBYTE:
+			OpcodeSetPtrData(Command+2,DEF_BYTE);
+			break;
+
+		case COM_DEBUG:
+			extern BOOL bDebugCompile;
+			//int 3
+			if(bDebugCompile) OpBuffer[obp++]=(char)0xCC;
+#if defined(_DEBUG)
+			else OpBuffer[obp++]=(char)0xCC;
+#endif
+			break;
+
+		case COM_LET:
+			OpcodeCalc(Command+2);
+			break;
+		default:
+			OpcodeOthers(Command);
+			break;
+	}
+}
+
+void GetGlobalDataForDll(void){
+	extern char *basbuf;
+	extern HANDLE hHeap;
+	int i2,BufferSize;
+	char *Command;
+	DWORD dwRetCode;
+
+	dwRetCode=0;
+	BufferSize=128;
+	Command=(char *)HeapAlloc(hHeap,0,BufferSize);
+	for(cp++,i2=0;;cp++,i2++){
+		if(i2>=BufferSize){
+			//バッファ領域が足りなくなった場合はバッファを増量する
+			BufferSize+=128;
+			Command=(char *)HeapReAlloc(hHeap,0,Command,BufferSize);
+		}
+		if(basbuf[cp]=='\"'){
+			Command[i2]=basbuf[cp];
+			for(cp++,i2++;;cp++,i2++){
+				if(i2>=BufferSize){
+					//バッファ領域が足りなくなった場合はバッファを増量する
+					BufferSize+=128;
+					Command=(char *)HeapReAlloc(hHeap,0,Command,BufferSize);
+				}
+				Command[i2]=basbuf[cp];
+				if(basbuf[cp]=='\"') break;
+			}
+			continue;
+		}
+		if(IsCommandDelimitation(basbuf[cp])){
+			Command[i2]=0;
+
+			if(Command[0]==1&&Command[1]==ESC_SUB){
+				i2=cp;
+				while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDSUB)){
+					if(basbuf[cp]=='\0'){
+						SetError(22,"Sub",i2);
+						break;
+					}
+					cp++;
+				}
+				if(basbuf[cp+2]=='\0'||basbuf[cp]=='\0') break;
+				cp+=2;
+				i2=-1;
+				continue;
+			}
+			if(Command[0]==1&&Command[1]==ESC_FUNCTION){
+				i2=cp;
+				while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDFUNCTION)){
+					if(basbuf[cp]=='\0'){
+						SetError(22,"Function",i2);
+						break;
+					}
+					cp++;
+				}
+				if(basbuf[cp+2]=='\0'||basbuf[cp]=='\0') break;
+				cp+=2;
+				i2=-1;
+				continue;
+			}
+			if(Command[0]==1&&Command[1]==ESC_MACRO){
+				i2=cp;
+				while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDMACRO)){
+					if(basbuf[cp]=='\0'){
+						SetError(22,"Macro",i2);
+						break;
+					}
+					cp++;
+				}
+				if(basbuf[cp+2]=='\0'||basbuf[cp]=='\0') break;
+				cp+=2;
+				i2=-1;
+				continue;
+			}
+			if(Command[0]==1&&Command[1]==ESC_TYPE){
+				i2=cp;
+				while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDTYPE)){
+					if(basbuf[cp]=='\0'){
+						SetError(22,"Type",i2);
+						break;
+					}
+					cp++;
+				}
+				if(basbuf[cp+2]=='\0'||basbuf[cp]=='\0') break;
+				cp+=2;
+				i2=-1;
+				continue;
+			}
+			if(Command[0]==1&&Command[1]==ESC_CLASS){
+				i2=cp;
+				while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDCLASS)){
+					if(basbuf[cp]=='\0'){
+						SetError(22,"Class",i2);
+						break;
+					}
+					cp++;
+				}
+				if(basbuf[cp+2]=='\0'||basbuf[cp]=='\0') break;
+				cp+=2;
+				i2=-1;
+				continue;
+			}
+			if(Command[0]==1&&Command[1]==ESC_INTERFACE){
+				i2=cp;
+				while(!(basbuf[cp]==1&&basbuf[cp+1]==ESC_ENDINTERFACE)){
+					if(basbuf[cp]=='\0'){
+						SetError(22,"Interface",i2);
+						break;
+					}
+					cp++;
+				}
+				if(basbuf[cp+2]=='\0'||basbuf[cp]=='\0') break;
+				cp+=2;
+				i2=-1;
+				continue;
+			}
+
+			//DLLのグローバルデータに必要なコマンドだけ
+			if(MAKEWORD(Command[1],Command[0])==COM_DIM)
+				OpcodeDim(Command+2,0);
+
+			// ネイティブコードバッファの再確保
+			ReallocNativeCodeBuffer();
+
+			if(basbuf[cp]=='\0') break;
+			i2=-1;
+			continue;
+		}
+		Command[i2]=basbuf[cp];
+	}
+	HeapDefaultFree(Command);
+}
+DWORD CompileBuffer(char Return_Sequence,WORD Return_Command){
+	extern char *basbuf;
+	extern HANDLE hHeap;
+	int i,i2,i3,i4,BufferSize,ScopeStart;
+	char *Command,temporary[VN_SIZE],*temp2,temp3[32];
+	DWORD dwRetCode;
+
+	ScopeStart=cp;
+
+	dwRetCode=0;
+	BufferSize=128;
+	Command=(char *)HeapAlloc(hHeap,0,BufferSize);
+
+	for(cp++,i2=0;;cp++,i2++){
+		if(i2>=BufferSize){
+			//バッファ領域が足りなくなった場合はバッファを増量する
+			BufferSize+=128;
+			Command=(char *)HeapReAlloc(hHeap,0,Command,BufferSize);
+		}
+		if(basbuf[cp]=='\"'){
+			Command[i2]=basbuf[cp];
+			for(cp++,i2++;;cp++,i2++){
+				if(i2>=BufferSize){
+					//バッファ領域が足りなくなった場合はバッファを増量する
+					BufferSize+=128;
+					Command=(char *)HeapReAlloc(hHeap,0,Command,BufferSize);
+				}
+				Command[i2]=basbuf[cp];
+				if(basbuf[cp]=='\"') break;
+			}
+			continue;
+		}
+		if(IsCommandDelimitation(basbuf[cp])){
+			Command[i2]=0;
+
+			if(Command[0]==1&&Command[1]==ESC_LINENUM){
+				for(i=2,i2=0;;i++,i2++){
+					if(Command[i]==','){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=Command[i];
+				}
+				i3=atoi(temporary);
+				i4=i+1;
+
+				//Goto先ラベル
+				pLabelNames=(LABEL *)HeapReAlloc(hHeap,0,pLabelNames,(MaxLabelNum+1)*sizeof(LABEL));
+				pLabelNames[MaxLabelNum].pName=0;
+				pLabelNames[MaxLabelNum].line=i3;
+				pLabelNames[MaxLabelNum].address=obp;
+				MaxLabelNum++;
+
+				//書き込みスケジュール
+				for(i=0;i<GotoLabelScheduleNum;i++){
+					if(pGotoLabelSchedule[i].pName==0&&
+						pGotoLabelSchedule[i].line==i3){
+						*((long *)(OpBuffer+pGotoLabelSchedule[i].pos))=obp-(pGotoLabelSchedule[i].pos+sizeof(long));
+
+						//詰める
+						GotoLabelScheduleNum--;
+						for(i2=i;i2<GotoLabelScheduleNum;i2++){
+							pGotoLabelSchedule[i2].pName=pGotoLabelSchedule[i2+1].pName;
+							pGotoLabelSchedule[i2].line=pGotoLabelSchedule[i2+1].line;
+							pGotoLabelSchedule[i2].pos=pGotoLabelSchedule[i2+1].pos;
+						}
+						i--;
+					}
+				}
+
+				temp2=(char *)HeapAlloc(hHeap,0,lstrlen(Command+i4)+1);
+				lstrcpy(temp2,Command+i4);
+				lstrcpy(Command,temp2);
+				HeapDefaultFree(temp2);
+			}
+
+			if(Command[0]==1&&
+				(((Command[1]==ESC_VIRTUAL||Command[1]==ESC_OVERRIDE)&&Command[2]==1&&(Command[3]==ESC_SUB||Command[3]==ESC_FUNCTION))||
+				Command[1]==ESC_SUB||
+				Command[1]==ESC_FUNCTION||
+				Command[1]==ESC_MACRO||
+				Command[1]==ESC_TYPE||
+				Command[1]==ESC_CLASS||
+				Command[1]==ESC_INTERFACE||
+				Command[1]==ESC_ENUM||
+				(Command[1]==ESC_CONST&&Command[2]==1&&Command[3]==ESC_ENUM)
+				)
+				){
+				if(Command[1]==ESC_VIRTUAL||Command[1]==ESC_OVERRIDE||Command[1]==ESC_CONST){
+					GetDefaultNameFromES(Command[3],temporary);
+				}
+				else{
+					GetDefaultNameFromES(Command[1],temporary);
+				}
+				if(Return_Sequence){
+					SetError(12,temporary,cp);
+					break;
+				}
+
+				if(Command[1]==ESC_CONST) i3=GetEndXXXCommand(Command[3]);
+				else i3=GetEndXXXCommand(Command[1]);
+				for(i2=cp;;cp++){
+					if(basbuf[cp]==1){
+						if(basbuf[cp+1]==i3) break;
+						if(Command[1]==ESC_CLASS||Command[1]==ESC_INTERFACE){
+							//クラス、インターフェイスではSub、Functionの定義を可能にしておく
+							if(basbuf[cp+1]==ESC_MACRO||
+								basbuf[cp+1]==ESC_TYPE||
+								basbuf[cp+1]==ESC_CLASS||
+								basbuf[cp+1]==ESC_INTERFACE||
+								basbuf[cp+1]==ESC_ENUM){
+								GetDefaultNameFromES(basbuf[cp+1],temp3);
+								SetError(12,temp3,cp);
+							}
+						}
+						else{
+							if(basbuf[cp-1]!='*'&&(
+								basbuf[cp+1]==ESC_VIRTUAL||
+								basbuf[cp+1]==ESC_OVERRIDE||
+								basbuf[cp+1]==ESC_SUB||
+								basbuf[cp+1]==ESC_FUNCTION||
+								basbuf[cp+1]==ESC_MACRO||
+								basbuf[cp+1]==ESC_TYPE||
+								basbuf[cp+1]==ESC_CLASS||
+								basbuf[cp+1]==ESC_INTERFACE||
+								basbuf[cp+1]==ESC_ENUM)){
+								GetDefaultNameFromES(basbuf[cp+1],temp3);
+								SetError(12,temp3,cp);
+							}
+						}
+					}
+					if(basbuf[cp]=='\0'){
+						//error
+						//既にエラー発行済みのため、何もせずに抜ける
+						break;
+					}
+				}
+				if(basbuf[cp+2]=='\0'||basbuf[cp]=='\0') break;
+				cp+=2;
+				i2=-1;
+				continue;
+			}
+
+			if(Command[0]==0x10||Command[0]==0x11){
+				//Wend、Next、Loopなど
+				if(Return_Command==MAKEWORD(Command[1],Command[0])){
+					if(Return_Command==COM_NEXT){
+						//Nextの場合は、パラメータ（省略化）の整合性を判断する必要がある（OpcodeFor関数を参照）
+						extern char szNextVariable[VN_SIZE];
+						if(Command[2]) lstrcpy(szNextVariable,Command+2);
+						else szNextVariable[0]=0;
+					}
+					break;
+				}
+			}
+
+			NextLine();
+
+			if(Command[0]==1){
+				if(Return_Sequence==ESC_ENDIF&&Command[1]==ESC_ELSE){
+					dwRetCode=ESC_ELSE;
+					break;
+				}
+
+				if(Command[1]==Return_Sequence){
+					dwRetCode=Command[1];
+					break;
+				}
+			}
+
+			ChangeOpcode(Command);
+
+#ifdef _DEBUG
+			epi_check();
+#endif
+
+			//コンパイルを中断するとき
+			extern BOOL bStopCompile;
+			if(bStopCompile) return 0;
+
+			if(obp_AllocSize<obp+8192){
+				obp_AllocSize+=8192;
+				OpBuffer=(char *)HeapReAlloc(hHeap,0,OpBuffer,obp_AllocSize);
+			}
+
+			if(basbuf[cp]=='\0'){
+				switch(Return_Command){
+					case COM_WEND:
+						SetError(4,"\"While\" - \"Wend\" ",ScopeStart);
+						break;
+					case COM_NEXT:
+						SetError(4,"\"For\" - \"Next\" ",ScopeStart);
+						break;
+					case COM_LOOP:
+						SetError(4,"\"Do\" - \"Loop\" ",ScopeStart);
+						break;
+				}
+				switch(Return_Sequence){
+					case ESC_ENDSUB:
+						SetError(4,"\"Sub\" - \"End Sub\" ",ScopeStart);
+						break;
+					case ESC_ENDFUNCTION:
+						SetError(4,"\"Function\" - \"End Function\" ",ScopeStart);
+						break;
+					case ESC_ENDMACRO:
+						SetError(4,"\"Macro\" - \"End Macro\" ",ScopeStart);
+						break;
+					case ESC_ENDIF:
+						SetError(22,"If",ScopeStart);
+						break;
+				}
+				break;
+			}
+			i2=-1;
+			continue;
+		}
+		Command[i2]=basbuf[cp];
+	}
+	HeapDefaultFree(Command);
+
+	return dwRetCode;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Const.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Const.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Const.cpp	(revision 178)
@@ -0,0 +1,230 @@
+#include "common.h"
+#include OPCODE_H_PATH	//opcode.h
+
+
+//シングルトンオブジェクト
+CDBConst CDBConst::obj;
+
+
+bool ConstBase::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	if( GetName() != name ){
+		return false;
+	}
+	return NamespaceScopes::IsSameArea( this->namespaceScopes, namespaceScopes );
+}
+bool ConstBase::IsEqualSymbol( const string &fullName ) const
+{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
+
+	return IsEqualSymbol( NamespaceScopes( AreaName ), NestName );
+}
+
+
+
+
+CConst::CConst( const NamespaceScopes &namespaceScopes, const string &name, const Type &type, _int64 i64data)
+	: ConstBase( namespaceScopes, name )
+	, type( type )
+	, i64data( i64data )
+	, pNext( NULL )
+{
+}
+CConst::CConst( const NamespaceScopes &namespaceScopes, const string &name, int value)
+	: ConstBase( namespaceScopes, name )
+	, type( Type(DEF_LONG) )
+	, i64data( value )
+	, pNext( NULL )
+{
+}
+CConst::~CConst(){
+	//連結先のオブジェクトを破棄
+	if(pNext){
+		delete pNext;
+		pNext = 0;
+	}
+}
+
+Type CConst::GetType(){
+	return type;
+}
+_int64 CConst::GetWholeData(){
+	return i64data;
+}
+double CConst::GetDoubleData(){
+	double dbl;
+	memcpy(&dbl,&i64data,sizeof(_int64));
+	return dbl;
+}
+
+
+
+CConstMacro::CConstMacro( const NamespaceScopes &namespaceScopes, const string &name, char *Expression)
+	: ConstBase( namespaceScopes, name )
+{
+}
+CConstMacro::~CConstMacro(){
+}
+
+
+
+
+
+CDBConst::CDBConst(){
+	memset(this,0,sizeof(CDBConst));
+
+	ppHash = (CConst **)calloc(MAX_HASH*sizeof(CConst *),1);
+	Init();
+}
+CDBConst::~CDBConst(){
+	Free();
+
+	free(ppHash);
+}
+
+//解放
+void CDBConst::Free(){
+	int i;
+	for(i=0; i<MAX_HASH; i++){
+		if(ppHash[i]){
+			delete ppHash[i];
+			ppHash[i] = 0;
+		}
+	}
+}
+
+//初期化
+void CDBConst::Init(){
+	Free();
+}
+
+void AddConstData(char *Command);
+void CDBConst::Add( const NamespaceScopes &namespaceScopes, char *buffer ){
+	int i;
+
+	//名前を取得
+	char Name[VN_SIZE];
+	for(i=0;;i++){
+		if(buffer[i]=='\0'){
+			SetError(10,"Const",cp);
+			return;
+		}
+		if(buffer[i]=='='||buffer[i]=='('){
+			Name[i]=0;
+			break;
+		}
+		Name[i]=buffer[i];
+	}
+
+	//重複チェック
+	if(GetBasicType(Name)){
+		SetError(15,Name,cp);
+		return;
+	}
+
+	if(buffer[i] == '('){
+		//定数マクロ
+
+		//未完成
+		AddConstData(buffer);
+	}
+	else{
+		//一般の定数
+		char *Expression = buffer + i + 1;
+
+		AddConst( namespaceScopes, Name,Expression);
+	}
+}
+
+void CDBConst::AddConst( const string &name, CConst *newconst){
+	int key = hash_default(name.c_str());
+
+	//ハッシュリストに追加
+	if(ppHash[key]){
+		CConst *pConst = ppHash[key];
+		while(pConst->pNext){
+			pConst = pConst->pNext;
+		}
+
+		pConst->pNext = newconst;
+	}
+	else{
+		ppHash[key] = newconst;
+	}
+}
+void CDBConst::AddConst( const NamespaceScopes &namespaceScopes, const string &name , char *Expression){
+	_int64 i64data;
+	Type resultType;
+	if( !StaticCalculation(false, Expression, 0, &i64data, resultType) ){
+		//変数の場合
+		//何もしない（実行領域コンパイル時にdim宣言として扱う）
+		return;
+	}
+
+	//リテラル値の場合
+	//登録を行う
+
+	CConst *newconst = new CConst(namespaceScopes, name, resultType, i64data);
+
+	AddConst( name, newconst);
+}
+void CDBConst::AddConst(const NamespaceScopes &namespaceScopes, const string &name, int value){
+	CConst *newconst = new CConst( namespaceScopes, name, value);
+
+	AddConst(name, newconst);
+}
+
+CConst *CDBConst::GetObjectPtr( const string &name ){
+	char ObjName[VN_SIZE];		//オブジェクト変数
+	char NestMember[VN_SIZE];	//入れ子メンバ
+	bool isObjectMember = SplitMemberName( name.c_str(), ObjName, NestMember );
+
+	//ハッシュ値を取得
+	int key;
+	key=hash_default( NestMember );
+
+	//格納位置を取得
+	CConst *pConst;
+	pConst=ppHash[key];
+	while(pConst){
+		if( pConst->IsEqualSymbol( name ) ) break;
+
+		pConst=pConst->pNext;
+	}
+
+	return pConst;
+}
+
+
+int CDBConst::GetBasicType(char *Name){
+	CConst *pConst = GetObjectPtr(Name);
+
+	if(!pConst) return 0;
+
+	return pConst->GetType().GetBasicType();
+}
+_int64 CDBConst::GetWholeData(char *Name){
+	CConst *pConst = GetObjectPtr(Name);
+
+	if(!pConst) return 0;
+
+	return pConst->GetWholeData();
+}
+double CDBConst::GetDoubleData(char *Name){
+	CConst *pConst = GetObjectPtr(Name);
+
+	if(!pConst) return 0;
+
+	return pConst->GetDoubleData();
+}
+bool CDBConst::IsStringPtr( char *Name ){
+	CConst *pConst = GetObjectPtr(Name);
+
+	if(!pConst) return false;
+
+	const Type &type = pConst->GetType();
+
+	return ( type.GetBasicType() == typeOfPtrChar && type.GetIndex() == LITERAL_STRING );
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Const.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Const.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Const.h	(revision 178)
@@ -0,0 +1,91 @@
+
+
+//定数の基底クラス
+class ConstBase{
+	const string name;
+	const NamespaceScopes namespaceScopes;
+
+public:
+
+	ConstBase( const NamespaceScopes &namespaceScopes, const string &name )
+		: namespaceScopes( namespaceScopes )
+		, name( name )
+	{
+	}
+	~ConstBase()
+	{
+	}
+
+	const string &GetName() const
+	{
+		return name;
+	}
+
+	bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	bool IsEqualSymbol( const string &name ) const;
+};
+
+//定数
+class CConst:public ConstBase{
+	Type type;
+	_int64 i64data;
+
+public:
+	CConst *pNext;
+
+	CConst( const NamespaceScopes &namespaceScopes, const string &name, const Type &type, _int64 i64data);
+	CConst( const NamespaceScopes &namespaceScopes, const string &name, int value);
+	~CConst();
+
+	Type GetType();
+	_int64 GetWholeData();
+	double GetDoubleData();
+};
+
+//定数マクロ
+class CConstMacro:public ConstBase{
+	int ParmNum;
+	char **ppParm;
+public:
+
+	CConstMacro( const NamespaceScopes &namespaceScopes, const string &name, char *Expression);
+	~CConstMacro();
+};
+
+//定数管理クラス
+class CDBConst{
+	CConst **ppHash;
+
+	CConstMacro **ppobj_Macro;
+	int NumOfMacro;
+
+	//シングルトンクラスなので、プライベートに置く
+	CDBConst();
+	~CDBConst();
+	void _free();
+	void Free();
+
+public:
+
+	void Init();
+
+	void Add( const NamespaceScopes &namespaceScopes, char *buffer);
+private:
+	void AddConst( const string &name, CConst *newconst);
+public:
+	void AddConst( const NamespaceScopes &namespaceScopes, const string &name, char *Expression);
+	void AddConst( const NamespaceScopes &namespaceScopes, const string &name, int value);
+
+private:
+	CConst *GetObjectPtr( const string &name );
+public:
+
+	int GetBasicType(char *Name);
+	_int64 GetWholeData(char *Name);
+	double GetDoubleData(char *Name);
+	bool IsStringPtr(char *Name);
+
+
+	//シングルトンオブジェクト
+	static CDBConst obj;
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/DataTable.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/DataTable.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/DataTable.cpp	(revision 178)
@@ -0,0 +1,91 @@
+#include "common.h"
+
+DataTable dataTable;
+
+DataTable::DataTable(){
+	pdata = malloc( 1 );
+	size = 0;
+}
+DataTable::~DataTable(){
+	free( pdata );
+}
+
+void DataTable::Init(){
+	free( pdata );
+
+	pdata = malloc( 1 );
+	size = 0;
+}
+
+int DataTable::AddBinary( const void *pdata, int size ){
+	int retSize = this->size;
+
+	this->pdata = realloc( this->pdata, this->size + size );
+	memcpy( (char *)this->pdata + this->size, pdata, size );
+	this->size += size;
+
+	return retSize;
+}
+int DataTable::Add( _int64 i64data ){
+	int retSize = size;
+	AddBinary( &i64data, sizeof( _int64 ) );
+	return retSize;
+}
+int DataTable::Add( int i32data ){
+	int retSize = size;
+	AddBinary( &i32data, sizeof( int ) );
+	return retSize;
+}
+int DataTable::Add( double dbl ){
+	int retSize = size;
+	AddBinary( &dbl, sizeof( double ) );
+	return retSize;
+}
+int DataTable::Add( float flt ){
+	int retSize = size;
+	AddBinary( &flt, sizeof( float ) );
+	return retSize;
+}
+int DataTable::AddString( const char *str, int length ){
+	int retSize = size;
+
+	if( isUnicode ){
+		//Shift-JIS → Unicode
+		int size = MultiByteToWideChar(
+			CP_ACP,
+			0,
+			str, length + 1,
+			NULL, 0 ) * 2;
+
+		LPWSTR pwstr = (LPWSTR)malloc( size );
+
+		MultiByteToWideChar(
+			CP_ACP,
+			0,
+			str, length + 1,
+			pwstr, length + 1 );
+
+		AddBinary( pwstr, size );
+
+		free( pwstr );
+	}
+	else{
+		AddBinary( str, length + 1 );
+	}
+
+	return retSize;
+}
+int DataTable::AddString( const char *str ){
+	int retSize = size;
+	AddString( str, lstrlen( str ) );
+	return retSize;
+}
+
+const void *DataTable::GetPtr() const
+{
+	return pdata;
+}
+int DataTable::GetSize() const
+{
+	return size;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Debug.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Debug.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Debug.cpp	(revision 178)
@@ -0,0 +1,767 @@
+#include "../BasicCompiler_Common/common.h"
+
+//デバッグ用
+#include "../BasicCompiler_Common/debug.h"
+
+extern char *OpBuffer;
+
+extern DWORD dwStepRun;
+
+HANDLE hDebugProcess;
+
+DWORD _DebugSys_dwThreadID[MAX_DEBUG_THREAD];
+HANDLE array_hDebugThread[MAX_DEBUG_THREAD];
+
+int StepCursorObpSchedule=-1;
+int StepCursor_BackupChar;
+
+int NextStepThreadNum;
+
+
+void Debugger_StepIn(void){
+	dwStepRun=1;
+}
+void Debugger_StepOver(void){
+	dwStepRun=2;
+}
+
+void Debugger_StepCursor(void){
+	char temporary[MAX_PATH];
+	GetTempPath(MAX_PATH,temporary);
+	if(temporary[lstrlen(temporary)-1]!='\\') lstrcat(temporary,"\\");
+	lstrcat(temporary,"ab_breakpoint.tmp");
+
+	char *buffer;
+	buffer=ReadBuffer_NonErrMsg(temporary);
+
+	int i=0;
+	char szFilePath[MAX_PATH];
+	i=GetOneParameter(buffer,i,szFilePath);
+	RemoveStringQuotes(szFilePath);
+
+	int iLineNum;
+	i=GetOneParameter(buffer,i,temporary);
+	iLineNum=atoi(temporary);
+
+
+
+	/////////////////////////////////////////////////////////
+	// デバッグ中プロセスのネイティブバッファ領域を更新
+	/////////////////////////////////////////////////////////
+
+	extern INCLUDEFILEINFO IncludeFileInfo;
+
+	int FileNum;
+	for(FileNum=0;FileNum<IncludeFileInfo.FilesNum;FileNum++){
+		if(lstrcmpi(IncludeFileInfo.ppFileNames[FileNum],szFilePath)==0) break;
+	}
+	if(FileNum==IncludeFileInfo.FilesNum) return;
+
+	for(i=0;;i++){
+		if(IncludeFileInfo.LineOfFile[i]==FileNum||
+			IncludeFileInfo.LineOfFile[i]==-1) break;
+	}
+	if(IncludeFileInfo.LineOfFile[i]==-1) return;
+
+	int FileBaseLine;
+	FileBaseLine=i;
+
+	int i2;
+	for(i2=0;;i++,i2++){
+		if(FileNum<IncludeFileInfo.LineOfFile[i]){
+			while(FileNum!=IncludeFileInfo.LineOfFile[i]) i++;
+		}
+
+		if(i2==iLineNum){
+			extern int MaxLineInfoNum;
+			extern LINEINFO *pLineInfo;
+
+loop:
+			int tempCp;
+			tempCp=GetCpFromLine(FileBaseLine+i2);
+
+			int i3;
+			for(i3=0;i3<MaxLineInfoNum-1;i3++){
+				if(pLineInfo[i3].TopCp==tempCp) break;
+			}
+			if(i3==MaxLineInfoNum-1){
+				i2--;
+				goto loop;
+			}
+
+			StepCursorObpSchedule=pLineInfo[i3].TopObp;
+			StepCursor_BackupChar=pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer[StepCursorObpSchedule];
+
+			pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer[StepCursorObpSchedule]=(char)0xCC;
+
+			break;
+		}
+	}
+
+	extern HWND hDebugWnd;
+	SendMessage(hDebugWnd,WM_DEBUG_CONTINUE,0,0);
+
+
+
+	HeapDefaultFree(buffer);
+}
+void Debugger_Stop(void){
+	//プロセスを終了
+	TerminateProcess(hDebugProcess,0);
+	hDebugProcess=0;
+
+	//デバッグダイアログを終了
+	extern HWND hDebugWnd;
+	if(hDebugWnd){
+		DestroyWindow(hDebugWnd);
+	}
+}
+void Debugger_Pause(void){
+	///////////////////////////
+	// デバッグを一時中断
+	///////////////////////////
+
+	//ターゲットプロセス内のスレッドを一時中断
+	int i;
+	for(i=0;i<MAX_DEBUG_THREAD;i++){
+		if(_DebugSys_dwThreadID[i])
+			SuspendThread(array_hDebugThread[i]);
+	}
+
+	//デバッグレジスタにフラグをセット
+	CONTEXT Context;
+	for(i=0;i<MAX_DEBUG_THREAD;i++){
+		if(_DebugSys_dwThreadID[i]){
+			Context.ContextFlags=CONTEXT_CONTROL|CONTEXT_DEBUG_REGISTERS;
+			GetThreadContext(array_hDebugThread[i],&Context);
+			Context.EFlags|=0x100;
+			SetThreadContext(array_hDebugThread[i],&Context);
+		}
+	}
+
+	//スレッドを再開
+	for(i=0;i<MAX_DEBUG_THREAD;i++){
+		if(_DebugSys_dwThreadID[i])
+			ResumeThread(array_hDebugThread[i]);
+	}
+}
+
+void ReleaseCPUSingleStep(void){
+	////////////////////////////////////////
+	// CPU機構のシングルステップを解除
+	////////////////////////////////////////
+
+	//ターゲットプロセス内のスレッドを一時中断
+	int i;
+	for(i=0;i<MAX_DEBUG_THREAD;i++){
+		if(_DebugSys_dwThreadID[i])
+			SuspendThread(array_hDebugThread[i]);
+	}
+
+	//デバッグレジスタにフラグをセット
+	CONTEXT Context;
+	for(i=0;i<MAX_DEBUG_THREAD;i++){
+		if(_DebugSys_dwThreadID[i]){
+			Context.ContextFlags=CONTEXT_CONTROL|CONTEXT_DEBUG_REGISTERS;
+			GetThreadContext(array_hDebugThread[i],&Context);
+			Context.EFlags&=~0x00000100;
+			SetThreadContext(array_hDebugThread[i],&Context);
+		}
+	}
+
+	//スレッドを再開
+	for(i=0;i<MAX_DEBUG_THREAD;i++){
+		if(_DebugSys_dwThreadID[i])
+			ResumeThread(array_hDebugThread[i]);
+	}
+}
+
+
+ULONG_PTR rva_to_real(DWORD p){
+	extern DWORD ImageBase;
+	extern int MemPos_CodeSection;
+	return p+ImageBase+MemPos_CodeSection;
+}
+
+void ShowVarList(DEBUG_EVENT *pde,BOOL bExit){
+	extern DWORD ImageBase;
+	extern int MemPos_RWSection;
+
+	//デバッグダイアログを表示
+	extern HINSTANCE hInst;
+	extern HWND hMainDlg;
+	extern HWND hDebugWnd;
+	dwStepRun=0;
+	if(!hDebugWnd) SendMessage(hMainDlg,WM_SHOWVARLIST,0,pde->dwThreadId);
+	else InitVarList(pde->dwThreadId);
+
+	if(bExit){
+		//"中断"
+		SetDlgItemText(hMainDlg,IDOK,STRING_CLOSE);
+
+		extern HWND hDebuggerToolbar;
+		SendMessage(hDebuggerToolbar,TB_SETSTATE,IDC_DEBUG_START,TBSTATE_INDETERMINATE);
+		SendMessage(hDebuggerToolbar,TB_SETSTATE,IDC_DEBUG_STEPOVER,TBSTATE_INDETERMINATE);
+		SendMessage(hDebuggerToolbar,TB_SETSTATE,IDC_DEBUG_STEPIN,TBSTATE_INDETERMINATE);
+	}
+	else{
+		//"継続"
+		SetDlgItemText(hDebugWnd,IDCANCEL,STRING_CONTINUE);
+	}
+	while(hDebugWnd&&dwStepRun==0) Sleep(1);
+}
+void DebugMessage(char *buffer){
+	extern HWND hMainDlg;
+	int pos;
+
+	if(!IsWindowEnabled(GetDlgItem(hMainDlg,IDC_DEBUGLIST))){
+		SetDlgItemText(hMainDlg,IDC_DEBUGLIST,"");
+		EnableWindow(GetDlgItem(hMainDlg,IDC_DEBUGLIST),1);
+	}
+
+	pos=GetWindowTextLength(GetDlgItem(hMainDlg,IDC_DEBUGLIST));
+	SendDlgItemMessage(hMainDlg,IDC_DEBUGLIST,EM_SETSEL,pos,pos);
+	SendDlgItemMessage(hMainDlg,IDC_DEBUGLIST,EM_REPLACESEL,0,(LPARAM)buffer);
+}
+GlobalProc *GetSubFromObp(ULONG_PTR pos){
+	extern GlobalProc **ppSubHash;
+	GlobalProc *pUserProc;
+	int i2;
+
+	for(i2=0;i2<MAX_HASH;i2++){
+		pUserProc=ppSubHash[i2];
+		while(pUserProc){
+			if(rva_to_real(pUserProc->beginOpAddress) <= pos  &&
+				pos < rva_to_real(pUserProc->endOpAddress))
+				return pUserProc;
+
+			pUserProc=pUserProc->pNextData;
+		}
+	}
+	return 0;
+}
+void ReleaseSingleStep(DWORD dwBeforeStepRun,HANDLE hThread,CONTEXT *pContext){
+	//以前にシングルステップ実行をした場合
+	extern DWORD ImageBase;
+	extern int MemPos_CodeSection;
+	extern int FileSize_CodeSection;
+	int i2;
+	ULONG_PTR lpAccBytes;
+
+	///////////////////////////
+	// シングルステップOFF
+	///////////////////////////
+
+	//ユーザー指定のブレークポイントをセット
+	WriteProcessMemory(hDebugProcess,
+		(void *)(ULONG_PTR)(ImageBase+MemPos_CodeSection),
+		pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer,
+		FileSize_CodeSection,&lpAccBytes);
+
+	//次に実行すべき命令はユーザー指定によるブレークポイントをはずしておく
+	if(ImageBase+MemPos_CodeSection<=EIP_RIP(*pContext)&&EIP_RIP(*pContext)<ImageBase+MemPos_CodeSection+FileSize_CodeSection){
+		if(OpBuffer[EIP_RIP(*pContext)-ImageBase-MemPos_CodeSection-1]!=
+			pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer[EIP_RIP(*pContext)-ImageBase-MemPos_CodeSection-1]){
+			//直前のブレークポイントがユーザー指定によるものだったとき
+
+			//eip/ripを1だけ減少
+			EIP_RIP(*pContext)--;
+			SetThreadContext(hThread,pContext);
+
+			//ブレークポイントを解除
+			WriteProcessMemory(hDebugProcess,(void *)EIP_RIP(*pContext),&OpBuffer[EIP_RIP(*pContext)-ImageBase-MemPos_CodeSection],1,&lpAccBytes);
+
+
+			extern int StepCursorObpSchedule;
+			if(StepCursorObpSchedule==(int)(EIP_RIP(*pContext)-ImageBase-MemPos_CodeSection)){
+				//カーソル行までのステップ実行の場合
+				pobj_DBDebugSection->pobj_now->BreakStepCodeBuffer[StepCursorObpSchedule]=StepCursor_BackupChar;
+				StepCursorObpSchedule=-1;
+			}
+
+			return;
+		}
+	}
+
+
+	if(dwBeforeStepRun){
+		//直前にシングルステップを行った場合
+		if(ImageBase+MemPos_CodeSection <= EIP_RIP(*pContext) &&
+			EIP_RIP(*pContext) < ImageBase+MemPos_CodeSection+FileSize_CodeSection){
+			//オリジナルコード内のみ、シングルステップ用の"int 3"を考慮
+			EIP_RIP(*pContext)--;
+			SetThreadContext(hThread,pContext);
+		}
+
+		//他のスレッドのサスペンドを解除
+		for(i2=0;i2<MAX_DEBUG_THREAD;i2++){
+			if(array_hDebugThread[i2] && hThread!=array_hDebugThread[i2])
+				ResumeThread(array_hDebugThread[i2]);
+		}
+	}
+}
+
+void Set_DebugSys_dwThreadID(){
+	int i;
+	for(i=0;i<pobj_DBDebugSection->num;i++){
+		ULONG_PTR lpAccBytes;
+		WriteProcessMemory(hDebugProcess,
+			(void *)(ULONG_PTR)(pobj_DBDebugSection->ppobj_ds[i]->dwImageBase + pobj_DBDebugSection->ppobj_ds[i]->dwRVA_RWSection),
+			_DebugSys_dwThreadID,sizeof(DWORD)*MAX_DEBUG_THREAD,&lpAccBytes);
+	}
+}
+void AddThread(DWORD dwThreadId, HANDLE hThread){
+	int i;
+
+
+	for(i=0;i<MAX_DEBUG_THREAD;i++){
+		if(_DebugSys_dwThreadID[i]==0){
+			_DebugSys_dwThreadID[i]=dwThreadId;
+			array_hDebugThread[i]=hThread;
+			break;
+		}
+	}
+
+	Set_DebugSys_dwThreadID();
+}
+void DeleteThread(DWORD dwThreadId){
+	int i;
+
+	for(i=0;i<MAX_DEBUG_THREAD;i++){
+		if(_DebugSys_dwThreadID[i]==dwThreadId){
+			_DebugSys_dwThreadID[i]=0;
+			array_hDebugThread[i]=0;
+			break;
+		}
+	}
+
+	Set_DebugSys_dwThreadID();
+}
+
+void DebugProgram(void){
+	extern HWND hMainDlg;
+	extern char OutputFileName[MAX_PATH];
+	extern DWORD ImageBase;
+	extern int MemPos_CodeSection;
+	extern int MemPos_RWSection;
+	extern int FileSize_CodeSection;
+	int i2,i3,i4;
+	char temporary[1024];
+
+	extern BOOL bDll;
+	char ExeFilePathForDll[MAX_PATH];
+	if(bDll){
+		//DLLをデバッグする場合
+		extern char szDebugExeForDll[1024];
+		if(szDebugExeForDll[0]){
+			//指定済み
+			lstrcpy(ExeFilePathForDll,szDebugExeForDll);
+		}
+		else{
+			//ユーザーに実行ファイルを選択させる
+			extern HWND hOwnerEditor;
+			extern LPSTR ExeFileFilter;
+			if(!GetFilePathDialog(hOwnerEditor,ExeFilePathForDll,ExeFileFilter,"デバッグ用の実行可能ファイルを指定してください。",1)) return;
+		}
+	}
+
+
+	//"中断"
+	SetDlgItemText(hMainDlg,IDOK,STRING_STOP);
+
+	SendMessage(hOwnerEditor,WM_SETDEBUGGERBASE,0,0);
+
+	//カレントディレクトリを設定
+	extern char BasicCurDir[MAX_PATH];
+	SetCurrentDirectory(BasicCurDir);
+
+	SendDlgItemMessage(hMainDlg,IDC_SHOWERROR,BM_SETCHECK,BST_UNCHECKED,0);
+	SendDlgItemMessage(hMainDlg,IDC_SHOWDEBUG,BM_SETCHECK,BST_CHECKED,0);
+	SendMessage(hMainDlg,WM_COMMAND,IDC_SHOWDEBUG,0);
+
+	//ブレークポイントを生成
+	pobj_DBBreakPoint=new CDBBreakPoint;
+
+
+	extern BOOL bAttach;
+	if(bAttach){
+		extern DWORD dwAttachProcessId;
+
+		//プロセスIDを元にハンドルを取得
+		HANDLE hProcess;
+		hProcess=OpenProcess(PROCESS_ALL_ACCESS,0,dwAttachProcessId);
+		if(!hProcess) goto AttachError;
+
+		//そのプロセスにおける実行モジュールのインスタンスハンドルを取得
+		HINSTANCE hModule;
+		DWORD cbReturned;
+		if(!EnumProcessModules( hProcess, &hModule, sizeof(HINSTANCE), &cbReturned )) goto AttachError;
+
+		//実行ファイル名を取得
+		GetModuleFileNameEx(hProcess,hModule,OutputFileName,MAX_PATH);
+
+		CloseHandle(hProcess);
+
+/*
+		//デバッグ用の拡張情報を取得
+		pobj_DebugSection->load(OutputFileName);*/
+
+		if(!DebugActiveProcess(dwAttachProcessId)){
+AttachError:
+			DebugMessage("アタッチに失敗しました。");
+			return;
+		}
+	}
+	else{
+		/*if(!pobj_DebugSection->load(OutputFileName)){
+			extern BOOL bDebugCompile;
+			bDebugCompile=1;
+			OutputExe();
+			pobj_DebugSection->load(OutputFileName);
+		}*/
+
+		//スレッドを生成
+		extern char szDebugCmdLine[1024];
+		STARTUPINFO si;
+		PROCESS_INFORMATION pi;
+		memset(&si,0,sizeof(STARTUPINFO));
+		si.cb=sizeof(STARTUPINFO);
+		if(!bDll){
+			//EXEファイルをデバッグ
+			CreateProcess(OutputFileName,szDebugCmdLine,NULL,NULL,0,NORMAL_PRIORITY_CLASS|DEBUG_ONLY_THIS_PROCESS,NULL,NULL,&si,&pi);
+		}
+		else{
+			//DLLファイルをデバッグ
+			CreateProcess(ExeFilePathForDll,szDebugCmdLine,NULL,NULL,0,NORMAL_PRIORITY_CLASS|DEBUG_ONLY_THIS_PROCESS,NULL,NULL,&si,&pi);
+		}
+
+		CloseHandle(pi.hProcess);
+		CloseHandle(pi.hThread);
+	}
+
+
+	//デバッグ情報データベースを生成
+	pobj_DBDebugSection=new CDBDebugSection();
+
+	//デバッグスレッド情報（プロシージャの階層構造を管理）を生成
+	pobj_dti=new CDebugThreadInfo();
+
+	GlobalProc *pUserProc;
+
+	extern DWORD dwStepRun;
+	BOOL bFirstBreak=1;
+	CONTEXT Context;
+	HANDLE hMainThread;
+	ULONG_PTR lpAccBytes;
+
+	DEBUG_EVENT de;
+	memset(&de,0,sizeof(DEBUG_EVENT));
+
+	while(WaitForDebugEvent(&de,INFINITE)){
+		if(de.dwDebugEventCode==LOAD_DLL_DEBUG_EVENT){
+			WCHAR wcBuf[MAX_PATH];
+			LONG_PTR lpData;
+
+			wcBuf[0]=0;
+			temporary[0]=0;
+
+			if(de.u.LoadDll.lpImageName){
+				if(!ReadProcessMemory(hDebugProcess,de.u.LoadDll.lpImageName,&lpData,sizeof(LONG_PTR),&lpAccBytes)){
+					sprintf(temporary,"ロードされたDLLの名前取得（アドレス:&H%08x）に失敗しました。\r\n",(ULONG_PTR)de.u.LoadDll.lpImageName);
+					DebugMessage(temporary);
+					goto NextContinue;
+				}
+				if(!lpData) goto Attach_DllLoad;
+
+				if(!ReadProcessMemory(hDebugProcess,(void *)lpData,wcBuf,sizeof(WCHAR)*MAX_PATH,&lpAccBytes)){
+					sprintf(temporary,"ロードされたDLLの名前取得（アドレス:&H%08x）に失敗しました。\r\n",lpData);
+					DebugMessage(temporary);
+					goto NextContinue;
+				}
+
+				if(de.dwThreadId,de.u.LoadDll.fUnicode)
+					WideCharToMultiByte(CP_ACP,0,wcBuf,-1,temporary,255,NULL,NULL);
+				else lstrcpy(temporary,(char *)wcBuf);
+			}
+			else{
+Attach_DllLoad:
+				//アタッチした場合
+				GetModuleFileNameEx(hDebugProcess,(HINSTANCE)de.u.LoadDll.lpBaseOfDll,temporary,MAX_PATH);
+			}
+
+			char temp2[1024];
+			sprintf(temp2,"\"%s\" をロードしました。\r\n",temporary);
+			DebugMessage(temp2);
+
+
+			//可能であればデバッグ情報を読みとる
+			if(pobj_DBDebugSection->add((HMODULE)de.u.LoadDll.lpBaseOfDll)){
+				pobj_DBDebugSection->choice(0);
+				Set_DebugSys_dwThreadID();
+			}
+
+
+			/*if(lstrcmpi(temporary, OutputFileName)==0){
+				ImageBase=(DWORD)de.u.LoadDll.lpBaseOfDll;
+
+				AddThread(de.dwThreadId,hMainThread);
+			}*/
+		}
+		else if(de.dwDebugEventCode==UNLOAD_DLL_DEBUG_EVENT){
+			//DLLのアンロード
+
+			pobj_DBDebugSection->del((HMODULE)de.u.UnloadDll.lpBaseOfDll);
+		}
+		else if(de.dwDebugEventCode==CREATE_PROCESS_DEBUG_EVENT){
+			hDebugProcess=de.u.CreateProcessInfo.hProcess;
+			hMainThread=de.u.CreateProcessInfo.hThread;
+
+			if(pobj_DBDebugSection->add((HMODULE)de.u.CreateProcessInfo.lpBaseOfImage)){
+				pobj_DBDebugSection->choice(0);
+			}
+
+			AddThread(de.dwThreadId,de.u.CreateProcessInfo.hThread);
+		}
+		else if(de.dwDebugEventCode==CREATE_THREAD_DEBUG_EVENT){
+			AddThread(de.dwThreadId,de.u.CreateThread.hThread);
+		}
+		else if(de.dwDebugEventCode==EXIT_PROCESS_DEBUG_EVENT){
+			//デバッグダイアログを終了
+			SendMessage(hMainDlg,WM_CLOSE_DEBUGGER,0,0);
+
+			DeleteThread(de.dwThreadId);
+
+			//"スレッド(&H%X)はコード &H%X で終了しました。\r\n"
+			sprintf(temporary,STRING_DEBUG_THREADFINISH,de.dwThreadId,de.u.ExitProcess.dwExitCode);
+			DebugMessage(temporary);
+
+			//"プログラムはコード &H%X で終了しました。\r\n"
+			sprintf(temporary,STRING_DEBUG_PROCESSFINISH,de.u.ExitProcess.dwExitCode);
+			DebugMessage(temporary);
+			break;
+		}
+		else if(de.dwDebugEventCode==EXIT_THREAD_DEBUG_EVENT){
+			//"スレッド(&H%X)はコード &H%X で終了しました。\r\n"
+			sprintf(temporary,STRING_DEBUG_THREADFINISH,de.dwThreadId,de.u.ExitThread.dwExitCode);
+			DebugMessage(temporary);
+
+			//以前にシングルステップ実行をした場合
+			//ステップ実行を解除
+			if(dwStepRun){
+				extern HWND hDebugWnd;
+				if(hDebugWnd) SendMessage(hDebugWnd,WM_VARLIST_CLOSE,0,0);
+
+				for(i4=0;i4<MAX_DEBUG_THREAD;i4++){
+					if(de.dwThreadId==_DebugSys_dwThreadID[i4]) break;
+				}
+				Context.ContextFlags=CONTEXT_CONTROL;
+				GetThreadContext(array_hDebugThread[i4],&Context);
+
+				ReleaseSingleStep(dwStepRun,array_hDebugThread[i4],&Context);
+			}
+
+			DeleteThread(de.dwThreadId);
+		}
+		else if(de.dwDebugEventCode==OUTPUT_DEBUG_STRING_EVENT){
+			ReadProcessMemory(hDebugProcess,(void *)de.u.DebugString.lpDebugStringData,temporary,de.u.DebugString.nDebugStringLength,&lpAccBytes);
+			DebugMessage(temporary);
+		}
+		else if(de.dwDebugEventCode==EXCEPTION_DEBUG_EVENT){
+
+			//////////////////////////////////////
+			// モジュールを再確認
+			// ※DLLへのデバッグ分岐を可能にする
+			//////////////////////////////////////
+
+
+			//初回例外は無視
+			if(bFirstBreak){
+				bFirstBreak=0;
+				goto NextContinue;
+			}
+
+			for(i2=0;;i2++){
+				if(_DebugSys_dwThreadID[i2]==de.dwThreadId) break;
+			}
+
+			//スレッド情報をリフレッシュ
+			if(!pobj_dti->Reflesh(i2)){
+				MessageBox(hOwnerEditor,"デバッグ情報が壊れています。ターゲットファイルを再コンパイルしてください。","ActiveBasic",MB_OK|MB_ICONEXCLAMATION);
+
+				break;
+			}
+
+			if(de.u.Exception.ExceptionRecord.ExceptionCode==EXCEPTION_ACCESS_VIOLATION){
+
+				//"スレッド(&H%X)でアクセス違反がありました(EPI=&H%08X)。\r\n"
+				sprintf(temporary,STRING_DEBUG_THREAD_ACCESSVIOLATION,de.dwThreadId,(ULONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress);
+				DebugMessage(temporary);
+
+				MessageBeep(MB_ICONEXCLAMATION);
+				ShowVarList(&de,1);
+				break;
+			}
+			else if(de.u.Exception.ExceptionRecord.ExceptionCode==EXCEPTION_BREAKPOINT||
+				de.u.Exception.ExceptionRecord.ExceptionCode==EXCEPTION_SINGLE_STEP){
+				/////////////////////////
+				// ブレークポイント
+				/////////////////////////
+
+				if(de.u.Exception.ExceptionRecord.ExceptionCode==EXCEPTION_SINGLE_STEP){
+					//CPU機構のシングルステップによるブレークポイント
+					//※シングルステップを解除
+					ReleaseCPUSingleStep();
+				}
+
+				i3=dwStepRun;
+
+				for(i4=0;i4<MAX_DEBUG_THREAD;i4++){
+					if(de.dwThreadId==_DebugSys_dwThreadID[i4]) break;
+				}
+				Context.ContextFlags=CONTEXT_CONTROL;
+				GetThreadContext(array_hDebugThread[i4],&Context);
+
+				if(i3==0||
+					i3&&(!(ImageBase+MemPos_CodeSection<=EIP_RIP(Context)&&EIP_RIP(Context)<ImageBase+MemPos_CodeSection+FileSize_CodeSection))
+					){
+					//"スレッド(&H%X)のブレーク ポイント(EPI=&H%08X)。\r\n"
+					sprintf(temporary,STRING_DEBUG_BREAKPOINT,de.dwThreadId,(ULONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress);
+					DebugMessage(temporary);
+				}
+
+				ShowVarList(&de,0);
+
+				//ステップ実行を解除
+				ReleaseSingleStep(i3,array_hDebugThread[i4],&Context);
+
+				if(dwStepRun){
+					//新たにシングルステップを行う場合
+
+					if(i4!=NextStepThreadNum){
+						//次回のステップ対象が別スレッドの場合
+						Context.ContextFlags=CONTEXT_CONTROL;
+						GetThreadContext(array_hDebugThread[NextStepThreadNum],&Context);
+					}
+
+					if(ImageBase+MemPos_CodeSection <= EIP_RIP(Context) &&
+						EIP_RIP(Context) < ImageBase+MemPos_CodeSection+FileSize_CodeSection){
+						//Debug命令語が続く場合はシングルステップは不要になるので、無効にする
+						//（オリジナルコード内のみ）
+						if(OpBuffer[EIP_RIP(Context)-ImageBase-MemPos_CodeSection]==(char)0xCC)
+							dwStepRun=0;
+					}
+					if(dwStepRun==1){
+						//ステップイン
+StepIn:
+						//シングルステップON
+						WriteProcessMemory(hDebugProcess,(void *)(ULONG_PTR)(ImageBase+MemPos_CodeSection),
+							pobj_DBDebugSection->pobj_now->SingleStepCodeBuffer,
+							FileSize_CodeSection,&lpAccBytes);
+
+						//次の命令語のブレーク命令は解除しておく（シングルステップ実行後のみ）
+						//（オリジナルコード内のみ）
+						if(i3&&ImageBase+MemPos_CodeSection<=EIP_RIP(Context)&&EIP_RIP(Context)<ImageBase+MemPos_CodeSection+FileSize_CodeSection)
+							WriteProcessMemory(hDebugProcess,(void *)EIP_RIP(Context),&OpBuffer[EIP_RIP(Context)-ImageBase-MemPos_CodeSection],1,&lpAccBytes);
+
+						//他のスレッドを一時中断
+						for(i4=0;i4<MAX_DEBUG_THREAD;i4++){
+							if(_DebugSys_dwThreadID[i4] && NextStepThreadNum!=i4)
+								SuspendThread(array_hDebugThread[i4]);
+						}
+					}
+					else if(dwStepRun==2){
+						//ステップオーバー
+
+						BOOL bRet;
+						bRet=ReadProcessMemory(hDebugProcess,
+							(void *)EIP_RIP(Context),
+							temporary,
+							5,
+							&lpAccBytes);
+						if(!bRet) MessageBox(hMainDlg,"プロセスメモリーの読み込みに失敗","error",MB_OK);
+
+						extern UserProc *pSub_DebugSys_EndProc;
+						if((BYTE)temporary[0]==0xE8&&
+							*((long *)(temporary+1))+5==(long)rva_to_real(pSub_DebugSys_EndProc->beginOpAddress)-(long)EIP_RIP(Context)){
+							//プロシージャの終端位置の場合はステップインを行う
+							goto StepIn;
+						}
+
+						extern int GlobalOpBufferSize;
+						if(ImageBase+MemPos_CodeSection<=pobj_dti->lplpObp[pobj_dti->iProcLevel]&&
+							pobj_dti->lplpObp[pobj_dti->iProcLevel]<ImageBase+MemPos_CodeSection+GlobalOpBufferSize){
+							//シングルステップON
+							WriteProcessMemory(hDebugProcess,
+								(void *)(ULONG_PTR)(ImageBase+MemPos_CodeSection),
+								pobj_DBDebugSection->pobj_now->SingleStepCodeBuffer,
+								GlobalOpBufferSize,
+								&lpAccBytes);
+						}
+						else{
+							//プロシージャを識別
+							pUserProc=GetSubFromObp(pobj_dti->lplpObp[pobj_dti->iProcLevel]);
+
+							//シングルステップON
+							WriteProcessMemory(hDebugProcess,
+								(void *)rva_to_real(pUserProc->beginOpAddress),
+								pobj_DBDebugSection->pobj_now->SingleStepCodeBuffer+pUserProc->beginOpAddress,
+								pUserProc->endOpAddress-pUserProc->beginOpAddress,
+								&lpAccBytes);
+						}
+
+						//次の命令語のブレーク命令は解除しておく（シングルステップ実行後のみ）
+						//（オリジナルコード内のみ）
+						if(i3&&ImageBase+MemPos_CodeSection<=EIP_RIP(Context)&&EIP_RIP(Context)<ImageBase+MemPos_CodeSection+FileSize_CodeSection)
+							WriteProcessMemory(hDebugProcess,(void *)EIP_RIP(Context),&OpBuffer[EIP_RIP(Context)-ImageBase-MemPos_CodeSection],1,&lpAccBytes);
+
+						//他のスレッドを一時中断
+						for(i4=0;i4<MAX_DEBUG_THREAD;i4++){
+							if(_DebugSys_dwThreadID[i4] && NextStepThreadNum!=i4)
+								SuspendThread(array_hDebugThread[i4]);
+						}
+					}
+				}
+			}
+			else if(de.u.Exception.ExceptionRecord.ExceptionCode==STATUS_INTEGER_DIVIDE_BY_ZERO){
+				//"0による除算が行われました。スレッド(&H%X) ブレーク ポイント(EPI=&H%08X)。\r\n"
+				sprintf(temporary,STRING_DEBUG_DIVIDE_BY_ZERO,de.dwThreadId,(ULONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress);
+				DebugMessage(temporary);
+
+				ShowVarList(&de,1);
+				break;
+			}
+			else if(de.u.Exception.ExceptionRecord.ExceptionCode==STATUS_NO_MEMORY){
+				//"メモリ不足、またはヒープが壊れていることが原因で、メモリの割り当てに失敗しました。スレッド(&H%X) ブレーク ポイント(EPI=&H%08X)。\r\n"
+				sprintf(temporary,STRING_DEBUG_DIVIDE_NO_MEMORY,de.dwThreadId,(ULONG_PTR)de.u.Exception.ExceptionRecord.ExceptionAddress);
+				DebugMessage(temporary);
+
+				ShowVarList(&de,1);
+				break;
+			}
+			else{
+				//"例外処理\ncode:%X"
+				sprintf(temporary,STRING_DEBUG_ERROR,de.u.Exception.ExceptionRecord.ExceptionCode);
+				DebugMessage(temporary);
+			}
+		}
+NextContinue:
+		ContinueDebugEvent(de.dwProcessId,de.dwThreadId,DBG_CONTINUE);
+	}
+
+	extern HWND hDebugWnd;
+	if(hDebugWnd) SendMessage(hDebugWnd,WM_COMMAND,IDCANCEL,0);
+
+	//デバッグに利用した情報を解放
+	delete pobj_DBDebugSection;
+
+	//デバッグスレッド情報を解放
+	delete pobj_dti;
+
+	//ブレークポイントを解放
+	delete pobj_DBBreakPoint;
+
+	//"閉じる"
+	SetDlgItemText(hMainDlg,IDOK,STRING_CLOSE);
+
+	SendMessage(hOwnerEditor,WM_DESTROYDEBUGGERBASE,0,0);
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/DebugMiddleFile.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/DebugMiddleFile.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/DebugMiddleFile.cpp	(revision 178)
@@ -0,0 +1,1056 @@
+#include "../BasicCompiler_Common/common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+#define MDLFILE_VER	0x70000003
+
+
+void SetLpIndex_DebugFile(char *buffer,int *p,const Type &type){
+	if(NATURAL_TYPE(type.GetBasicType())==DEF_OBJECT || NATURAL_TYPE(type.GetBasicType())==DEF_STRUCT){
+		lstrcpy(buffer+(*p),type.GetClass().GetName().c_str());
+		(*p)+=lstrlen(buffer+(*p))+1;
+	}
+	else{
+		*(LONG_PTR *)(buffer+(*p))=type.GetIndex();
+		(*p)+=sizeof(LONG_PTR);
+	}
+}
+
+
+void GetLpIndex_DebugFile(char *buffer,int *p,Type &type){
+	if(NATURAL_TYPE(type.GetBasicType())==DEF_OBJECT || NATURAL_TYPE(type.GetBasicType())==DEF_STRUCT){
+		char szClassName[VN_SIZE];
+		lstrcpy(szClassName,buffer+(*p));
+		(*p)+=lstrlen(buffer+(*p))+1;
+
+		type.SetIndex( (LONG_PTR)pobj_DBClass->Find(szClassName) );
+	}
+	else{
+		type.SetIndex( *(LONG_PTR *)(buffer+(*p)) );
+		(*p)+=sizeof(LONG_PTR);
+	}
+}
+
+
+
+CDebugSection::CDebugSection(){
+	memset(this,0,sizeof(CDebugSection));
+}
+CDebugSection::~CDebugSection(){
+	if(pobj_DBClass) DeleteDebugInfo();
+	if(buffer){
+		HeapDefaultFree(buffer);
+		buffer=0;
+	}
+}
+void CDebugSection::make(void){
+	extern INCLUDEFILEINFO IncludeFileInfo;
+	int i2,i3,i5,BufferSize;
+
+	if(buffer){
+		HeapDefaultFree(buffer);
+		buffer=0;
+	}
+
+	i2=0;
+
+	extern char *basbuf;
+	BufferSize=lstrlen(basbuf)+65535;
+	buffer=(char *)HeapAlloc(hHeap,0,BufferSize);
+
+	//デバッグ用ファイルのバージョン
+	*(long *)(buffer+i2)=MDLFILE_VER;
+	i2+=sizeof(long);
+
+	//プラットフォームのビット数
+	*(long *)(buffer+i2)=PLATFORM;
+	i2+=sizeof(long);
+
+	//インクルード情報
+	*(long *)(buffer+i2)=IncludeFileInfo.FilesNum;
+	i2+=sizeof(long);
+	for(i3=0;i3<IncludeFileInfo.FilesNum;i3++){
+		lstrcpy(buffer+i2,IncludeFileInfo.ppFileNames[i3]);
+		i2+=lstrlen(buffer+i2)+1;
+	}
+	buffer[i2++]=0;
+	for(i3=0;;i3++){
+		buffer[i2++]=(char)IncludeFileInfo.LineOfFile[i3];
+		if(IncludeFileInfo.LineOfFile[i3]==-1) break;
+	}
+
+	//ソースコード
+	lstrcpy(buffer+i2,basbuf);
+	i2+=lstrlen(buffer+i2)+1;
+
+
+	////////////////////////
+	// コードと行番号の関係
+	////////////////////////
+	extern int MaxLineInfoNum;
+	extern LINEINFO *pLineInfo;
+
+	//バッファが足りない場合は再確保
+	if(MaxLineInfoNum*sizeof(LINEINFO)<32768) i3=32768;
+	else i3=MaxLineInfoNum*sizeof(LINEINFO)+32768;
+	if(BufferSize<i2+i3){
+		BufferSize+=i3;
+		buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
+	}
+
+	*(long *)(buffer+i2)=MaxLineInfoNum;
+	i2+=sizeof(long);
+	memcpy(buffer+i2,pLineInfo,MaxLineInfoNum*sizeof(LINEINFO));
+	i2+=MaxLineInfoNum*sizeof(LINEINFO);
+
+
+
+	////////////////////////////////////////////
+	// クラス情報（名前のみ。詳細は後で保存）
+	////////////////////////////////////////////
+
+	//イテレータをリセット
+	extern Classes *pobj_DBClass;
+	pobj_DBClass->Iterator_Reset();
+
+	//個数
+	*(long *)(buffer+i2)=pobj_DBClass->Iterator_GetMaxCount();
+	i2+=sizeof(long);
+
+	while(pobj_DBClass->Iterator_HasNext()){
+		CClass *pobj_c;
+		pobj_c=pobj_DBClass->Iterator_GetNext();
+
+		//クラス名
+		lstrcpy(buffer+i2,pobj_c->GetName().c_str());
+		i2+=lstrlen(buffer+i2)+1;
+	}
+
+
+
+	//////////////////
+	// TypeDef情報
+	//////////////////
+	*(long *)(buffer+i2)=(int)Smoothie::meta.typeDefs.size();
+	i2+=sizeof(long);
+	for(i3=0;i3<(int)Smoothie::meta.typeDefs.size();i3++){
+		lstrcpy(buffer+i2,Smoothie::meta.typeDefs[i3].GetName().c_str() );
+		i2+=lstrlen(buffer+i2)+1;
+
+		lstrcpy(buffer+i2,Smoothie::meta.typeDefs[i3].GetBaseName().c_str() );
+		i2+=lstrlen(buffer+i2)+1;
+
+		//バッファが足りない場合は再確保
+		if(BufferSize<i2+32768){
+			BufferSize+=32768;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
+		}
+	}
+
+
+	//グローバル変数情報
+	*(long *)(buffer+i2)=(int)::globalVars.size();
+	i2+=sizeof(long);
+	foreach( Variable *pVar, ::globalVars ){
+		//変数名
+		lstrcpy(buffer+i2,pVar->GetName().c_str());
+		i2+=lstrlen(buffer+i2)+1;
+
+		//型
+		*(long *)(buffer+i2)=pVar->GetBasicType();
+		i2+=sizeof(long);
+
+		//型の拡張情報
+		SetLpIndex_DebugFile(buffer,&i2,*pVar);
+
+		buffer[i2++] = pVar->IsRef() ? 1 : 0;
+
+		buffer[i2++] = pVar->IsArray() ? 1 : 0;
+
+		if(pVar->IsArray()){
+			for(i5=0;;i5++){
+				*(long *)(buffer+i2)=pVar->GetSubScriptsPtr()[i5];
+				i2+=sizeof(long);
+				if(pVar->GetSubScriptsPtr()[i5]==-1) break;
+			}
+		}
+
+		//レキシカルスコープ情報
+		*(long *)(buffer+i2)=pVar->ScopeStartAddress;
+		i2+=sizeof(long);
+		*(long *)(buffer+i2)=pVar->ScopeEndAddress;
+		i2+=sizeof(long);
+		*(long *)(buffer+i2)=pVar->ScopeLevel;
+		i2+=sizeof(long);
+
+		//メモリ位置
+		*(long *)(buffer+i2)=pVar->offset;
+		i2+=sizeof(long);
+
+		//バッファが足りない場合は再確保
+		if(BufferSize<i2+32768){
+			BufferSize+=32768;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
+		}
+	}
+
+	//グローバル実行領域のサイズ
+	extern int GlobalOpBufferSize;
+	*(long *)(buffer+i2)=GlobalOpBufferSize;
+	i2+=sizeof(long);
+
+	//プロシージャ情報
+	extern GlobalProc **ppSubHash;
+	extern int SubNum;
+	GlobalProc *pUserProc;
+	*(long *)(buffer+i2)=SubNum;
+	i2+=sizeof(long);
+	for(i3=0;i3<MAX_HASH;i3++){
+		pUserProc=ppSubHash[i3];
+		while(pUserProc){
+			if(pUserProc->GetParentClassPtr()){
+				lstrcpy(buffer+i2,pUserProc->GetParentClassPtr()->GetName().c_str());
+				i2+=lstrlen(buffer+i2)+1;
+			}
+			else{
+				lstrcpy(buffer+i2,"");
+				i2+=lstrlen(buffer+i2)+1;
+			}
+
+			//ID
+			*(long *)(buffer+i2)=pUserProc->id;
+			i2+=sizeof(long);
+
+			//関数名
+			lstrcpy(buffer+i2,pUserProc->GetName().c_str());
+			i2+=lstrlen(buffer+i2)+1;
+
+			*(long *)(buffer+i2)=pUserProc->beginOpAddress;
+			i2+=sizeof(long);
+			*(long *)(buffer+i2)=pUserProc->endOpAddress;
+			i2+=sizeof(long);
+
+			//ローカル変数情報
+			*(long *)(buffer+i2)=(int)pUserProc->localVars.size();
+			i2+=sizeof(long);
+
+			//バッファが足りない場合は再確保
+			if(BufferSize<i2+32768){
+				BufferSize+=32768;
+				buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
+			}
+
+			foreach( Variable *pVar, pUserProc->localVars ){
+				lstrcpy(buffer+i2,pVar->GetName().c_str());
+				i2+=lstrlen(buffer+i2)+1;
+
+				//型
+				*(long *)(buffer+i2)=pVar->GetBasicType();
+				i2+=sizeof(long);
+
+				//型の拡張情報
+				SetLpIndex_DebugFile(buffer,&i2,*pVar);
+
+				//参照型パラメータかどうか
+				buffer[i2++] = pVar->IsRef() ? 1 : 0;
+
+				//配列かどうか
+				buffer[i2++] = pVar->IsArray() ? 1 : 0;
+
+				//配列要素
+				if(pVar->IsArray()){
+					for(i5=0;;i5++){
+						*(long *)(buffer+i2)=pVar->GetSubScriptsPtr()[i5];
+						i2+=sizeof(long);
+						if(pVar->GetSubScriptsPtr()[i5]==-1) break;
+					}
+				}
+
+				//レキシカルスコープ情報
+				*(long *)(buffer+i2)=pVar->ScopeStartAddress;
+				i2+=sizeof(long);
+				*(long *)(buffer+i2)=pVar->ScopeEndAddress;
+				i2+=sizeof(long);
+				*(long *)(buffer+i2)=pVar->ScopeLevel;
+				i2+=sizeof(long);
+
+				//メモリ位置
+				*(long *)(buffer+i2)=pVar->offset;
+				i2+=sizeof(long);
+
+
+
+
+				//バッファが足りない場合は再確保
+				if(BufferSize<i2+32768){
+					BufferSize+=32768;
+					buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
+				}
+			}
+
+			pUserProc=pUserProc->pNextData;
+		}
+	}
+
+
+
+	///////////////////
+	// クラス情報
+	///////////////////
+
+	//イテレータをリセット
+	pobj_DBClass->Iterator_Reset();
+
+	while(pobj_DBClass->Iterator_HasNext()){
+		CClass *pobj_c;
+		pobj_c=pobj_DBClass->Iterator_GetNext();
+
+
+		//クラス名
+		lstrcpy(buffer+i2,pobj_c->GetName().c_str());
+		i2+=lstrlen(buffer+i2)+1;
+
+		//仮想関数の数
+		*(long *)(buffer+i2)=pobj_c->GetVtblNum();
+		i2+=sizeof(long);
+
+		//アラインメント
+		*(long *)(buffer+i2)=pobj_c->iAlign;
+		i2+=sizeof(long);
+
+		//メンバ
+		*(long *)(buffer+i2)=(int)pobj_c->dynamicMembers.size();
+		i2+=sizeof(long);
+		foreach( CMember *member, pobj_c->dynamicMembers ){
+			// 名前
+			lstrcpy(buffer+i2,member->GetName().c_str());
+			i2+=lstrlen(buffer+i2)+1;
+
+			// 型
+			*(long *)(buffer+i2)=member->GetType().GetBasicType();
+			i2+=sizeof(long);
+
+			// 型の拡張情報
+			SetLpIndex_DebugFile(buffer,&i2,member->GetType());
+
+			// アクセシビリティ
+			*(Prototype::Accessibility *)(buffer+i2)=member->GetAccessibility();
+			i2+=sizeof(Prototype::Accessibility);
+
+			memcpy(buffer+i2,member->SubScripts,sizeof(int)*MAX_ARRAYDIM);
+			i2+=sizeof(int)*MAX_ARRAYDIM;
+
+			//バッファが足りない場合は再確保
+			if(BufferSize<i2+32768){
+				BufferSize+=32768;
+				buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
+			}
+		}
+
+		//メソッド
+		*(long *)(buffer+i2)=(long)pobj_c->methods.size();
+		i2+=sizeof(long);
+		foreach( const CMethod *pMethod, pobj_c->methods ){
+			*(Prototype::Accessibility *)(buffer+i2)=pMethod->GetAccessibility();
+			i2+=sizeof(Prototype::Accessibility);
+			if( pMethod->GetInheritsClassPtr() ){
+				lstrcpy(buffer+i2,pMethod->GetInheritsClassPtr()->GetName().c_str());
+				i2+=lstrlen(buffer+i2)+1;
+			}
+			else{
+				lstrcpy(buffer+i2,"");
+				i2+=lstrlen(buffer+i2)+1;
+			}
+			lstrcpy(buffer+i2,pMethod->pUserProc->GetName().c_str());
+			i2+=lstrlen(buffer+i2)+1;
+		}
+
+		//静的メンバ
+		*(long *)(buffer+i2)=(long)pobj_c->staticMembers.size();
+		i2+=sizeof(long);
+		foreach( CMember *member, pobj_c->staticMembers ){
+			// 名前
+			lstrcpy(buffer+i2,member->GetName().c_str());
+			i2+=lstrlen(buffer+i2)+1;
+
+			// 型
+			*(long *)(buffer+i2)=member->GetType().GetBasicType();
+			i2+=sizeof(long);
+
+			// 型の拡張情報
+			SetLpIndex_DebugFile(buffer,&i2,member->GetType());
+
+			// アクセシビリティ
+			*(Prototype::Accessibility *)(buffer+i2)=member->GetAccessibility();
+			i2+=sizeof(Prototype::Accessibility);
+
+			memcpy(buffer+i2,member->SubScripts,sizeof(int)*MAX_ARRAYDIM);
+			i2+=sizeof(int)*MAX_ARRAYDIM;
+
+			//バッファが足りない場合は再確保
+			if(BufferSize<i2+32768){
+				BufferSize+=32768;
+				buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
+			}
+		}
+
+		//バッファが足りない場合は再確保
+		if(BufferSize<i2+32768){
+			BufferSize+=32768;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufferSize);
+		}
+	}
+
+	length=i2;
+}
+
+char *CDebugSection::MakeSingleStepCode(void){
+	char *buffer;
+	buffer=(char *)HeapAlloc(hHeap,0,SizeOf_CodeSection);
+
+	memcpy(buffer,OpBuffer,SizeOf_CodeSection);
+
+	int i2;
+	for(i2=0;i2<MaxLineInfoNum;i2++){
+		if(!(
+			pLineInfo[i2].dwCodeType&CODETYPE_SYSTEMPROC||
+			pLineInfo[i2].dwCodeType&CODETYPE_DEBUGPROC
+			)){
+			//int 3
+			buffer[pLineInfo[i2].TopObp]=(char)0xCC;
+		}
+	}
+
+	return buffer;
+}
+BOOL CDebugSection::__load(void){
+	int i2,i3,i4,i5,num;
+	char temp2[MAX_PATH],*temp5;
+
+	pobj_CompilingClass = NULL;
+
+	i2=0;
+
+	//デバッグ用ファイルのバージョンをチェック
+	if(*(long *)(buffer+i2)<MDLFILE_VER){
+		HeapDefaultFree(buffer);
+		return 0;
+	}
+	i2+=sizeof(long);
+
+	//プラットフォームのビット数をチェック
+	if(*(long *)(buffer+i2)!=PLATFORM){
+		HeapDefaultFree(buffer);
+		return 0;
+	}
+	i2+=sizeof(long);
+
+	//インクルード情報
+	IncludeFileInfo.FilesNum=*(long *)(buffer+i2);
+	i2+=sizeof(long);
+	IncludeFileInfo.ppFileNames=(char **)HeapAlloc(hHeap,0,IncludeFileInfo.FilesNum*sizeof(char *));
+	for(i3=0;i3<IncludeFileInfo.FilesNum;i3++){
+		if(buffer[i2]=='\0') break;
+		IncludeFileInfo.ppFileNames[i3]=(char *)HeapAlloc(hHeap,0,lstrlen(buffer+i2)+1);
+		lstrcpy(IncludeFileInfo.ppFileNames[i3],buffer+i2);
+		i2+=lstrlen(buffer+i2)+1;
+	}
+	for(i2++,i3=0;;i2++,i3++){
+		IncludeFileInfo.LineOfFile[i3]=(long)buffer[i2];
+		if(IncludeFileInfo.LineOfFile[i3]==-1) break;
+	}
+
+	//ソースコード
+	i2++;
+	source.SetBuffer( buffer + i2 );
+	i2+=lstrlen(buffer+i2)+1;
+
+	//コードと行番号の関係
+	MaxLineInfoNum=*(long *)(buffer+i2);
+	i2+=sizeof(long);
+	pLineInfo=(LINEINFO *)HeapAlloc(hHeap,0,MaxLineInfoNum*sizeof(LINEINFO)+1);
+	memcpy(pLineInfo,buffer+i2,MaxLineInfoNum*sizeof(LINEINFO));
+	i2+=MaxLineInfoNum*sizeof(LINEINFO);
+
+
+	///////////////////////////////////////////
+	// クラス情報（名前のみ。詳細は後で取得）
+	///////////////////////////////////////////
+
+	this->pobj_DBClass=new Classes();
+
+	int iMaxClassCount;
+	iMaxClassCount=*(long *)(buffer+i2);
+	i2+=sizeof(long);
+	for(i3=0;i3<iMaxClassCount;i3++){
+		//クラス名
+		// TODO: 名前空間が未完成
+		pobj_DBClass->AddClass(NamespaceScopes(),NamespaceScopesCollection(),buffer+i2,0);
+		i2+=lstrlen(buffer+i2)+1;
+	}
+
+	extern Classes *pobj_DBClass;
+	pobj_DBClass=this->pobj_DBClass;
+
+
+	//////////////////
+	// TypeDef情報
+	//////////////////
+
+	//初期化
+	Smoothie::meta.typeDefs.clear();
+
+	//個数を取得
+	num=*(long *)(buffer+i2);
+	i2+=sizeof(long);
+	for(i3=0;i3<num;i3++){
+		temp5=buffer+i2;
+		i2+=lstrlen(buffer+i2)+1;
+
+		// 名前空間に未対応
+		Smoothie::meta.typeDefs.push_back( TypeDef( NamespaceScopes(), temp5, buffer+i2 ) );
+
+		i2+=lstrlen(buffer+i2)+1;
+	}
+
+	//定数を取得
+	GetConstInfo();
+	extern CONSTINFO **ppConstHash;
+	this->ppConstHash=ppConstHash;
+
+
+	//グローバル変数情報
+	globalVars.clear();
+	int maxGlobalVars=*(long *)(buffer+i2);
+	i2+=sizeof(long);
+	for(i3=0;i3<maxGlobalVars;i3++){
+
+		//変数名
+		char *name = buffer+i2;
+		i2+=lstrlen(buffer+i2)+1;
+
+		int basicType = *(long *)(buffer+i2);
+		i2+=sizeof(long);
+
+		Type type( basicType );
+		GetLpIndex_DebugFile(buffer,&i2,type);
+
+		bool isRef = (buffer[i2++]) ? true:false;
+
+		bool isArray = (buffer[i2++]) ? true:false;
+
+		Variable *pVar = new Variable( name, type, false, isRef );
+
+		if(isArray){
+			int SubScripts[MAX_ARRAYDIM];
+			for(i4=0;;i4++){
+				SubScripts[i4]=*(long *)(buffer+i2);
+				i2+=sizeof(long);
+
+				if(SubScripts[i4]==-1) break;
+			}
+
+			pVar->SetArray( SubScripts );
+		}
+
+		//レキシカルスコープ情報
+		pVar->ScopeStartAddress=*(long *)(buffer+i2);
+		i2+=sizeof(long);
+		pVar->ScopeEndAddress=*(long *)(buffer+i2);
+		i2+=sizeof(long);
+		pVar->ScopeLevel=*(long *)(buffer+i2);
+		i2+=sizeof(long);
+
+		//メモリ位置
+		pVar->offset=*(long *)(buffer+i2);
+		i2+=sizeof(long);
+
+		//変数を追加
+		globalVars.push_back( pVar );
+	}
+
+	//グローバル実行領域のサイズ
+	GlobalOpBufferSize=*(long *)(buffer+i2);
+	i2+=sizeof(long);
+
+	//プロシージャ情報
+	GlobalProc *pUserProc;
+	SubNum=*(long *)(buffer+i2);
+	i2+=sizeof(long);
+	ppSubHash=(GlobalProc **)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,MAX_HASH*sizeof(GlobalProc *));
+	for(int i6=0;i6<SubNum;i6++){
+		char szParentClassName[VN_SIZE];
+		lstrcpy(szParentClassName,buffer+i2);
+		i2+=lstrlen(buffer+i2)+1;
+
+		const CClass *pClass = NULL;
+		if(szParentClassName[0]){
+			pClass=pobj_DBClass->Find(szParentClassName);
+		}
+
+		//ID
+		int id=*(long *)(buffer+i2);
+		i2+=sizeof(long);
+
+		//名前
+		char *name = buffer+i2;
+		i2+=lstrlen(buffer+i2)+1;
+
+		// オブジェクトを生成
+		// TODO: 名前空間が未完成
+		pUserProc = new GlobalProc( NamespaceScopes(), NamespaceScopesCollection(), name, Procedure::Function, false, false, false );
+		pUserProc->pNextData=0;
+		pUserProc->id=id;
+		pUserProc->SetParentClass( pClass );
+
+		pUserProc->beginOpAddress=*(long *)(buffer+i2);
+		i2+=sizeof(long);
+		pUserProc->endOpAddress=*(long *)(buffer+i2);
+		i2+=sizeof(long);
+
+		pUserProc->CompleteCompile();
+
+		//ローカル変数情報
+		pUserProc->localVars.clear();
+		int maxLocalVar=*(long *)(buffer+i2);
+		i2+=sizeof(long);
+		for(i3=0;i3<maxLocalVar;i3++){
+			//変数名
+			char *name = buffer+i2;
+			i2+=lstrlen(buffer+i2)+1;
+
+			int basicType = *(long *)(buffer+i2);
+			i2+=sizeof(long);
+
+			Type type( basicType );
+			GetLpIndex_DebugFile(buffer,&i2,type);
+
+			bool isRef = (buffer[i2++]) ? true:false;
+
+			bool isArray = (buffer[i2++]) ? true:false;
+
+			Variable *pVar = new Variable( name, type, false, isRef );
+
+			if(isArray){
+				int SubScripts[MAX_ARRAYDIM];
+				for(i4=0;;i4++){
+					SubScripts[i4]=*(long *)(buffer+i2);
+					i2+=sizeof(long);
+
+					if(SubScripts[i4]==-1) break;
+				}
+
+				pVar->SetArray( SubScripts );
+			}
+
+			//レキシカルスコープ情報
+			pVar->ScopeStartAddress=*(long *)(buffer+i2);
+			i2+=sizeof(long);
+			pVar->ScopeEndAddress=*(long *)(buffer+i2);
+			i2+=sizeof(long);
+			pVar->ScopeLevel=*(long *)(buffer+i2);
+			i2+=sizeof(long);
+
+			//メモリ位置
+			pVar->offset=*(long *)(buffer+i2);
+			i2+=sizeof(long);
+
+			//変数を追加
+			pUserProc->localVars.push_back( pVar );
+		}
+
+
+		/////////////////////////////////
+		// 格納位置を計算してpUserProcをセット
+		/////////////////////////////////
+
+		i4=hash_default(pUserProc->GetName().c_str());
+
+		GlobalProc *psi2;
+		if(ppSubHash[i4]){
+			psi2=ppSubHash[i4];
+			while(1){
+				if(psi2->pNextData==0){
+					psi2->pNextData=pUserProc;
+					break;
+				}
+				psi2=psi2->pNextData;
+			}
+		}
+		else{
+			ppSubHash[i4]=pUserProc;
+		}
+	}
+
+	//クラス情報
+	CClass *pobj_c;
+	for(i3=0;i3<iMaxClassCount;i3++){
+		//クラス名
+		char szClassName[VN_SIZE];
+		lstrcpy(szClassName,buffer+i2);
+		i2+=lstrlen(buffer+i2)+1;
+
+		pobj_c =  const_cast<CClass *>( pobj_DBClass->Find(szClassName) );
+
+		//仮想関数の数
+		pobj_c->SetVtblNum( *(long *)(buffer+i2) );
+		i2+=sizeof(long);
+
+		//アラインメント
+		pobj_c->iAlign=*(long *)(buffer+i2);
+		i2+=sizeof(long);
+
+		//静的メンバ
+		int nDynamicMember = *(long *)(buffer+i2);
+		i2+=sizeof(long);
+		for( i4=0; i4<nDynamicMember; i4++ ){
+			// 名前
+			string name = (char *)(buffer+i2);
+			i2+=lstrlen(buffer+i2)+1;
+
+			// 型
+			Type type( *(long *)(buffer+i2) );
+			i2+=sizeof(long);
+
+			// 型の拡張情報
+			GetLpIndex_DebugFile(buffer,&i2,type);
+
+			// アクセシビリティ
+			Prototype::Accessibility accessibility = *(Prototype::Accessibility *)(buffer+i2);
+			i2+=sizeof(Prototype::Accessibility);
+
+			CMember *member=new CMember( accessibility, name, type, false );
+
+			memcpy(member->SubScripts,buffer+i2,sizeof(int)*MAX_ARRAYDIM);
+			i2+=sizeof(int)*MAX_ARRAYDIM;
+
+			pobj_c->dynamicMembers.push_back( member );
+		}
+
+		//メソッド
+		int nMethod = *(long *)(buffer+i2);
+		i2+=sizeof(long);
+		for( i4=0; i4<nMethod; i4++ ){
+
+			Prototype::Accessibility accessibility=*(Prototype::Accessibility *)(buffer+i2);
+			i2+=sizeof(Prototype::Accessibility);
+
+			char szInherits[VN_SIZE];
+			lstrcpy(szInherits,buffer+i2);
+			i2+=lstrlen(buffer+i2)+1;
+
+			const CClass *pobj_InheritsClass = NULL;
+			if(szInherits[0]){
+				pobj_InheritsClass=pobj_DBClass->Find(szInherits);
+			}
+
+			lstrcpy(temp2,buffer+i2);
+			i2+=lstrlen(buffer+i2)+1;
+
+			const CClass *pobj_temp_c;
+			pobj_temp_c=pobj_InheritsClass;
+			if(pobj_temp_c==0) pobj_temp_c=pobj_c;
+			i5=hash_default(temp2);
+			pUserProc=ppSubHash[i5];
+			while(1){
+				if( pUserProc->GetName() == temp2 &&pUserProc->GetParentClassPtr()==pobj_temp_c) break;
+				pUserProc=pUserProc->pNextData;
+			}
+
+			CMethod *pMethod = new DynamicMethod( pUserProc, accessibility, 0,0,false, pobj_InheritsClass);
+
+			pobj_c->methods.push_back( pMethod );
+		}
+
+		//静的メンバ
+		int nStaticMember = *(long *)(buffer+i2);
+		i2+=sizeof(long);
+		for( i4=0; i4<nStaticMember; i4++ ){
+			// 名前
+			string name = (char *)(buffer+i2);
+			i2+=lstrlen(buffer+i2)+1;
+
+			// 型
+			Type type( *(long *)(buffer+i2) );
+			i2+=sizeof(long);
+
+			// 型の拡張情報
+			GetLpIndex_DebugFile(buffer,&i2,type);
+
+			// アクセシビリティ
+			Prototype::Accessibility accessibility = *(Prototype::Accessibility *)(buffer+i2);
+			i2+=sizeof(Prototype::Accessibility);
+
+			CMember *member=new CMember( accessibility, name, type, false );
+
+			memcpy(member->SubScripts,buffer+i2,sizeof(int)*MAX_ARRAYDIM);
+			i2+=sizeof(int)*MAX_ARRAYDIM;
+
+			pobj_c->staticMembers.push_back( member );
+		}
+	}
+
+	HeapDefaultFree(buffer);
+	buffer=0;
+
+
+
+
+	extern GlobalProc **ppSubHash;
+	ppSubHash=this->ppSubHash;
+	pSub_DebugSys_EndProc=GetSubHash("_DebugSys_EndProc");
+
+
+	SingleStepCodeBuffer=MakeSingleStepCode();
+
+
+	/////////////////////////////
+	// ブレークポイントを適用
+	/////////////////////////////
+
+	//インクルード情報
+	extern INCLUDEFILEINFO IncludeFileInfo;
+	IncludeFileInfo=this->IncludeFileInfo;
+
+	//コードと行番号の関係
+	extern int MaxLineInfoNum;
+	extern LINEINFO *pLineInfo;
+	MaxLineInfoNum=this->MaxLineInfoNum;
+	pLineInfo=this->pLineInfo;
+
+	BreakStepCodeBuffer=pobj_DBBreakPoint->update(OpBuffer,SizeOf_CodeSection);
+
+	//プロセスメモリにコピー
+	extern HANDLE hDebugProcess;
+	SIZE_T accessBytes;
+	WriteProcessMemory(hDebugProcess,(void *)(ULONG_PTR)(dwImageBase+dwRVA_CodeSection),
+		BreakStepCodeBuffer,
+		SizeOf_CodeSection,&accessBytes);
+
+
+	return 1;
+}
+
+BOOL CDebugSection::load(HMODULE hModule){
+	if(buffer){
+		HeapDefaultFree(buffer);
+		buffer=0;
+	}
+
+
+	extern HANDLE hDebugProcess;
+	SIZE_T accessBytes;
+	IMAGE_DOS_HEADER ImageDosHeader;
+	ReadProcessMemory(hDebugProcess,hModule,&ImageDosHeader,sizeof(IMAGE_DOS_HEADER),&accessBytes);
+
+	int pe_size;
+#ifdef _AMD64_
+	IMAGE_NT_HEADERS64 pe_hdr;
+	pe_size=sizeof(IMAGE_NT_HEADERS64);
+#else
+	IMAGE_NT_HEADERS pe_hdr;
+	pe_size=sizeof(IMAGE_NT_HEADERS);
+#endif
+	ReadProcessMemory(hDebugProcess,(void *)(((ULONG_PTR)hModule)+ImageDosHeader.e_lfanew),&pe_hdr,pe_size,&accessBytes);
+
+	IMAGE_SECTION_HEADER *pSectionHdr;
+	pSectionHdr=(IMAGE_SECTION_HEADER *)HeapAlloc(hHeap,0,pe_hdr.FileHeader.NumberOfSections*sizeof(IMAGE_SECTION_HEADER));
+	ReadProcessMemory(hDebugProcess,
+		(void *)(((ULONG_PTR)hModule)+ImageDosHeader.e_lfanew+pe_size),
+		pSectionHdr,
+		pe_hdr.FileHeader.NumberOfSections*sizeof(IMAGE_SECTION_HEADER),
+		&accessBytes);
+
+	int i;
+	for(i=0;i<pe_hdr.FileHeader.NumberOfSections;i++){
+
+		//リライタブルセクション内の情報
+		if(lstrcmp((char *)pSectionHdr[i].Name,".data")==0){
+			dwRVA_RWSection=pSectionHdr[i].VirtualAddress;
+		}
+
+		//コードセクション内の情報
+		if(lstrcmp((char *)pSectionHdr[i].Name,".text")==0){
+			dwRVA_CodeSection=pSectionHdr[i].VirtualAddress;
+			SizeOf_CodeSection=pSectionHdr[i].SizeOfRawData;
+		}
+
+		//デバッグセクション内の情報
+		if(lstrcmp((char *)pSectionHdr[i].Name,".debug")==0){
+			length=pSectionHdr[i].Misc.VirtualSize;
+			buffer=(char *)HeapAlloc(hHeap,0,length+1);
+
+			ReadProcessMemory(hDebugProcess,
+				(void *)(((ULONG_PTR)hModule)+pSectionHdr[i].VirtualAddress),
+				buffer,
+				length,
+				&accessBytes);
+			buffer[length]=0;
+		}
+
+	}
+	HeapDefaultFree(pSectionHdr);
+
+	if(!buffer) return 0;
+
+
+	dwImageBase=(DWORD)(ULONG_PTR)hModule;
+
+
+
+	if(OpBuffer) HeapDefaultFree(OpBuffer);
+	OpBuffer=(char *)HeapAlloc(hHeap,0,SizeOf_CodeSection);
+
+	ReadProcessMemory(hDebugProcess,
+		(void *)(ULONG_PTR)(dwImageBase+dwRVA_CodeSection),OpBuffer,
+		SizeOf_CodeSection,&accessBytes);
+
+
+	return __load();
+}
+
+void CDebugSection::choice(void){
+	//イメージベース
+	extern DWORD ImageBase;
+	ImageBase=this->dwImageBase;
+
+	//リライタブルセクションのRVA
+	extern int MemPos_RWSection;
+	MemPos_RWSection=this->dwRVA_RWSection;
+
+	//コードセクションのRVAとサイズ
+	extern int MemPos_CodeSection;
+	extern int FileSize_CodeSection;
+	MemPos_CodeSection=this->dwRVA_CodeSection;
+	FileSize_CodeSection=this->SizeOf_CodeSection;
+
+	//インクルード情報
+	extern INCLUDEFILEINFO IncludeFileInfo;
+	IncludeFileInfo=this->IncludeFileInfo;
+
+	//ソースコード
+	Smoothie::Lexical::source = source;
+
+	//コードと行番号の関係
+	extern int MaxLineInfoNum;
+	extern LINEINFO *pLineInfo;
+	MaxLineInfoNum=this->MaxLineInfoNum;
+	pLineInfo=this->pLineInfo;
+
+	// クラス情報
+	extern Classes *pobj_DBClass;
+	pobj_DBClass=this->pobj_DBClass;
+
+	//定数を取得
+	extern CONSTINFO **ppConstHash;
+	ppConstHash=this->ppConstHash;
+
+	//グローバル実行領域のサイズ
+	extern int GlobalOpBufferSize;
+	GlobalOpBufferSize=this->GlobalOpBufferSize;
+
+	//プロシージャ
+	extern char **ppMacroNames;
+	ppMacroNames=0;
+	extern GlobalProc **ppSubHash;
+	extern int SubNum;
+	ppSubHash=this->ppSubHash;
+	SubNum=this->SubNum;
+
+	extern UserProc *pSub_DebugSys_EndProc;
+	pSub_DebugSys_EndProc=this->pSub_DebugSys_EndProc;
+
+	//ネイティブコードバッファ
+	extern char *OpBuffer;
+	OpBuffer=this->OpBuffer;
+}
+
+void CDebugSection::DeleteDebugInfo(void){
+	int i2;
+
+	//インクルード情報を解放
+	for(i2=0;i2<IncludeFileInfo.FilesNum;i2++)
+		HeapDefaultFree(IncludeFileInfo.ppFileNames[i2]);
+	HeapDefaultFree(IncludeFileInfo.ppFileNames);
+
+	//クラスに関するメモリを解放
+	delete pobj_DBClass;
+	pobj_DBClass=0;
+
+	//サブルーチン情報のメモリ解放
+	DeleteSubInfo(ppSubHash,0,0);
+
+	//定数に関する情報を解放
+	DeleteConstInfo(ppConstHash);
+
+	//コードと行番号の関係を解放
+	HeapDefaultFree(pLineInfo);
+
+	//コードバッファを解放
+	HeapDefaultFree(OpBuffer);
+	OpBuffer=0;
+
+	HeapDefaultFree(SingleStepCodeBuffer);
+	SingleStepCodeBuffer=0;
+
+	HeapDefaultFree(BreakStepCodeBuffer);
+	BreakStepCodeBuffer=0;
+}
+
+
+
+CDBDebugSection::CDBDebugSection(){
+	ppobj_ds=(CDebugSection **)HeapAlloc(hHeap,0,1);
+	num=0;
+}
+CDBDebugSection::~CDBDebugSection(){
+	int i;
+	for(i=0;i<num;i++){
+		delete ppobj_ds[i];
+	}
+	HeapDefaultFree(ppobj_ds);
+}
+
+BOOL CDBDebugSection::add(HMODULE hModule){
+	CDebugSection *pobj_d;
+	pobj_d=new CDebugSection();
+	if(!pobj_d->load(hModule)){
+		//デバッグ情報が存在しないとき
+		delete pobj_d;
+		return 0;
+	}
+
+	ppobj_ds=(CDebugSection **)HeapReAlloc(hHeap,0,ppobj_ds,(num+1)*sizeof(CDebugSection *));
+	ppobj_ds[num]=pobj_d;
+	num++;
+
+	return 1;
+}
+
+void CDBDebugSection::del(HMODULE hModule){
+	int i;
+	for(i=0;i<num;i++){
+		if((HMODULE)(ULONG_PTR)ppobj_ds[i]->dwImageBase==hModule){
+			delete ppobj_ds[i];
+
+			num--;
+			for(;i<num;i++){
+				ppobj_ds[i]=ppobj_ds[i+1];
+			}
+			break;
+		}
+	}
+}
+
+void CDBDebugSection::choice(int index){
+	pobj_now=ppobj_ds[index];
+	pobj_now->choice();
+}
+
+
+
+CDBDebugSection *pobj_DBDebugSection;
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/DebugSection.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/DebugSection.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/DebugSection.h	(revision 178)
@@ -0,0 +1,94 @@
+
+class CDebugSection{
+public:
+	char szNowFilePath[MAX_PATH];
+
+	char *buffer;
+	int length;
+
+
+	////////////////////////////////////
+	// デバッグ用の固有情報
+
+	//イメージベース
+	DWORD dwImageBase;
+
+	//リライタブルセクションのRVA
+	DWORD dwRVA_RWSection;
+
+	//コードセクションのRAVとサイズ
+	DWORD dwRVA_CodeSection;
+	int SizeOf_CodeSection;
+
+	//インクルード情報
+	INCLUDEFILEINFO IncludeFileInfo;
+
+	//ソースコード
+	BasicSource source;
+
+	//コードと行番号の関係
+	int MaxLineInfoNum;
+	LINEINFO *pLineInfo;
+
+	// クラス情報
+	Classes *pobj_DBClass;
+
+	//定数を取得
+	CONSTINFO **ppConstHash;
+
+	//グローバル実行領域のサイズ
+	int GlobalOpBufferSize;
+
+	//プロシージャ
+	GlobalProc **ppSubHash;
+	int SubNum;
+
+	UserProc *pSub_DebugSys_EndProc;
+
+	//ネイティブコードバッファ
+	char *OpBuffer;
+
+	//シングルステップ用コードバッファ
+	char *SingleStepCodeBuffer;
+
+	//ブレークポイント用コードバッファ
+	char *BreakStepCodeBuffer;
+
+
+	////////////////////////////////////
+
+
+	CDebugSection();
+	~CDebugSection();
+
+	void make(void);
+private:
+	void UpdateBreakPoint(void);
+	char *MakeSingleStepCode(void);
+	BOOL __load(void);
+public:
+	BOOL load(HMODULE hModule);
+
+	void choice(void);
+
+	void DeleteDebugInfo(void);
+};
+
+class CDBDebugSection{
+public:
+	CDebugSection **ppobj_ds;
+	int num;
+
+	CDebugSection *pobj_now;
+
+	CDBDebugSection();
+	~CDBDebugSection();
+
+	BOOL add(HMODULE hModule);
+	void del(HMODULE hModule);
+
+	void choice(int index);
+
+};
+
+extern CDBDebugSection *pobj_DBDebugSection;
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Diagnose.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Diagnose.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Diagnose.cpp	(revision 178)
@@ -0,0 +1,138 @@
+#include <Program.h>
+
+#include "../BasicCompiler_Common/common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+
+void Diagnose(){
+	char temporary[8192];
+
+	{
+		///////////////////////////////////////////////////////////////////
+		// グローバル / ローカル コード領域のサイズを調べる
+		///////////////////////////////////////////////////////////////////
+
+		extern int obp;
+		extern int GlobalOpBufferSize;
+		sprintf(temporary, "%d", GlobalOpBufferSize/1024 );
+		trace_for_size( (string)"グローバル領域のコードサイズ: " + temporary + "KB" );
+		sprintf(temporary, "%d", (obp-GlobalOpBufferSize)/1024 );
+		trace_for_size( (string)"ローカル領域のコードサイズ: " + temporary + "KB" );
+		sprintf(temporary, "%d", obp/1024 );
+		trace_for_size( (string)"コードサイズ総量: " + temporary + "KB" );
+	}
+
+	{
+		///////////////////////////////////////////////////////////////////
+		// グローバル関数、クラスメソッドのサイズを調べる
+		///////////////////////////////////////////////////////////////////
+
+		int codeSizeOfGlobalProc = 0;
+		int codeSizeOfClassMethod = 0;
+		for(int i2=0;i2<MAX_HASH;i2++){
+			extern GlobalProc **ppSubHash;
+			GlobalProc *pUserProc = ppSubHash[i2];
+			while(pUserProc){
+				if( pUserProc->IsCompiled() ){
+					if( pUserProc->HasParentClass() ){
+						codeSizeOfClassMethod += pUserProc->GetCodeSize();
+					}
+					else{
+						codeSizeOfGlobalProc += pUserProc->GetCodeSize();
+					}
+				}
+
+				pUserProc=pUserProc->pNextData;
+			}
+		}
+
+		sprintf(temporary, "%d", codeSizeOfGlobalProc/1024 );
+		trace_for_size( (string)"グローバル関数のコードサイズ総量: " + temporary + "KB" );
+		sprintf(temporary, "%d", codeSizeOfClassMethod/1024 );
+		trace_for_size( (string)"クラスメソッドのコードサイズ総量: " + temporary + "KB" );
+	}
+
+	{
+		///////////////////////////////////////////////////////////////////
+		// Enumに必要なのコードサイズを調べる
+		///////////////////////////////////////////////////////////////////
+		int codeSizeOfEnum = 0;
+
+		// イテレータをリセット
+		extern Classes *pobj_DBClass;
+		pobj_DBClass->Iterator_Reset();
+
+		while( pobj_DBClass->Iterator_HasNext() ){
+			int codeSizeOfClass = 0;
+
+			CClass &objClass = *pobj_DBClass->Iterator_GetNext();
+
+			if( !objClass.IsEnum() ){
+				// 列挙型以外は無視
+				continue;
+			}
+
+			// 動的メソッド
+			foreach( const CMethod *pMethod, objClass.GetMethods() ){
+				if( pMethod->pUserProc->IsCompiled() ){
+					codeSizeOfClass += pMethod->pUserProc->GetCodeSize();
+				}
+			}
+
+			// 静的メソッド
+			foreach( const CMethod *pMethod, objClass.GetStaticMethods() ){
+					codeSizeOfClass += pMethod->pUserProc->GetCodeSize();
+			}
+
+			codeSizeOfEnum += codeSizeOfClass;
+		}
+
+		sprintf(temporary, "%d", codeSizeOfEnum/1024 );
+		trace_for_size( (string)"Enumのコードサイズ総量: " + temporary + "KB" );
+	}
+
+	trace_for_size( "\n\n" );
+
+	{
+		///////////////////////////////////////////////////////////////////
+		// クラスのサイズを調べる
+		///////////////////////////////////////////////////////////////////
+
+		// イテレータをリセット
+		extern Classes *pobj_DBClass;
+		pobj_DBClass->Iterator_Reset();
+
+		while( pobj_DBClass->Iterator_HasNext() ){
+			int codeSizeOfClass = 0;
+
+			CClass &objClass = *pobj_DBClass->Iterator_GetNext();
+
+			// 動的メソッド
+			foreach( const CMethod *pMethod, objClass.GetMethods() ){
+				if( pMethod->pUserProc->IsCompiled() ){
+					codeSizeOfClass += pMethod->pUserProc->GetCodeSize();
+				}
+			}
+
+			// 静的メソッド
+			foreach( const CMethod *pMethod, objClass.GetStaticMethods() ){
+					codeSizeOfClass += pMethod->pUserProc->GetCodeSize();
+			}
+
+			if( codeSizeOfClass ){
+				temporary[0]=0;
+				lstrcat( temporary, "------------------------------------------------------------------\n" );
+				sprintf( temporary + lstrlen(temporary), "【 %s クラスのコード情報】\n", objClass.GetName().c_str() );
+				sprintf( temporary + lstrlen(temporary), "class code size: %d bytes\n", codeSizeOfClass );
+				lstrcat( temporary, "------------------------------------------------------------------\n" );
+				lstrcat( temporary, "\n" );
+				trace_for_size( temporary );
+			}
+		}
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Enum.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Enum.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Enum.cpp	(revision 178)
@@ -0,0 +1,294 @@
+#include <jenga/include/common/logger.h>
+
+#include "common.h"
+
+CEnumParent **ppobj_EnumParent;
+int iEnumParentNum;
+
+CEnumMember::CEnumMember(char *name,int value){
+	m_name=(char *)HeapAlloc(hHeap,0,lstrlen(name)+1);
+	lstrcpy(m_name,name);
+
+	m_value=value;
+}
+CEnumMember::~CEnumMember(){
+	if(m_name) HeapDefaultFree(m_name);
+}
+
+
+CEnumParent::CEnumParent( const NamespaceScopes &namespaceScopes, const char *buffer,int nowLine)
+	: namespaceScopes( namespaceScopes )
+{
+	ppobj_EnumMember=(CEnumMember **)HeapAlloc(hHeap,0,1);
+	iEnumMemberNum=0;
+
+	int i=0,i2;
+
+	if(!(buffer[i]==1&&buffer[i+1]==ESC_ENUM)) return;
+	i+=2;
+
+	//列挙体の名前を取得
+	char temporary[VN_SIZE];
+	for(i2=0;;i++,i2++){
+		if(IsCommandDelimitation(buffer[i])){
+			temporary[i2]=0;
+			break;
+		}
+		if(!IsVariableChar(buffer[i])){
+			SetError(1,NULL,i);
+			break;
+		}
+		temporary[i2]=buffer[i];
+	}
+
+	name = temporary;
+
+	if(buffer[i]=='\0'){
+		SetError(22,"Enum",nowLine);
+		return;
+	}
+
+	int NextValue=0;
+	while(1){
+		i++;
+
+		if(buffer[i]==1&&buffer[i+1]==ESC_ENDENUM) break;
+
+		for(i2=0;;i2++,i++){
+			if(IsCommandDelimitation(buffer[i])){
+				temporary[i2]=0;
+				break;
+			}
+			if(buffer[i]=='='){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=buffer[i];
+		}
+		if(temporary[0]=='\0'){
+			if(buffer[i]=='\0'){
+				SetError(22,"Enum",nowLine);
+				break;
+			}
+			continue;
+		}
+
+		if(buffer[i]!='='){
+			NextValue++;
+		}
+		else{
+			char temp2[VN_SIZE];
+			for(i++,i2=0;;i2++,i++){
+				if(IsCommandDelimitation(buffer[i])){
+					temp2[i2]=0;
+					break;
+				}
+				temp2[i2]=buffer[i];
+			}
+			NextValue=atoi(temp2);
+		}
+
+		//メンバを追加
+		ppobj_EnumMember=(CEnumMember **)HeapReAlloc(hHeap,0,ppobj_EnumMember,(iEnumMemberNum+1)*sizeof(CEnumMember *));
+		ppobj_EnumMember[iEnumMemberNum]=new CEnumMember(temporary,NextValue);
+		iEnumMemberNum++;
+	}
+}
+CEnumParent::~CEnumParent(){
+	int i;
+	for(i=0;i<iEnumMemberNum;i++){
+		delete ppobj_EnumMember[i];
+	}
+	HeapDefaultFree(ppobj_EnumMember);
+}
+
+
+
+void CEnumParent::InitEnum(void){
+	ppobj_EnumParent=(CEnumParent **)HeapAlloc(hHeap,0,1);
+	iEnumParentNum=0;
+
+	const char *source = Smoothie::Lexical::source.GetBuffer();
+
+	// 名前空間管理
+	NamespaceScopes &namespaceScopes = Smoothie::Lexical::liveingNamespaceScopes;
+	namespaceScopes.clear();
+
+	int i2;
+	char temporary[VN_SIZE];
+	for(int i=0;;i++){
+		if(source[i]=='\0') break;
+
+		if( source[i] == 1 && source[i+1] == ESC_NAMESPACE ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( source[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=source[i];
+			}
+			namespaceScopes.push_back( temporary );
+
+			continue;
+		}
+		else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
+			if( namespaceScopes.size() <= 0 ){
+				SetError(12, "End Namespace", i );
+			}
+			else{
+				namespaceScopes.pop_back();
+			}
+
+			i += 2;
+			continue;
+		}
+
+		if(source[i]==1&&source[i+1]==ESC_ENUM){
+			if(i>=2){
+				if(source[i-2]==1&&source[i-1]==ESC_CONST) continue;
+			}
+			ppobj_EnumParent=(CEnumParent **)HeapReAlloc(hHeap,0,ppobj_EnumParent,(iEnumParentNum+1)*sizeof(CEnumParent *));
+			ppobj_EnumParent[iEnumParentNum]=new CEnumParent( namespaceScopes, source+i,i);
+			iEnumParentNum++;
+		}
+	}
+}
+void CEnumParent::DestroyEnum(void){
+	int i;
+	for(i=0;i<iEnumParentNum;i++){
+		delete ppobj_EnumParent[i];
+	}
+	HeapDefaultFree(ppobj_EnumParent);
+}
+
+char *CEnumParent::GenerateCodes(void){
+	char *buffer;
+	int MaxSize,length;
+	MaxSize=65535;
+	buffer=(char *)HeapAlloc(hHeap,0,MaxSize+65535);
+	length=0;
+
+	buffer[0]=0;
+
+	for(int i=0;i<iEnumParentNum;i++){
+		CEnumParent *parent;
+		parent=ppobj_EnumParent[i];
+
+		BOOST_FOREACH( const string &namespaceStr, parent->GetNamespaceScopes() ){
+			sprintf(buffer+length,"Namespace %s\n",namespaceStr.c_str());
+			length+=lstrlen(buffer+length);
+		}
+
+		sprintf(buffer+length,"Class Enum %s\n",parent->GetName().c_str());
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\tInherits EnumBase\n");
+		length+=lstrlen(buffer+length);
+		sprintf(buffer+length,"\tSub %s(value As Long,lpszName As LPSTR)\n",parent->GetName().c_str());
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\t\tEnumBase(value,lpszName)\n");
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\tEnd Sub\n");
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"Public\n");
+		length+=lstrlen(buffer+length);
+		sprintf(buffer+length,"\tSub %s()\n",parent->GetName().c_str());
+		length+=lstrlen(buffer+length);
+		if(parent->iEnumMemberNum){
+			sprintf(buffer+length,"\t\tEnumBase(%d,\"%s\")\n",
+				parent->ppobj_EnumMember[0]->m_value,
+				parent->ppobj_EnumMember[0]->m_name);
+			length+=lstrlen(buffer+length);
+		}
+		lstrcpy(buffer+length,"\tEnd Sub\n");
+		length+=lstrlen(buffer+length);
+		sprintf(buffer+length,"\tSub ~%s()\n",parent->GetName().c_str());
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\tEnd Sub\n");
+		length+=lstrlen(buffer+length);
+
+		for(int i2=0;i2<parent->iEnumMemberNum;i2++){
+			CEnumMember *member;
+			member=parent->ppobj_EnumMember[i2];
+
+			sprintf(buffer+length,"\tStatic %s As %s(%d,\"%s\")\n",
+				member->m_name,
+				parent->GetName().c_str(),
+				member->m_value,
+				member->m_name);
+			length+=lstrlen(buffer+length);
+		}
+
+		/*
+		sprintf(buffer+length,"\tOverride Function ToString() As String\n",parent->TypeName);
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\t\tSelect Case value\n");
+		length+=lstrlen(buffer+length);
+		for(i2=0;i2<parent->iEnumMemberNum;i2++){
+			CEnumMember *member;
+			member=parent->ppobj_EnumMember[i2];
+
+			sprintf(buffer+length,"\t\t\tCase %d\n",member->m_value);
+			length+=lstrlen(buffer+length);
+			sprintf(buffer+length,"\t\t\t\tReturn \"%s\"\n",member->m_name);
+			length+=lstrlen(buffer+length);
+		}
+		lstrcpy(buffer+length,"\t\tEnd Select\n");
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\tEnd Function\n");
+		length+=lstrlen(buffer+length);
+
+		
+		sprintf(buffer+length,"\tSub Operator= (ByRef value As %s)\n",parent->TypeName);
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\t\tThis.Copy(ByVal VarPtr(value))\n");
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\tEnd Sub\n");
+		length+=lstrlen(buffer+length);
+
+		sprintf(buffer+length,"\tSub Operator= (ByRef value As String)\n",parent->TypeName);
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\t\tSelect Case value\n");
+		length+=lstrlen(buffer+length);
+		for(i2=0;i2<parent->iEnumMemberNum;i2++){
+			CEnumMember *member;
+			member=parent->ppobj_EnumMember[i2];
+
+			sprintf(buffer+length,"\t\t\tCase \"%s\"\n",member->m_name);
+			length+=lstrlen(buffer+length);
+			sprintf(buffer+length,"\t\t\t\tThis=%s.%s\n",parent->TypeName,member->m_name);
+			length+=lstrlen(buffer+length);
+		}
+		lstrcpy(buffer+length,"\t\tEnd Select\n");
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\tEnd Sub\n");
+		length+=lstrlen(buffer+length);
+
+		sprintf(buffer+length,"\tSub Operator= (value As Long)\n",parent->TypeName);
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\t\tm_Value=value\n");
+		length+=lstrlen(buffer+length);
+		lstrcpy(buffer+length,"\tEnd Sub\n");
+		length+=lstrlen(buffer+length);*/
+
+		lstrcpy(buffer+length,"End Class\n");
+		length+=lstrlen(buffer+length);
+
+		BOOST_FOREACH( const string &namespaceStr, parent->GetNamespaceScopes() ){
+			lstrcpy( buffer+length, "End Namespace\n" );
+			length+=lstrlen(buffer+length);
+		}
+
+
+		//バッファ領域が足りなくなった場合はバッファを増量する
+		if(length>MaxSize){
+			MaxSize+=65535;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,MaxSize+65535);
+		}
+	}
+
+	// ログを生成
+	Jenga::Common::Logger logger( Jenga::Common::Environment::GetAppDir() + "\\enum_generated.log" );
+	logger << buffer << endl;
+
+	return buffer;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Enum.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Enum.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Enum.h	(revision 178)
@@ -0,0 +1,40 @@
+
+
+class CEnumMember{
+public:
+	char *m_name;
+	int m_value;
+	CEnumMember(char *name,int value);
+	~CEnumMember();
+};
+
+class CEnumParent{
+	NamespaceScopes namespaceScopes;
+	string name;
+
+	BOOL bConst;
+
+	CEnumMember **ppobj_EnumMember;
+	int iEnumMemberNum;
+public:
+
+	CEnumParent( const NamespaceScopes &namespaceScopes, const char *buffer,int nowLine);
+	~CEnumParent();
+
+	const NamespaceScopes &GetNamespaceScopes() const
+	{
+		return namespaceScopes;
+	}
+	const string &GetName() const
+	{
+		return name;
+	}
+
+public:
+	static void InitEnum(void);
+	static void DestroyEnum(void);
+
+	static char *GenerateCodes(void);
+};
+extern CEnumParent **ppobj_EnumParent;
+extern int iEnumParentNum;
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Intermediate_Step1.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Intermediate_Step1.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Intermediate_Step1.cpp	(revision 178)
@@ -0,0 +1,1211 @@
+#include "../BasicCompiler_Common/common.h"
+
+void ChangeReturnCode(char *buffer){
+
+#ifdef _DEBUG
+	//改行コードの整合性チェック
+	for( int i=0; ; i++ ){
+		if( buffer[i] == '\0' ){
+			break;
+		}
+		if( buffer[i]!='\r' && buffer[i+1]=='\n'
+			||  buffer[i]=='\r' && buffer[i+1]!='\n' ){
+				char temporary[255];
+				strncpy( temporary, buffer + i-100, 130 );
+				temporary[130] = 0;
+				for(int i2=0; ;i2++){
+					if(temporary[i2]=='\r') temporary[i2]='A';
+					if(temporary[i2]=='\n') temporary[i2]='B';
+					if(temporary[i2]=='\0') break;
+				}
+				MessageBox( hOwnerEditor, temporary, "改行コードの整合性チェック", MB_OK | MB_ICONEXCLAMATION );
+		}
+	}
+#endif
+
+	//改行コードのCRLFをLFに変換
+	for(int i=0,i2=0;;i++,i2++){
+		if(buffer[i]=='\r'&&buffer[i+1]=='\n') i++;
+		buffer[i2]=buffer[i];
+		if(buffer[i]=='\0') break;
+	}
+}
+void DeleteComment(char *buffer){	//注釈「'」の取り除き
+	int i,i2,i3,IsStr;
+	char *temporary;
+	temporary=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(buffer)+1);
+	for(i=0,i2=0,i3=0,IsStr=0;;i++,i2++){
+		if(buffer[i]=='\"') IsStr^=1;
+		if(buffer[i]=='\n'||buffer[i]=='\0'){
+			i2--;
+			while(temporary[i2]==' '||temporary[i2]=='\t') i2--;
+			i2++;
+
+			if(i3){
+				//複数行に渡る注釈文の中に改行が存在するとき
+				memset(temporary+i2,'\n',i3);
+				i2+=i3;
+				i3=0;
+			}
+		}
+		if(buffer[i]=='\''&&IsStr==0){
+			//注釈文
+			i2--;
+			while(temporary[i2]==' '||temporary[i2]=='\t') i2--;
+			i2++;
+			while(buffer[i]!='\n'&&buffer[i]!='\0') i++;
+		}
+		if(buffer[i]=='/'&&buffer[i+1]=='*'&&IsStr==0){
+			//注釈文（複数行）
+			i+=2;
+			i3=0;
+			while(!(buffer[i]=='*'&&buffer[i+1]=='/')){
+				if(buffer[i]=='\n') i3++;
+				if(buffer[i]=='\0') break;
+				i++;
+			}
+			if(buffer[i]){
+				i+=2;
+			}
+			i--;
+			i2--;
+			continue;
+		}
+		temporary[i2]=buffer[i];
+		if(buffer[i]=='\0') break;
+	}
+	lstrcpy(buffer,temporary);
+	GlobalFree(temporary);
+}
+void CheckParenthesis(char *buffer){
+	int i,IsStr,PareNum,sw;
+	_int8 bracket[1024];
+
+	for(i=0,IsStr=0,PareNum=0,sw=0;;i++){
+		if(buffer[i]=='\"'){
+			IsStr^=1;
+			continue;
+		}
+
+		else if(buffer[i]=='('&&IsStr==0){
+			bracket[PareNum]=0;
+			PareNum++;
+		}
+		else if(buffer[i]=='['&&IsStr==0){
+			bracket[PareNum]=1;
+			PareNum++;
+		}
+
+		else if(buffer[i]==')'&&IsStr==0){
+			PareNum--;
+			if(bracket[PareNum]!=0||PareNum<0){
+				//"カッコ \'( )\'"
+				SetError(4,STRING_PARENTHESIS,i);
+				return;
+			}
+		}
+		else if(buffer[i]==']'&&IsStr==0){
+			PareNum--;
+			if(bracket[PareNum]!=1||PareNum<0){
+				//"カッコ \'( )\'"
+				SetError(4,STRING_PARENTHESIS,i);
+				return;
+			}
+		}
+
+		else if(buffer[i]=='\n'||buffer[i]=='\0'){
+
+			//"カッコ \'( )\'"
+			if(PareNum!=0) SetError(4,STRING_PARENTHESIS,i);
+
+			if(IsStr!=0) SetError(5,NULL,i);
+			if(buffer[i]=='\0') break;
+			PareNum=0;
+			IsStr=0;
+
+			sw=0;
+		}
+
+		else if((IsDBCSLeadByte(buffer[i])||buffer[i]==1)&&IsStr==0){
+			//不正な文字コード
+			if(sw==0){
+				//全角スペース
+				if(buffer[i]==(char)0x81&&buffer[i+1]==(char)0x40)
+					SetError(20,NULL,i);
+
+				//その他の全角文字
+				else SetError(8,NULL,i);
+				sw=1;
+			}
+		}
+	}
+}
+BOOL CheckParenthesis2(char *buffer){
+	int i,IsStr,PareNum,sw;
+	_int8 bracket[1024];
+
+	for(i=0,IsStr=0,PareNum=0,sw=0;;i++){
+		if(buffer[i]=='\"'){
+			IsStr^=1;
+			continue;
+		}
+
+		else if(buffer[i]=='('&&IsStr==0){
+			bracket[PareNum]=0;
+			PareNum++;
+		}
+		else if(buffer[i]=='['&&IsStr==0){
+			bracket[PareNum]=1;
+			PareNum++;
+		}
+
+		else if(buffer[i]==')'&&IsStr==0){
+			PareNum--;
+			if(bracket[PareNum]!=0||PareNum<0){
+				//"カッコ \'( )\'"
+				return 0;
+			}
+		}
+		else if(buffer[i]==']'&&IsStr==0){
+			PareNum--;
+			if(bracket[PareNum]!=1||PareNum<0){
+				//"カッコ \'( )\'"
+				return 0;
+			}
+		}
+
+		else if(buffer[i]=='\n'||buffer[i]=='\0'){
+
+			//"カッコ \'( )\'"
+			if(PareNum!=0){
+				return 0;
+			}
+
+			if(IsStr!=0){
+				return 0;
+			}
+			if(buffer[i]=='\0') break;
+			PareNum=0;
+			IsStr=0;
+
+			sw=0;
+		}
+
+		else if((IsDBCSLeadByte(buffer[i])||buffer[i]==1)&&IsStr==0){
+			//不正な文字コード
+			if(sw==0){
+				//全角スペース
+				if(buffer[i]==(char)0x81&&buffer[i+1]==(char)0x40){
+					return 0;
+				}
+
+				//その他の全角文字
+				else return 0;
+				sw=1;
+			}
+		}
+	}
+	return 1;
+}
+void DirectiveCheck(void){
+	extern char *basbuf;
+	extern char BasicCurDir[MAX_PATH];
+	int i,i2,i3;
+	char temporary[VN_SIZE];
+
+	extern BOOL bStrict;
+	bStrict=1;
+
+	for(i=0;;i++){
+		if(basbuf[i]=='\0') break;
+		if(((basbuf[i-2]==0&&basbuf[i-1]==-1)||basbuf[i-1]=='\n')&&
+			basbuf[i]=='#'){
+			for(i2=i+1,i3=0;;i2++,i3++){
+				if(!IsVariableChar(basbuf[i2])){
+					temporary[i3]=0;
+					break;
+				}
+				temporary[i3]=basbuf[i2];
+			}
+			if(lstrcmpi(temporary,"noprompt")==0){
+				//#noprompt
+				//旧機能なので、無視
+				for(;;i2++){
+					if(basbuf[i2]=='\n'||basbuf[i2]=='\0') break;
+				}
+				SlideString(basbuf+i2,i-i2);
+			}
+			else if(lstrcmpi(temporary,"strict")==0){
+				//#strict
+				//旧機能なので、無視
+				for(;;i2++){
+					if(basbuf[i2]=='\n'||basbuf[i2]=='\0') break;
+				}
+				SlideString(basbuf+i2,i-i2);
+			}
+			else if(lstrcmpi(temporary,"struct")==0){
+				//#struct code
+				//旧機能なので、無視
+				for(;;i2++){
+					if(basbuf[i2]=='\n'||basbuf[i2]=='\0') break;
+				}
+				SlideString(basbuf+i2,i-i2);
+			}
+			else if( lstrcmpi( temporary, "_fullcompile" ) == 0 ){
+				// すべての関数・メソッドをコンパイルする（デバッグ用）
+				for(;;i2++){
+					if(basbuf[i2]=='\n'||basbuf[i2]=='\0') break;
+				}
+				SlideString(basbuf+i2,i-i2);
+
+				Smoothie::isFullCompile = true;
+			}
+			else if(lstrcmpi(temporary,"resource")==0){
+				//#resource
+				while(basbuf[i2]==' '||basbuf[i2]=='\t') i2++;
+				if(basbuf[i2]!='\"'){
+					SetError(1,NULL,i2);
+					return;
+				}
+				for(i3=0,i2++;;i2++,i3++){
+					if(basbuf[i2]=='\"'){
+						temporary[i3]=0;
+						break;
+					}
+					temporary[i3]=basbuf[i2];
+				}
+				GetFullPath(temporary,BasicCurDir);
+
+				extern char ResourceFileName[MAX_PATH];
+				lstrcpy(ResourceFileName,temporary);
+
+				for(;;i2++){
+					if(basbuf[i2]=='\n'||basbuf[i2]=='\0') break;
+				}
+				SlideString(basbuf+i2,i-i2);
+			}
+		}
+	}
+}
+void NextCommandFormat(char *buffer){
+	int i,i2,i3;
+	char temporary[255];
+
+	//Next命令語のフォーマット
+	for(i=0;;i++){
+		if(buffer[i]=='\n'||buffer[i]==':'||i==0){
+			if(buffer[i]=='\n'||buffer[i]==':') i++;
+			while(buffer[i]==' '||buffer[i]=='\t') i++;
+			while(buffer[i]>='0'&&buffer[i]<='9') i++;
+			while(buffer[i]==' '||buffer[i]=='\t') i++;
+			if((buffer[i]=='n'||buffer[i]=='N')&&(buffer[i+1]=='e'||buffer[i+1]=='E')&&(buffer[i+2]=='x'||buffer[i+2]=='X')&&(buffer[i+3]=='t'||buffer[i+3]=='T')&&
+				(buffer[i+4]==' '||buffer[i+4]=='\t')){
+				i2=i+5;
+				while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+				if(buffer[i2]!='\n'){
+					lstrcpy(temporary,"NEXT");
+					for(i3=0;;i2++){
+						if(buffer[i2]=='\n'||buffer[i2]==':'||buffer[i2]=='\0') break;
+						if(buffer[i2]==','){
+							lstrcat(temporary,":NEXT");
+							i3=1;
+						}
+					}
+					if(i3){
+						i3=lstrlen(temporary);
+						SlideString(buffer+i2,i-i2+i3);
+						memcpy(buffer+i,temporary,i3);
+					}
+				}
+			}
+		}
+		if(buffer[i]=='\0') break;
+	}
+}
+void SetEscapeSequenceFormat(char *buffer){
+	/*「MOD」「AND」「OR」
+		その他制御文字をエスケープシーケンスを使用した記号へ変換 */
+	int i,i2,i3,i4,i5,i6,sw1,IsStr;
+	char *temporary,temp2[VN_SIZE];
+
+	bool isBeforeCharDelimitation = false;
+	temporary=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,lstrlen(buffer)*2);
+	for(i=0,i2=0,IsStr=0;;i++,i2++){
+		if(buffer[i]=='\"') IsStr^=1;
+		if(buffer[i]=='-'&&buffer[i+1]=='>'&&IsStr==0){
+			buffer[i]=1;
+			buffer[i+1]=ESC_PSMEM;
+		}
+
+		if( buffer[i] && IsCommandDelimitation( buffer[i] ) ){
+			isBeforeCharDelimitation = true;
+
+			temporary[i2]=buffer[i];
+			continue;
+		}
+
+		if(IsVariableChar(buffer[i])&&IsStr==0){
+
+			i3=i2;
+			for(;;i++,i2++){
+				if(!IsVariableChar(buffer[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+
+			bool isAfterCharBlank = false;
+			if( IsBlank( buffer[i] ) ){
+				isAfterCharBlank = true;
+			}
+
+			if(lstrcmpi(temporary+i3,"End")==0) i6=1;
+			else if(lstrcmpi(temporary+i3,"Exit")==0) i6=2;
+			else if(lstrcmpi(temporary+i3,"Select")==0) i6=3;
+			else if(lstrcmpi(temporary+i3,"Case")==0) i6=4;
+			else if(lstrcmpi(temporary+i3,"Else")==0) i6=5;
+			else i6=0;
+			if(i6){
+				i4=i;
+				while(buffer[i4]==' '||buffer[i4]=='\t') i4++;
+				for(i5=0;;i4++,i5++){
+					if(!IsVariableChar(buffer[i4])){
+						temp2[i5]=0;
+						break;
+					}
+					temp2[i5]=buffer[i4];
+				}
+				sw1=0;
+				if(i6==3){
+					//Select～
+					if(lstrcmpi(temp2,"Case")==0) sw1=1;
+				}
+				else if(i6==4){
+					//Case～
+					if(lstrcmpi(temp2,"Else")==0) sw1=1;
+				}
+				else if(i6==5){
+					//Else If
+					if(lstrcmpi(temp2,"If")==0) sw1=1;
+				}
+				else if(i6==1){
+					//End～
+					switch(temp2[0]){
+						case 'c':
+						case 'C':
+							if(lstrcmpi(temp2,"Class")==0) sw1=1;
+							break;
+						case 'e':
+						case 'E':
+							if(lstrcmpi(temp2,"Enum")==0) sw1=1;
+							break;
+						case 'i':
+						case 'I':
+							if(lstrcmpi(temp2,"If")==0) sw1=1;
+							else if(lstrcmpi(temp2,"Interface")==0) sw1=1;
+							break;
+						case 'f':
+						case 'F':
+							if(lstrcmpi(temp2,"Function")==0) sw1=1;
+							break;
+						case 'm':
+						case 'M':
+							if(lstrcmpi(temp2,"Macro")==0) sw1=1;
+							break;
+						case 'n':
+						case 'N':
+							if(lstrcmpi(temp2,"Namespace")==0) sw1=1;
+							break;
+						case 's':
+						case 'S':
+							if(lstrcmpi(temp2,"Sub")==0) sw1=1;
+							else if(lstrcmpi(temp2,"Select")==0) sw1=1;
+							break;
+						case 't':
+						case 'T':
+							if(lstrcmpi(temp2,"Type")==0) sw1=1;
+							break;
+						case 'w':
+						case 'W':
+							if(lstrcmpi(temp2,"With")==0) sw1=1;
+							break;
+					}
+				}
+				else if(i6==2){
+					//Exit～
+					if(
+						lstrcmpi(temp2,"For")==0||
+						lstrcmpi(temp2,"While")==0||
+						lstrcmpi(temp2,"Do")==0||
+						lstrcmpi(temp2,"Function")==0||
+						lstrcmpi(temp2,"Sub")==0||
+						lstrcmpi(temp2,"Macro")==0
+						) sw1=1;
+				}
+
+				if(sw1){
+					i=i4;
+					memcpy(temporary+i2,temp2,i5);
+					i2+=i5;
+					temporary[i2]=0;
+				}
+			}
+			i--;
+			i2--;
+
+			switch(temporary[i3]){
+				case '_':
+					if(lstrcmpi(temporary+i3,"_ClearNamespaceImported")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_CLEARNAMESPACEIMPORTED;
+					}
+					break;
+				case 'a':
+				case 'A':
+					if(lstrcmpi(temporary+i3,"And")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_AND;
+					}
+					else if(lstrcmpi(temporary+i3,"Abstract")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_ABSTRACT;
+					}
+					else if(lstrcmpi(temporary+i3,"As")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_AS;
+					}
+					break;
+				case 'b':
+				case 'B':
+					if(lstrcmpi(temporary+i3,"ByVal")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_BYVAL;
+					}
+					else if(lstrcmpi(temporary+i3,"ByRef")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_BYREF;
+					}
+					break;
+				case 'c':
+				case 'C':
+					if(lstrcmpi(temporary+i3,"Catch")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_CATCH;
+					}
+					else if(lstrcmpi(temporary+i3,"Continue")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_CONTINUE;
+					}
+					else if(lstrcmpi(temporary+i3,"cdecl")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_CDECL;
+					}
+					else if(lstrcmpi(temporary+i3,"Case")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_CASE;
+					}
+					else if(lstrcmpi(temporary+i3,"CaseElse")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_CASEELSE;
+					}
+					else if(lstrcmpi(temporary+i3,"Const")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_CONST;
+					}
+					else if(lstrcmpi(temporary+i3,"Class")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_CLASS;
+					}
+					break;
+				case 'd':
+				case 'D':
+					if(lstrcmpi(temporary+i3,"Declare")==0){
+						i2=i3;
+						int i9=i2;
+						temporary[i2]=1;
+						temporary[++i2]=ESC_DECLARE;
+						i++;
+						while(buffer[i]==' '||buffer[i]=='\t') i++;
+
+						// Sub/Function
+						for(i4=0;;i++,i4++){
+							if(!IsVariableChar(buffer[i])){
+								temp2[i4]=0;
+								break;
+							}
+							temp2[i4]=buffer[i];
+						}
+						if(lstrcmpi(temp2,"Sub")==0) temporary[++i2]=ESC_SUB;
+						else if(lstrcmpi(temp2,"Function")==0) temporary[++i2]=ESC_FUNCTION;
+						while(buffer[i]==' '||buffer[i]=='\t') i++;
+
+						// 関数名
+						for(i2++;;i++,i2++){
+							if(!IsVariableChar(buffer[i])){
+								i2--;
+								break;
+							}
+							temporary[i2]=buffer[i];
+						}
+						while(buffer[i]==' '||buffer[i]=='\t') i++;
+
+						for(i4=0;;i++,i4++){
+							if(!IsVariableChar(buffer[i])){
+								temp2[i4]=0;
+								break;
+							}
+							temp2[i4]=buffer[i];
+						}
+						if(lstrcmpi(temp2,"cdecl")==0){
+							temporary[++i2]=1;
+							temporary[++i2]=ESC_CDECL;
+
+							while(buffer[i]==' '||buffer[i]=='\t') i++;
+							for(i4=0;;i++,i4++){
+								if(!IsVariableChar(buffer[i])){
+									temp2[i4]=0;
+									break;
+								}
+								temp2[i4]=buffer[i];
+							}
+						}
+						if(lstrcmpi(temp2,"Lib")==0) temporary[++i2]=',';
+						while(buffer[i]==' '||buffer[i]=='\t') i++;
+
+						if(buffer[i]=='\"'){
+							temporary[++i2]=buffer[i];
+							for(i++,i2++;;i++,i2++){
+								temporary[i2]=buffer[i];
+								if(buffer[i]=='\"'){
+									i++;
+									break;
+								}
+								if(buffer[i]=='\0') break;
+							}
+						}
+						else{
+							for(i2++;;i++,i2++){
+								if(!IsVariableChar(buffer[i])){
+									i2--;
+									break;
+								}
+								temporary[i2]=buffer[i];
+							}
+						}
+						while(buffer[i]==' '||buffer[i]=='\t') i++;
+
+						temporary[++i2]=',';
+
+						if( memicmp( buffer + i, "Alias", 5 ) ==0 ){
+							i+=5;
+							for(i++,i2++;;i++,i2++){
+								temporary[i2]=buffer[i];
+								if(buffer[i]=='('){
+									i2--;
+									break;
+								}
+								if(buffer[i]=='\0') break;
+							}
+						}
+
+						temporary[++i2]=',';
+
+						i--;
+					}
+					else if(lstrcmpi(temporary+i3,"Def")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_DEF;
+					}
+					break;
+				case 'e':
+				case 'E':
+					if(lstrcmpi(temporary+i3,"ElseIf")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_ELSEIF;
+					}
+					else if(lstrcmpi(temporary+i3,"Else")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_ELSE;
+					}
+					else if(lstrcmpi(temporary+i3,"Export")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_EXPORT;
+					}
+					else if(lstrcmpi(temporary+i3,"Enum")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_ENUM;
+					}
+
+					else if(temporary[i3+1]=='n'||temporary[i3+1]=='N'){
+						//終了記述
+						if(lstrcmpi(temporary+i3,"EndIf")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_ENDIF;
+						}
+						else if(lstrcmpi(temporary+i3,"EndFunction")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_ENDFUNCTION;
+						}
+						else if(lstrcmpi(temporary+i3,"EndSub")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_ENDSUB;
+						}
+						else if(lstrcmpi(temporary+i3,"EndMacro")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_ENDMACRO;
+						}
+						else if(lstrcmpi(temporary+i3,"EndNamespace")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_ENDNAMESPACE;
+						}
+						else if(lstrcmpi(temporary+i3,"EndClass")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_ENDCLASS;
+						}
+						else if(lstrcmpi(temporary+i3,"EndInterface")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_ENDINTERFACE;
+						}
+						else if(lstrcmpi(temporary+i3,"EndTry")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_ENDTRY;
+						}
+						else if(lstrcmpi(temporary+i3,"EndType")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_ENDTYPE;
+						}
+						else if(lstrcmpi(temporary+i3,"EndEnum")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_ENDENUM;
+						}
+						else if(lstrcmpi(temporary+i3,"EndSelect")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_ENDSELECT;
+						}
+						else if(lstrcmpi(temporary+i3,"EndWith")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_ENDWITH;
+						}
+					}
+					else if(temporary[i3+1]=='x'||temporary[i3+1]=='X'){
+						if(lstrcmpi(temporary+i3,"ExitFor")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_EXITFOR;
+						}
+						else if(lstrcmpi(temporary+i3,"ExitWhile")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_EXITWHILE;
+						}
+						else if(lstrcmpi(temporary+i3,"ExitDo")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_EXITDO;
+						}
+						else if(lstrcmpi(temporary+i3,"ExitFunction")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_EXITFUNCTION;
+						}
+						else if(lstrcmpi(temporary+i3,"ExitSub")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_EXITSUB;
+						}
+						else if(lstrcmpi(temporary+i3,"ExitMacro")==0){
+							i2=i3;
+							temporary[i2++]=1;
+							temporary[i2]=ESC_EXITMACRO;
+						}
+					}
+					break;
+				case 'f':
+				case 'F':
+					if(lstrcmpi(temporary+i3,"Finally")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_FINALLY;
+					}
+					else if(lstrcmpi(temporary+i3,"Function")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_FUNCTION;
+					}
+					break;
+				case 'i':
+				case 'I':
+					if(lstrcmpi(temporary+i3,"If")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_IF;
+					}
+					else if(lstrcmpi(temporary+i3,"Imports")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_IMPORTS;
+					}
+					else if(lstrcmpi(temporary+i3,"Inherits")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_INHERITS;
+					}
+					else if(lstrcmpi(temporary+i3,"Interface")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_INTERFACE;
+					}
+					break;
+				case 'm':
+				case 'M':
+					if(lstrcmpi(temporary+i3,"Mod")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_MOD;
+					}
+					else if(lstrcmpi(temporary+i3,"Macro")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_MACRO;
+					}
+					break;
+				case 'n':
+				case 'N':
+					if(isBeforeCharDelimitation
+						&& lstrcmpi(temporary+i3,"Namespace")==0
+						&& isAfterCharBlank ){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_NAMESPACE;
+					}
+					else if(lstrcmpi(temporary+i3,"New")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_NEW;
+					}
+					else if(lstrcmpi(temporary+i3,"Not")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_NOT;
+					}
+					break;
+				case 'o':
+				case 'O':
+					if(lstrcmpi(temporary+i3,"Or")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_OR;
+					}
+					else if(lstrcmpi(temporary+i3,"Override")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_OVERRIDE;
+					}
+					else if(lstrcmpi(temporary+i3,"Operator")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_OPERATOR;
+					}
+					break;
+				case 's':
+				case 'S':
+					if(lstrcmpi(temporary+i3,"Sub")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_SUB;
+					}
+					else if(lstrcmpi(temporary+i3,"SelectCase")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_SELECTCASE;
+					}
+					else if(lstrcmpi(temporary+i3,"Static")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_STATIC;
+					}
+					break;
+				case 't':
+				case 'T':
+					if(lstrcmpi(temporary+i3,"Then")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_THEN;
+					}
+					else if(lstrcmpi(temporary+i3,"Throw")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_THROW;
+					}
+					else if(lstrcmpi(temporary+i3,"Try")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_TRY;
+					}
+					else if(lstrcmpi(temporary+i3,"Type")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_TYPE;
+					}
+					else if(lstrcmpi(temporary+i3,"TypeDef")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_TYPEDEF;
+					}
+					break;
+				case 'u':
+				case 'U':
+					if(lstrcmpi(temporary+i3,"Using")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_USING;
+					}
+					break;
+				case 'v':
+				case 'V':
+					if(lstrcmpi(temporary+i3,"Virtual")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_VIRTUAL;
+					}
+					break;
+				case 'w':
+				case 'W':
+					if(lstrcmpi(temporary+i3,"With")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_WITH;
+					}
+					break;
+				case 'x':
+				case 'X':
+					if(lstrcmpi(temporary+i3,"Xor")==0){
+						i2=i3;
+						temporary[i2++]=1;
+						temporary[i2]=ESC_XOR;
+					}
+					break;
+			}
+					
+			continue;
+		}
+
+		if( !IsBlank( buffer[i] ) ){
+			isBeforeCharDelimitation = false;
+		}
+
+		temporary[i2]=buffer[i];
+		if(buffer[i]=='\0') break;
+	}
+	lstrcpy(buffer,temporary);
+	HeapDefaultFree(temporary);
+}
+void DefCommandFormat(char *buffer){
+	int i,i2,PareNum;
+	char temporary[255];
+
+	//Def命令語からFunction命令語へ
+	for(i=0;;i++){
+		if(buffer[i]==1&&buffer[i+1]==ESC_DEF){
+			buffer[i+1]=ESC_FUNCTION;
+			i+=2;
+			while(buffer[i]==' '||buffer[i]=='\t') i++;
+			for(i2=0;;i++,i2++){
+				if(!IsVariableChar(buffer[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+			while(buffer[i]==' '||buffer[i]=='\t') i++;
+			if(buffer[i]!='('){
+				SetError(1,NULL,i);
+				return;
+			}
+			i++;
+			while(1){
+				while(buffer[i]==' '||buffer[i]=='\t') i++;
+				if(buffer[i]==')') break;
+				SlideString(buffer+i,2);
+				buffer[i]=1;
+				buffer[i+1]=ESC_BYVAL;
+				i+=2;
+				PareNum=0;
+				for(;;i++){
+					if(buffer[i]=='(') PareNum++;
+					if(buffer[i]==')'){
+						PareNum--;
+						if(PareNum<0) break;
+					}
+					if(buffer[i]==','&&PareNum==0) break;
+				}
+				if(buffer[i]==')') break;
+				i++;
+			}
+			i++;
+			while(buffer[i]==' '||buffer[i]=='\t') i++;
+			if(buffer[i]!='='){
+				SetError(1,NULL,i);
+				break;
+			}
+			i2=lstrlen(temporary);
+			SlideString(buffer+i,i2+1);
+			buffer[i]=':';
+			i++;
+			memcpy(buffer+i,temporary,i2);
+			i+=i2;
+			while(!IsCommandDelimitation(buffer[i])) i++;
+			SlideString(buffer+i,3);
+			buffer[i]=':';
+			buffer[i+1]=1;
+			buffer[i+2]=ESC_ENDFUNCTION;
+		}
+		if(buffer[i]=='\0') break;
+	}
+}
+
+void ChangeOneIf(char *write,int &wp,char *read,int &rp){
+	int IsStr,sw;
+
+	//ブロック形式でないときはThenの後に区切り文字を入れる
+	for(IsStr=0,sw=0;;wp++,rp++){
+		if(read[rp]=='\"') IsStr^=1;
+
+		write[wp]=read[rp];
+
+		if(IsCommandDelimitation(read[rp])&&IsStr==0) return;
+		if(read[rp]==1&&read[rp+1]==ESC_THEN&&
+			(read[rp+2]==' '||read[rp+2]=='\t')){
+				write[wp+1]=read[rp+1];
+				write[wp+2]=':';
+				rp+=3;
+				wp+=3;
+				while(read[rp]==' '||read[rp]=='\t') rp++;
+				if((read[rp]>='0'&&read[rp]<='9')||read[rp]=='*'){
+					memcpy(write+wp,"Goto ",5);
+					wp+=5;
+				}
+				break;
+		}
+	}
+
+	//Elseの後に区切り文字を入れる
+	for(IsStr=0;;wp++,rp++){
+		if(read[rp]=='\"') IsStr^=1;
+
+		write[wp]=read[rp];
+
+		if(read[rp]=='\n'||read[rp]=='\0') break;
+		if(read[rp]==1&&read[rp+1]==ESC_IF){
+			write[wp+1]=read[rp+1];
+			wp+=2;
+			rp+=2;
+			ChangeOneIf(write,wp,read,rp);
+			wp--;
+			rp--;
+			continue;
+		}
+		if(read[rp]==1&&read[rp+1]==ESC_ELSE){
+			write[wp++]=':';
+
+			write[wp]=read[rp];
+			write[wp+1]=read[rp+1];
+			wp+=2;
+			rp+=2;
+
+			write[wp++]=':';
+
+			while(read[rp]==' '||read[rp]=='\t') rp++;
+			if((read[rp]>='0'&&read[rp]<='9')||read[rp]=='*'){
+				memcpy(write+wp,"Goto ",5);
+				wp+=5;
+			}
+			break;
+		}
+	}
+
+	//"End If" を付加
+	for(;;rp++,wp++){
+		if(read[rp]=='\n'||read[rp]=='\0') break;
+
+		if(read[rp]==1&&read[rp+1]==ESC_IF){
+			write[wp+1]=read[rp+1];
+			wp+=2;
+			rp+=2;
+			ChangeOneIf(write,wp,read,rp);
+			wp--;
+			rp--;
+			continue;
+		}
+		if(read[rp]==1&&read[rp+1]==ESC_ELSE) break;
+
+		write[wp]=read[rp];
+	}
+	write[wp]=':';
+	write[wp+1]=1;
+	write[wp+2]=ESC_ENDIF;
+	wp+=3;
+}
+void OutsideIfFormat(char *write,int &wp,char *read,int &rp){
+	int ElseCount=1;
+
+	for(;;rp++,wp++){
+		if(read[rp]==1){
+			if(read[rp+1]==ESC_IF){
+				write[wp++]=read[rp++];
+				write[wp++]=read[rp++];
+				OutsideIfFormat(write,wp,read,rp);
+				wp--,rp--;
+				continue;
+			}
+			if(read[rp+1]==ESC_ENDIF){
+				for(;ElseCount>0;wp+=3,ElseCount--){
+					write[wp]=1;
+					write[wp+1]=ESC_ENDIF;
+					write[wp+2]=':';
+				}
+				rp+=2;
+				break;
+			}
+			if(read[rp+1]==ESC_ELSEIF){
+				write[wp]=1;
+				write[wp+1]=ESC_ELSE;
+				write[wp+2]=':';
+
+				write[wp+3]=1;
+				write[wp+4]=ESC_IF;
+
+				wp+=4;
+				rp++;
+
+				ElseCount++;
+				continue;
+			}
+		}
+
+		write[wp]=read[rp];
+		if(read[rp]=='\0') break;
+	}
+}
+void IfCommandFormat(char *buffer){
+	int i,i2;
+
+	char *temporary;
+	temporary=(char *)HeapAlloc(hHeap,0,lstrlen(buffer)*2+1024);
+
+	//１行Ifをブロック形式にする
+	for(i=0,i2=0;;i++,i2++){
+		if(buffer[i]==1&&buffer[i+1]==ESC_IF){
+			temporary[i2++]=buffer[i++];
+			temporary[i2++]=buffer[i++];
+			ChangeOneIf(temporary,i2,buffer,i);
+			i2--,i--;
+			continue;
+		}
+
+		temporary[i2]=buffer[i];
+		if(buffer[i]=='\0') break;
+	}
+
+	//ElseIfを入れ子構造に変更する
+	for(i=0,i2=0;;i++,i2++){
+		if(temporary[i]==1&&temporary[i+1]==ESC_IF){
+			buffer[i2++]=temporary[i++];
+			buffer[i2++]=temporary[i++];
+			OutsideIfFormat(buffer,i2,temporary,i);
+			i2--,i--;
+			continue;
+		}
+
+		buffer[i2]=temporary[i];
+		if(temporary[i]=='\0') break;
+	}
+
+	HeapDefaultFree(temporary);
+}
+void CheckPareCommand(void){
+	extern char *basbuf;
+	int i2,i3;
+
+	int FuncNum=0;
+	int FuncType=0;
+	int FuncPtr=-1;
+	for(i2=0;;i2++){
+		if(basbuf[i2]=='\0') break;
+		if(IsCommandDelimitation(basbuf[i2])){
+			if(basbuf[i2+1]==1){
+				i2++;
+				switch(basbuf[i2+1]){
+					case ESC_FUNCTION:
+					case ESC_SUB:
+					case ESC_MACRO:
+						if(FuncNum!=0){
+							if(FuncType==ESC_FUNCTION)
+								SetError(54,"End Function",FuncPtr);
+							else if(FuncType==ESC_SUB)
+								SetError(54,"End Sub",FuncPtr);
+							else if(FuncType==ESC_MACRO)
+								SetError(54,"End Macro",FuncPtr);
+							return;
+						}
+						FuncType=basbuf[i2+1];
+						FuncNum++;
+						FuncPtr=i2;
+						break;
+					case ESC_ENDFUNCTION:
+					case ESC_ENDSUB:
+					case ESC_ENDMACRO:
+						if(basbuf[i2+1]==ESC_ENDFUNCTION)	i3=ESC_FUNCTION;
+						else if(basbuf[i2+1]==ESC_ENDSUB)	i3=ESC_SUB;
+						else if(basbuf[i2+1]==ESC_ENDMACRO)	i3=ESC_MACRO;
+
+						FuncNum--;
+
+						if(FuncNum!=0||i3!=FuncType){
+							if(basbuf[i2+1]==ESC_ENDFUNCTION)
+								SetError(12,"End Function",i2);
+							else if(basbuf[i2+1]==ESC_ENDSUB)
+								SetError(12,"End Sub",i2);
+							else if(basbuf[i2+1]==ESC_ENDMACRO)
+								SetError(12,"End Macro",i2);
+							return;
+						}
+						break;
+				}
+			}
+
+
+		}
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Intermediate_Step2.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Intermediate_Step2.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Intermediate_Step2.cpp	(revision 178)
@@ -0,0 +1,758 @@
+#include "../BasicCompiler_Common/common.h"
+
+CONSTINFO *GetNewConstHash(char *name){
+	extern int cp;
+	CONSTINFO *pci;
+
+	int key;
+	key=hash_default(name);
+
+	extern CONSTINFO **ppConstHash;
+	if(ppConstHash[key]){
+		pci=ppConstHash[key];
+		while(1){
+			if(lstrcmp(pci->name,name)==0){
+				//重複エラー
+				SetError(15,name,cp);
+				return 0;
+			}
+
+			if(pci->pNextData==0){
+				pci->pNextData=(CONSTINFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(CONSTINFO));
+				break;
+			}
+			pci=pci->pNextData;
+		}
+		pci=pci->pNextData;
+	}
+	else{
+		ppConstHash[key]=(CONSTINFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(CONSTINFO));
+		pci=ppConstHash[key];
+	}
+
+	return pci;
+}
+
+// マクロ定数を追加するための関数
+void AddConstData(char *Command){
+	extern HANDLE hHeap;
+	extern int cp;
+	int i,i2;
+	char temporary[VN_SIZE];
+
+	for(i=0;;i++){
+		if(Command[i]=='\0'){
+			SetError(10,"Const",cp);
+			return;
+		}
+		if(Command[i]=='=' ||  Command[i] == 1 && Command[i+1] == ESC_AS ){
+			//定数定義は新しいクラスモジュール（CDBConst）へ移行
+			// ※この関数はマクロ定数のみを扱う
+			return;
+		}
+		if(Command[i]=='('){
+			temporary[i]=0;
+			break;
+		}
+		temporary[i]=Command[i];
+	}
+
+
+	/////////////////////////////////
+	// 格納位置を計算してpciにセット
+	/////////////////////////////////
+
+	CONSTINFO *pci;
+	pci=GetNewConstHash(temporary);
+	if(!pci) return;
+
+
+
+	////////////////////
+	// 定数情報を取得
+	////////////////////
+
+	//定数名
+	pci->name=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+	lstrcpy(pci->name,temporary);
+
+	if(Command[i]=='('){
+		pci->ppParm=(char **)HeapAlloc(hHeap,0,1);
+		pci->ParmNum=0;
+		for(i++,i2=0;;i++,i2++){
+			if(Command[i]=='\0'){
+				SetError(1,NULL,cp);
+				return;
+			}
+			if(Command[i]==','||Command[i]==')'){
+				temporary[i2]=0;
+				pci->ppParm=(char **)HeapReAlloc(hHeap,0,pci->ppParm,(pci->ParmNum+1)*sizeof(char *));
+				pci->ppParm[pci->ParmNum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+				lstrcpy(pci->ppParm[pci->ParmNum],temporary);
+				pci->ParmNum++;
+				if(Command[i]==')'){
+					i++;
+					if(Command[i]!='='){
+						SetError(1,NULL,cp);
+						return;
+					}
+					break;
+				}
+
+				i2=-1;
+				continue;
+			}
+			temporary[i2]=Command[i];
+		}
+	}
+	else pci->ParmNum=0;
+
+	//データ
+	lstrcpy(temporary,Command+i+1);
+	if(pci->ParmNum){
+		pci->StrValue=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+		lstrcpy(pci->StrValue,temporary);
+	}
+	else if(temporary[0]=='\"'){
+		//文字列定数
+		RemoveStringQuotes(temporary);
+		i2=lstrlen(temporary);
+
+		pci->StrValue=(char *)HeapAlloc(hHeap,0,i2+1);
+		memcpy(pci->StrValue,temporary,i2);
+		pci->StrValue[i2]=0;
+
+		pci->DblValue=(double)i2;
+
+		pci->type=DEF_STRING;
+		pci->lpIndex=-1;
+	}
+	else if((temporary[0]=='e'||temporary[0]=='E')&&
+		(temporary[1]=='x'||temporary[1]=='X')&&
+		temporary[2]=='\"'){
+		//文字列定数
+		RemoveStringQuotes(temporary+2);
+		i2=FormatString_EscapeSequence(temporary+2);
+		pci->StrValue=(char *)HeapAlloc(hHeap,0,i2+1);
+		memcpy(pci->StrValue,temporary+2,i2);
+		pci->StrValue[i2]=0;
+
+		pci->DblValue=(double)i2;
+
+		pci->type=DEF_STRING;
+		pci->lpIndex=-1;
+	}
+	else{
+		//数値定数
+		_int64 i64data;
+		Type resultType;
+		StaticCalculation(true, temporary,0,&i64data,resultType);
+		pci->type=resultType.GetBasicType();
+		if(IsRealNumberType(pci->type)){
+			//実数型
+			memcpy(&pci->DblValue,&i64data,sizeof(double));
+		}
+		else if(Is64Type(pci->type)){
+			//64ビット型
+			pci->i64Value=i64data;
+		}
+		else if(IsWholeNumberType(pci->type)){
+			//その他整数型
+			pci->DblValue=(double)i64data;
+		}
+
+		pci->StrValue=0;
+	}
+}
+void AddConstEnum( const NamespaceScopes &namespaceScopes, char *buffer){
+	extern int cp;
+	int i=0,i2;
+
+	if(!(buffer[i]==1&&buffer[i+1]==ESC_ENUM)) return;
+	i+=2;
+
+	//列挙体の名前を取得
+	char temporary[VN_SIZE];
+	for(i2=0;;i++,i2++){
+		if(IsCommandDelimitation(buffer[i])){
+			temporary[i2]=0;
+			break;
+		}
+		if(!IsVariableChar(buffer[i])){
+			SetError(1,NULL,i);
+			break;
+		}
+		temporary[i2]=buffer[i];
+	}
+
+	if(buffer[i]=='\0'){
+		SetError(22,"Enum",cp);
+		return;
+	}
+
+	int NextValue=0;
+	while(1){
+		i++;
+
+		if(buffer[i]==1&&buffer[i+1]==ESC_ENDENUM) break;
+
+		for(i2=0;;i2++,i++){
+			if(IsCommandDelimitation(buffer[i])){
+				temporary[i2]=0;
+				break;
+			}
+			if(buffer[i]=='='){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=buffer[i];
+		}
+		if(temporary[0]=='\0'){
+			if(buffer[i]=='\0'){
+				SetError(22,"Enum",cp);
+				break;
+			}
+			continue;
+		}
+
+		if(buffer[i]!='='){
+			NextValue++;
+		}
+		else{
+			char temp2[VN_SIZE];
+			for(i++,i2=0;;i2++,i++){
+				if(IsCommandDelimitation(buffer[i])){
+					temp2[i2]=0;
+					break;
+				}
+				temp2[i2]=buffer[i];
+			}
+
+			_int64 i64data;
+			StaticCalculation(true, temp2,DEF_LONG,&i64data,Type());
+			NextValue=(int)i64data;
+		}
+
+		//定数を追加
+		CDBConst::obj.AddConst( namespaceScopes, temporary, NextValue);
+	}
+}
+bool GetConstInfo(void){
+	////////////////////////////////////////////
+	// Const命令の情報を取得
+	////////////////////////////////////////////
+
+	int i2;
+	char temporary[1024];
+
+	// 名前空間管理
+	NamespaceScopes &namespaceScopes = Smoothie::Lexical::liveingNamespaceScopes;
+	namespaceScopes.clear();
+
+	//定数に関する情報
+	extern CONSTINFO **ppConstHash;
+	ppConstHash=(CONSTINFO **)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,MAX_HASH*sizeof(CONSTINFO *));
+
+	extern char *basbuf;
+	for(int i=0;;i++){
+		if( basbuf[i] == '\0' ) break;
+
+		if( basbuf[i] == 1 && basbuf[i+1] == ESC_NAMESPACE ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( basbuf[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+			}
+			namespaceScopes.push_back( temporary );
+
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
+			if( namespaceScopes.size() <= 0 ){
+				SetError(12, "End Namespace", i );
+			}
+			else{
+				namespaceScopes.pop_back();
+			}
+
+			i += 2;
+			continue;
+		}
+
+		if( basbuf[i] == 1 ){
+			if(basbuf[i]==1&&basbuf[i+1]==ESC_CONST){
+				i+=2;
+
+				extern int cp;
+				cp=i;	//エラー用
+
+
+				if(basbuf[i]==1&&basbuf[i+1]==ESC_ENUM){
+					AddConstEnum( namespaceScopes, basbuf+i);
+					continue;
+				}
+
+				for(i2=0;;i++,i2++){
+					if(basbuf[i]=='\"'){
+						temporary[i2]=basbuf[i];
+						for(i++,i2++;;i++,i2++){
+							temporary[i2]=basbuf[i];
+							if(basbuf[i]=='\"') break;
+						}
+						continue;
+					}
+					if(IsCommandDelimitation(basbuf[i])){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=basbuf[i];
+				}
+				CDBConst::obj.Add( namespaceScopes, temporary);
+				if(basbuf[i]=='\0') break;
+			}
+			else{
+				int result = JumpStatement( basbuf, i );
+				if( result == -1 ){
+					//エラー
+					return false;
+				}
+				else if( result == 1 ){
+					//ジャンプした場合
+					i--;
+				}
+			}
+		}
+	}
+	return true;
+}
+
+char ConstructorDestructorSchedule[MAX_PATH];
+void MakeConstructorAndDestructor(char *buffer,int nowLine,char *ClassName){
+	int i,i2;
+	char temporary[MAX_PATH],*pTemp;
+	BOOL bConstructor,bDestructor;
+
+	ConstructorDestructorSchedule[0]=0;
+	bConstructor=0;
+	bDestructor=0;
+
+	for(i=nowLine;;i++){
+		if(buffer[i]=='\0') break;
+		if(buffer[i]==1&&buffer[i+1]==ESC_ENDCLASS){
+			if((!bConstructor)||(!bDestructor)){
+				pTemp=ConstructorDestructorSchedule;
+
+				lstrcpy(pTemp,"Public:");
+
+				if(!bConstructor){
+					//コンストラクタが無いときは生成する
+					sprintf(pTemp+lstrlen(pTemp),"%c%c%s():%c%c:",
+						1,ESC_SUB,
+						ClassName,
+						1,ESC_ENDSUB);
+				}
+
+				if(!bDestructor){
+					//デストラクタが無いときは生成する
+					sprintf(pTemp+lstrlen(pTemp),"%c%c~%s():%c%c:",
+						1,ESC_SUB,
+						ClassName,
+						1,ESC_ENDSUB);
+				}
+			}
+			break;
+		}
+
+		if(buffer[i]==1&&(buffer[i+1]==ESC_SUB||buffer[i+1]==ESC_FUNCTION)){
+			i+=2;
+			while(IsBlank(buffer[i])) i++;
+			if(buffer[i]=='~'){
+				//デストラクタ
+				bDestructor=1;
+			}
+			else{
+				//コンストラクタかどうかをチェック
+				for(i2=0;;i++,i2++){
+					if(!IsVariableChar(buffer[i])){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+				if(lstrcmp(temporary,ClassName)==0) bConstructor=1;
+			}
+		}
+	}
+}
+void ChangeCommand(char *buffer,int nowLine,char *Command){
+	int i,i2,IsStr;
+	unsigned _int16 ComNum;
+	char com[8192],pam[8192];
+
+	static int nCountOfNonGlobalScope = 0;
+
+	if(Command[0]==1){
+		switch(Command[1]){
+			case ESC_SELECTCASE:
+			case ESC_CASE:
+				KillStringSpaces(Command+2);
+				break;
+			case ESC_WITH:
+				KillStringSpaces(Command+2);
+				break;
+			case ESC_TYPEDEF:
+				KillStringSpaces(Command+2);
+				break;
+			case ESC_DECLARE:
+				KillStringSpaces(Command+2);
+				break;
+			case ESC_IF:
+				KillStringSpaces(Command+2);
+				break;
+
+			case ESC_CLASS:
+				KillStringSpaces(Command+2);
+				i2 = 2;
+				if( Command[i2] == 1 && Command[i2+1] == ESC_ENUM ){
+					i2 += 2;
+				}
+				else if( memicmp( Command + i2, "Blittable(", 10 ) == 0 ){
+					i2 += 10;
+					i2 = JumpStringInPare(Command,i2)+1;
+				}
+
+				//コンストラクタ、デストラクタを暗黙的に生成
+				MakeConstructorAndDestructor(buffer,nowLine,Command + i2);
+				break;
+			case ESC_INTERFACE:
+				KillStringSpaces(Command+2);
+				break;
+			case ESC_ENDCLASS:
+				if(ConstructorDestructorSchedule[0]){
+					//生成されたコンストラクタ、デストラクタを挿入
+					sprintf(Command,"%s%c%c",ConstructorDestructorSchedule,1,ESC_ENDCLASS);
+				}
+				break;
+
+			case ESC_TYPE:
+				KillStringSpaces(Command+2);
+				break;
+
+			case ESC_CONST:
+				KillStringSpaces(Command+2);
+				if( Command[2] == 1 && Command[3] == ESC_ENUM ){
+					nCountOfNonGlobalScope++;
+				}
+				break;
+
+			case ESC_ENUM:
+				nCountOfNonGlobalScope++;
+				KillStringSpaces(Command+2);
+				break;
+
+			case ESC_ENDENUM:
+				nCountOfNonGlobalScope--;
+				break;
+
+			case ESC_INHERITS:
+			case ESC_VIRTUAL:
+			case ESC_OVERRIDE:
+			case ESC_ABSTRACT:
+			case ESC_SUB:
+			case ESC_FUNCTION:
+			case ESC_MACRO:
+			case ESC_STATIC:
+			case ESC_NAMESPACE:
+			case ESC_IMPORTS:
+				KillStringSpaces(Command+2);
+				break;
+		}
+		return;
+	}
+
+	bool isPare = false;
+	for(i=0;;i++){
+		if(Command[i]==' '||Command[i]=='\t'||Command[i]=='('||Command[i]=='\"'||Command[i]=='@'||Command[i]=='-'){
+			com[i]=0;
+			while(Command[i]==' '||Command[i]=='\t') i++;
+			if( Command[i] == '(' ) isPare = true;
+			break;
+		}
+		if(Command[i]=='='){
+			KillStringSpaces(Command);
+			return;
+		}
+		com[i]=Command[i];
+		if(Command[i]=='\0') break;
+	}
+
+	//マクロによるコマンド
+	i2=1;
+	if( nCountOfNonGlobalScope == 0 ){
+		//グローバル
+		if(lstrcmpi(com,"Open")==0) ComOpen(Command+i,pam,nowLine);
+		else if(lstrcmpi(com,"Close")==0) ComClose(Command+i,pam);
+		else if(lstrcmpi(com,"Field")==0||
+			lstrcmpi(com,"Get")==0||
+			lstrcmpi(com,"Put")==0) ComField(Command+i,pam);
+		else if(lstrcmpi(com,"Line")==0) ComLine(Command+i,pam,nowLine);
+		else if(lstrcmpi(com,"Circle")==0) ComCircle(Command+i,pam,nowLine);
+		else if(lstrcmpi(com,"PSet")==0) ComPSet(Command+i,pam,nowLine);
+		else if(lstrcmpi(com,"Paint")==0) ComPaint(Command+i,pam,nowLine);
+
+		else if(
+			lstrcmpi(com,"EXEC")==0||
+			lstrcmpi(com,"INPUT")==0||
+			lstrcmpi(com,"PRINT")==0||
+			lstrcmpi(com,"RANDOMIZE")==0||
+			( lstrcmpi(com,"WRITE")==0 && isPare == false )||
+			lstrcmpi(com,"MSGBOX")==0||
+			lstrcmpi(com,"WINDOW")==0||
+			lstrcmpi(com,"DELWND")==0||
+			lstrcmpi(com,"INSMENU")==0||
+			lstrcmpi(com,"CHDIR")==0||
+			lstrcmpi(com,"MKDIR")==0||
+			lstrcmpi(com,"KILL")==0||
+			lstrcmpi(com,"CLS")==0||
+			lstrcmpi(com,"COLOR")==0||
+			lstrcmpi(com,"LOCATE")==0
+			){
+			KillSpaces(Command+i,pam);
+
+			//大文字に変換
+			CharUpper(com);
+
+			sprintf(Command,"%s(%s)",com,pam);
+			return;
+		}
+
+		else i2=0;
+	}
+	else i2=0;
+	if(i2){
+		//大文字に変換
+		CharUpper(com);
+
+		sprintf(Command,"%s(%s)",com,pam);
+		return;
+	}
+
+
+
+	//コンパイラに搭載されるコマンド
+	if(lstrcmpi(com,"Do")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_DO;
+	}
+	else if(lstrcmpi(com,"goto")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_GOTO;
+	}
+	else if(lstrcmpi(com,"gosub")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_GOSUB;
+	}
+	else if(lstrcmpi(com,"Loop")==0){
+		if((Command[i]=='w'||Command[i]=='W')&&(Command[i+1]=='h'||Command[i+1]=='H')&&(Command[i+2]=='i'||Command[i+2]=='I')&&(Command[i+3]=='l'||Command[i+3]=='L')&&(Command[i+4]=='e'||Command[i+4]=='E')){
+			lstrcpy(pam,"0,");
+			KillSpaces(Command+i+5,pam+2);
+		}
+		else if((Command[i]=='u'||Command[i]=='U')&&(Command[i+1]=='n'||Command[i+1]=='N')&&(Command[i+2]=='t'||Command[i+2]=='T')&&(Command[i+3]=='i'||Command[i+3]=='I')&&(Command[i+4]=='l'||Command[i+4]=='L')){
+			lstrcpy(pam,"1,");
+			KillSpaces(Command+i+5,pam+2);
+		}
+		else pam[0]=0;
+		ComNum=COM_LOOP;
+	}
+	else if(lstrcmpi(com,"For")==0){
+		for(i2=0,IsStr=0;;i++,i2++){
+			while(Command[i]==' '||Command[i]=='\t') i++;
+			if(Command[i]=='\"') IsStr^=1;
+			if((Command[i-1]==' '||Command[i-1]=='\t')&&(Command[i]=='t'||Command[i]=='T')&&(Command[i+1]=='o'||Command[i+1]=='O')&&(Command[i+2]==' '||Command[i+2]=='\t')&&IsStr==0){
+				pam[i2]=',';
+				break;
+			}
+			pam[i2]=Command[i];
+			if(Command[i]=='\0') break;
+		}
+		if(Command[i]){
+			for(i+=3,i2++,IsStr=0;;i++,i2++){
+				while(Command[i]==' '||Command[i]=='\t') i++;
+				if((Command[i-1]==' '||Command[i-1]=='\t')&&(Command[i]=='s'||Command[i]=='S')&&(Command[i+1]=='t'||Command[i+1]=='T')&&(Command[i+2]=='e'||Command[i+2]=='E')&&(Command[i+3]=='p'||Command[i+3]=='P')&&(Command[i+4]==' '||Command[i+4]=='\t')){
+					pam[i2]=',';
+					i+=4;
+					continue;
+				}
+				pam[i2]=Command[i];
+				if(Command[i]=='\0') break;
+			}
+		}
+		ComNum=COM_FOR;
+	}
+	else if(lstrcmpi(com,"Next")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_NEXT;
+	}
+	else if(lstrcmpi(com,"Return")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_RETURN;
+	}
+	else if(lstrcmpi(com,"While")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_WHILE;
+	}
+	else if(lstrcmpi(com,"Wend")==0){
+		pam[0]=0;
+		ComNum=COM_WEND;
+	}
+
+	//変数、データ操作
+	else if(lstrcmpi(com,"dim")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_DIM;
+	}
+	else if(lstrcmpi(com,"Delete")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_DELETE;
+	}
+	else if( lstrcmpi( com, "_System_SweepingDelete" ) == 0 ){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_SWEEPINGDELETE;
+	}
+
+	//その他
+	else if(lstrcmpi(com,"Debug")==0){
+		pam[0]=0;
+		ComNum=COM_DEBUG;
+	}
+	else if(lstrcmpi(com,"let")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_LET;
+	}
+	else if(lstrcmpi(com,"rem")==0){
+		Command[0]=0;
+		return;
+	}
+
+	//ポインタ
+	else if(lstrcmpi(com,"SetDouble")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_SETDOUBLE;
+	}
+	else if(lstrcmpi(com,"SetSingle")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_SETSINGLE;
+	}
+	else if(lstrcmpi(com,"SetQWord")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_SETQWORD;
+	}
+	else if(lstrcmpi(com,"SetDWord")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_SETDWORD;
+	}
+	else if(lstrcmpi(com,"SetWord")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_SETWORD;
+	}
+	else if(lstrcmpi(com,"SetByte")==0){
+		KillSpaces(Command+i,pam);
+		ComNum=COM_SETBYTE;
+	}
+
+	else{
+		//その他のコマンド（一般コード）
+		lstrcpy(com,Command);
+		KillSpaces(com,Command);
+		return;
+	}
+
+	i=lstrlen(pam);
+	while(pam[i-1]==' '||pam[i-1]=='\t') i--;
+	pam[i]=0;
+	if(pam[0]) sprintf(Command,"%c%c%s",HIBYTE(ComNum),LOBYTE(ComNum),pam);
+	else sprintf(Command,"%c%c",HIBYTE(ComNum),LOBYTE(ComNum));
+
+	return;
+}
+
+void ChangeCommandToCode(char *buffer){
+	extern HANDLE hHeap;
+	int i,i2,i3,IsStr,CommandBufferSize;
+	char *temporary,*tempBase,temp2[VN_SIZE],*lpCommand;
+
+	tempBase=(char *)HeapAlloc(hHeap,0,(lstrlen(buffer)+1)*2+8192);
+	temporary=tempBase+1;
+	temporary[0]=0;
+	i=0;
+	i3=0;
+
+	CommandBufferSize=512;
+	lpCommand=(char *)HeapAlloc(hHeap,0,CommandBufferSize);
+
+	while(1){
+		i2=0;
+		while(buffer[i]==' '||buffer[i]=='\t') i++;
+		while(buffer[i]>='0'&&buffer[i]<='9'){
+			temp2[i2]=buffer[i];
+			i++;
+			i2++;
+		}
+		temp2[i2]=0;
+		while(buffer[i]==' '||buffer[i]=='\t') i++;
+		for(i2=0,IsStr=0;;i++,i2++){
+			if(i2>=CommandBufferSize){	//バッファ領域が足りなくなった場合はバッファを増量する
+				CommandBufferSize+=512;
+				lpCommand=(char *)HeapReAlloc(hHeap,0,lpCommand,CommandBufferSize);
+			}
+			if(buffer[i]=='\"') IsStr^=1;
+			if(buffer[i]=='\n'||(buffer[i]==':'&&IsStr==0)||buffer[i]=='\0'){
+				lpCommand[i2]=0;
+
+				if(temp2[0]){
+					//行番号ラベル
+					sprintf(temporary+i3,"%c%c%s,",1,ESC_LINENUM,temp2);
+					i3+=lstrlen(temporary+i3);
+
+					temp2[0]=0;
+				}
+
+				//命令コードへ変換
+				if(i2){
+					//エラー用
+					extern int cp;
+					cp=i;
+
+					ChangeCommand(buffer,i,lpCommand);
+
+					lstrcpy(temporary+i3,lpCommand);
+					i3+=lstrlen(temporary+i3);
+				}
+
+				if(!(lpCommand[0]=='\0'&&buffer[i]==':')){
+					temporary[i3++]=buffer[i];
+					temporary[i3]=0;
+				}
+
+				if(buffer[i]=='\n'){
+					i++;
+					break;
+				}
+				else if(buffer[i]==':'){
+					while(buffer[i+1]==' '||buffer[i+1]=='\t') i++;
+				}
+				if(buffer[i]=='\0') break;
+				i2=-1;
+				continue;
+			}
+			lpCommand[i2]=buffer[i];
+		}
+		if(buffer[i]=='\0') break;
+	}
+	HeapDefaultFree(lpCommand);
+	lstrcpy(buffer,temporary);
+
+	HeapDefaultFree(tempBase);
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/LexicalScoping.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/LexicalScoping.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/LexicalScoping.cpp	(revision 178)
@@ -0,0 +1,236 @@
+#include "common.h"
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+
+CLexicalScopes obj_LexScopes;
+
+
+CScope::CScope( int level, int addr, SCOPE_TYPE TypeOfStatement ){
+	this->level = level;
+	this->StartAddress = addr;
+	this->TypeOfStatement = TypeOfStatement;
+
+	pBreakSchedule = (DWORD *)malloc( 1 );
+	nBreakSchedule = 0;
+}
+CScope::~CScope(){
+	free( pBreakSchedule );
+}
+
+int CScope::GetStartAddress(){
+	return StartAddress;
+}
+SCOPE_TYPE CScope::GetTypeOfStatement(){
+	return TypeOfStatement;
+}
+
+void CScope::Break(){
+	//未解放のローカルオブジェクトを解放する
+	obj_LexScopes.CallDestructorsOfReturn( level );
+
+	//jmp ...(Next addr)
+	OpBuffer[obp++]=(char)0xE9;
+
+	pBreakSchedule=(DWORD *)realloc( pBreakSchedule, ( nBreakSchedule + 1 ) * sizeof(DWORD) );
+	pBreakSchedule[nBreakSchedule]=obp;
+	nBreakSchedule++;
+
+	obp+=sizeof(long);
+}
+void CScope::RunScheduleOfBreak(){
+	for(int i=0;i<nBreakSchedule;i++){
+		*((long *)(OpBuffer+pBreakSchedule[i]))=obp-(pBreakSchedule[i]+sizeof(long));
+	}
+}
+
+
+CScope *CLexicalScopes::SearchScope( SCOPE_TYPE TypeOfStatement ){
+	for( int i = level; i>=0; i-- ){
+		if( ppScopes[i]->GetTypeOfStatement() == TypeOfStatement ){
+			return ppScopes[i];
+		}
+	}
+	return NULL;
+}
+
+CLexicalScopes::CLexicalScopes(){
+	ppScopes = (CScope **)malloc( 1 );
+	level=0;
+}
+CLexicalScopes::~CLexicalScopes(){
+	free( ppScopes );
+}
+void CLexicalScopes::Init(int addr){
+	// TODO: エラーチェック
+
+	level = -1;
+	Start( addr, SCOPE_TYPE_BASE );
+}
+void CLexicalScopes::Start( int addr, SCOPE_TYPE TypeOfStatement ){
+	level++;
+	ppScopes = (CScope **)realloc( ppScopes, ( level + 1 ) * sizeof( CScope * ) );
+	ppScopes[level] = new CScope( level, addr, TypeOfStatement );
+}
+void CLexicalScopes::End(){
+	if( level <= 0 ){
+		SetError(300,NULL,cp);
+		return;
+	}
+
+	//デストラクタを呼ぶ
+	CallDestructorsOfScopeEnd();
+
+	Variables &vars = UserProc::IsGlobalAreaCompiling()?
+		globalVars :
+		UserProc::CompilingUserProc().localVars;
+
+	//使用済みローカル変数の生存チェックを外す
+	foreach( Variable *pVar, vars ){
+		if(pVar->bLiving&&pVar->ScopeLevel==level){
+			pVar->bLiving=0;
+			extern int obp;
+			pVar->ScopeEndAddress=obp;
+		}
+	}
+
+
+	//スコープ抜け出しスケジュール
+	ppScopes[level]->RunScheduleOfBreak();
+
+
+	//スコープレベルを下げる
+	delete ppScopes[level];
+	level--;
+}
+
+void CLexicalScopes::ExitFor(){
+	CScope *pScope = SearchScope( SCOPE_TYPE_FOR );
+	if( !pScope ){
+		SetError(12,"Exit For",cp);
+		return;
+	}
+
+	pScope->Break();
+}
+void CLexicalScopes::ExitWhile(){
+	CScope *pScope = SearchScope( SCOPE_TYPE_WHILE );
+	if( !pScope ){
+		SetError(12,"Exit While",cp);
+		return;
+	}
+
+	pScope->Break();
+}
+void CLexicalScopes::ExitDo(){
+	CScope *pScope = SearchScope( SCOPE_TYPE_DO );
+	if( !pScope ){
+		SetError(12,"Exit Do",cp);
+		return;
+	}
+
+	pScope->Break();
+}
+
+int CLexicalScopes::GetNowLevel(){
+	return level;
+}
+void CLexicalScopes::SetNowLevel( int level ){
+	this->level = level;
+}
+int CLexicalScopes::GetStartAddress(){
+	return ppScopes[level]->GetStartAddress();
+}
+
+
+// スコープ終了時のデストラクタ呼び出し
+void CLexicalScopes::CallDestructorsOfScopeEnd(){
+
+	Variables &vars = UserProc::IsGlobalAreaCompiling()?
+		globalVars :
+		UserProc::CompilingUserProc().localVars;
+
+
+	int i3;
+	int indexSystemGC=-1;
+	for( i3 = (int)vars.size() - 1; i3 >= 0; i3-- ){		//確保したのと逆順序で解放するため、バックサーチにする
+
+		Variable *pVar = vars[i3];
+
+		if( UserProc::IsGlobalAreaCompiling() && GetNowLevel() == 0 ){
+			if( pVar->GetName() == "_System_GC" ){
+				indexSystemGC=i3;
+				continue;
+			}
+		}
+
+		//同一レベルのレキシカルスコープのみを検知
+		if(!pVar->bLiving) continue;
+		if( pVar->ScopeLevel != GetNowLevel() ) continue;
+
+		if( pVar->IsStruct() && pVar->IsParameter() ){
+			//構造体パラメータを持つとき
+
+			//メモリを解放する
+
+#ifdef _AMD64_
+			//x64ビットコード
+
+			//mov rcx,qword ptr[rsp+offset]
+			op_mov_RM(sizeof(_int64),REG_RCX,REG_RSP,
+				-pVar->offset,
+				MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+#else
+			//x86コード
+
+			//mov ecx,dword ptr[ebp+offset]
+			op_mov_RM(sizeof(long),REG_ECX,REG_EBP,-pVar->offset,MOD_BASE_DISP32);
+			obp-=sizeof(long);
+			AddLocalVarAddrSchedule();
+			obp+=sizeof(long);
+
+			//push ecx
+			op_push(REG_ECX);
+#endif
+
+			//call free
+			extern UserProc *pSub_free;
+			op_call(pSub_free);
+
+
+			if( UserProc::IsGlobalAreaCompiling() ){
+				//ここには来ないハズ
+				SetError(300,NULL,cp);
+			}
+		}
+	}
+
+	if(indexSystemGC!=-1){
+		//_System_GCオブジェクトのデストラクタの呼び出し処理
+		const CMethod *method = vars[indexSystemGC]->GetClass().GetDestructorMethod();
+		if( method ){
+			Opcode_CallProc("",method->pUserProc,0,vars[indexSystemGC]->GetName().c_str(),DEF_OBJECT);
+		}
+	}
+}
+
+// Returnステートメントで発行されるデストラクタを生成
+void CLexicalScopes::CallDestructorsOfReturn( int BaseLevel ){
+	//現在のスコープレベルを退避
+	int backupScopeLevel = GetNowLevel();
+
+	for( int i = GetNowLevel(); i >= BaseLevel; i-- ){
+		SetNowLevel( i );
+
+		CallDestructorsOfScopeEnd();
+	}
+
+	//現在のスコープレベルを復元
+	SetNowLevel( backupScopeLevel );
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/LexicalScoping.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/LexicalScoping.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/LexicalScoping.h	(revision 178)
@@ -0,0 +1,74 @@
+
+
+enum SCOPE_TYPE{
+	//ベース
+	SCOPE_TYPE_BASE,
+
+	//分岐
+	SCOPE_TYPE_IF,
+
+	//ループ
+	SCOPE_TYPE_DO,
+	SCOPE_TYPE_FOR,
+	SCOPE_TYPE_WHILE,
+
+	//ケース分け
+	SCOPE_TYPE_SELECT,
+};
+
+class CScope{
+	int level;
+	int StartAddress;
+	SCOPE_TYPE TypeOfStatement;
+
+	DWORD *pBreakSchedule;
+	int nBreakSchedule;
+
+public:
+	CScope( int level, int addr, SCOPE_TYPE TypeOfStatement );
+	~CScope();
+
+	int GetStartAddress();
+	SCOPE_TYPE GetTypeOfStatement();
+
+	void Break();
+	void RunScheduleOfBreak();
+};
+
+class CLexicalScopes{
+	CScope **ppScopes;
+	int level;
+
+	CScope *SearchScope( SCOPE_TYPE TypeOfStatement );
+
+public:
+	CLexicalScopes();
+	~CLexicalScopes();
+
+	//初期化（関数コンパイルの開始時に呼び出される）
+	void Init(int addr);
+
+	// スコープを開始
+	void Start( int addr, SCOPE_TYPE TypeOfStatement );
+
+	//スコープを終了
+	void End();
+
+	//スコープ抜け出しステートメント
+	void Break();
+	void ExitFor();
+	void ExitWhile();
+	void ExitDo();
+
+	int GetNowLevel(void);
+	void SetNowLevel( int level );
+	int GetStartAddress(void);
+
+	//スコープ終了時のデストラクタ呼び出し
+	void CallDestructorsOfScopeEnd();
+
+	//Returnステートメント用のデストラクタ呼び出し
+	void CallDestructorsOfReturn( int BaseLevel = 0 );
+};
+
+extern CLexicalScopes obj_LexScopes;
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/LoopRefCheck.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/LoopRefCheck.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/LoopRefCheck.cpp	(revision 178)
@@ -0,0 +1,58 @@
+#include "../BasicCompiler_Common/common.h"
+
+
+//////////////////////////////////////////////////////////////
+// 循環参照でないかをチェックするためのクラスモジュール
+//////////////////////////////////////////////////////////////
+
+extern HANDLE hHeap;
+
+
+void CLoopRefCheck::init(){
+	int i;
+	for(i=0;i<num;i++){
+		HeapDefaultFree(names[i]);
+	}
+	HeapDefaultFree(names);
+}
+
+CLoopRefCheck::CLoopRefCheck(){
+	names=(char **)HeapAlloc(hHeap,0,1);
+	num=0;
+}
+CLoopRefCheck::~CLoopRefCheck(){
+	init();
+}
+void CLoopRefCheck::add(const char *lpszInheritsClass){
+	names=(char **)HeapReAlloc(hHeap,0,names,(num+1)*sizeof(char *));
+	names[num]=(char *)HeapAlloc(hHeap,0,lstrlen(lpszInheritsClass)+1);
+	lstrcpy(names[num],lpszInheritsClass);
+	num++;
+}
+void CLoopRefCheck::del(const char *lpszInheritsClass){
+	int i;
+	for(i=0;i<num;i++){
+		if(lstrcmp(names[i],lpszInheritsClass)==0){
+			HeapDefaultFree(names[i]);
+			break;
+		}
+	}
+	if(i!=num){
+		num--;
+		for(;i<num;i++){
+			names[i]=names[i+1];
+		}
+	}
+}
+BOOL CLoopRefCheck::check(const CClass &inheritsClass) const
+{
+	//ループ継承チェック
+	int i;
+	for(i=0;i<num;i++){
+		if( inheritsClass.GetName() == names[i] ){
+			return 1;
+		}
+	}
+	return 0;
+}
+CLoopRefCheck *pobj_LoopRefCheck;
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/MakeExe.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/MakeExe.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/MakeExe.cpp	(revision 178)
@@ -0,0 +1,279 @@
+#include "common.h"
+
+void StepCompileProgress(void){
+	extern HWND hMainDlg;
+	PostMessage(GetDlgItem(hMainDlg,IDC_PROGRESS),PBM_STEPIT,0,0);
+}
+
+void Delete_ci(CONSTINFO *pci){
+	int i;
+
+	HeapDefaultFree(pci->name);
+	if(pci->StrValue) HeapDefaultFree(pci->StrValue);
+	if(pci->ParmNum){
+		for(i=0;i<pci->ParmNum;i++)
+			HeapDefaultFree(pci->ppParm[i]);
+		HeapDefaultFree(pci->ppParm);
+	}
+
+	if(pci->pNextData){
+		Delete_ci(pci->pNextData);
+	}
+
+	HeapDefaultFree(pci);
+}
+void DeleteConstInfo(CONSTINFO **ppConstHash){
+	int i;
+
+	for(i=0;i<MAX_HASH;i++){
+		if(ppConstHash[i]){
+			Delete_ci(ppConstHash[i]);
+		}
+	}
+	HeapDefaultFree(ppConstHash);
+}
+
+void AddSourceCode(char *buffer){
+	char *temp;
+	temp=(char *)HeapAlloc(hHeap,0,lstrlen(buffer)+8192);
+	lstrcpy(temp,buffer);
+
+	//エスケープシーケンス設定
+	SetEscapeSequenceFormat(temp);
+
+	//コマンド対応
+	ChangeCommandToCode(temp);
+
+	//最後尾に貼り付け
+	Smoothie::Lexical::source.Addition( temp );
+
+	HeapDefaultFree(temp);
+}
+
+void OutputExe(void){
+	extern HANDLE hHeap;
+	extern char *basbuf;
+	extern int ErrorNum;
+	extern BOOL bStopCompile;
+	extern HWND hMainDlg;
+	int i2,i3;
+	char temp2[MAX_PATH];
+
+	//プログレスバーの設定
+	PostMessage(GetDlgItem(hMainDlg,IDC_PROGRESS),PBM_SETRANGE,0,MAKELPARAM(0,6));
+	PostMessage(GetDlgItem(hMainDlg,IDC_PROGRESS),PBM_SETSTEP,1,0);
+
+	//"中断"
+	SetDlgItemText(hMainDlg,IDOK,STRING_STOP);
+
+	//中断フラグを初期化
+	bStopCompile=0;
+
+	//サブシステムのタイプ
+	extern unsigned short TypeOfSubSystem;
+	TypeOfSubSystem=IMAGE_SUBSYSTEM_WINDOWS_GUI;
+
+	//プログラムをファイルから読み込む
+	extern char SourceFileName[MAX_PATH];
+	if( !Smoothie::Lexical::source.ReadFile( SourceFileName ) ){
+		SetError(201,SourceFileName,-1);
+		goto EndCompile;
+	}
+
+	//イメージベースの設定
+	extern DWORD ImageBase;
+	extern BOOL bDll;
+	if(bDll) ImageBase=0x10000000;
+	else ImageBase=0x00400000;
+
+	extern BOOL bError;
+	if(bError||bStopCompile) goto EndCompile;
+
+
+	//////////////////////////
+	// 中間コードの生成を開始
+	extern BOOL bClipCompileView;
+
+	//"最適化中..."
+	CompileMessage(STRING_COMPILE_OPTIMIZING);
+
+	//カッコを相互チェック（ダブルクォートチェックチェックを含む）
+	CheckParenthesis(basbuf);
+
+	if(bError||bStopCompile) goto EndCompile;
+
+	//コンパイルダイアログのプログレスバーを上げる
+	StepCompileProgress();
+
+	//ディレクティブ
+	DirectiveCheck();
+
+	//Next命令語を正規表現に変換
+	//NextCommandFormat(basbuf);
+
+	//エスケープシーケンス設定
+	SetEscapeSequenceFormat(basbuf);
+
+	//Def命令語をFunction命令語に変換
+	DefCommandFormat(basbuf);
+
+	//すべてのIf命令語をブロック形式に変換
+	IfCommandFormat(basbuf);
+
+	//対になる命令語を相互チェック
+	//CheckPareCommand();
+
+	if(bError||bStopCompile) goto EndCompile;
+
+	/*未完成
+	//定数に関する情報
+	extern CONSTINFO **ppConstHash;
+	ppConstHash=(CONSTINFO **)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,MAX_HASH*sizeof(CONSTINFO *));
+	*/
+
+	//コンパイルダイアログのプログレスバーを上げる
+	StepCompileProgress();
+
+	//重複エラー情報管理のメモリを確保
+	extern char **SynonymErrorWords;
+	extern int SynonymErrorNum;
+	SynonymErrorNum=0;
+	SynonymErrorWords=(char **)HeapAlloc(hHeap,0,1);
+
+	ChangeCommandToCode(basbuf);
+
+	//重複エラー情報管理のメモリを解放
+	for(i3=0;i3<SynonymErrorNum;i3++) HeapDefaultFree(SynonymErrorWords[i3]);
+	HeapDefaultFree(SynonymErrorWords);
+	SynonymErrorWords=0;
+
+	if(bError||bStopCompile){
+		//定数に関する情報を解放
+		goto EndCompile;
+	}
+
+	StepCompileProgress();
+
+
+	///////////////////////
+	// コンパイル開始
+
+	//"コンパイル中..."
+	CompileMessage(STRING_COMPILE_COMPILING);
+
+	//グローバル変数に関する情報
+	extern int AllGlobalVarSize;
+	extern int AllInitGlobalVarSize;
+	globalVars.clear();
+	AllGlobalVarSize=0;
+	AllInitGlobalVarSize=0;
+
+
+	/*
+	int t,t2;
+	t=GetTickCount();
+	Compile();
+	t2=GetTickCount();
+	t2-=t;
+	char s[100];
+	sprintf(s,"%d",t2);
+	MessageBox(0,s,"test",0);*/
+	Compile();
+
+	//リソース情報を解放
+	extern RESOURCEDATAINFO *pCursorResourceInfo;
+	extern RESOURCEDATAINFO *pIconResourceInfo;
+	extern RESOURCEDATAINFO *pBitmapResourceInfo;
+	HeapDefaultFree(pCursorResourceInfo);
+	HeapDefaultFree(pBitmapResourceInfo);
+	HeapDefaultFree(pIconResourceInfo);
+
+	//コードと行番号の関係情報を解放
+	extern LINEINFO *pLineInfo;
+	HeapDefaultFree(pLineInfo);
+
+	//サブルーチン（ユーザー定義）情報のメモリ解放
+	extern GlobalProc **ppSubHash;
+	extern char **ppMacroNames;
+	extern int MacroNum;
+	DeleteSubInfo(ppSubHash,ppMacroNames,MacroNum);
+
+	//Declare（DLL関数）情報のメモリ解放
+	DeleteDeclareInfo();
+
+	//関数ポインタ情報のメモリ解放
+	DeleteProcPtrInfo();
+
+	//定数に関する情報を解放
+	extern CONSTINFO **ppConstHash;
+	DeleteConstInfo(ppConstHash);
+
+	//コンパイルダイアログのプログレスバーを上げる
+	StepCompileProgress();
+
+
+	//////////////////////////
+	// 終了処理
+EndCompile:
+	if(bStopCompile){
+		PostMessage(GetDlgItem(hMainDlg,IDC_PROGRESS),PBM_SETPOS,0,0);
+
+		//"コンパイルはユーザーにより中断されました。"
+		CompileMessage(STRING_COMPILE_STOP);
+	}
+	else{
+		extern int CompileMsgNum;
+		extern int WarningNum;
+		if(bError==0){
+			//"コンパイルは正常に完了しました（エラー:%d、警告:%d）"
+			sprintf(temp2,STRING_COMPILE_SUCCESS,ErrorNum-CompileMsgNum-WarningNum,WarningNum);
+		}
+		else{
+			//"コンパイルは中断されました（エラー:%d、警告:%d）"
+			sprintf(temp2,STRING_COMPILE_ERROR,ErrorNum-CompileMsgNum-WarningNum,WarningNum);
+		}
+
+		CompileMessage("");
+		CompileMessage("-----------------------------------------------------");
+		CompileMessage(temp2);
+	}
+
+	//"閉じる"
+	SetDlgItemText(hMainDlg,IDOK,STRING_CLOSE);
+
+#ifdef _DEBUG
+	// デバッグモードのときはダイアログが隠れている
+	ShowWindow(hMainDlg,SW_SHOW);
+#endif
+
+	//#include情報を解放
+	extern INCLUDEFILEINFO IncludeFileInfo;
+	for(i2=0;i2<IncludeFileInfo.FilesNum;i2++)
+		HeapDefaultFree(IncludeFileInfo.ppFileNames[i2]);
+	HeapDefaultFree(IncludeFileInfo.ppFileNames);
+}
+int MainThread(DWORD dummy){
+	extern BOOL bDebugCompile;
+	extern BOOL bDebugRun;
+	extern int bError;
+
+	if(bDebugRun){
+		if(bDebugCompile){
+			bDebugRun=0;
+
+			//デバッグコンパイル
+			OutputExe();
+
+			bDebugRun=1;
+		}
+
+		//デバッグ実行
+		if(bError==0) DebugProgram();
+	}
+	else{
+		//リリースコンパイル
+		OutputExe();
+	}
+
+	return 0;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/NonVolatile.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/NonVolatile.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/NonVolatile.cpp	(revision 178)
@@ -0,0 +1,293 @@
+#include <jenga/include/common/Environment.h>
+
+#include "../BasicCompiler_Common/common.h"
+
+
+char *ReadBuffer_NonErrMsg( const string &path ){
+	extern HANDLE hHeap;
+	int i;
+	DWORD dw;
+	char *buffer;
+	HANDLE hFile;
+
+	hFile=CreateFile(path.c_str(),GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE) return 0;
+	i=GetFileSize(hFile,0);
+	buffer=(char *)HeapAlloc(hHeap,0,i+1);
+	ReadFile(hFile,buffer,i,&dw,0);
+	buffer[dw]=0;
+	CloseHandle(hFile);
+	return buffer;
+}
+_int8 WriteBuffer( const string &path, char *buffer,int length){
+	extern HWND hOwnerEditor;
+	HANDLE hFile;
+	DWORD dw;
+	hFile=CreateFile(path.c_str(),GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE){
+		char temporary[MAX_PATH];
+
+		sprintf(temporary,"\"%s\" ファイルへの書き込みに失敗しました。",path);
+		MessageBox(hOwnerEditor,temporary,"エラー",MB_OK|MB_ICONEXCLAMATION);
+		return 0;
+	}
+	if(length) WriteFile(hFile,buffer,length,&dw,NULL);
+	CloseHandle(hFile);
+	return 1;
+}
+
+
+///////////////////////////
+// 不揮発性のデータ管理
+///////////////////////////
+
+BOOL CNonVolatile::GetDataLine(char *name,char *parms){
+	int i,i2,length;
+	length=lstrlen(name);
+	for(i=0;;i++){
+		if(buffer[i]=='\0') break;
+		if(i==0||buffer[i]=='\r'&&buffer[i+1]=='\n'){
+			if(buffer[i]=='\r'&&buffer[i+1]=='\n') i+=2;
+			if(memcmp(buffer+i,name,length)==0&&buffer[i+length]=='='){
+				i+=length+1;
+				for(i2=0;;i++,i2++){
+					if(buffer[i]=='\r'&&buffer[i+1]=='\n'||buffer[i]=='\0'){
+						parms[i2]=0;
+						break;
+					}
+					parms[i2]=buffer[i];
+				}
+				return 1;
+			}
+		}
+	}
+	return 0;
+}
+
+BOOL CNonVolatile::GetWholeValue(char *name,int *pi32data){
+	char temporary[8192];
+	if(!GetDataLine(name,temporary)) return 0;
+	*pi32data=atoi(temporary);
+	return 1;
+}
+BOOL CNonVolatile::Get3WholeValue(char *name,int *pd1,int *pd2,int *pd3){
+	char temporary[8192];
+	if(!GetDataLine(name,temporary)) return 0;
+	sscanf(temporary,"%d,%d,%d",pd1,pd2,pd3);
+	return 1;
+}
+BOOL CNonVolatile::GetRGBValue(char *name,COLORREF *prgb){
+	char temporary[8192];
+	if(!GetDataLine(name,temporary)) return 0;
+	sscanf(temporary,"%x",prgb);
+	return 1;
+}
+BOOL CNonVolatile::GetStringValue(char *name,char *str){
+	if(!GetDataLine(name,str)) return 0;
+	return 1;
+}
+BOOL CNonVolatile::GetRectValue(char *name,RECT *prc){
+	char temporary[8192];
+	if(!GetDataLine(name,temporary)) return 0;
+	sscanf(temporary,"%d,%d,%d,%d",&prc->left,&prc->top,&prc->right,&prc->bottom);
+	return 1;
+}
+BOOL CNonVolatile::GetPointValue(char *name,POINT *pos){
+	char temporary[8192];
+	if(!GetDataLine(name,temporary)) return 0;
+	sscanf(temporary,"%d,%d",&pos->x,&pos->y);
+	return 1;
+}
+
+void CNonVolatile::load(){
+	extern HANDLE hHeap;
+	int i;
+
+	//開く
+	buffer=ReadBuffer_NonErrMsg( Jenga::Common::Environment::GetAppDir() + "\\UserSetting\\compiler.ini" );
+	if(!buffer){
+		//レジストリを読み込む
+		OldLoad();
+		return;
+	}
+
+
+	if(!GetWholeValue("IsShow_DefaultSystem_Var",&bShow_DefaultSystem_Var)) bShow_DefaultSystem_Var=0;
+	if(!GetWholeValue("IsShow_Rad_Var",&bShow_Rad_Var)) bShow_Rad_Var=0;
+	if(!GetWholeValue("IsShow_GUID_Var",&bShow_GUID_Var)) bShow_Rad_Var=0;
+
+	extern int ScreenX,ScreenY;
+	if(!GetPointValue("MainDlgPos",&MainDlgPos)){
+		MainDlgPos.x=ScreenX/2-100;
+		MainDlgPos.y=ScreenX/2-250;
+	}
+
+	if(!GetRectValue("VarDlgRect",&VarDlgRect)){
+		VarDlgRect.left=ScreenX/2-390/2;
+		VarDlgRect.top=ScreenY/2-270/2;
+		VarDlgRect.right=ScreenX/2+390/2;
+		VarDlgRect.bottom=ScreenY/2+270/2;
+	}
+
+	//ウォッチリスト
+	if(!GetWholeValue("WatchNum",&WatchNum)) WatchNum=0;
+
+	ppWatchStr=(char **)HeapAlloc(hHeap,0,WatchNum*sizeof(char *)+1);
+	for(i=0;i<WatchNum;i++){
+		char temporary[VN_SIZE];
+		sprintf(temporary,"Watch%03d",i);
+
+		char temp2[VN_SIZE];
+		GetStringValue(temporary,temp2);
+		ppWatchStr[i]=(char *)HeapAlloc(hHeap,0,lstrlen(temp2)+1);
+		lstrcpy(ppWatchStr[i],temp2);
+	}
+
+
+	HeapDefaultFree(buffer);
+}
+void CNonVolatile::OldLoad(){
+	extern HANDLE hHeap;
+	extern int ScreenX,ScreenY;
+
+	int i;
+	HKEY hKey;
+	ULONG ulSize;
+	char temporary[MAX_PATH],temp2[VN_SIZE];
+
+	if(RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Discoversoft\\BasicCompiler",0,KEY_ALL_ACCESS,&hKey)!=ERROR_SUCCESS){
+		bShow_DefaultSystem_Var=0;
+		bShow_Rad_Var=0;
+		bShow_GUID_Var=0;
+
+		MainDlgPos.x=ScreenX/2-100;
+		MainDlgPos.y=ScreenX/2-250;
+
+		VarDlgRect.left=ScreenX/2-390/2;
+		VarDlgRect.top=ScreenY/2-270/2;
+		VarDlgRect.right=ScreenX/2+390/2;
+		VarDlgRect.bottom=ScreenY/2+270/2;
+
+		WatchNum=0;
+		ppWatchStr=(char **)HeapAlloc(hHeap,0,1);
+	}
+	else{
+		ulSize=sizeof(DWORD);
+		if(RegQueryValueEx(hKey,"bShow_DefaultSystem_Var",NULL,NULL,(BYTE *)&bShow_DefaultSystem_Var,&ulSize)!=ERROR_SUCCESS)
+			bShow_DefaultSystem_Var=0;
+
+		ulSize=sizeof(DWORD);
+		if(RegQueryValueEx(hKey,"bShow_Rad_Var",NULL,NULL,(BYTE *)&bShow_Rad_Var,&ulSize)!=ERROR_SUCCESS)
+			bShow_Rad_Var=0;
+
+		ulSize=sizeof(DWORD);
+		if(RegQueryValueEx(hKey,"bShow_GUID_Var",NULL,NULL,(BYTE *)&bShow_GUID_Var,&ulSize)!=ERROR_SUCCESS)
+			bShow_GUID_Var=0;
+
+		ulSize=1024;
+		if(RegQueryValueEx(hKey,"MainDlgPos",NULL,NULL,(unsigned char *)temporary,&ulSize)!=ERROR_SUCCESS){
+			MainDlgPos.x=ScreenX/2-100;
+			MainDlgPos.y=ScreenX/2-250;
+		}
+		else sscanf(temporary,"%d %d",
+			&MainDlgPos.x,
+			&MainDlgPos.y);
+
+		ulSize=1024;
+		if(RegQueryValueEx(hKey,"VarDlgRect",NULL,NULL,(unsigned char *)temporary,&ulSize)!=ERROR_SUCCESS){
+			VarDlgRect.left=ScreenX/2-390/2;
+			VarDlgRect.top=ScreenY/2-270/2;
+			VarDlgRect.right=ScreenX/2+390/2;
+			VarDlgRect.bottom=ScreenY/2+270/2;
+		}
+		else sscanf(temporary,"%d %d %d %d",
+			&VarDlgRect.left,
+			&VarDlgRect.top,
+			&VarDlgRect.right,
+			&VarDlgRect.bottom);
+
+		ulSize=sizeof(DWORD);
+		if(RegQueryValueEx(hKey,"WatchNum",NULL,NULL,(BYTE *)&WatchNum,&ulSize)!=ERROR_SUCCESS)
+			WatchNum=0;
+		ppWatchStr=(char **)HeapAlloc(hHeap,0,WatchNum*sizeof(char *)+1);
+		for(i=0;i<WatchNum;i++){
+			sprintf(temporary,"WathNum%03d",i);
+			ulSize=VN_SIZE;
+			if(RegQueryValueEx(hKey,temporary,NULL,NULL,(unsigned char *)temp2,&ulSize)!=ERROR_SUCCESS){
+				WatchNum=i;
+				break;
+			}
+			ppWatchStr[i]=(char *)HeapAlloc(hHeap,0,lstrlen(temp2)+1);
+			lstrcpy(ppWatchStr[i],temp2);
+		}
+	}
+}
+
+void CNonVolatile::SetWholeValue(char *name,long i32data){
+	sprintf(buffer+lstrlen(buffer),"%s=%d\r\n",name,i32data);
+}
+void CNonVolatile::Set3WholeValue(char *name,long d1,long d2,long d3){
+	sprintf(buffer+lstrlen(buffer),"%s=%d,%d,%d\r\n",name,d1,d2,d3);
+}
+void CNonVolatile::SetRGBValue(char *name,COLORREF rgb){
+	sprintf(buffer+lstrlen(buffer),"%s=%x\r\n",name,rgb);
+}
+void CNonVolatile::SetStringValue(char *name,char *str){
+	sprintf(buffer+lstrlen(buffer),"%s=%s\r\n",name,str);
+}
+void CNonVolatile::SetRectValue(char *name,RECT *prc){
+	sprintf(buffer+lstrlen(buffer),"%s=%d,%d,%d,%d\r\n",name,prc->left,prc->top,prc->right,prc->bottom);
+}
+void CNonVolatile::SetPointValue(char *name,POINT *pos){
+	sprintf(buffer+lstrlen(buffer),"%s=%d,%d\r\n",name,pos->x,pos->y);
+}
+
+void CNonVolatile::save(){
+	int i;
+	char temporary[MAX_PATH];
+
+	const string userSettingDirPath = Jenga::Common::Environment::GetAppDir() + "\\UserSetting";
+
+	HANDLE hFind;
+	WIN32_FIND_DATA wfd;
+	hFind=FindFirstFile( userSettingDirPath.c_str() ,&wfd);
+	if(hFind==INVALID_HANDLE_VALUE){
+		//UserSettingディレクトリを作成
+		if(!CreateDirectory( userSettingDirPath.c_str() ,NULL)){
+			extern HWND hOwnerEditor;
+			MessageBox(hOwnerEditor,"UserSettingディレクトリの作成に失敗","ActiveBasic",MB_OK|MB_ICONEXCLAMATION);
+			return;
+		}
+	}
+
+	extern HANDLE hHeap;
+	buffer=(char *)HeapAlloc(hHeap,0,65536);
+	buffer[0]=0;
+
+
+	SetWholeValue("IsShow_DefaultSystem_Var",bShow_DefaultSystem_Var);
+	SetWholeValue("IsShow_Rad_Var",bShow_Rad_Var);
+	SetWholeValue("IsShow_GUID_Var",bShow_GUID_Var);
+
+	SetPointValue("MainDlgPos",&MainDlgPos);
+
+	SetRectValue("VarDlgRect",&VarDlgRect);
+
+	//ウォッチリスト
+	SetWholeValue("WatchNum",WatchNum);
+	for(i=0;i<WatchNum;i++){
+		sprintf(temporary,"Watch%03d",i);
+		SetStringValue(temporary,ppWatchStr[i]);
+		HeapDefaultFree(ppWatchStr[i]);
+	}
+	HeapDefaultFree(ppWatchStr);
+
+
+	//保存
+	WriteBuffer(
+		userSettingDirPath + "\\compiler.ini",
+		buffer,lstrlen(buffer));
+
+
+	HeapDefaultFree(buffer);
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/NonVolatile.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/NonVolatile.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/NonVolatile.h	(revision 178)
@@ -0,0 +1,42 @@
+
+char *ReadBuffer_NonErrMsg( const string &path );
+
+class CNonVolatile{
+	char *buffer;
+
+	void OldLoad();
+
+	BOOL GetDataLine(char *name,char *parms);
+
+	BOOL GetWholeValue(char *name,int *pi32data);
+	BOOL Get3WholeValue(char *name,int *pd1,int *pd2,int *pd3);
+	BOOL GetRGBValue(char *name,COLORREF *prgb);
+	BOOL GetStringValue(char *name,char *str);
+	BOOL GetRectValue(char *name,RECT *prc);
+	BOOL GetPointValue(char *name,POINT *prc);
+
+	void SetWholeValue(char *name,long i32data);
+	void Set3WholeValue(char *name,long d1,long d2,long d3);
+	void SetRGBValue(char *name,COLORREF rgb);
+	void SetStringValue(char *name,char *str);
+	void SetRectValue(char *name,RECT *prc);
+	void SetPointValue(char *name,POINT *prc);
+public:
+	BOOL bShow_DefaultSystem_Var;
+	BOOL bShow_Rad_Var;
+	BOOL bShow_GUID_Var;
+
+	POINT MainDlgPos;
+	RECT VarDlgRect;
+
+	//デバッグのウォッチリスト
+	int WatchNum;
+	char **ppWatchStr;
+
+
+	CNonVolatile(){};
+	~CNonVolatile(){};
+	void load();
+	void save();
+};
+extern CNonVolatile *pobj_nv;
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/NumOpe_GetType.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/NumOpe_GetType.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/NumOpe_GetType.cpp	(revision 178)
@@ -0,0 +1,924 @@
+#include "common.h"
+
+
+int MakeWholeType(int size,int bSigned){
+	switch(size){
+		case 1:
+			if(bSigned) return DEF_SBYTE;
+			else return DEF_BYTE;
+			break;
+		case 2:
+			if(bSigned) return DEF_INTEGER;
+			else return DEF_WORD;
+			break;
+		case 4:
+			if(bSigned) return DEF_LONG;
+			else return DEF_DWORD;
+			break;
+		case 8:
+			if(bSigned) return DEF_INT64;
+			else return DEF_QWORD;
+			break;
+	}
+	return 0;
+}
+
+int AutoBigCast(int BaseType,int CalcType){
+	int type;
+	type=CalcType;
+
+	if(BaseType==0||BaseType==-1){
+		//ベースタイプが未定のとき
+		return type;
+	}
+
+	if(!IsWholeNumberType(type)){
+		//整数型ではないときは暗黙の変換は必要なし
+		return type;
+	}
+
+	if(BaseType==DEF_OBJECT||BaseType==DEF_STRUCT){
+		//ベースタイプがオブジェクトのときは暗黙の変換は必要なし
+		return type;
+	}
+
+	int BaseTypeSize;
+	BaseTypeSize=GetTypeSize(BaseType,-1);
+
+	if(IsRealNumberType(BaseType)){
+		if(GetTypeSize(CalcType,-1)<4)
+			type=MakeWholeType(4,IsSignedType(CalcType));
+	}
+	else if(BaseTypeSize>GetTypeSize(CalcType,-1)){
+		//要求される型のほうがサイズが大きいとき
+		type=MakeWholeType(BaseTypeSize,IsSignedType(CalcType));
+	}
+
+	if(!type){
+		extern int cp;
+		SetError(300,NULL,cp);
+	}
+
+	return type;
+}
+
+BOOL CheckCalcType(int idCalc,int *type,int sp){
+	//演算子の右辺、左辺の型をチェック
+	extern int cp;
+
+	//演算子名を取得
+	char temporary[255];
+	GetCalcName(idCalc,temporary);
+
+	switch(idCalc){
+
+		/////////////////////////////////////
+		// 実数に対する論理演算はエラー
+		/////////////////////////////////////
+
+		case CALC_XOR:
+		case CALC_OR:
+		case CALC_AND:
+			if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
+				//いずれかの項が実数のとき
+				SetError(45,temporary,cp);
+				return 0;
+			}
+
+			//As以外の演算子に型名が指定されていないかをチェック
+			if((type[sp-2]&FLAG_CAST)||(type[sp-1]&FLAG_CAST)){
+				SetError(48,temporary,cp);
+				return 0;
+			}
+			break;
+
+		case CALC_NOT:
+			if(IsRealNumberType(type[sp-1])){
+				//実数のとき
+				SetError(45,temporary,cp);
+				return 0;
+			}
+
+			//As以外の演算子に型名が指定されていないかをチェック
+			if(type[sp-1]&FLAG_CAST){
+				SetError(48,temporary,cp);
+				return 0;
+			}
+			break;
+
+
+
+		/////////////////////////////////////
+		// 比較演算はチェック項目なし
+		/////////////////////////////////////
+
+		case CALC_PE:
+		case CALC_QE:
+		case CALC_NOTEQUAL:
+		case CALC_EQUAL:
+		case CALC_P:
+		case CALC_Q:
+			//As以外の演算子に型名が指定されていないかをチェック
+			if((type[sp-2]&FLAG_CAST)||(type[sp-1]&FLAG_CAST)){
+				SetError(48,temporary,cp);
+				return 0;
+			}
+			break;
+
+
+
+		/////////////////////////////////////
+		// 算術演算をチェック
+		/////////////////////////////////////
+
+		case CALC_ADDITION:
+		case CALC_SUBTRACTION:
+		case CALC_PRODUCT:
+		case CALC_QUOTIENT:
+		case CALC_POWER:
+			//As以外の演算子に型名が指定されていないかをチェック
+			if((type[sp-2]&FLAG_CAST)||(type[sp-1]&FLAG_CAST)){
+				SetError(48,temporary,cp);
+				return 0;
+			}
+			break;
+
+		case CALC_SHL:
+		case CALC_SHR:
+		case CALC_MOD:
+		case CALC_INTQUOTIENT:
+			if(IsRealNumberType(type[sp-2])||IsRealNumberType(type[sp-1])){
+				//いずれかの項が実数のとき
+				SetError(45,temporary,cp);
+				return 0;
+			}
+
+			//As以外の演算子に型名が指定されていないかをチェック
+			if((type[sp-2]&FLAG_CAST)||(type[sp-1]&FLAG_CAST)){
+				SetError(48,temporary,cp);
+				return 0;
+			}
+			break;
+
+		case CALC_AS:
+			if((type[sp-1]&FLAG_CAST)==0){
+				//型名が指定されていないときはエラー
+				SetError(47,NULL,cp);
+				return 0;
+			}
+			break;
+
+		case CALC_BYVAL:
+			if(type[sp-1]&FLAG_CAST){
+				//型名が指定されていないときはエラー
+				SetError(47,NULL,cp);
+				return 0;
+			}
+			break;
+
+		case CALC_MINUSMARK:
+			//As以外の演算子に型名が指定されていないかをチェック
+			if(type[sp-1]&FLAG_CAST){
+				SetError(48,temporary,cp);
+				return 0;
+			}
+			break;
+	}
+	return 1;
+}
+
+int GetReturnType_OperatorProc(int idCalc,const Type &baseType,int *type,LONG_PTR *index_stack,int &sp){
+	//オーバーロードされたオペレータ関数の戻り値を取得
+	CClass *pobj_c;
+	pobj_c=(CClass *)index_stack[sp-2];
+
+	std::vector<UserProc *> subs;
+	pobj_c->GetMethods().Enum( idCalc, subs );
+	if( subs.size() == 0 ){
+		return 0;
+	}
+
+
+	//項の数
+	BOOL bTwoTerm=1;
+	if(idCalc==CALC_AS) bTwoTerm=0;
+
+
+
+	/////////////////////////////////////////////
+	// オーバーロード解決用のパラメータを設定
+	/////////////////////////////////////////////
+
+
+	//_System_LocalThis
+	Parameters params;
+
+	if(bTwoTerm){
+		params.push_back( new Parameter( "", Type( type[sp-1], index_stack[sp-1] ) ) );
+	}
+
+
+	//オーバーロードを解決
+	char temporary[255];
+	if(idCalc==CALC_EQUAL) lstrcpy(temporary,"==");
+	else GetCalcName(idCalc,temporary);
+	UserProc *pUserProc = OverloadSolution( temporary, subs, params, baseType );
+
+	if(bTwoTerm){
+		delete params[0];
+	}
+
+	if(!pUserProc){
+		return 0;
+	}
+	else{
+		//オーバーロードされていないが、パラメータ個数が一致しないとき
+		if(params.size()!=pUserProc->Params().size()){
+			return 0;
+		}
+	}
+
+	sp--;
+	type[sp-1]=pUserProc->ReturnType().GetBasicType();
+	index_stack[sp-1]=pUserProc->ReturnType().GetIndex();
+
+	return 1;
+}
+
+bool Operator_New_GetType(const char *Parameter,const Type &baseType, Type &resultType ){
+	char TypeName[VN_SIZE],CreateParameter[VN_SIZE],objectSizeStr[VN_SIZE];
+	int i,i2;
+
+	i=0;
+
+	if(Parameter[0]=='['){
+		i=GetStringInBracket(objectSizeStr,Parameter);
+
+		SlideString(objectSizeStr+1,-1);
+		objectSizeStr[i-2]=0;
+	}
+	else objectSizeStr[0]=0;
+
+	for(i2=0;;i++,i2++){
+		if(Parameter[i]=='('){
+			TypeName[i2]=0;
+
+			//コンストラクタに渡すパラメータを取得
+			i2=GetStringInPare(CreateParameter,Parameter+i);
+			RemoveStringPare(CreateParameter);
+			i+=i2;
+			if(Parameter[i]!='\0'){
+				SetError(42,NULL,cp);
+				return false;
+			}
+			break;
+		}
+		TypeName[i2]=Parameter[i];
+		if(Parameter[i]=='\0'){
+			CreateParameter[0]=0;
+			break;
+		}
+	}
+
+	if( !Type::StringToType( TypeName, resultType ) ){
+		return false;
+	}
+
+	if( baseType.IsObject() ){
+		resultType.SetBasicType( DEF_OBJECT );
+	}
+	else{
+		resultType.SetBasicType( DEF_PTR_OBJECT );
+	}
+	return true;
+}
+
+bool GetTermType( const char *term, Type &resultType, bool &isLiteral, bool *pIsClassName ){
+	char parameter[VN_SIZE];
+
+	// Withを解決
+	char termFull[VN_SIZE];
+	if(term[0]=='.'){
+		GetWithName(termFull);
+		lstrcat(termFull,term);
+	}
+	else lstrcpy(termFull,term);
+
+	char termLeft[VN_SIZE];
+	lstrcpy(termLeft,termFull);
+
+	// パース
+	char member[VN_SIZE];
+	CClass::RefType refType;
+	if( SplitMemberName( termFull, termLeft, member, refType ) ){
+		///////////////////////////////////////////////////////////////////
+		// オブジェクトとメンバに分解できるとき
+		// termLeft.member
+		///////////////////////////////////////////////////////////////////
+
+		isLiteral = false;
+
+		// オブジェクト側の型を取得
+		bool isClassName = false;
+		Type leftType;
+		if( GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){
+			if( isClassName == false && Smoothie::meta.blittableTypes.IsExist( leftType ) ){
+				// 左側のオブジェクト部分がBlittable型のとき
+
+				char temporary[VN_SIZE];
+				lstrcpy( temporary, termLeft );
+				sprintf( termLeft, "%s(%s)",
+					Smoothie::meta.blittableTypes.Find( leftType ).GetCreateStaticMethodFullName().c_str(),
+					temporary );
+
+				if( !GetTermType( termLeft, leftType, isLiteral, &isClassName ) ){
+					goto globalArea;
+				}
+			}
+		}
+		else{
+			goto globalArea;
+		}
+
+		if( isClassName ){
+			// 静的メンバ/メソッドの場合
+			goto globalArea;
+		}
+
+		if( !leftType.HasMember() ){
+			// メンバを持たない型の場合
+			return false;
+		}
+
+		const CClass &objClass = leftType.GetClass();
+
+
+		///////////////////////////////////////////////////////////////////
+		// メンバを検索
+		///////////////////////////////////////////////////////////////////
+		if( GetMemberType( objClass, member, resultType, 0, false ) ){
+			// メンバが見つかったとき
+			return true;
+		}
+
+
+		///////////////////////////////////////////////////////////////////
+		// 動的メソッドを検索
+		///////////////////////////////////////////////////////////////////
+		vector<UserProc *> userProcs;
+
+		char methodName[VN_SIZE] ,lpPtrOffset[VN_SIZE];
+		lstrcpy( methodName, member );
+		GetVarFormatString(methodName,parameter,lpPtrOffset,member,refType);
+
+		objClass.GetMethods().Enum( methodName, userProcs );
+		UserProc *pUserProc;
+		if(userProcs.size()){
+			//オーバーロードを解決
+			pUserProc=OverloadSolutionWithStrParam(termFull,userProcs,parameter,termLeft);
+
+			if( pUserProc ){
+				resultType = pUserProc->ReturnType();
+				return true;
+			}
+		}
+
+		return false;
+	}
+
+
+	//////////////////////////////////////////////
+	// クラス名かどうかをチェック（静的メンバ用）
+	//////////////////////////////////////////////
+
+	if( pIsClassName ){
+		if( pobj_DBClass->Find( termFull ) ){
+			*pIsClassName = true;
+			return true;
+		}
+	}
+
+
+	/////////////////////////////////////////////////////////////////
+	// グローバル属性
+	/////////////////////////////////////////////////////////////////
+globalArea:
+
+
+	if(lstrcmpi(termFull,"This")==0){
+		//Thisオブジェクト
+		resultType.SetType( DEF_OBJECT, pobj_CompilingClass );
+		isLiteral = false;
+		return true;
+	}
+
+
+	//////////////////////////////////////
+	// 関数（DLL、ユーザー定義、組み込み）
+	//////////////////////////////////////
+	char procName[VN_SIZE];
+	char temporary[8192];
+
+	int i2=GetCallProcName(termFull,procName);
+	if(termFull[i2]=='('){
+		int i4=GetStringInPare_RemovePare(parameter,termFull+i2+1);
+
+		void *pProc;
+		int idProc=GetProc(procName,(void **)&pProc);
+
+		if(idProc){
+			//閉じカッコ")"に続く文字がNULLでないとき
+			if(termFull[i2+1+i4+1]!='\0'){
+				SetError(42,NULL,cp);
+			}
+
+
+			////////////////
+			// 呼び出し
+			////////////////
+
+			if( !CallProc(idProc,pProc,procName,parameter, resultType, false ) ){
+				return false;
+			}
+			if( resultType.IsNull() ){
+				//戻り値が存在しないとき
+				return false;
+			}
+
+			isLiteral = false;
+
+			return true;
+		}
+		else if(GetConstCalcBuffer(procName,parameter,temporary)){
+			/////////////////////////
+			// マクロ関数
+			/////////////////////////
+
+			//閉じカッコ")"に続く文字がNULLでないときはエラーにする
+			if(termFull[i2+1+i4+1]!='\0') SetError(42,NULL,cp);
+
+			//マクロ関数の場合
+			if( !NumOpe_GetType(temporary,Type(),resultType) ){
+				return false;
+			}
+
+			if( !IS_LITERAL( resultType.GetIndex() ) ){
+				//リテラル値ではなかったとき
+				isLiteral = false;
+			}
+
+			return true;
+		}
+	}
+
+
+	////////////////////////////////
+	// インデクサ（getアクセサ）
+	////////////////////////////////
+
+	char VarName[VN_SIZE],ArrayElements[VN_SIZE];
+	GetArrayElement(termFull,VarName,ArrayElements);
+	if(ArrayElements[0]){
+		GetVarType(VarName,resultType,false);
+		if( resultType.IsObject() ){
+			if( !GetReturnTypeOfIndexerGetterProc( resultType.GetClass(),resultType) ){
+				SetError(1,NULL,cp);
+				return false;
+			}
+
+			isLiteral = false;
+
+			return true;
+		}
+	}
+
+
+	////////////////////////////////
+	// 変数
+	////////////////////////////////
+
+	if( GetVarType( termFull, resultType, false ) ){
+		if( resultType.GetBasicType() & FLAG_PTR ){
+			//配列ポインタ
+			resultType.SetBasicType( GetPtrType( resultType.GetBasicType()^FLAG_PTR ) );
+		}
+
+		isLiteral = false;
+
+		return true;
+	}
+
+
+	/////////////////////////////////
+	// プロパティ用のメソッド
+	/////////////////////////////////
+
+	//配列要素を排除
+	GetArrayElement(termFull,VarName,ArrayElements);
+
+	if(GetSubHash(VarName,0)){
+		GetReturnTypeOfPropertyMethod(termFull,NULL,resultType);
+
+		isLiteral = false;
+
+		return true;
+	}
+
+
+	return false;
+}
+
+bool NumOpe_GetType( const char *expression, const Type &baseType, Type &resultType ){
+	extern int cp;
+	int i,i3;
+
+	if(expression[0]=='\0'){
+		SetError(1,NULL,cp);
+		return false;
+	}
+
+	if(expression[0]==1&& expression[1]==ESC_NEW ){
+		//New演算子（オブジェクト生成）
+		return Operator_New_GetType(expression+2,baseType, resultType );
+	}
+
+	if( expression[0] == '[' ){
+		if( !baseType.IsPointer() ){
+			SetError(1,NULL,cp);
+			return false;
+		}
+
+		resultType = baseType;
+		return true;
+	}
+
+
+	/////////////////////////////////
+	// 式要素を逆ポーランド式で取得
+	/////////////////////////////////
+
+	char *values[255];
+	long calc[255];
+	long stack[255];
+	int pnum;
+	if(!GetNumOpeElements(expression,&pnum,values,calc,stack)){
+		for(i=0;i<pnum;i++){
+			if(values[i]) HeapDefaultFree(values[i]);
+		}
+		return false;
+	}
+
+
+
+	////////////////////////////////
+	// 演算部分のコード生成を開始
+	////////////////////////////////
+
+	BOOL bError;
+	bError=0;
+
+	//リテラル値のみの計算かどうかを判別するためのフラグ
+	BOOL bLiteralCalculation=1;
+
+	int sp;
+	int type_stack[255];
+	LONG_PTR index_stack[255];
+	bool isNothing_stack[255];
+	_int64 i64data;
+	int idCalc;
+	for(i=0,sp=0;i<pnum;i++){
+		idCalc=calc[i]%100;
+
+		if(idCalc){
+			if(type_stack[sp-2]==DEF_OBJECT){
+				if( idCalc == CALC_AS
+					&& type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST )
+					&& index_stack[sp-1] == index_stack[sp-2]
+					|| isNothing_stack[sp-2] ){
+						// 同一の型、またはNothingに対するAsはAs演算子を呼び出さない
+				}
+				else if( idCalc == CALC_AS
+					&& type_stack[sp-1] == ( DEF_OBJECT | FLAG_CAST )
+					&& ( ((CClass *)index_stack[sp-1])->IsEqualsOrSubClass( (CClass *)index_stack[sp-2] ) || ((CClass *)index_stack[sp-2])->IsEqualsOrSubClass( (CClass *)index_stack[sp-1] )
+					)){
+						// ダウンキャストを許可する
+				}
+				else if( idCalc == CALC_AS ){
+					// NumOpe_GetTypeではすべてのキャストを許可する
+				}
+				else{
+					//オーバーロードされたオペレータを呼び出す
+					if(!GetReturnType_OperatorProc(idCalc,baseType,type_stack,index_stack,sp)){
+						goto error;
+					}
+
+					continue;
+				}
+			}
+
+			if(!CheckCalcType(idCalc,type_stack,sp)) goto error;
+		}
+
+		switch(idCalc){
+			//数値
+			case 0:
+				index_stack[sp]=-1;
+				isNothing_stack[sp] = false;
+
+				char *term;
+				term = values[i];
+
+				if( calc[i+1]%100 == CALC_AS ){
+					// As演算子の右辺値
+					//型名
+					if( Type::StringToType( term, resultType ) ){
+
+						if( resultType.IsObject() ){
+							if( resultType.GetClass().IsBlittableType() ){
+								// Blittable型のときは基本型として扱う
+								// ※ただし、コンパイル中のメソッドがBlittable型クラスに属していないこと
+								if( UserProc::IsLocalAreaCompiling()
+									&& UserProc::CompilingUserProc().HasParentClass()
+									&& UserProc::CompilingUserProc().GetParentClass().IsBlittableType() )
+								{
+									// コンパイル中のメソッドがBlittable型クラスに属している
+								}
+								else{
+									resultType = resultType.GetClass().GetBlittableType();
+								}
+							}
+						}
+
+						resultType.SetBasicType( resultType.GetBasicType() | FLAG_CAST );
+					}
+					else{
+						SetError(3, term, cp );
+						goto error;
+					}
+
+					type_stack[sp] = resultType.GetBasicType();
+					index_stack[sp] = resultType.GetIndex();
+					sp++;
+
+					break;
+				}
+
+				if(term[0]=='\"'){
+StrLiteral:
+
+					if( baseType.IsObject() || baseType.IsNull() ){
+						//要求タイプがオブジェクト、または未定のとき
+						type_stack[sp]=DEF_OBJECT;
+						index_stack[sp]=(LONG_PTR)pobj_DBClass->GetStringClassPtr();
+						bLiteralCalculation=0;
+
+						sp++;
+						break;
+					}
+
+					type_stack[sp]=typeOfPtrChar;
+					bLiteralCalculation=0;
+				}
+				else if((term[0]=='e'||term[0]=='E')&&
+					(term[1]=='x'||term[1]=='X')&&
+					term[2]=='\"'){
+					//拡張版リテラル文字列（エスケープシーケンス可能）
+					goto StrLiteral;
+				}
+				else if(IsVariableTopChar(term[0])||
+					term[0]=='*'||
+					(term[0]=='.'&&IsVariableTopChar(term[1]))){
+					//////////////////
+					// 何らかの識別子
+
+					bool isLiteral = true;
+					if( GetTermType( term, resultType, isLiteral ) ){
+						type_stack[sp] = resultType.GetBasicType();
+						index_stack[sp] = resultType.GetIndex();
+
+						if( !isLiteral ){
+							bLiteralCalculation=0;
+						}
+
+						sp++;
+						break;
+					}
+
+
+					// Nothing
+					if( lstrcmp( term, "Nothing" ) == 0 ){
+						isNothing_stack[sp] = true;
+
+						type_stack[sp] = DEF_OBJECT;
+						if( baseType.IsObject() ){
+							index_stack[sp] = baseType.GetIndex();
+						}
+						else{
+							index_stack[sp] = (LONG_PTR)pobj_DBClass->GetObjectClassPtr();
+						}
+						bLiteralCalculation = 0;
+						sp++;
+						break;
+					}
+
+
+					//////////////
+					// 定数の場合
+					//////////////
+
+					i3 = CDBConst::obj.GetBasicType(term);
+					if(i3){
+						if( CDBConst::obj.IsStringPtr( term ) ){
+							//リテラル文字列
+							goto StrLiteral;
+						}
+
+						type_stack[sp]=i3;
+						if(IsRealNumberType(i3)){
+							//実数
+							goto Literal;
+						}
+						else if(IsWholeNumberType(i3)){
+							//整数
+							goto Literal;
+						}
+						else if(Is64Type(i3)){
+							//64ビット整数値
+							goto Literal;
+						}
+						else{
+							SetError(1,NULL,0);
+							goto error;
+						}
+					}
+
+
+					/////////////////////////////////
+					// プロパティ用のメソッド
+					/////////////////////////////////
+
+					//配列要素を排除
+					char VarName[VN_SIZE],ArrayElements[VN_SIZE];
+					GetArrayElement(term,VarName,ArrayElements);
+
+					if(GetSubHash(VarName,0)){
+						SetError();
+						Type tempType;
+						GetReturnTypeOfPropertyMethod(term,NULL,tempType);
+
+						//大きな型への暗黙の変換
+						type_stack[sp]=tempType.GetBasicType();
+
+						index_stack[sp]=tempType.GetIndex();
+						bLiteralCalculation=0;
+
+						sp++;
+						break;
+					}
+
+
+
+					//該当する識別子が見当たらないときはエラー扱いにする
+					bError=1;
+					SetError(3,term,cp);
+					type_stack[sp]=DEF_DOUBLE;
+				}
+				else{
+					//リテラル値
+					int base_type = 0;
+					if( !baseType.IsNull() ) base_type = baseType.GetBasicType();
+					type_stack[sp]=GetLiteralValue(term,&i64data,base_type);
+Literal:
+					if((long)i64data==0&&index_stack[sp]==-1) index_stack[sp]=LITERAL_NULL;
+				}
+
+				sp++;
+				break;
+
+			//論理演算子
+			case CALC_XOR:
+			case CALC_OR:
+			case CALC_AND:
+				sp--;
+				type_stack[sp-1]=NeutralizationType(type_stack[sp-1],index_stack[sp-1],type_stack[sp],index_stack[sp]);
+				break;
+			case CALC_NOT:
+				//values[sp-1]=Not values[sp-1]
+				//NOT演算子
+				break;
+
+			//比較演算子
+			case CALC_PE:		//values[sp-2] <= values[sp-1]
+			case CALC_QE:		//values[sp-2] >= values[sp-1]
+			case CALC_P:		//values[sp-2] <  values[sp-1]
+			case CALC_Q:		//values[sp-2] >  values[sp-1]
+			case CALC_NOTEQUAL:	//values[sp-2] <> values[sp-1]
+			case CALC_EQUAL:	//values[sp-2] =  values[sp-1]	
+				sp--;
+				type_stack[sp-1]=DEF_LONG;
+				break;
+
+			//ビットシフト
+			case CALC_SHL:	//values[sp-2] << values[sp-1]
+			case CALC_SHR:	//values[sp-2] >> values[sp-1]
+				sp--;
+				break;
+
+			//算術演算
+			case CALC_ADDITION:
+			case CALC_SUBTRACTION:
+			case CALC_PRODUCT:
+				sp--;
+				type_stack[sp-1]=NeutralizationType(type_stack[sp-1],index_stack[sp-1],type_stack[sp],index_stack[sp]);
+				break;
+			case CALC_MOD:
+				//values[sp-2]%=values[sp-1]
+				//剰余演算
+				sp--;
+				type_stack[sp-1]=NeutralizationType(type_stack[sp-1],index_stack[sp-1],type_stack[sp],index_stack[sp]);
+				break;
+			case CALC_QUOTIENT:
+				//values[sp-2]/=values[sp-1];
+				//除算
+				sp--;
+				type_stack[sp-1]=NeutralizationType(type_stack[sp-1],index_stack[sp-1],type_stack[sp],index_stack[sp]);
+				break;
+			case CALC_INTQUOTIENT:
+				//values[sp-2]/=values[sp-1]
+				//整数除算
+				sp--;
+				type_stack[sp-1]=NeutralizationType(type_stack[sp-1],index_stack[sp-1],type_stack[sp],index_stack[sp]);
+				break;
+			case CALC_MINUSMARK:
+				//values[sp-1]=-values[sp-1]
+				//符号反転
+				break;
+			case CALC_POWER:
+				//べき乗演算（浮動小数点演算のみ）
+				sp--;
+				//未完成
+				break;
+			case CALC_AS:
+				//キャスト
+				type_stack[sp-2]=type_stack[sp-1]&(~FLAG_CAST);
+				index_stack[sp-2]=index_stack[sp-1];
+
+				sp--;
+				break;
+
+			case CALC_BYVAL:
+				//ポインタ型→参照型
+				if( PTR_LEVEL( type_stack[sp-1] ) <= 0 ){
+					//ポインタ型ではないとき
+					SetError( 3, NULL, cp );
+					goto error;
+				}
+
+				type_stack[sp-1] = PTR_LEVEL_DOWN( type_stack[sp-1] );
+				break;
+		}
+	}
+
+	if(bError) goto error;
+
+	if(sp!=1){
+		SetError(1,NULL,cp);
+		goto error;
+	}
+
+	if(bLiteralCalculation){
+		//右辺値が数値の定数式の場合
+		int base_type = 0;
+		if( !baseType.IsNull() ) base_type = baseType.GetBasicType();
+		Type tempType;
+		StaticCalculation(true, expression,base_type,&i64data,tempType);
+
+		type_stack[0]=tempType.GetBasicType();
+		index_stack[0]=tempType.GetIndex();
+	}
+	else{
+		//右辺値が数値の定数式ではないとき
+		if(IS_LITERAL(index_stack[0])) index_stack[0]=-1;
+	}
+
+	resultType.SetType( type_stack[0], index_stack[0] );
+
+	bool isSuccessful = true;
+	goto finish;
+
+
+	//////////////////
+	// エラー処理
+	//////////////////
+
+error:
+	isSuccessful = false;
+	goto finish;
+
+
+finish:
+	for(i=0;i<pnum;i++){
+		if(values[i]) HeapDefaultFree(values[i]);
+	}
+	return isSuccessful;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Object.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Object.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Object.cpp	(revision 178)
@@ -0,0 +1,138 @@
+#include "../BasicCompiler_Common/common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+extern HANDLE hHeap;
+
+void CallConstructor( const char *ObjectName,const int *SubScripts,const Type &type,const char *Parameter){
+	if( !type.IsObject() ){
+		return;
+	}
+
+	/////////////////////////////////////
+	// クラスオブジェクトの場合
+	// ※コンストラクタの呼び出し
+	/////////////////////////////////////
+
+	UserProc *pUserProc;
+	pUserProc=GetMethodHash(ObjectName,type.GetClass().GetName().c_str(),Parameter);
+	if(!pUserProc){
+		if(Parameter[0]) SetError(113,type.GetClass().GetName().c_str(),cp);
+		return;
+	}
+
+
+	char temporary[VN_SIZE];
+
+	if(SubScripts[0]!=-1){
+		int ss[MAX_ARRAYDIM];
+		memset(ss,0,MAX_ARRAYDIM*sizeof(int));
+		while(1){
+			int i3;
+			for(i3=0;;i3++){
+				if(SubScripts[i3]==-1) break;
+
+				if(ss[i3]>SubScripts[i3]){
+					ss[i3]=0;
+					ss[i3+1]++;
+				}
+				else break;
+			}
+			if(SubScripts[i3]==-1) break;
+			sprintf(temporary,"%s[%d",ObjectName,ss[0]);
+			for(i3=1;;i3++){
+				if(SubScripts[i3]==-1) break;
+
+				sprintf(temporary+lstrlen(temporary),",%d",ss[i3]);
+			}
+			lstrcat(temporary,"]");
+
+			Type dummyType;
+			sprintf(temporary+lstrlen(temporary),".%s",type.GetClass().GetName().c_str());
+			CallProc( PROC_DEFAULT,
+				pUserProc,
+				temporary,
+				Parameter,
+				dummyType );
+
+			ss[0]++;
+
+
+			//ネイティブコードバッファの再確保
+			ReallocNativeCodeBuffer();
+		}
+	}
+	else{
+		Type dummyType;
+		sprintf(temporary,"%s.%s",ObjectName,type.GetClass().GetName().c_str());
+		CallProc( PROC_DEFAULT,
+			pUserProc,
+			temporary,
+			Parameter,
+			dummyType );
+	}
+}
+
+bool Operator_New( const char *expression, const Type &baseType, Type &resultType ){
+	char CreateParameter[VN_SIZE],objectSizeStr[VN_SIZE];
+	int i,i2;
+
+	i=0;
+
+	if(expression[0]=='['){
+		i=GetStringInBracket(objectSizeStr,expression);
+
+		SlideString(objectSizeStr+1,-1);
+		objectSizeStr[i-2]=0;
+	}
+	else objectSizeStr[0]=0;
+
+	char typeName[VN_SIZE];
+	for(i2=0;;i++,i2++){
+		if(expression[i]=='('){
+			typeName[i2]=0;
+
+			//コンストラクタに渡すパラメータを取得
+			i2=GetStringInPare(CreateParameter,expression+i);
+			RemoveStringPare(CreateParameter);
+			i+=i2;
+			if(expression[i]!='\0'){
+				SetError(42,NULL,cp);
+				return false;
+			}
+			break;
+		}
+		typeName[i2]=expression[i];
+		if(expression[i]=='\0'){
+			CreateParameter[0]=0;
+			break;
+		}
+	}
+
+	if( !Type::StringToType( typeName, resultType ) ){
+		SetError(3,typeName,cp);
+		return false;
+	}
+
+	if( !resultType.IsObject() ){
+		////////////////////////
+		// 通常のデータ型の場合
+		////////////////////////
+
+		SetError(121,NULL,cp);
+		return false;
+	}
+
+	Operator_New( resultType.GetClass(), objectSizeStr, CreateParameter, baseType );
+
+	if( !baseType.IsObject() ){
+		// オブジェクトポインタ向け
+		resultType.SetBasicType( DEF_PTR_OBJECT );
+	}
+
+	return true;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/OldStatement.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/OldStatement.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/OldStatement.cpp	(revision 178)
@@ -0,0 +1,332 @@
+#include "common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+void Opcode_Input(const char *Parameter){
+	extern int cp;
+	int i2,i3,i4,i5;
+	BOOL bFile;
+	char temporary[VN_SIZE],temp2[VN_SIZE],buffer[VN_SIZE];
+
+	if(Parameter[0]=='#'){
+		bFile=1;
+		for(i2=0,i3=1;;i2++,i3++){
+			buffer[i2]=Parameter[i3];
+			if(Parameter[i3]==','||Parameter[i3]=='\0') break;
+		}
+		buffer[i2+1]=0;
+		i2=i3+1;
+	}
+	else{
+		bFile=0;
+		i2=0;
+		buffer[0]=0;
+
+		//表示用文字列パラメータをセット
+		if(Parameter[0]=='\"'){
+			buffer[0]='\"';
+			for(i2=1;;i2++){
+				if(Parameter[i2]=='\"'){
+					buffer[i2]=0;
+					break;
+				}
+				buffer[i2]=Parameter[i2];
+			}
+			if(Parameter[i2+1]==';') lstrcpy(buffer+i2,"? \"");
+			else if(Parameter[i2+1]==',') lstrcpy(buffer+i2,"\"");
+			else SetError(10,"Input",cp);
+			i2+=2;
+		}
+		else if((Parameter[0]=='e'||Parameter[0]=='E')&&
+			(Parameter[1]=='x'||Parameter[1]=='X')&&
+			Parameter[2]=='\"'){
+			memcpy(buffer,Parameter,3);
+			for(i2=3;;i2++){
+				if(Parameter[i2]=='\"'){
+					buffer[i2]=0;
+					break;
+				}
+				buffer[i2]=Parameter[i2];
+			}
+			if(Parameter[i2+1]==';') lstrcpy(buffer+i2,"? \"");
+			else if(Parameter[i2+1]==',') lstrcpy(buffer+i2,"\"");
+			else SetError(10,"Input",cp);
+			i2+=2;
+		}
+		else{
+			lstrcpy(buffer,"\"? \"");
+			i2=0;
+		}
+	}
+
+	//変数ポインタ、変数のタイプをセット
+	i4=0;
+	while(1){
+		for(i3=0;;i2++,i3++){
+			if(Parameter[i2]=='('){
+				i5=GetStringInPare(temporary+i3,Parameter+i2);
+				i2+=i5-1;
+				i3+=i5-1;
+			}
+			if(Parameter[i2]=='['){
+				i5=GetStringInBracket(temporary+i3,Parameter+i2);
+				i2+=i5-1;
+				i3+=i5-1;
+			}
+			if(Parameter[i2]==','){
+				temporary[i3]=0;
+				i2++;
+				break;
+			}
+			temporary[i3]=Parameter[i2];
+			if(Parameter[i2]=='\0') break;
+		}
+		if(temporary[0]=='\0'){
+			SetError(10,"Input",cp);
+			return;
+		}
+
+		Type varType;
+		if( !GetVarType(temporary, varType, 1) ){
+			return;
+		}
+
+		sprintf(temp2,"_System_InputDataPtr[%d]=VarPtr(%s)",i4,temporary);
+		OpcodeCalc(temp2);
+
+		if(varType.IsLong()) varType.SetBasicType( DEF_DWORD );
+		else if(varType.IsInteger()) varType.SetBasicType( DEF_WORD );
+		else if(varType.IsObject()){
+			varType.SetBasicType( DEF_OBJECT );
+			if( varType.IsStringClass() ){
+				varType.SetBasicType( DEF_STRING );
+			}
+		}
+		sprintf(temp2,"_System_InputDataType[%d]=%d",i4,varType.GetBasicType());
+		OpcodeCalc(temp2);
+
+		i4++;
+		if(Parameter[i2]=='\0') break;
+	}
+	sprintf(temp2,"_System_InputDataPtr[%d]=0",i4);
+	OpcodeCalc(temp2);
+
+	UserProc *pUserProc;
+	if(bFile) pUserProc=GetSubHash("INPUT_FromFile");
+	else pUserProc=GetSubHash("INPUT_FromPrompt");
+	if(!pUserProc){
+		SetError(3,"Input",cp);
+		return;
+	}
+	Opcode_CallProc(buffer,pUserProc,0,"",0);
+}
+void Opcode_PrintUsing(const char *Parameter,char *buffer,BOOL bFile){
+	extern int cp;
+	int i2,i3,i4,i5;
+	char temporary[VN_SIZE],temp2[8192];
+	BOOL bReturnLine;
+
+	char parms[8192];
+	lstrcpy( parms, Parameter );
+
+	i2=lstrlen(parms);
+	if(parms[i2-1]==';'){
+		bReturnLine=0;
+		parms[i2-1]=0;
+	}
+	else bReturnLine=1;
+
+	i3=lstrlen(buffer);
+	for(i2=0;;i2++,i3++){
+		if(parms[i2]==';'){
+			buffer[i3]=0;
+			break;
+		}
+		buffer[i3]=parms[i2];
+		if(parms[i2]=='\0') break;
+	}
+	if(parms[i2]==';') i2++;
+
+	if(bReturnLine) lstrcat(buffer,"+Ex\"\\r\\n\"");
+
+	//データポインタ、データのタイプをセット
+	i4=0;
+	while(1){
+		for(i3=0;;i2++,i3++){
+			if(parms[i2]=='\"'){
+				temporary[i3]=parms[i2];
+				for(i2++,i3++;;i2++,i3++){
+					temporary[i3]=parms[i2];
+					if(parms[i2]=='\"') break;
+				}
+				continue;
+			}
+			if(parms[i2]=='('){
+				i5=GetStringInPare(temporary+i3,parms+i2);
+				i2+=i5-1;
+				i3+=i5-1;
+				continue;
+			}
+			if(parms[i2]=='['){
+				i5=GetStringInBracket(temporary+i3,parms+i2);
+				i2+=i5-1;
+				i3+=i5-1;
+				continue;
+			}
+			if(parms[i2]==','){
+				temporary[i3]=0;
+				i2++;
+				break;
+			}
+			temporary[i3]=parms[i2];
+			if(parms[i2]=='\0') break;
+		}
+		if(temporary[0]=='\0'){
+			SetError(10,"Print",cp);
+			return;
+		}
+
+		int iResult;
+		iResult=IsStrCalculation(temporary);
+
+		if(iResult==1){
+			//文字列
+			sprintf(temp2,"_System_UsingStrData[%d]=%s",i4,temporary);
+			OpcodeCalc(temp2);
+
+			sprintf(temp2,"_System_UsingDataType[%d]=%d",i4,DEF_STRING);
+			OpcodeCalc(temp2);
+		}
+		else if(iResult==0){
+			//数値
+			sprintf(temp2,"_System_UsingDblData[%d]=%s",i4,temporary);
+			OpcodeCalc(temp2);
+
+			sprintf(temp2,"_System_UsingDataType[%d]=%d",i4,DEF_DOUBLE);
+			OpcodeCalc(temp2);
+		}
+		//else if(iResult==-1) エラー
+
+		i4++;
+		if(parms[i2]=='\0') break;
+	}
+	sprintf(temp2,"_System_UsingDataType[%d]=-1",i4);
+	OpcodeCalc(temp2);
+
+	UserProc *pUserProc;
+	if(bFile) pUserProc=GetSubHash("PRINTUSING_ToFile");
+	else pUserProc=GetSubHash("PRINTUSING_ToPrompt");
+	if(!pUserProc){
+		SetError(3,"Print",cp);
+		return;
+	}
+	Opcode_CallProc(buffer,pUserProc,0,"",0);
+}
+void Opcode_Print(const char *Parameter,BOOL bWrite){
+	int i2,i3,i4,sw;
+	char temporary[VN_SIZE],buffer[VN_SIZE];
+	BOOL bFile;
+
+	if(Parameter[0]=='#'){
+		bFile=1;
+		for(i2=0,i3=1;;i2++,i3++){
+			buffer[i2]=Parameter[i3];
+			if(Parameter[i3]==','||Parameter[i3]=='\0') break;
+		}
+		buffer[i2+1]=0;
+		if(Parameter[i3]==',') i3++;
+		i2=i3;
+	}
+	else{
+		bFile=0;
+		i2=0;
+		buffer[0]=0;
+	}
+	if(Parameter[i2]==1&&Parameter[i2+1]==ESC_USING){
+		Opcode_PrintUsing(Parameter+i2+2,buffer,bFile);
+		return;
+	}
+
+	lstrcat(buffer,"_System_DummyStr+");
+
+	sw=1;
+	while(1){
+		for(i3=0;;i2++,i3++){
+			if(Parameter[i2]=='\"'){
+				temporary[i3]=Parameter[i2];
+				for(i2++,i3++;;i2++,i3++){
+					temporary[i3]=Parameter[i2];
+					if(Parameter[i2]=='\"') break;
+				}
+				continue;
+			}
+			if(Parameter[i2]=='('){
+				i4=GetStringInPare(temporary+i3,Parameter+i2);
+				i2+=i4-1;
+				i3+=i4-1;
+				continue;
+			}
+			if(Parameter[i2]=='['){
+				i4=GetStringInBracket(temporary+i3,Parameter+i2);
+				i2+=i4-1;
+				i3+=i4-1;
+				continue;
+			}
+			if(Parameter[i2]==','||Parameter[i2]==';'){
+				temporary[i3]=0;
+				break;
+			}
+			temporary[i3]=Parameter[i2];
+			if(Parameter[i2]=='\0') break;
+		}
+
+		if(temporary[0]=='\0') lstrcat(buffer,"\"\"");
+		else{
+			int iResult;
+			iResult=IsStrCalculation(temporary);
+			if(iResult==-1){
+				//エラー
+				lstrcat(buffer,"\"\"");
+			}
+			else if(iResult){
+				//文字列
+				lstrcat(buffer,temporary);
+			}
+			else{
+				//数値
+				sprintf(buffer+lstrlen(buffer),"Str$(%s)",temporary);
+			}
+		}
+
+		if(Parameter[i2]==','){
+			if(bWrite) lstrcat(buffer,"+\",\"+");
+			else lstrcat(buffer,"+\"\t\"+");
+		}
+		else if(Parameter[i2]==';'){
+			if(Parameter[i2+1]=='\0'){
+				sw=0;
+				break;
+			}
+			if(bWrite) lstrcat(buffer,"+\",\"+");
+			else lstrcat(buffer,"+\" \"+");
+		}
+		else if(Parameter[i2]=='\0') break;
+
+		i2++;
+	}
+
+	if(sw) lstrcat(buffer,"+Ex\"\\r\\n\"");
+
+	UserProc *pUserProc;
+	if(bFile) pUserProc=GetSubHash("PRINT_ToFile");
+	else pUserProc=GetSubHash("PRINT_ToPrompt");
+	if(!pUserProc){
+		SetError(3,"Print",cp);
+		return;
+	}
+	Opcode_CallProc(buffer,pUserProc,0,"",0);
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Overload.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Overload.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Overload.cpp	(revision 178)
@@ -0,0 +1,74 @@
+#include "../BasicCompiler_Common/common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+UserProc *OverloadSolutionWithStrParam(
+	const char *name,
+	std::vector<UserProc *> &subs,
+	const char *Parameter,
+	const char *ObjectName){
+
+		// オーバーロードの解決
+
+		//オーバーロードされていないとき
+		if( subs.size() == 1 ) return subs[0];
+
+
+		////////////////////////
+		// パラメータをセット
+		////////////////////////
+
+		ParamImpl *pobj_parameter=0;
+
+		char MethodName[VN_SIZE];
+		if( !SplitMemberName( name, NULL, MethodName ) ) lstrcpy( MethodName, name );
+/*
+		//メソッドの場合は静的かどうかを調べる
+		bool isStatic = false;
+		CClass *pClass = subs[0]->GetParentClassPtr();
+		if( pClass ){
+			isStatic = pClass->IsExistStaticMethod( MethodName );
+		}
+*/
+		//パラメータオブジェクトを生成
+		pobj_parameter=new ParamImpl(Parameter);
+
+
+		UserProc *pUserProc;
+		pUserProc=pobj_parameter->OverloadSolution(name,subs);
+
+
+		//パラメータオブジェクトを破棄
+		delete pobj_parameter;
+		pobj_parameter=0;
+
+		return pUserProc;
+}
+UserProc *OverloadSolution(
+	const char *name,
+	std::vector<UserProc *> &subs,
+	const Parameters &params,
+	const Type &returnType ){
+
+		// オーバーロードの解決
+
+		//オーバーロードされていないとき
+		if( subs.size() == 1 ) return subs[0];
+
+
+		ParamImpl *pobj_Parameter=new ParamImpl( params );
+		if( !returnType.IsNull() ){
+			pobj_Parameter->SetReturnType( returnType );
+		}
+
+		UserProc *pUserProc;
+		pUserProc=pobj_Parameter->OverloadSolution(name,subs);
+
+		delete pobj_Parameter;
+
+		return pUserProc;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/PESchedule.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/PESchedule.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/PESchedule.cpp	(revision 178)
@@ -0,0 +1,286 @@
+#include "../BasicCompiler_Common/common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+extern HANDLE hHeap;
+
+/////////////////////////////////////////////
+// 再配置スケジュール
+//
+// メモリの再配置は.textセクション、または.dataセクションに行われることが予想される。
+//        .textセクション … セクションデータへのポインタ
+//        .dataセクション … vtblの再配置
+/////////////////////////////////////////////
+
+CReloc *pobj_Reloc;
+
+CReloc::CReloc(){
+	buffer=0;
+	length=0;
+	NowPageRVAToReloc=0;
+
+	pdwData_CodeSection=(DWORD *)HeapAlloc(hHeap,0,1);
+	iNum_CodeSection=0;
+	pdwData_DataSection=(DWORD *)HeapAlloc(hHeap,0,1);
+	iNum_DataSection=0;
+}
+CReloc::~CReloc(){
+	AllFree();
+}
+void CReloc::AllFree(void){
+	if(buffer){
+		HeapDefaultFree(buffer);
+		buffer=0;
+	}
+
+	HeapDefaultFree(pdwData_CodeSection);
+	HeapDefaultFree(pdwData_DataSection);
+}
+void CReloc::copy(CReloc *por){
+	AllFree();
+
+	if(por->buffer){
+		buffer=(char *)HeapReAlloc(hHeap,0,buffer,por->length);
+		memcpy(buffer,por->buffer,por->length);
+	}
+	else buffer=0;
+
+	length=por->length;
+
+	NowPageRVAToReloc=por->NowPageRVAToReloc;
+	NowCountAddrToReloc=por->NowCountAddrToReloc;
+
+	iNum_CodeSection=por->iNum_CodeSection;
+	pdwData_CodeSection=(DWORD *)HeapAlloc(hHeap,0,iNum_CodeSection*sizeof(DWORD));
+	memcpy(pdwData_CodeSection,por->pdwData_CodeSection,iNum_CodeSection*sizeof(DWORD));
+
+	iNum_DataSection=por->iNum_DataSection;
+	pdwData_DataSection=(DWORD *)HeapAlloc(hHeap,0,iNum_DataSection*sizeof(DWORD));
+	memcpy(pdwData_DataSection,por->pdwData_DataSection,iNum_DataSection*sizeof(DWORD));
+}
+
+void CReloc::AddSchedule_CodeSection(DWORD addr){
+	extern BOOL bDll;
+	if(!bDll) return;
+
+	pdwData_CodeSection=(DWORD *)HeapReAlloc(hHeap,0,pdwData_CodeSection,(iNum_CodeSection+1)*sizeof(DWORD));
+	pdwData_CodeSection[iNum_CodeSection]=addr;
+	iNum_CodeSection++;
+}
+void CReloc::AddSchedule_DataSection(DWORD addr){
+	extern BOOL bDll;
+	if(!bDll) return;
+
+	pdwData_DataSection=(DWORD *)HeapReAlloc(hHeap,0,pdwData_DataSection,(iNum_DataSection+1)*sizeof(DWORD));
+	pdwData_DataSection[iNum_DataSection]=addr;
+	iNum_DataSection++;
+}
+
+void CReloc::__add(DWORD addr){
+	extern BOOL bDll;
+	if(!bDll) return;
+
+	BOOL sw;
+	sw=0;
+	while((addr-(addr%MEM_ALIGNMENT))>NowPageRVAToReloc){
+		NowPageRVAToReloc+=MEM_ALIGNMENT;
+		sw=1;
+	}
+
+	if(sw){
+		//ページを増やす
+		while(length%4){
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,length+sizeof(WORD));
+			(*(WORD *)(buffer+length))=0;
+			length+=2;
+
+			(*(DWORD *)(buffer+NowCountAddrToReloc))+=sizeof(WORD);
+		}
+
+		buffer=(char *)HeapReAlloc(hHeap,0,buffer,
+			length+
+			sizeof(DWORD)+
+			sizeof(DWORD));
+
+		//Page RVA
+		*(DWORD *)(buffer+length)=NowPageRVAToReloc;
+		length+=sizeof(DWORD);
+
+		NowCountAddrToReloc=length;
+
+		//Block size
+		*(DWORD *)(buffer+length)=sizeof(DWORD)*2;
+		length+=sizeof(DWORD);
+	}
+
+	//リロケーション情報の追加
+	buffer=(char *)HeapReAlloc(hHeap,0,buffer,length+sizeof(WORD));
+	buffer[length]=0;
+	buffer[length+1]=0x30;	//=IMAGE_REL_BASED_HIGHLOW
+	(*(WORD *)(buffer+length))|=addr&0x0FFF;
+	length+=2;
+
+	(*(DWORD *)(buffer+NowCountAddrToReloc))+=sizeof(WORD);
+}
+void CReloc::ResetRelocBuffer(void){
+	if(buffer) HeapDefaultFree(buffer);
+
+	buffer=(char *)HeapAlloc(hHeap,0,1);
+	length=0;
+	NowPageRVAToReloc=0;
+
+	int i;
+	for(i=0;i<iNum_CodeSection;i++){
+		extern int MemPos_CodeSection;
+		__add(MemPos_CodeSection + pdwData_CodeSection[i]);
+	}
+
+	for(i=0;i<iNum_DataSection;i++){
+		extern int MemPos_DataSection;
+		__add(MemPos_DataSection + pdwData_DataSection[i]);
+	}
+}
+
+
+
+
+//////////////////////////
+// 一般スケジュール
+//////////////////////////
+
+CSchedule::CSchedule(){
+	pObpValues=(int *)HeapAlloc(hHeap,0,1);
+	num=0;
+
+	this->flag=0;
+}
+CSchedule::~CSchedule(){
+	HeapDefaultFree(pObpValues);
+}
+void CSchedule::SetFlag(int flag){
+	this->flag=flag;
+}
+void CSchedule::add(){
+	pObpValues=(int *)HeapReAlloc(hHeap,0,pObpValues,(num+1)*sizeof(int));
+	pObpValues[num]=obp;
+	num++;
+
+	if(flag&SCHEDULE_FLAG_RELOC){
+		//リロケーション情報を追加する
+		pobj_Reloc->AddSchedule_CodeSection(obp);
+	}
+}
+void CSchedule::move(int iStartPos,int iSize,int offset){
+	int i;
+	for(i=0;i<num;i++){
+		if(iStartPos<=pObpValues[i] && pObpValues[i]<iStartPos+iSize){
+			pObpValues[i]+=offset;
+		}
+	}
+}
+
+//データテーブルスケジュール
+CSchedule *pobj_DataTableSchedule;
+
+//グローバル変数アドレススケジュール
+CSchedule *pobj_GlobalVarSchedule;
+
+
+
+/////////////////////////////////////////
+// インポート アドレス スケジューリング
+/////////////////////////////////////////
+
+CImportAddrSchedule::CImportAddrSchedule(){
+	ppdi=(DllProc **)HeapAlloc(hHeap,0,1);
+}
+CImportAddrSchedule::~CImportAddrSchedule(){
+	HeapDefaultFree(ppdi);
+}
+
+void CImportAddrSchedule::add(DllProc *pDllProc){
+	ppdi=(DllProc **)HeapReAlloc(hHeap,0,ppdi,(num+1)*sizeof(DllProc *));
+	ppdi[num]=pDllProc;
+
+	CSchedule::add();
+}
+
+CImportAddrSchedule *pobj_ImportAddrSchedule;
+
+
+
+
+/////////////////////////////////////////
+// プロシージャ アドレス スケジューリング
+/////////////////////////////////////////
+
+CSubAddrSchedule::CSubAddrSchedule(){
+	ppsi=(UserProc **)HeapAlloc(hHeap,0,1);
+	pbCall=(BOOL *)HeapAlloc(hHeap,0,1);
+}
+CSubAddrSchedule::~CSubAddrSchedule(){
+	HeapDefaultFree(ppsi);
+	HeapDefaultFree(pbCall);
+}
+
+void CSubAddrSchedule::add(UserProc *pUserProc,BOOL bCall){
+	if(!pUserProc) return;
+
+	ppsi=(UserProc **)HeapReAlloc(hHeap,0,ppsi,(num+1)*sizeof(UserProc *));
+	ppsi[num]=pUserProc;
+	pbCall=(BOOL *)HeapReAlloc(hHeap,0,pbCall,(num+1)*sizeof(BOOL));
+	pbCall[num]=bCall;
+
+	CSchedule::add();
+
+	if(!bCall){
+		//リロケーション情報を追加する
+		pobj_Reloc->AddSchedule_CodeSection(obp);
+	}
+}
+
+CSubAddrSchedule *pobj_SubAddrSchedule;
+
+
+
+
+/////////////////////////////////////////
+// 一時スケジューリングポインタ
+/////////////////////////////////////////
+CTempSchedule::CTempSchedule(){
+	ppObpValues=(int **)HeapAlloc(hHeap,0,1);
+	num=0;
+}
+CTempSchedule::~CTempSchedule(){
+	HeapDefaultFree(ppObpValues);
+}
+void CTempSchedule::lock(int *pobp){
+	ppObpValues=(int **)HeapReAlloc(hHeap,0,ppObpValues,(num+1)*sizeof(int *));
+	ppObpValues[num]=pobp;
+	num++;
+}
+void CTempSchedule::unlock(){
+	if( num <= 0 ){
+		//エラー
+		SetError(300,NULL,cp);
+	}
+	num--;
+}
+void CTempSchedule::move(int iStartPos,int iSize,int offset){
+	int i;
+	for(i=0;i<num;i++){
+		if(iStartPos<=*ppObpValues[i] && *ppObpValues[i]<iStartPos+iSize){
+			(*ppObpValues[i])+=offset;
+		}
+	}
+}
+
+CTempSchedule *pobj_TempSchedule;
+
+
+
+
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/PESchedule.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/PESchedule.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/PESchedule.h	(revision 178)
@@ -0,0 +1,110 @@
+
+
+///////////////////////
+// リロケーション情報
+///////////////////////
+class CReloc{
+public:
+	char *buffer;
+	int length;
+	DWORD NowPageRVAToReloc;
+	DWORD NowCountAddrToReloc;
+
+	CReloc();
+	~CReloc();
+	void AllFree(void);
+	void copy(CReloc *por);
+
+private:
+	DWORD *pdwData_CodeSection;
+	int iNum_CodeSection;
+public:
+	void AddSchedule_CodeSection(DWORD addr);
+
+private:
+	DWORD *pdwData_DataSection;
+	int iNum_DataSection;
+public:
+	void AddSchedule_DataSection(DWORD addr);
+
+private:
+	void __add(DWORD addr);
+public:
+	void ResetRelocBuffer(void);
+};
+extern CReloc *pobj_Reloc;
+
+
+//////////////////////////
+// 一般スケジューリング
+//////////////////////////
+#define SCHEDULE_FLAG_RELOC 1
+class CSchedule{
+	int flag;
+public:
+	int *pObpValues;
+	int num;
+
+	CSchedule();
+	~CSchedule();
+	void SetFlag(int flag);
+
+	void add();
+	void move(int iStartPos,int iSize,int offset);
+};
+extern CSchedule *pobj_DataTableSchedule;
+extern CSchedule *pobj_GlobalVarSchedule;
+
+
+
+/////////////////////////////////////////
+// インポート アドレス スケジューリング
+/////////////////////////////////////////
+class CImportAddrSchedule:public CSchedule{
+public:
+	DllProc **ppdi;
+
+	CImportAddrSchedule();
+	~CImportAddrSchedule();
+
+	void add(DllProc *pDllProc);
+};
+extern CImportAddrSchedule *pobj_ImportAddrSchedule;
+
+
+
+/////////////////////////////////////////
+// プロシージャ アドレス スケジューリング
+/////////////////////////////////////////
+class CSubAddrSchedule:public CSchedule{
+public:
+	UserProc **ppsi;
+	BOOL *pbCall;
+
+	CSubAddrSchedule();
+	~CSubAddrSchedule();
+
+	void add(UserProc *pUserProc,BOOL bCall);
+};
+extern CSubAddrSchedule *pobj_SubAddrSchedule;
+
+
+
+/////////////////////////////////////
+// 一時スケジューリングポインタ
+/////////////////////////////////////
+class CTempSchedule{
+	int **ppObpValues;
+	int num;
+public:
+	CTempSchedule();
+	~CTempSchedule();
+
+	void lock(int *pobp);
+	void unlock();
+	void move(int iStartPos,int iSize,int offset);
+};
+extern CTempSchedule *pobj_TempSchedule;
+
+
+void NativeBuffer_StaticRelocation(int iStartPos,int iSize,int offset);
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/ParamImpl.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/ParamImpl.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/ParamImpl.cpp	(revision 178)
@@ -0,0 +1,339 @@
+#include <Program.h>
+
+#include "common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+#define OVERLOAD_MIN_LEVEL 0
+#define OVERLOAD_MAX_LEVEL 6
+#define OVERLOAD_LEVEL0 0		// 型調整なし。厳密に等しい
+#define OVERLOAD_LEVEL1 1		// 型調整なし。レベル1以上はオブジェクトの場合は派生関係を考慮
+#define OVERLOAD_LEVEL2 2		// 型調整なし。整数型/実数型レベルでの同一性チェック（サイズ照合あり）
+#define OVERLOAD_LEVEL3 3		// 型調整なし。整数型/実数型レベルでの同一性チェック
+#define OVERLOAD_LEVEL4 4		// 型調整あり。厳密に等しい
+#define OVERLOAD_LEVEL5 5		// 型調整あり。整数型/実数型レベルでの同一性チェック
+#define OVERLOAD_LEVEL6 6		// 型調整あり。数値型/クラス型レベルでの同一性チェック
+
+ParamImpl::ParamImpl(const char *buffer):
+	returnType()
+{
+	///////////////////////////
+	// パラメータ文字列を整理
+	///////////////////////////
+
+	extern HANDLE hHeap;
+	int i,i2,i3;
+	char temporary[VN_SIZE];
+
+	i=0;
+	ParmsNum=0;
+	while(1){
+		if(buffer[i]=='\0') break;
+
+		for(i2=0;;i2++,i++){
+			if(buffer[i]=='\"'){
+				temporary[i2]=buffer[i];
+				for(i++,i2++;;i++,i2++){
+					temporary[i2]=buffer[i];
+					if(buffer[i]=='\"') break;
+				}
+				continue;
+			}
+
+			if(buffer[i]=='('){
+				i3=GetStringInPare(temporary+i2,buffer+i);
+				i2+=i3-1;
+				i+=i3-1;
+				continue;
+			}
+			if(buffer[i]=='['){
+				i3=GetStringInBracket(temporary+i2,buffer+i);
+				i2+=i3-1;
+				i+=i3-1;
+				continue;
+			}
+
+			if(buffer[i]==','||buffer[i]=='\0'){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=buffer[i];
+		}
+
+		Parms[ParmsNum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+		lstrcpy(Parms[ParmsNum],temporary);
+		ParmsNum++;
+
+		types.push_back( Type() );
+
+		if(buffer[i]==',') i++;
+	}
+}
+ParamImpl::ParamImpl(const Parameters &params):
+	returnType()
+{
+	ParmsNum = 0;
+	foreach( Parameter *pParam, params ){
+		Parms[ParmsNum]=0;
+		ParmsNum++;
+
+		types.push_back( *pParam );
+	}
+}
+ParamImpl::~ParamImpl(){
+	int i2;
+
+	//パラメータ文字列を解放
+	for(i2=0;i2<ParmsNum;i2++){
+		if(Parms[i2]==(char *)-1) continue;
+
+		if(Parms[i2]) HeapDefaultFree(Parms[i2]);
+	}
+}
+
+void ParamImpl::SetReturnType( const Type &returnType ){
+	this->returnType = returnType;
+}
+
+bool ParamImpl::EvaluateOverloadScore( int level, const Parameters &targetParms, const Type &targetResultType ){
+	//パラメータを識別してオーバーロードを解決
+
+	//パラメータの個数が不一致の場合
+	int max = (int)targetParms.size();
+
+	if( ParmsNum > max ){
+		// 実引数が駆り引数より多いとき
+		// ※無条件で不一致
+		return false;
+	}
+
+	Type argType;
+	for(int i=0;i<max;i++){
+		Parameter &param = *targetParms[i];
+
+		if( i >= ParmsNum ){
+			// 引数が多いとき
+			if( param.GetInitValue().size() > 0 ){
+				// 初期値が指定されているパラメータを考慮
+				return true;
+			}
+			else{
+				return false;
+			}
+		}
+
+		if(Parms[i]){
+			Type nullParam( DEF_NON );
+
+			NumOpe_GetType(Parms[i],
+				( level <= OVERLOAD_LEVEL3 )? nullParam : param,
+				argType);
+		}
+		else{
+			argType = types[i];
+		}
+
+		if(argType.GetBasicType()!=param.GetBasicType()){
+			if( level == OVERLOAD_LEVEL0 || level == OVERLOAD_LEVEL1 || level==OVERLOAD_LEVEL4 ){
+				return false;
+			}
+			else if( level == OVERLOAD_LEVEL2 ){
+				if( !(argType.IsWhole() && param.IsWhole() && argType.GetBasicSize() == param.GetBasicSize() ) ){
+					// サイズ違い
+					return false;
+				}
+			}
+			else if( level == OVERLOAD_LEVEL3 || level==OVERLOAD_LEVEL5){
+				if(!(
+					argType.IsWhole()&&param.IsWhole()||
+					argType.IsReal()&&param.IsReal()
+					)){
+						return false;
+				}
+				if( argType.IsPointer() || param.IsPointer() )
+				{
+					// ポインタ型の不整合は認めない
+					return false;
+				}
+			}
+			else if(level==OVERLOAD_LEVEL6){
+				if(argType.IsObject()||param.IsObject()) return false;
+			}
+		}
+		else{
+			//if(NATURAL_TYPE(argType.GetBasicType())==DEF_OBJECT || NATURAL_TYPE(argType.GetBasicType())==DEF_STRUCT){
+			if( NATURAL_TYPE(argType.GetBasicType())==DEF_STRUCT){
+				if(argType.GetIndex()!=param.GetIndex()){
+					return false;
+				}
+			}
+			else if( NATURAL_TYPE(argType.GetBasicType())==DEF_OBJECT ){
+				if( level == OVERLOAD_LEVEL0 ){
+					if( !param.GetClass().IsEquals( &argType.GetClass() ) ){
+						return false;
+					}
+				}
+				else{
+					if( !param.GetClass().IsEqualsOrSubClass( &argType.GetClass() ) ){
+						return false;
+					}
+				}
+			}
+		}
+	}
+
+	if( !targetResultType.IsNull() ){
+		//戻り値も比較対象にする
+		if( !returnType.Equals( targetResultType ) ){
+			return false;
+		}
+	}
+
+	return true;
+}
+
+UserProc *ParamImpl::_OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType ){
+	int sw=0;
+	UserProc *pUserProc;
+	pUserProc=0;
+
+	for( int level=OVERLOAD_MIN_LEVEL; level<=OVERLOAD_MAX_LEVEL; level++ ){
+
+		foreach( UserProc *pTempUserProc, subs ){
+
+			if(EvaluateOverloadScore( level, pTempUserProc->Params(), isEnabledReturnType?pTempUserProc->ReturnType():Type() )){
+				trace_for_overload( "レベル" << level <<	" ○適合..." << pTempUserProc->_paramStr );
+
+				if(sw){
+					if( isEnabledReturnType ){
+						SetError(52,name,cp);
+
+						return 0;
+					}
+					else{
+						// 戻り値も比較するモードにして再びオーバーロード解決を試みる
+
+						trace_for_overload( "戻り値も比較するモードに切り替えてオーバーロード解決を試みる" );
+
+						return OverloadSolution(name,subs, true);
+					}
+				}
+				sw=1;
+
+				pUserProc = pTempUserProc;
+			}
+			else
+			{
+				trace_for_overload( "レベル" << level <<	" ×不適合..." << pTempUserProc->_paramStr );
+			}
+		}
+
+		if( sw ) break;
+	}
+
+	if(!sw){
+		foreach( UserProc *pTempUserProc, subs ){
+
+			//エラーチェック
+			if(pTempUserProc->Params().size()==this->ParmsNum){
+				if(sw){
+					sw=0;
+					break;
+				}
+				sw=1;
+
+				pUserProc=pTempUserProc;
+			}
+		}
+	}
+
+	if(!sw){
+		SetError(52,name,cp);
+
+		return 0;
+	}
+
+
+	return pUserProc;
+}
+UserProc *ParamImpl::OverloadSolution( const char *name, std::vector<UserProc *> &subs, bool isEnabledReturnType ){
+	trace_for_overload( "" );
+	trace_for_overload( "■■■■■■■■■■■■■■■■■■" );
+	trace_for_overload( "■■■ オーバーロード解決(" << name << ")" );
+
+	UserProc *result = _OverloadSolution( name, subs, isEnabledReturnType );
+
+	trace_for_overload( "■■■ ここまで" );
+	trace_for_overload( "■■■■■■■■■■■■■■■■■■" );
+	trace_for_overload( "" );
+
+	return result;
+}
+
+void ParamImpl::ApplyDefaultParameters( const Parameters &params ){
+	if( ParmsNum == (int)params.size() ){
+		// デフォルト引数の適用が不必要なとき
+		return;
+	}
+
+	while( ParmsNum < (int)params.size() ){
+		Parameter &param = *params[ParmsNum];
+
+		Parms[ParmsNum]=(char *)HeapAlloc(hHeap,0,param.GetInitValue().size() + 1 );
+		lstrcpy(Parms[ParmsNum],param.GetInitValue().c_str() );
+		ParmsNum++;
+	}
+}
+
+bool ParamImpl::ErrorCheck( const string &procName, const Parameters &params, int SecondParmNum ){
+	if( SecondParmNum == -1 ) SecondParmNum = (int)params.size();
+
+	if(ParmsNum>(int)params.size() && params.size() != 0){
+		if(params[params.size()-1]->GetBasicType()!=DEF_ELLIPSE){
+			//パラメータが多すぎるとき
+			SetError(10,procName,cp);
+			return false;
+		}
+	}
+	else if(ParmsNum<(int)params.size()){
+		if(ParmsNum<SecondParmNum){
+			if(params[ParmsNum]->GetBasicType()==DEF_ELLIPSE){
+				return true;
+			}
+
+			//パラメータが少なすぎるとき
+			SetError(10,procName,cp);
+			return false;
+		}
+
+		//省略パラメータに "0" を指定する
+		for(;ParmsNum < (int)params.size();ParmsNum++){
+			extern HANDLE hHeap;
+			char temporary[64];
+			if(params[ParmsNum]->IsRef() == false) lstrcpy(temporary,"0");
+			else sprintf(temporary,"%c%c0",1,ESC_BYVAL);
+			Parms[ParmsNum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+			lstrcpy(Parms[ParmsNum],temporary);
+		}
+	}
+
+	return true;
+}
+
+void ParamImpl::MacroParameterSupport( const Parameters &params ){
+	for(int i=0;i<ParmsNum;i++){
+		if(Parms[i][0]=='\0'){
+			extern HANDLE hHeap;
+			char temporary[64];
+			if( params[i]->IsRef() == false ) lstrcpy(temporary,"0");
+			else sprintf(temporary,"%c%c0",1,ESC_BYVAL);
+			HeapDefaultFree(Parms[i]);
+			Parms[i]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+			lstrcpy(Parms[i],temporary);
+		}
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Parameter.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Parameter.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Parameter.h	(revision 178)
@@ -0,0 +1,113 @@
+#pragma once
+
+#include "Type.h"
+
+class Parameter : public Type
+{
+	string varName;
+	bool isRef;
+	bool isArray;
+	int subScripts[MAX_ARRAYDIM];
+
+	const string initValue;
+
+public:
+	Parameter( const string &varName, const Type &type, bool isRef = false, const string initValue = "" ):
+		Type( type ),
+		varName( varName ),
+		isRef( isRef ),
+		isArray( false ),
+		initValue( initValue )
+	{
+		subScripts[0] = -1;
+	}
+	Parameter( const Parameter &param ):
+		Type( param ),
+		varName( param.varName ),
+		isRef( param.isRef ),
+		isArray( false ),
+		initValue( param.initValue )
+	{
+		subScripts[0] = -1;
+		if( param.isArray ){
+			SetArray( param.subScripts );
+		}
+	}
+	~Parameter(){}
+
+	void SetArray( const int *pSubScripts ){
+		isArray = true;
+		memcpy( this->subScripts, pSubScripts, sizeof(int) * MAX_ARRAYDIM );
+	}
+
+	const string &GetVarName() const
+	{
+		return varName;
+	}
+
+	bool IsRef() const
+	{
+		return isRef;
+	}
+	bool IsArray(){
+		return isArray;
+	}
+	int *GetSubScriptsPtr(){
+		return subScripts;
+	}
+
+	const string &GetInitValue() const
+	{
+		return initValue;
+	}
+
+	bool Equals( const Parameter &param ) const
+	{
+		if( Type::Equals( param ) ){
+			return true;
+		}
+		else{
+
+			if( this->isRef && this->GetBasicType() == DEF_ANY &&
+				param.isRef == false && param.IsPointer()
+				||
+				this->isRef == false && this->IsPointer() &&
+				param.isRef && param.GetBasicType() == DEF_ANY ){
+					/* ByRef var As Any
+							と
+						var As VoidPtr
+						は同等
+					*/
+					return true;
+			}
+		}
+
+		return false;
+	}
+};
+
+class Parameters : public vector<Parameter *>
+{
+public:
+
+	bool Equals( const Parameters &params ) const
+	{
+		if( this->size() != params.size() ){
+			return false;
+		}
+
+		int max = (int)this->size();
+		for( int i=0; i<max; i++ ){
+			if( !(*this)[i]->Equals( *params[i] ) ){
+				return false;
+			}
+		}
+
+		return true;
+	}
+
+	int GetMemorySize() const
+	{
+		return (int)this->size() * PTR_SIZE;
+	}
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Procedure.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Procedure.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Procedure.cpp	(revision 178)
@@ -0,0 +1,955 @@
+#include "common.h"
+
+string UserProc::GetFullName() const
+{
+	if( HasParentClass() ){
+		return GetParentClass().GetName() + "." + GetName();
+	}
+
+	return GetName();
+}
+bool UserProc::SetParamsAndReturnType( const char *sourceOfParams, int nowLine, bool isStatic ){
+	int i = 0;
+	int i2,i3,sw;
+	char temporary[8192],temp2[VN_SIZE];
+
+	//ソースコードの位置
+	this->codePos = nowLine;
+
+	//パラメータ
+	if(sourceOfParams[i]!='('){
+		SetError(1,NULL,nowLine);
+		return 0;
+	}
+	i++;
+	if(sourceOfParams[i]!=')'&& this->pParentClass ){
+		//クラスのメンバ関数の場合のみ、デストラクタにパラメータがある場合にエラーをだす
+		if(this->GetName()[0]=='~'){
+			SetError(114,NULL,nowLine);
+			i=JumpStringInPare(sourceOfParams,i);
+		}
+	}
+	while(1){
+		if(sourceOfParams[i]==')') break;
+
+		//ByRef
+		bool isRef;
+		if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYVAL){
+			isRef = false;
+			i+=2;
+		}
+		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYREF){
+			isRef = true;
+			i+=2;
+		}
+		else isRef = false;
+
+		//パラメータ名
+		bool isArray = false;
+		int subScripts[MAX_ARRAYDIM];
+		char name[VN_SIZE];
+		sw=0;
+		for(i2=0;;i++,i2++){
+			if(sourceOfParams[i]=='('){
+				if(!sw) sw=1;
+
+				i3=GetStringInPare(name+i2,sourceOfParams+i);
+				i2+=i3-1;
+				i+=i3-1;
+				continue;
+			}
+			if(sourceOfParams[i]=='['){
+				if(!sw) sw=1;
+
+				i3=GetStringInBracket(name+i2,sourceOfParams+i);
+				i2+=i3-1;
+				i+=i3-1;
+				continue;
+			}
+			if(!IsVariableChar(sourceOfParams[i])){
+				name[i2]=0;
+				break;
+			}
+			name[i2]=sourceOfParams[i];
+		}
+		if(sw){
+			//配列パラメータ
+			if( isRef == false ) SetError(29,NULL,nowLine);
+			isArray = true;
+
+			if((name[i2-2]=='('&&name[i2-1]==')')||
+				(name[i2-2]=='['&&name[i2-1]==']')){
+				subScripts[0]=LONG_MAX;
+				subScripts[1]=-1;
+
+				name[i2-2]=0;
+			}
+			else{
+				GetArrange(name,temp2,subScripts);
+				lstrcpy(name,temp2);
+			}
+
+			i2=lstrlen(name);
+		}
+
+		Type type( DEF_NON );
+		char initValue[8192] = "";
+		if( sourceOfParams[i] == '=' ){
+			i++;
+			i = GetOneParameter( sourceOfParams, i, initValue );
+
+			//エラー用
+			cp = nowLine;
+
+			NumOpe_GetType( initValue, Type::String(), type );
+		}
+		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_AS){
+			// As指定
+			i+=2;
+
+			i2=0;
+			while(sourceOfParams[i]=='*'){
+				temporary[i2]=sourceOfParams[i];
+				i++;
+				i2++;
+			}
+			for(;;i++,i2++){
+				if(!IsVariableChar(sourceOfParams[i])){
+					if(sourceOfParams[i]==1&&(sourceOfParams[i+1]==ESC_FUNCTION||sourceOfParams[i+1]==ESC_SUB)){
+						temporary[i2++]=sourceOfParams[i++];
+						temporary[i2]=sourceOfParams[i];
+						continue;
+					}
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=sourceOfParams[i];
+			}
+
+			Type::StringToType( temporary, type );
+
+			if( type.IsNull() ){
+				SetError(3,temporary,nowLine);
+				type.SetBasicType( DEF_PTR_VOID );
+			}
+
+			if( type.IsObject() ){
+				if( type.GetClass().IsBlittableType() ){
+					// Blittable型のときは基本型として扱う
+					type = type.GetClass().GetBlittableType();
+				}
+			}
+		}
+		else{
+			type.SetBasicType( GetTypeFromSimpleName(temporary) );
+			SetError(-103,temporary,nowLine);
+		}
+
+		Parameter *pParam = new Parameter( name, type, isRef, initValue );
+		if( isArray ){
+			pParam->SetArray( subScripts );
+		}
+
+		//パラメータを追加
+		this->params.push_back( pParam );
+
+/*		if( type.IsObject() && type.GetClass().IsInterface() ){
+			// インターフェイスが引数だったとき
+			// vtblOffsetを引き渡すための引数も用意しておく
+			this->params.push_back( new Parameter( ((string)name + "_vtbl").c_str(), Type(DEF_LONG) ) );
+		}*/
+
+		if(sourceOfParams[i]==','){
+			i++;
+			continue;
+		}
+		else if(sourceOfParams[i]==')') continue;
+		else{
+			SetError(1,NULL,nowLine);
+			break;
+		}
+	}
+	this->secondParmNum = (int)this->params.size();
+	i++;
+	if(sourceOfParams[i]=='('){
+		i++;
+		while(1){
+			if(sourceOfParams[i]==')') break;
+
+			//ByRef
+			bool isRef;
+			if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYVAL){
+				isRef = false;
+				i+=2;
+			}
+			else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYREF){
+				isRef = true;
+				i+=2;
+			}
+			else isRef = false;
+
+			//パラメータ名
+			bool isArray = false;
+			int subScripts[MAX_ARRAYDIM];
+			char name[VN_SIZE];
+			sw=0;
+			for(i2=0;;i++,i2++){
+				if(sourceOfParams[i]=='('){
+					if(!sw) sw=1;
+
+					i3=GetStringInPare(name+i2,sourceOfParams+i);
+					i2+=i3-1;
+					i+=i3-1;
+					continue;
+				}
+				if(sourceOfParams[i]=='['){
+					if(!sw) sw=1;
+
+					i3=GetStringInBracket(name+i2,sourceOfParams+i);
+					i2+=i3-1;
+					i+=i3-1;
+					continue;
+				}
+				if(!IsVariableChar(sourceOfParams[i])){
+					name[i2]=0;
+					break;
+				}
+				name[i2]=sourceOfParams[i];
+			}
+			if(sw){
+				//配列パラメータ
+				if( isRef == false ) SetError(29,NULL,nowLine);
+				isArray = true;
+
+				if((name[i2-2]=='('&&name[i2-1]==')')||
+					(name[i2-2]=='['&&name[i2-1]==']')){
+					subScripts[0]=LONG_MAX;
+					subScripts[1]=-1;
+
+					name[i2-2]=0;
+				}
+				else{
+					GetArrange(name,temp2,subScripts);
+					lstrcpy(name,temp2);
+				}
+
+				i2=lstrlen(name);
+			}
+
+			//型
+			Type type( DEF_NON );
+			if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_AS){
+				i+=2;
+
+				i2=0;
+				while(sourceOfParams[i]=='*'){
+					temporary[i2]=sourceOfParams[i];
+					i++;
+					i2++;
+				}
+				for(;;i++,i2++){
+					if(!IsVariableChar(sourceOfParams[i])){
+						if(sourceOfParams[i]==1&&(sourceOfParams[i+1]==ESC_FUNCTION||sourceOfParams[i+1]==ESC_SUB)){
+							temporary[i2++]=sourceOfParams[i++];
+							temporary[i2]=sourceOfParams[i];
+							continue;
+						}
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=sourceOfParams[i];
+				}
+
+				Type::StringToType( temporary, type );
+
+				if( type.IsNull() ){
+					SetError(3,temporary,nowLine);
+					type.SetBasicType( DEF_PTR_VOID );
+				}
+			}
+			else{
+				type.SetBasicType( GetTypeFromSimpleName(temporary) );
+				SetError(-103,temporary,nowLine);
+			}
+
+			Parameter *pParam = new Parameter( name, type, isRef );
+			if( isArray ){
+				pParam->SetArray( subScripts );
+			}
+
+			//パラメータを追加
+			this->params.push_back( pParam );
+
+			if(sourceOfParams[i]==','){
+				i++;
+				continue;
+			}
+			else if(sourceOfParams[i]==')') continue;
+			else{
+				SetError(1,NULL,nowLine);
+				break;
+			}
+		}
+		i++;
+	}
+
+	if(sourceOfParams[i]){
+		///////////////////
+		// 戻り値を取得
+		///////////////////
+
+		if( !this->IsFunction() ){
+			// Sub/Macroの場合
+			SetError(38,this->GetName(),nowLine);
+		}
+
+		if( this->pParentClass ){
+			if( this->GetName() == this->pParentClass->GetName() ||
+				this->GetName()[0]=='~'){
+				//クラスのコンストラクタ、デストラクタがFunction定義の場合はエラーをだす
+				SetError(115,NULL,nowLine);
+			}
+		}
+
+
+		i2=lstrlen(sourceOfParams)-2;
+
+		int sw_as=0;
+		for(;i2>0;i2--){
+			if(sourceOfParams[i2]==')') break;
+
+			if(sourceOfParams[i2]==1&&sourceOfParams[i2+1]==ESC_AS){
+				i2+=2;
+				i3=0;
+				while(sourceOfParams[i2]=='*') temporary[i3++]=sourceOfParams[i2++];
+				for(;;i2++,i3++){
+					if(!IsVariableChar(sourceOfParams[i2])){
+						temporary[i3]=0;
+						break;
+					}
+					temporary[i3]=sourceOfParams[i2];
+				}
+				Type::StringToType( temporary, this->returnType );
+				if( this->returnType.IsNull() ) SetError(3,temporary,nowLine);
+
+				sw_as=1;
+				break;
+			}
+		}
+
+		if(!sw_as){
+			SetError(-104,this->GetName().c_str(),nowLine);
+
+			this->returnType.SetBasicType( DEF_DOUBLE );
+		}
+	}
+	else{
+		//戻り値なしのSub定義
+		this->returnType.SetNull();
+	}
+
+	//リアルパラメータ領域を取得（_System_LocalThisを考慮して2つだけ多く確保する場合がある）
+
+	if( this->pParentClass && isStatic == false ){
+		//オブジェクトメンバの場合は、第一パラメータを_System_LocalThis引き渡し用として利用
+		string name = "_System_LocalThis";
+		Type type( DEF_PTR_VOID );
+		this->realParams.push_back( new Parameter( name, type ) );
+	}
+
+	if( this->returnType.IsStruct() ){
+		//構造体を戻り値として持つ場合
+		//※第一パラメータ（Thisポインタありの場合は第二パラメータ）を戻り値用の参照宣言にする
+
+		string name = this->GetName();
+		if(name[0]==1&&name[1]==ESC_OPERATOR){
+			name="_System_ReturnValue";
+		}
+		Type type( DEF_STRUCT, this->returnType.GetIndex() );
+		this->realParams.push_back( new Parameter( name, type, true ) );
+	}
+
+	//パラメータをコピー
+	foreach( Parameter *pParam, params ){
+		this->realParams.push_back( new Parameter( *pParam ) );
+	}
+
+	return true;
+}
+bool UserProc::IsVirtual() const
+{
+	if( pMethod == NULL ){
+		return false;
+	}
+	return ( pMethod->IsVirtual() != 0 );
+}
+const NamespaceScopes &UserProc::GetNamespaceScopes() const
+{
+	if( !pParentClass ){
+		SetError();
+	}
+	return pParentClass->GetNamespaceScopes();
+}
+const NamespaceScopesCollection &UserProc::GetImportedNamespaces() const
+{
+	if( !pParentClass ){
+		SetError();
+	}
+	return pParentClass->GetImportedNamespaces();
+}
+bool UserProc::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	SetError();
+	return false;
+}
+
+/*
+GlobalProc *GlobalProc::Create( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine ){
+	int i2;
+	char temporary[8192];
+
+	int i=1;
+
+	Procedure::Kind kind = Procedure::Sub;
+	bool isMacro = false;
+	if(buffer[i]==ESC_FUNCTION) kind = Procedure::Function;
+	if(buffer[i]==ESC_MACRO){
+		isMacro = true;
+	}
+
+	i++;
+
+	bool isCdecl = false;
+	bool isExport = false;
+	while(1){
+		if(buffer[i]==1&&buffer[i+1]==ESC_CDECL&& isCdecl == false ){
+			isCdecl = true;
+
+			i+=2;
+		}
+		else if(buffer[i]==1&&buffer[i+1]==ESC_EXPORT&& isExport == false ){
+			isExport = true;
+
+			i+=2;
+		}
+		else break;
+	}
+
+	i2=0;
+	if(buffer[i]==1&&buffer[i+1]==ESC_OPERATOR){
+		SetError(126,NULL,nowLine);
+		return 0;
+	}
+	else{
+		for(;;i++,i2++){
+			if(!IsVariableChar(buffer[i])){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=buffer[i];
+		}
+	}
+
+	if( isMacro ){
+		//大文字に変換
+		CharUpper(temporary);
+
+		//マクロ関数の場合は名前リストに追加
+		extern char **ppMacroNames;
+		extern int MacroNum;
+		ppMacroNames=(char **)HeapReAlloc(hHeap,0,ppMacroNames,(MacroNum+1)*sizeof(char *));
+		ppMacroNames[MacroNum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+		lstrcpy(ppMacroNames[MacroNum],temporary);
+		MacroNum++;
+	}
+
+	//重複チェック
+	if(GetDeclareHash(temporary)){
+		SetError(15,temporary,nowLine);
+		return 0;
+	}
+
+	extern int SubNum;
+	SubNum++;
+
+	GlobalProc *pGlobalProc = new GlobalProc( namespaceScopes, temporary, kind, isMacro, isCdecl, isExport );
+
+	//ID
+	static int id_base=0;
+	pGlobalProc->id = (id_base++);
+
+	if(isExport){
+		pGlobalProc->Using();
+	}
+
+	// パラメータを解析
+	// ※第1パラメータにに指定するデータの例："( s As String ) As String"
+	pGlobalProc->SetParamsAndReturnType( buffer + i, nowLine, true );
+
+
+	pGlobalProc->_paramStr = buffer + i;
+
+
+
+	return pGlobalProc;
+}
+bool GlobalProc::AddGlobalProc( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine ){
+	GlobalProc *pGlobalProc = Create( namespaceScopes, buffer, nowLine );
+	if( pGlobalProc == NULL ){
+		return false;
+	}
+
+
+	/////////////////////////////////
+	// ハッシュデータに追加
+	/////////////////////////////////
+
+	int key;
+	key=hash_default(pGlobalProc->GetName().c_str());
+
+	extern GlobalProc **ppSubHash;
+	if(ppSubHash[key]){
+		GlobalProc *psi2;
+		psi2=ppSubHash[key];
+		while(1){
+			//重複エラーチェックを行う
+			if( pGlobalProc->GetName() == psi2->GetName() ){
+				if( Parameter::Equals( psi2->Params(), pGlobalProc->Params() ) ){
+					SetError(15,pGlobalProc->GetName().c_str(),nowLine);
+					return 0;
+				}
+			}
+
+			if(psi2->pNextData==0) break;
+			psi2=psi2->pNextData;
+		}
+		psi2->pNextData=pGlobalProc;
+	}
+	else{
+		ppSubHash[key]=pGlobalProc;
+	}
+
+	return true;
+}*/
+const NamespaceScopes &GlobalProc::GetNamespaceScopes() const
+{
+	if( HasParentClass() ){
+		return GetParentClassPtr()->GetNamespaceScopes();
+	}
+	return namespaceScopes;
+}
+bool GlobalProc::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	if( GetName() != name ){
+		return false;
+	}
+
+	return NamespaceScopes::IsSameArea( GetNamespaceScopes(), namespaceScopes );
+}
+bool GlobalProc::IsEqualSymbol( const GlobalProc &globalProc ) const
+{
+	return IsEqualSymbol( globalProc.GetNamespaceScopes(), globalProc.GetName() );
+}
+bool GlobalProc::IsEqualSymbol( const string &fullName ) const
+{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
+
+	return IsEqualSymbol( NamespaceScopes( AreaName ), NestName );
+}
+
+bool DllProc::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	if( GetName() != name ){
+		return false;
+	}
+	return NamespaceScopes::IsSameArea( this->namespaceScopes, namespaceScopes );
+}
+bool DllProc::IsEqualSymbol( const string &fullName ) const
+{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
+
+	if( IsEqualSymbol( NamespaceScopes( AreaName ), NestName ) ){
+		return true;
+	}
+
+	if( isNest ){
+		// 静的メンバを考慮
+
+		char AreaName2[VN_SIZE] = "";		//オブジェクト変数
+		char NestName2[VN_SIZE] = "";		//入れ子メンバ
+		bool isNest = SplitMemberName( AreaName, AreaName2, NestName2 );
+		lstrcat( NestName2, "." );
+		lstrcat( NestName2, NestName );
+
+		return IsEqualSymbol( NamespaceScopes( AreaName2 ), NestName2 );
+	}
+
+	return false;
+}
+
+
+bool DllProc::SetParamsAndReturnType( const char *sourceOfParams, int nowLine ){
+	int i = 0;
+	int i2,i3,sw;
+	char temporary[8192],temp2[VN_SIZE];
+
+	//ソースコードの位置
+	this->codePos = nowLine;
+
+	//パラメータ
+	if(sourceOfParams[i]!='('){
+		SetError(1,NULL,nowLine);
+		return 0;
+	}
+	i++;
+
+	while(1){
+		if(sourceOfParams[i]==')') break;
+
+		//ByRef
+		bool isRef;
+		if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYVAL){
+			isRef = false;
+			i+=2;
+		}
+		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYREF){
+			isRef = true;
+			i+=2;
+		}
+		else isRef = false;
+
+		//パラメータ名
+		bool isArray = false;
+		int subScripts[MAX_ARRAYDIM];
+		char name[VN_SIZE];
+		sw=0;
+		for(i2=0;;i++,i2++){
+			if(sourceOfParams[i]=='('){
+				if(!sw) sw=1;
+
+				i3=GetStringInPare(name+i2,sourceOfParams+i);
+				i2+=i3-1;
+				i+=i3-1;
+				continue;
+			}
+			if(sourceOfParams[i]=='['){
+				if(!sw) sw=1;
+
+				i3=GetStringInBracket(name+i2,sourceOfParams+i);
+				i2+=i3-1;
+				i+=i3-1;
+				continue;
+			}
+			if(!IsVariableChar(sourceOfParams[i])){
+				name[i2]=0;
+				break;
+			}
+			name[i2]=sourceOfParams[i];
+		}
+		if(sw){
+			//配列パラメータ
+			if( isRef == false ) SetError(29,NULL,nowLine);
+			isArray = true;
+
+			if((name[i2-2]=='('&&name[i2-1]==')')||
+				(name[i2-2]=='['&&name[i2-1]==']')){
+				subScripts[0]=LONG_MAX;
+				subScripts[1]=-1;
+
+				name[i2-2]=0;
+			}
+			else{
+				GetArrange(name,temp2,subScripts);
+				lstrcpy(name,temp2);
+			}
+
+			i2=lstrlen(name);
+		}
+
+		//型
+		Type type( DEF_NON );
+		if(lstrcmp(name,"...")==0) type.SetBasicType( DEF_ELLIPSE );
+		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_AS){
+			i+=2;
+
+			i2=0;
+			while(sourceOfParams[i]=='*'){
+				temporary[i2]=sourceOfParams[i];
+				i++;
+				i2++;
+			}
+			for(;;i++,i2++){
+				if(!IsVariableChar(sourceOfParams[i])){
+					if(sourceOfParams[i]==1&&(sourceOfParams[i+1]==ESC_FUNCTION||sourceOfParams[i+1]==ESC_SUB)){
+						temporary[i2++]=sourceOfParams[i++];
+						temporary[i2]=sourceOfParams[i];
+						continue;
+					}
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=sourceOfParams[i];
+			}
+
+			Type::StringToType( temporary, type );
+
+			if( type.IsNull() ){
+				SetError(3,temporary,nowLine);
+				type.SetBasicType( DEF_PTR_VOID );
+			}
+		}
+		else{
+			type.SetBasicType( GetTypeFromSimpleName(temporary) );
+			SetError(-103,temporary,nowLine);
+		}
+
+		Parameter *pParam = new Parameter( name, type, isRef );
+		if( isArray ){
+			pParam->SetArray( subScripts );
+		}
+
+		//パラメータを追加
+		this->params.push_back( pParam );
+
+		if(sourceOfParams[i]==','){
+			i++;
+			continue;
+		}
+		else if(sourceOfParams[i]==')') continue;
+		else{
+			SetError(1,NULL,nowLine);
+			break;
+		}
+	}
+	i++;
+
+	if(sourceOfParams[i]){
+		///////////////////
+		// 戻り値を取得
+		///////////////////
+
+		i2=lstrlen(sourceOfParams)-2;
+
+		int sw_as=0;
+		for(;i2>0;i2--){
+			if(sourceOfParams[i2]==')') break;
+
+			if(sourceOfParams[i2]==1&&sourceOfParams[i2+1]==ESC_AS){
+				i2+=2;
+				i3=0;
+				while(sourceOfParams[i2]=='*') temporary[i3++]=sourceOfParams[i2++];
+				for(;;i2++,i3++){
+					if(!IsVariableChar(sourceOfParams[i2])){
+						temporary[i3]=0;
+						break;
+					}
+					temporary[i3]=sourceOfParams[i2];
+				}
+				Type::StringToType( temporary, this->returnType );
+				if( this->returnType.IsNull() ) SetError(3,temporary,nowLine);
+
+				sw_as=1;
+				break;
+			}
+		}
+	}
+	else{
+		//戻り値なしのSub定義
+		this->returnType.SetNull();
+	}
+
+	return true;
+}
+
+bool ProcPointer::SetParamsAndReturnType( const char *sourceOfParams, int nowLine ){
+	int i = 0;
+	int i2,i3,sw;
+	char temporary[8192],temp2[VN_SIZE];
+
+	//ソースコードの位置
+	this->codePos = nowLine;
+
+	//パラメータ
+	if(sourceOfParams[i]!='('){
+		SetError(1,NULL,nowLine);
+		return 0;
+	}
+	i++;
+	while(1){
+		if(sourceOfParams[i]==')') break;
+
+		//ByRef
+		bool isRef;
+		if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYVAL){
+			isRef = false;
+			i+=2;
+		}
+		else if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_BYREF){
+			isRef = true;
+			i+=2;
+		}
+		else isRef = false;
+
+		//パラメータ名
+		bool isArray = false;
+		int subScripts[MAX_ARRAYDIM];
+		char name[VN_SIZE];
+		sw=0;
+		for(i2=0;;i++,i2++){
+			if(sourceOfParams[i]=='('){
+				if(!sw) sw=1;
+
+				i3=GetStringInPare(name+i2,sourceOfParams+i);
+				i2+=i3-1;
+				i+=i3-1;
+				continue;
+			}
+			if(sourceOfParams[i]=='['){
+				if(!sw) sw=1;
+
+				i3=GetStringInBracket(name+i2,sourceOfParams+i);
+				i2+=i3-1;
+				i+=i3-1;
+				continue;
+			}
+			if(!IsVariableChar(sourceOfParams[i])){
+				name[i2]=0;
+				break;
+			}
+			name[i2]=sourceOfParams[i];
+		}
+		if(sw){
+			//配列パラメータ
+			if( isRef == false ) SetError(29,NULL,nowLine);
+			isArray = true;
+
+			if((name[i2-2]=='('&&name[i2-1]==')')||
+				(name[i2-2]=='['&&name[i2-1]==']')){
+				subScripts[0]=LONG_MAX;
+				subScripts[1]=-1;
+
+				name[i2-2]=0;
+			}
+			else{
+				GetArrange(name,temp2,subScripts);
+				lstrcpy(name,temp2);
+			}
+
+			i2=lstrlen(name);
+		}
+
+		//型
+		Type type( DEF_NON );
+		if(sourceOfParams[i]==1&&sourceOfParams[i+1]==ESC_AS){
+			i+=2;
+
+			i2=0;
+			while(sourceOfParams[i]=='*'){
+				temporary[i2]=sourceOfParams[i];
+				i++;
+				i2++;
+			}
+			for(;;i++,i2++){
+				if(!IsVariableChar(sourceOfParams[i])){
+					if(sourceOfParams[i]==1&&(sourceOfParams[i+1]==ESC_FUNCTION||sourceOfParams[i+1]==ESC_SUB)){
+						temporary[i2++]=sourceOfParams[i++];
+						temporary[i2]=sourceOfParams[i];
+						continue;
+					}
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=sourceOfParams[i];
+			}
+
+			Type::StringToType( temporary, type );
+
+			if( type.IsNull() ){
+				SetError(3,temporary,nowLine);
+				type.SetBasicType( DEF_PTR_VOID );
+			}
+		}
+		else{
+			type.SetBasicType( GetTypeFromSimpleName(temporary) );
+			SetError(-103,temporary,nowLine);
+		}
+
+		Parameter *pParam = new Parameter( name, type, isRef );
+		if( isArray ){
+			pParam->SetArray( subScripts );
+		}
+
+		//パラメータを追加
+		this->params.push_back( pParam );
+
+		if(sourceOfParams[i]==','){
+			i++;
+			continue;
+		}
+		else if(sourceOfParams[i]==')') continue;
+		else{
+			SetError(1,NULL,nowLine);
+			break;
+		}
+	}
+	i++;
+
+	if(sourceOfParams[i]){
+		///////////////////
+		// 戻り値を取得
+		///////////////////
+
+		i2=lstrlen(sourceOfParams)-2;
+
+		int sw_as=0;
+		for(;i2>0;i2--){
+			if(sourceOfParams[i2]==')') break;
+
+			if(sourceOfParams[i2]==1&&sourceOfParams[i2+1]==ESC_AS){
+				i2+=2;
+				i3=0;
+				while(sourceOfParams[i2]=='*') temporary[i3++]=sourceOfParams[i2++];
+				for(;;i2++,i3++){
+					if(!IsVariableChar(sourceOfParams[i2])){
+						temporary[i3]=0;
+						break;
+					}
+					temporary[i3]=sourceOfParams[i2];
+				}
+				Type::StringToType( temporary, this->returnType );
+				if( this->returnType.IsNull() ) SetError(3,temporary,nowLine);
+
+				sw_as=1;
+				break;
+			}
+		}
+	}
+	else{
+		//戻り値なしのSub定義
+		this->returnType.SetNull();
+	}
+
+	//戻り値のエラーチェック
+	if( IsFunction() ){
+		// Function定義
+
+		if( this->ReturnType().IsNull() ){
+			// 戻り値がない
+			SetError(26,this->GetName(),nowLine);
+		}
+	}
+	else{
+		if( !this->ReturnType().IsNull() ){
+			// Sub定義なのに、戻り値がある
+			SetError(38,this->GetName(),nowLine);
+		}
+	}
+
+	return true;
+}
+
+UserProc *UserProc::pCompilingUserProc = NULL;
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Procedure.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Procedure.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Procedure.h	(revision 178)
@@ -0,0 +1,347 @@
+#pragma once
+
+#include <Namespace.h>
+#include "Parameter.h"
+#include "Variable.h"
+
+class CClass;
+class CMethod;
+
+class Procedure{
+public:
+	// 種類
+	enum Kind{
+		Sub,
+		Function,
+	};
+
+private:
+	const string name;						// プロシージャ名
+
+	Kind kind;
+
+	bool isCdecl;
+	bool isUsing;
+
+protected:
+
+	// パラメータ
+	Parameters params;
+
+	// 戻り値の型
+	Type returnType;
+
+	// ソースコードの位置
+	int codePos;
+
+public:
+	Procedure( const string &name, Kind kind, bool isCdecl ):
+	  name( name ),
+	  kind( kind ),
+	  isCdecl( isCdecl ),
+	  isUsing( false ),
+	  codePos( -1 )
+	{}
+	~Procedure(){
+		foreach( Parameter *pParam, params ){
+			delete pParam;
+		}
+	}
+
+	const string &GetName() const
+	{
+		return name;
+	}
+
+	bool IsSub() const
+	{
+		return ( kind == Sub );
+	}
+	bool IsFunction() const
+	{
+		return ( kind == Function );
+	}
+
+	bool IsCdecl() const
+	{
+		return isCdecl;
+	}
+	void Using(){
+		isUsing = true;
+	}
+	bool IsUsing() const
+	{
+		return isUsing;
+	}
+
+	int GetCodePos() const
+	{
+		return codePos;
+	}
+
+	const Parameters &Params() const
+	{
+		return params;
+	}
+	const Type &ReturnType() const
+	{
+		return returnType;
+	}
+};
+
+class UserProc : public Procedure
+{
+public:
+	string _paramStr;
+
+private:
+	bool isMacro;
+
+	// パラメータの追加情報
+	int secondParmNum;
+	Parameters realParams;
+	int realSecondParmNum;
+
+	// 親クラスと対応するメソッド
+	const CClass *pParentClass;
+	CMethod *pMethod;
+
+	// 各種フラグ
+	bool isExport;
+	bool isSystem;
+	bool isAutoGeneration;
+	bool isCompiled;
+
+public:
+
+	UserProc( const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ):
+	  Procedure( name, kind, isCdecl ),
+	  isMacro( isMacro ),
+	  pParentClass( NULL ),
+	  pMethod( NULL ),
+	  isExport( isExport ),
+	  isSystem( false ),
+	  isAutoGeneration( false ),
+	  isCompiled( false ),
+	  beginOpAddress( 0 ),
+	  endOpAddress( 0 )
+	{
+	}
+	~UserProc(){
+		foreach( Parameter *pParam, realParams ){
+			delete pParam;
+		}
+	}
+
+	string GetFullName() const;
+
+	bool IsMacro() const
+	{
+		return isMacro;
+	}
+
+	virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine, bool isStatic );
+
+	int GetSecondParmNum() const
+	{
+		return secondParmNum;
+	}
+	const Parameters &RealParams() const
+	{
+		return realParams;
+	}
+	int GetRealSecondParmNum() const
+	{
+		return realSecondParmNum;
+	}
+
+	void SetParentClass( const CClass *pParentClass ){
+		this->pParentClass = pParentClass;
+	}
+	const CClass *GetParentClassPtr() const
+	{
+		return pParentClass;
+	}
+	const CClass &GetParentClass() const
+	{
+		return *pParentClass;
+	}
+	bool HasParentClass() const
+	{
+		return ( pParentClass != NULL );
+	}
+	void SetMethod( CMethod *pMethod ){
+		this->pMethod = pMethod;
+	}
+
+	void ExportOff(){
+		isExport = false;
+	}
+	bool IsExport() const
+	{
+		return isExport;
+	}
+	void ThisIsSystemProc(){
+		isSystem = true;
+	}
+	bool IsSystem() const
+	{
+		return isSystem;
+	}
+	void ThisIsAutoGenerationProc(){
+		isAutoGeneration = true;
+	}
+	bool IsAutoGeneration(){
+		return isAutoGeneration;
+	}
+	void CompleteCompile(){
+		isCompiled = true;
+	}
+	void KillCompileStatus(){
+		isCompiled = false;
+	}
+	bool IsCompiled() const
+	{
+		return isCompiled;
+	}
+	bool IsDestructor() const
+	{
+		return ( GetName()[0] == '~' );
+	}
+	bool IsVirtual() const;
+
+	// バイナリコードの位置
+	DWORD beginOpAddress;
+	DWORD endOpAddress;
+	int GetCodeSize() const
+	{
+		return endOpAddress - beginOpAddress;
+	}
+
+	virtual const NamespaceScopes &GetNamespaceScopes() const;
+	virtual const NamespaceScopesCollection &GetImportedNamespaces() const;
+	virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+
+	// ローカル変数
+	Variables localVars;
+
+	// TODO: 適切なコードへ直す
+	long id;
+
+
+	/////////////////////////////////////////////////////////////////
+	// コンパイル中の関数を管理
+	/////////////////////////////////////////////////////////////////
+private:
+	static UserProc *pCompilingUserProc;
+public:
+	static void CompileStartForGlobalArea(){
+		pCompilingUserProc = NULL;
+	}
+	static void CompileStartForUserProc( UserProc *pUserProc ){
+		pCompilingUserProc = pUserProc;
+	}
+	static bool IsGlobalAreaCompiling(){
+		return ( pCompilingUserProc == NULL );
+	}
+	static bool IsLocalAreaCompiling(){
+		return ( pCompilingUserProc != NULL );
+	}
+	static UserProc &CompilingUserProc(){
+		return *pCompilingUserProc;
+	}
+};
+
+class GlobalProc : public UserProc
+{
+	const NamespaceScopes namespaceScopes;
+	const NamespaceScopesCollection importedNamespaces;
+public:
+	// ハッシュリスト用
+	GlobalProc *pNextData;
+
+	GlobalProc( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, const string &name, Kind kind, bool isMacro, bool isCdecl, bool isExport ):
+	  UserProc( name, kind, isMacro, isCdecl, isExport ),
+	  namespaceScopes( namespaceScopes ),
+	  importedNamespaces( importedNamespaces ),
+	  pNextData( NULL )
+	{}
+	~GlobalProc(){}
+/*
+	GlobalProc *Create( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine );
+	bool AddGlobalProc( const NamespaceScopes &namespaceScopes, char *buffer,int nowLine );
+*/
+	virtual const NamespaceScopes &GetNamespaceScopes() const;
+	virtual const NamespaceScopesCollection &GetImportedNamespaces() const
+	{
+		return importedNamespaces;
+	}
+
+	virtual bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	virtual bool IsEqualSymbol( const GlobalProc &globalProc ) const;
+	virtual bool IsEqualSymbol( const string &name ) const;
+};
+
+class DllProc : public Procedure
+{
+	const NamespaceScopes namespaceScopes;
+
+	const string dllFileName;
+	const string alias;
+	int lookupAddress;
+
+public:
+	// ハッシュリスト用
+	DllProc *pNextData;
+
+	DllProc( const NamespaceScopes &namespaceScopes, const string &name, Kind kind, bool isCdecl, const string &dllFileName, const string &alias ):
+	  Procedure( name, kind, isCdecl ),
+	  namespaceScopes( namespaceScopes ),
+	  dllFileName( dllFileName ),
+	  alias( alias ),
+	  lookupAddress( 0 ),
+	  pNextData( NULL )
+	{
+	}
+	~DllProc(){}
+
+	bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	bool IsEqualSymbol( const string &name ) const;
+
+	const NamespaceScopes &GetNamespaceScopes() const
+	{
+		return namespaceScopes;
+	}
+
+	virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine );
+
+	const string &GetDllFileName() const
+	{
+		return dllFileName;
+	}
+	const string &GetAlias() const
+	{
+		return alias;
+	}
+
+	void SetLookupAddress( int lookupAddress ){
+		this->lookupAddress = lookupAddress;
+	}
+	int GetLookupAddress() const
+	{
+		return lookupAddress;
+	}
+
+};
+
+class ProcPointer : public Procedure
+{
+public:
+	ProcPointer( Kind kind ):
+	  Procedure( "", kind, false )
+	{
+	}
+	~ProcPointer(){}
+
+	virtual bool SetParamsAndReturnType( const char *sourceOfParams, int nowLine );
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Psapi.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Psapi.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Psapi.h	(revision 178)
@@ -0,0 +1,364 @@
+/*++ BUILD Version: 0001    // Increment this if a change has global effects
+
+Copyright (c) 1994-1999  Microsoft Corporation
+
+Module Name:
+
+    psapi.h
+
+Abstract:
+
+    Include file for APIs provided by PSAPI.DLL
+
+Author:
+
+    Richard Shupak   [richards]  06-Jan-1994
+
+Revision History:
+
+--*/
+
+#ifndef _PSAPI_H_
+#define _PSAPI_H_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+BOOL
+WINAPI
+EnumProcesses(
+    DWORD * lpidProcess,
+    DWORD   cb,
+    DWORD * cbNeeded
+    );
+
+BOOL
+WINAPI
+EnumProcessModules(
+    HANDLE hProcess,
+    HMODULE *lphModule,
+    DWORD cb,
+    LPDWORD lpcbNeeded
+    );
+
+DWORD
+WINAPI
+GetModuleBaseNameA(
+    HANDLE hProcess,
+    HMODULE hModule,
+    LPSTR lpBaseName,
+    DWORD nSize
+    );
+
+DWORD
+WINAPI
+GetModuleBaseNameW(
+    HANDLE hProcess,
+    HMODULE hModule,
+    LPWSTR lpBaseName,
+    DWORD nSize
+    );
+
+#ifdef UNICODE
+#define GetModuleBaseName  GetModuleBaseNameW
+#else
+#define GetModuleBaseName  GetModuleBaseNameA
+#endif // !UNICODE
+
+
+DWORD
+WINAPI
+GetModuleFileNameExA(
+    HANDLE hProcess,
+    HMODULE hModule,
+    LPSTR lpFilename,
+    DWORD nSize
+    );
+
+DWORD
+WINAPI
+GetModuleFileNameExW(
+    HANDLE hProcess,
+    HMODULE hModule,
+    LPWSTR lpFilename,
+    DWORD nSize
+    );
+
+#ifdef UNICODE
+#define GetModuleFileNameEx  GetModuleFileNameExW
+#else
+#define GetModuleFileNameEx  GetModuleFileNameExA
+#endif // !UNICODE
+
+
+typedef struct _MODULEINFO {
+    LPVOID lpBaseOfDll;
+    DWORD SizeOfImage;
+    LPVOID EntryPoint;
+} MODULEINFO, *LPMODULEINFO;
+
+
+BOOL
+WINAPI
+GetModuleInformation(
+    HANDLE hProcess,
+    HMODULE hModule,
+    LPMODULEINFO lpmodinfo,
+    DWORD cb
+    );
+
+
+BOOL
+WINAPI
+EmptyWorkingSet(
+    HANDLE hProcess
+    );
+
+
+BOOL
+WINAPI
+QueryWorkingSet(
+    HANDLE hProcess,
+    PVOID pv,
+    DWORD cb
+    );
+
+BOOL
+WINAPI
+QueryWorkingSetEx(
+    HANDLE hProcess,
+    PVOID pv,
+    DWORD cb
+    );
+
+BOOL
+WINAPI
+InitializeProcessForWsWatch(
+    HANDLE hProcess
+    );
+
+
+typedef struct _PSAPI_WS_WATCH_INFORMATION {
+    LPVOID FaultingPc;
+    LPVOID FaultingVa;
+} PSAPI_WS_WATCH_INFORMATION, *PPSAPI_WS_WATCH_INFORMATION;
+
+BOOL
+WINAPI
+GetWsChanges(
+    HANDLE hProcess,
+    PPSAPI_WS_WATCH_INFORMATION lpWatchInfo,
+    DWORD cb
+    );
+
+DWORD
+WINAPI
+GetMappedFileNameW(
+    HANDLE hProcess,
+    LPVOID lpv,
+    LPWSTR lpFilename,
+    DWORD nSize
+    );
+
+DWORD
+WINAPI
+GetMappedFileNameA(
+    HANDLE hProcess,
+    LPVOID lpv,
+    LPSTR lpFilename,
+    DWORD nSize
+    );
+
+#ifdef UNICODE
+#define GetMappedFileName  GetMappedFileNameW
+#else
+#define GetMappedFileName  GetMappedFileNameA
+#endif // !UNICODE
+
+BOOL
+WINAPI
+EnumDeviceDrivers(
+    LPVOID *lpImageBase,
+    DWORD cb,
+    LPDWORD lpcbNeeded
+    );
+
+
+DWORD
+WINAPI
+GetDeviceDriverBaseNameA(
+    LPVOID ImageBase,
+    LPSTR lpBaseName,
+    DWORD nSize
+    );
+
+DWORD
+WINAPI
+GetDeviceDriverBaseNameW(
+    LPVOID ImageBase,
+    LPWSTR lpBaseName,
+    DWORD nSize
+    );
+
+#ifdef UNICODE
+#define GetDeviceDriverBaseName  GetDeviceDriverBaseNameW
+#else
+#define GetDeviceDriverBaseName  GetDeviceDriverBaseNameA
+#endif // !UNICODE
+
+
+DWORD
+WINAPI
+GetDeviceDriverFileNameA(
+    LPVOID ImageBase,
+    LPSTR lpFilename,
+    DWORD nSize
+    );
+
+DWORD
+WINAPI
+GetDeviceDriverFileNameW(
+    LPVOID ImageBase,
+    LPWSTR lpFilename,
+    DWORD nSize
+    );
+
+#ifdef UNICODE
+#define GetDeviceDriverFileName  GetDeviceDriverFileNameW
+#else
+#define GetDeviceDriverFileName  GetDeviceDriverFileNameA
+#endif // !UNICODE
+
+// Structure for GetProcessMemoryInfo()
+
+typedef struct _PROCESS_MEMORY_COUNTERS {
+    DWORD cb;
+    DWORD PageFaultCount;
+    SIZE_T PeakWorkingSetSize;
+    SIZE_T WorkingSetSize;
+    SIZE_T QuotaPeakPagedPoolUsage;
+    SIZE_T QuotaPagedPoolUsage;
+    SIZE_T QuotaPeakNonPagedPoolUsage;
+    SIZE_T QuotaNonPagedPoolUsage;
+    SIZE_T PagefileUsage;
+    SIZE_T PeakPagefileUsage;
+} PROCESS_MEMORY_COUNTERS;
+typedef PROCESS_MEMORY_COUNTERS *PPROCESS_MEMORY_COUNTERS;
+
+#if (_WIN32_WINNT >= 0x0501)
+
+typedef struct _PROCESS_MEMORY_COUNTERS_EX {
+    DWORD cb;
+    DWORD PageFaultCount;
+    SIZE_T PeakWorkingSetSize;
+    SIZE_T WorkingSetSize;
+    SIZE_T QuotaPeakPagedPoolUsage;
+    SIZE_T QuotaPagedPoolUsage;
+    SIZE_T QuotaPeakNonPagedPoolUsage;
+    SIZE_T QuotaNonPagedPoolUsage;
+    SIZE_T PagefileUsage;
+    SIZE_T PeakPagefileUsage;
+    SIZE_T PrivateUsage;
+} PROCESS_MEMORY_COUNTERS_EX;
+typedef PROCESS_MEMORY_COUNTERS_EX *PPROCESS_MEMORY_COUNTERS_EX;
+
+#endif
+
+BOOL
+WINAPI
+GetProcessMemoryInfo(
+    HANDLE Process,
+    PPROCESS_MEMORY_COUNTERS ppsmemCounters,
+    DWORD cb
+    );
+
+typedef struct _PERFORMANCE_INFORMATION {
+    DWORD cb;
+    SIZE_T CommitTotal;
+    SIZE_T CommitLimit;
+    SIZE_T CommitPeak;
+    SIZE_T PhysicalTotal;
+    SIZE_T PhysicalAvailable;
+    SIZE_T SystemCache;
+    SIZE_T KernelTotal;
+    SIZE_T KernelPaged;
+    SIZE_T KernelNonpaged;
+    SIZE_T PageSize;
+    DWORD HandleCount;
+    DWORD ProcessCount;
+    DWORD ThreadCount;
+} PERFORMANCE_INFORMATION, *PPERFORMANCE_INFORMATION, PERFORMACE_INFORMATION, *PPERFORMACE_INFORMATION;
+
+BOOL
+WINAPI
+GetPerformanceInfo (
+    PPERFORMACE_INFORMATION pPerformanceInformation,
+    DWORD cb
+    );
+
+typedef struct _ENUM_PAGE_FILE_INFORMATION {
+    DWORD cb;
+    DWORD Reserved;
+    SIZE_T TotalSize;
+    SIZE_T TotalInUse;
+    SIZE_T PeakUsage;
+} ENUM_PAGE_FILE_INFORMATION, *PENUM_PAGE_FILE_INFORMATION;
+
+typedef BOOL (*PENUM_PAGE_FILE_CALLBACKW) (LPVOID pContext, PENUM_PAGE_FILE_INFORMATION pPageFileInfo, LPCWSTR lpFilename);
+
+typedef BOOL (*PENUM_PAGE_FILE_CALLBACKA) (LPVOID pContext, PENUM_PAGE_FILE_INFORMATION pPageFileInfo, LPCSTR lpFilename);
+
+BOOL
+WINAPI
+EnumPageFilesW (
+    PENUM_PAGE_FILE_CALLBACKW pCallBackRoutine,
+    LPVOID pContext
+    );
+
+BOOL
+WINAPI
+EnumPageFilesA (
+    PENUM_PAGE_FILE_CALLBACKA pCallBackRoutine,
+    LPVOID pContext
+    );
+
+#ifdef UNICODE
+#define PENUM_PAGE_FILE_CALLBACK PENUM_PAGE_FILE_CALLBACKW
+#define EnumPageFiles EnumPageFilesW
+#else
+#define PENUM_PAGE_FILE_CALLBACK PENUM_PAGE_FILE_CALLBACKA
+#define EnumPageFiles EnumPageFilesA
+#endif // !UNICODE
+
+DWORD
+WINAPI
+GetProcessImageFileNameA(
+    HANDLE hProcess,
+    LPSTR lpImageFileName,
+    DWORD nSize
+    );
+
+DWORD
+WINAPI
+GetProcessImageFileNameW(
+    HANDLE hProcess,
+    LPWSTR lpImageFileName,
+    DWORD nSize
+    );
+
+#ifdef UNICODE
+#define GetProcessImageFileName  GetProcessImageFileNameW
+#else
+#define GetProcessImageFileName  GetProcessImageFileNameA
+#endif // !UNICODE
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/RSrcSection.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/RSrcSection.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/RSrcSection.cpp	(revision 178)
@@ -0,0 +1,883 @@
+#include "../BasicCompiler_Common/common.h"
+
+#ifndef RT_MANIFEST
+#define RT_MANIFEST                        MAKEINTRESOURCE(24)
+#endif
+
+//リソースアドレススケジュール
+DWORD *lpdwRSrcAddrSchedule;
+int RSrcAddrScheduleNum;
+
+void AddRSrcAddrSchedule(DWORD pos){
+	extern HANDLE hHeap;
+
+	//グローバル変数アドレススケジュールに追加する
+	lpdwRSrcAddrSchedule=(DWORD *)HeapReAlloc(hHeap,0,lpdwRSrcAddrSchedule,(RSrcAddrScheduleNum+1)*sizeof(DWORD));
+	lpdwRSrcAddrSchedule[RSrcAddrScheduleNum]=pos;
+	RSrcAddrScheduleNum++;
+}
+
+char *PermutationString(char *buffer,char *lpszSearch,char *lpszRewrite){
+	//バッファ長
+	int length;
+	length=lstrlen(buffer);
+
+	//サーチ文字列の長さ
+	int search_length;
+	search_length=lstrlen(lpszSearch);
+
+	//置換文字列の長さ
+	int write_length;
+	write_length=lstrlen(lpszRewrite);
+
+	//置換時オフセット
+	int offset;
+	offset=lstrlen(lpszRewrite)-search_length;
+
+	int i;
+	for(i=0;i<length-search_length;i++){
+		if(memcmp(buffer+i,lpszSearch,search_length)==0){
+			if(offset>0){
+				length+=offset;
+				buffer=(char *)HeapReAlloc(hHeap,0,buffer,length+1);
+			}
+
+			SlideString(buffer+i+search_length,offset);
+			memcpy(buffer+i,lpszRewrite,write_length);
+			i+=write_length-1;
+		}
+	}
+
+	return buffer;
+}
+
+char *GetRSrcSectionBuffer(int *pLen){
+	extern HANDLE hHeap;
+	char *buffer,*temporary;
+	int i2,i3,i4,i5,i6,i7,sw,BufSize,TypeNum,NextBase;
+	HANDLE hFile;
+
+	//カーソルリソース
+	extern RESOURCEDATAINFO *pCursorResourceInfo;
+	extern int CursorResourceNum;
+	int CursorNum;
+	CURSORDIR *pCursorDir;
+	CURSORDIRENTRY *pCursorDirEntry;
+	CURSORDIRENTRY_RES CursorDirEntry_Res;
+	CursorNum=0;
+
+	//ビットマップリソース
+	extern RESOURCEDATAINFO *pBitmapResourceInfo;
+	extern int BitmapResourceNum;
+
+	//アイコンリソース
+	extern RESOURCEDATAINFO *pIconResourceInfo;
+	extern int IconResourceNum;
+	int IconNum;
+	ICONDIR *pIconDir;
+	ICONDIRENTRY *pIconDirEntry;
+	ICONDIRENTRY_RES IconDirEntry_Res;
+	IconNum=0;
+
+	//XPManifestリソース
+	extern char szManifestPath[MAX_PATH];
+	extern int XPManiResourceNum;
+
+	BufSize=8192*2;
+	buffer=(char *)HeapAlloc(hHeap,0,BufSize);
+	i2=0;
+	NextBase=0;
+
+	//リソースアドレススケジュール
+	lpdwRSrcAddrSchedule=(DWORD *)HeapAlloc(hHeap,0,1);
+	RSrcAddrScheduleNum=0;
+
+	*pLen=0;
+
+	if(CursorResourceNum==0&&
+		BitmapResourceNum==0&&
+		IconResourceNum==0&&
+		XPManiResourceNum==0) return buffer;
+
+	sw=0;
+
+	//カーソルの枚数を計算（CursorNumに格納）
+	for(i3=0;i3<CursorResourceNum;i3++){
+		hFile=CreateFile(pCursorResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		if(hFile==INVALID_HANDLE_VALUE){
+			SetError(23,pCursorResourceInfo[i3].FileName,-1);
+			sw=1;
+			continue;
+		}
+		i4=GetFileSize(hFile,NULL);
+		temporary=(char *)HeapAlloc(hHeap,0,i4);
+		ReadFile(hFile,temporary,i4,(DWORD *)&i5,NULL);
+		CloseHandle(hFile);
+
+		pCursorDir=(CURSORDIR *)temporary;
+		CursorNum+=pCursorDir->idCount;
+
+		HeapDefaultFree(temporary);
+	}
+
+	//ビットマップのファイルの有無を確認
+	for(i3=0;i3<BitmapResourceNum;i3++){
+		hFile=CreateFile(pBitmapResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		if(hFile==INVALID_HANDLE_VALUE){
+			SetError(23,pBitmapResourceInfo[i3].FileName,-1);
+			sw=1;
+			continue;
+		}
+		CloseHandle(hFile);
+	}
+
+	//アイコンの枚数を計算（IconNumに格納）
+	for(i3=0;i3<IconResourceNum;i3++){
+		hFile=CreateFile(pIconResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		if(hFile==INVALID_HANDLE_VALUE){
+			SetError(23,pIconResourceInfo[i3].FileName,-1);
+			sw=1;
+			continue;
+		}
+		i4=GetFileSize(hFile,NULL);
+		temporary=(char *)HeapAlloc(hHeap,0,i4);
+		ReadFile(hFile,temporary,i4,(DWORD *)&i5,NULL);
+		CloseHandle(hFile);
+
+		pIconDir=(ICONDIR *)temporary;
+		IconNum+=pIconDir->idCount;
+
+		HeapDefaultFree(temporary);
+	}
+
+	//ファイルの読み込みに失敗した場合
+	if(sw) return buffer;
+
+
+	/////////////////////////
+	// ディレクトリ エントリ
+	/////////////////////////
+	TypeNum=0;
+	if(CursorResourceNum) TypeNum+=2;
+	if(BitmapResourceNum) TypeNum++;
+	if(IconResourceNum) TypeNum+=2;
+	if(XPManiResourceNum) TypeNum++;
+
+	NextBase=sizeof(IMAGE_RESOURCE_DIRECTORY)+
+		sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)*TypeNum;
+
+	//1階層
+	IMAGE_RESOURCE_DIRECTORY ImgResDir;
+	ImgResDir.Characteristics=0;
+	ImgResDir.TimeDateStamp=0;
+	ImgResDir.MajorVersion=0;
+	ImgResDir.MinorVersion=0;
+	ImgResDir.NumberOfNamedEntries=0;
+	ImgResDir.NumberOfIdEntries=TypeNum;
+	memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+	i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+	i6=0;
+	IMAGE_RESOURCE_DIRECTORY_ENTRY ImgDirEntry;
+	if(CursorNum){
+		//RT_CURSOR
+		ImgDirEntry.Name=(DWORD)(LONG_PTR)RT_CURSOR;
+		ImgDirEntry.OffsetToData=(NextBase+i6)|0x80000000;
+		memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+		i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+
+		//2階層のサイズ
+		i6+=	sizeof(IMAGE_RESOURCE_DIRECTORY)+
+				sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)*CursorNum;
+	}
+	if(BitmapResourceNum){
+		//RT_BITMAP
+		ImgDirEntry.Name=(DWORD)(LONG_PTR)RT_BITMAP;
+		ImgDirEntry.OffsetToData=(NextBase+i6)|0x80000000;
+		memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+		i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+
+		//2階層のサイズ
+		i6+=	sizeof(IMAGE_RESOURCE_DIRECTORY)+
+				sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)*BitmapResourceNum;
+	}
+	if(IconNum){
+		//RT_ICON
+		ImgDirEntry.Name=(DWORD)(LONG_PTR)RT_ICON;
+		ImgDirEntry.OffsetToData=(NextBase+i6)|0x80000000;
+		memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+		i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+
+		//2階層のサイズ
+		i6+=	sizeof(IMAGE_RESOURCE_DIRECTORY)+
+				sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)*IconNum;
+	}
+	if(CursorResourceNum){
+		//RT_GROUP_CURSOR
+		ImgDirEntry.Name=(DWORD)(LONG_PTR)RT_GROUP_CURSOR;
+		ImgDirEntry.OffsetToData=(NextBase+i6)|0x80000000;
+		memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+		i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+
+		//2階層のサイズ
+		i6+=	sizeof(IMAGE_RESOURCE_DIRECTORY)+
+				sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)*CursorNum;
+	}
+	if(IconResourceNum){
+		//RT_GROUP_ICON
+		ImgDirEntry.Name=(DWORD)(LONG_PTR)RT_GROUP_ICON;
+		ImgDirEntry.OffsetToData=(NextBase+i6)|0x80000000;
+		memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+		i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+
+		//2階層のサイズ
+		i6+=	sizeof(IMAGE_RESOURCE_DIRECTORY)+
+				sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)*IconResourceNum;
+	}
+	if(XPManiResourceNum){
+		//RT_MANIFEST
+		ImgDirEntry.Name=(DWORD)(LONG_PTR)RT_MANIFEST;
+		ImgDirEntry.OffsetToData=(NextBase+i6)|0x80000000;
+		memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+		i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+
+		//2階層のサイズ
+		i6+=	sizeof(IMAGE_RESOURCE_DIRECTORY)+
+				sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY)*XPManiResourceNum;
+	}
+
+	NextBase+=i6;
+
+	//2階層
+	i6=0;
+	i7=0;
+	if(CursorNum){
+		//RT_CURSOR
+		ImgResDir.Characteristics=0;
+		ImgResDir.TimeDateStamp=0;
+		ImgResDir.MajorVersion=0;
+		ImgResDir.MinorVersion=0;
+		ImgResDir.NumberOfNamedEntries=0;
+		ImgResDir.NumberOfIdEntries=CursorNum;
+		memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+		i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+		for(i3=0;i3<CursorNum;i3++,i7++){
+			ImgDirEntry.Name=i7+1;
+			ImgDirEntry.OffsetToData=(NextBase+i6+
+				(sizeof(IMAGE_RESOURCE_DIRECTORY)+
+				sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*i3)
+				|0x80000000;
+			memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+		}
+
+		//3階層のサイズ
+		i6+=(sizeof(IMAGE_RESOURCE_DIRECTORY)+
+			sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*CursorNum;
+	}
+	if(BitmapResourceNum){
+		//RT_BITMAP
+		ImgResDir.Characteristics=0;
+		ImgResDir.TimeDateStamp=0;
+		ImgResDir.MajorVersion=0;
+		ImgResDir.MinorVersion=0;
+		ImgResDir.NumberOfNamedEntries=0;
+		ImgResDir.NumberOfIdEntries=BitmapResourceNum;
+		memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+		i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+		for(i3=0;i3<BitmapResourceNum;i3++){
+			ImgDirEntry.Name=pBitmapResourceInfo[i3].dwId;
+			ImgDirEntry.OffsetToData=(NextBase+i6+
+				(sizeof(IMAGE_RESOURCE_DIRECTORY)+
+				sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*i3)
+				|0x80000000;
+			memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+		}
+
+		i6+=(sizeof(IMAGE_RESOURCE_DIRECTORY)+
+			sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*BitmapResourceNum;
+	}
+	if(IconNum){
+		//RT_ICON
+		ImgResDir.Characteristics=0;
+		ImgResDir.TimeDateStamp=0;
+		ImgResDir.MajorVersion=0;
+		ImgResDir.MinorVersion=0;
+		ImgResDir.NumberOfNamedEntries=0;
+		ImgResDir.NumberOfIdEntries=IconNum;
+		memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+		i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+		for(i3=0;i3<IconNum;i3++,i7++){
+			ImgDirEntry.Name=i7+1;
+			ImgDirEntry.OffsetToData=(NextBase+i6+
+				(sizeof(IMAGE_RESOURCE_DIRECTORY)+
+				sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*i3)
+				|0x80000000;
+			memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+		}
+
+		//3階層のサイズ
+		i6+=(sizeof(IMAGE_RESOURCE_DIRECTORY)+
+			sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*IconNum;
+	}
+	if(CursorResourceNum){
+		//RT_GROUP_CURSOR
+		ImgResDir.Characteristics=0;
+		ImgResDir.TimeDateStamp=0;
+		ImgResDir.MajorVersion=0;
+		ImgResDir.MinorVersion=0;
+		ImgResDir.NumberOfNamedEntries=0;
+		ImgResDir.NumberOfIdEntries=CursorResourceNum;
+		memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+		i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+		for(i3=0;i3<CursorResourceNum;i3++){
+			ImgDirEntry.Name=pCursorResourceInfo[i3].dwId;
+			ImgDirEntry.OffsetToData=(NextBase+i6+
+				(sizeof(IMAGE_RESOURCE_DIRECTORY)+
+				sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*i3)
+				|0x80000000;
+			memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+		}
+
+		//3階層のサイズ
+		i6+=(sizeof(IMAGE_RESOURCE_DIRECTORY)+
+			sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*CursorResourceNum;
+	}
+	if(IconResourceNum){
+		//RT_GROUP_ICON
+		ImgResDir.Characteristics=0;
+		ImgResDir.TimeDateStamp=0;
+		ImgResDir.MajorVersion=0;
+		ImgResDir.MinorVersion=0;
+		ImgResDir.NumberOfNamedEntries=0;
+		ImgResDir.NumberOfIdEntries=IconResourceNum;
+		memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+		i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+		for(i3=0;i3<IconResourceNum;i3++){
+			ImgDirEntry.Name=pIconResourceInfo[i3].dwId;
+			ImgDirEntry.OffsetToData=(NextBase+i6+
+				(sizeof(IMAGE_RESOURCE_DIRECTORY)+
+				sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*i3)
+				|0x80000000;
+			memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+		}
+
+		//3階層のサイズ
+		i6+=(sizeof(IMAGE_RESOURCE_DIRECTORY)+
+			sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*IconResourceNum;
+	}
+	if(XPManiResourceNum){
+		//RT_MANIFEST
+		ImgResDir.Characteristics=0;
+		ImgResDir.TimeDateStamp=0;
+		ImgResDir.MajorVersion=0;
+		ImgResDir.MinorVersion=0;
+		ImgResDir.NumberOfNamedEntries=0;
+		ImgResDir.NumberOfIdEntries=XPManiResourceNum;
+		memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+		i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+		for(i3=0;i3<XPManiResourceNum;i3++){
+			ImgDirEntry.Name=i3+1;
+			ImgDirEntry.OffsetToData=(NextBase+i6+
+				(sizeof(IMAGE_RESOURCE_DIRECTORY)+
+				sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*i3)
+				|0x80000000;
+			memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+		}
+
+		i6+=(sizeof(IMAGE_RESOURCE_DIRECTORY)+
+			sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY))*XPManiResourceNum;
+	}
+
+
+	NextBase+=i6;
+
+	while(i2+8192>BufSize){
+		BufSize+=8192;
+		buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufSize);
+	}
+
+	//3階層
+	i6=0;
+	if(CursorNum){
+		//RT_CURSOR
+		for(i3=0;i3<CursorNum;i3++){
+			ImgResDir.Characteristics=0;
+			ImgResDir.TimeDateStamp=0;
+			ImgResDir.MajorVersion=0;
+			ImgResDir.MinorVersion=0;
+			ImgResDir.NumberOfNamedEntries=0;
+			ImgResDir.NumberOfIdEntries=1;
+			memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+			ImgDirEntry.Name=0x411;
+			ImgDirEntry.OffsetToData=NextBase+i6+
+				sizeof(IMAGE_RESOURCE_DATA_ENTRY)*i3;
+			memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+		}
+
+		i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY)*CursorNum;
+	}
+	if(BitmapResourceNum){
+		//RT_BITMAP
+		for(i3=0;i3<BitmapResourceNum;i3++){
+			ImgResDir.Characteristics=0;
+			ImgResDir.TimeDateStamp=0;
+			ImgResDir.MajorVersion=0;
+			ImgResDir.MinorVersion=0;
+			ImgResDir.NumberOfNamedEntries=0;
+			ImgResDir.NumberOfIdEntries=1;
+			memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+			ImgDirEntry.Name=0x411;
+			ImgDirEntry.OffsetToData=NextBase+i6+
+				sizeof(IMAGE_RESOURCE_DATA_ENTRY)*i3;
+			memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+		}
+
+		i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY)*BitmapResourceNum;
+	}
+	if(IconNum){
+		//RT_ICON
+		for(i3=0;i3<IconNum;i3++){
+			ImgResDir.Characteristics=0;
+			ImgResDir.TimeDateStamp=0;
+			ImgResDir.MajorVersion=0;
+			ImgResDir.MinorVersion=0;
+			ImgResDir.NumberOfNamedEntries=0;
+			ImgResDir.NumberOfIdEntries=1;
+			memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+			ImgDirEntry.Name=0x411;
+			ImgDirEntry.OffsetToData=NextBase+i6+
+				sizeof(IMAGE_RESOURCE_DATA_ENTRY)*i3;
+			memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+		}
+
+		i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY)*IconNum;
+	}
+	if(CursorResourceNum){
+		//RT_GROUP_CURSOR
+		for(i3=0;i3<CursorResourceNum;i3++){
+			ImgResDir.Characteristics=0;
+			ImgResDir.TimeDateStamp=0;
+			ImgResDir.MajorVersion=0;
+			ImgResDir.MinorVersion=0;
+			ImgResDir.NumberOfNamedEntries=0;
+			ImgResDir.NumberOfIdEntries=1;
+			memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+			ImgDirEntry.Name=0x411;
+			ImgDirEntry.OffsetToData=NextBase+i6+
+				sizeof(IMAGE_RESOURCE_DATA_ENTRY)*i3;
+			memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+		}
+
+		i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY)*CursorResourceNum;
+	}
+	if(IconResourceNum){
+		//RT_GROUP_ICON
+		for(i3=0;i3<IconResourceNum;i3++){
+			ImgResDir.Characteristics=0;
+			ImgResDir.TimeDateStamp=0;
+			ImgResDir.MajorVersion=0;
+			ImgResDir.MinorVersion=0;
+			ImgResDir.NumberOfNamedEntries=0;
+			ImgResDir.NumberOfIdEntries=1;
+			memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+			ImgDirEntry.Name=0x411;
+			ImgDirEntry.OffsetToData=NextBase+i6+
+				sizeof(IMAGE_RESOURCE_DATA_ENTRY)*i3;
+			memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+		}
+
+		i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY)*IconResourceNum;
+	}
+	if(XPManiResourceNum){
+		//RT_MANIFEST
+		for(i3=0;i3<XPManiResourceNum;i3++){
+			ImgResDir.Characteristics=0;
+			ImgResDir.TimeDateStamp=0;
+			ImgResDir.MajorVersion=0;
+			ImgResDir.MinorVersion=0;
+			ImgResDir.NumberOfNamedEntries=0;
+			ImgResDir.NumberOfIdEntries=1;
+			memcpy(buffer+i2,&ImgResDir,sizeof(IMAGE_RESOURCE_DIRECTORY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY);
+
+			ImgDirEntry.Name=0x411;
+			ImgDirEntry.OffsetToData=NextBase+i6+
+				sizeof(IMAGE_RESOURCE_DATA_ENTRY)*i3;
+			memcpy(buffer+i2,&ImgDirEntry,sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY));
+			i2+=sizeof(IMAGE_RESOURCE_DIRECTORY_ENTRY);
+		}
+
+		i6+=sizeof(IMAGE_RESOURCE_DATA_ENTRY)*XPManiResourceNum;
+	}
+
+	NextBase+=i6;
+
+	while(i2+8192>BufSize){
+		BufSize+=8192;
+		buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufSize);
+	}
+
+
+
+	////////////////////////////////////////
+	// データ エントリ
+	////////////////////////////////////////
+
+	DWORD dwDataEntrySchedule[100];
+	int DataEntryScheduleNum;
+	int CursorEntryBase;
+	int CursorGroupEntryBase;
+	int BitmapEntryBase;
+	int IconEntryBase;
+	int IconGroupEntryBase;
+
+	DataEntryScheduleNum=0;
+
+	//空のデータエントリ領域を作成
+
+	//RT_CURSOR
+	CursorEntryBase=DataEntryScheduleNum;
+	for(i3=0;i3<CursorNum;i3++){
+		dwDataEntrySchedule[DataEntryScheduleNum]=i2;
+		DataEntryScheduleNum++;
+		memset(buffer+i2,0,sizeof(IMAGE_RESOURCE_DATA_ENTRY));
+		i2+=sizeof(IMAGE_RESOURCE_DATA_ENTRY);
+	}
+
+	//RT_BITMAP
+	BitmapEntryBase=DataEntryScheduleNum;
+	for(i3=0;i3<BitmapResourceNum;i3++){
+		dwDataEntrySchedule[DataEntryScheduleNum]=i2;
+		DataEntryScheduleNum++;
+		memset(buffer+i2,0,sizeof(IMAGE_RESOURCE_DATA_ENTRY));
+		i2+=sizeof(IMAGE_RESOURCE_DATA_ENTRY);
+	}
+
+	//RT_ICON
+	IconEntryBase=DataEntryScheduleNum;
+	for(i3=0;i3<IconNum;i3++){
+		dwDataEntrySchedule[DataEntryScheduleNum]=i2;
+		DataEntryScheduleNum++;
+		memset(buffer+i2,0,sizeof(IMAGE_RESOURCE_DATA_ENTRY));
+		i2+=sizeof(IMAGE_RESOURCE_DATA_ENTRY);
+	}
+
+	//RT_GROUP_CURSOR
+	CursorGroupEntryBase=DataEntryScheduleNum;
+	for(i3=0;i3<CursorResourceNum;i3++){
+		dwDataEntrySchedule[DataEntryScheduleNum]=i2;
+		DataEntryScheduleNum++;
+		memset(buffer+i2,0,sizeof(IMAGE_RESOURCE_DATA_ENTRY));
+		i2+=sizeof(IMAGE_RESOURCE_DATA_ENTRY);
+	}
+
+	//RT_GROUP_ICON
+	IconGroupEntryBase=DataEntryScheduleNum;
+	for(i3=0;i3<IconResourceNum;i3++){
+		dwDataEntrySchedule[DataEntryScheduleNum]=i2;
+		DataEntryScheduleNum++;
+		memset(buffer+i2,0,sizeof(IMAGE_RESOURCE_DATA_ENTRY));
+		i2+=sizeof(IMAGE_RESOURCE_DATA_ENTRY);
+	}
+
+	//RT_MANIFEST
+	int XPManiEntryBase;
+	XPManiEntryBase=DataEntryScheduleNum;
+	for(i3=0;i3<XPManiResourceNum;i3++){
+		dwDataEntrySchedule[DataEntryScheduleNum]=i2;
+		DataEntryScheduleNum++;
+		memset(buffer+i2,0,sizeof(IMAGE_RESOURCE_DATA_ENTRY));
+		i2+=sizeof(IMAGE_RESOURCE_DATA_ENTRY);
+	}
+
+	i4=i2%8;
+	if(i4){
+		memset(buffer+i2,0,8-i4);
+		i2+=8-i4;
+	}
+
+	while(i2+8192>BufSize){
+		BufSize+=8192;
+		buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufSize);
+	}
+
+
+	///////////////////////////////////////
+	// バイナリ データ
+	// ※データエントリの内容も変更する
+	///////////////////////////////////////
+
+	IMAGE_RESOURCE_DATA_ENTRY *pImgDataEntry;
+
+	i7=0;
+
+	//カーソルリソース
+	for(i3=0,i6=0;i3<CursorResourceNum;i3++){
+		hFile=CreateFile(pCursorResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		if(hFile==INVALID_HANDLE_VALUE){
+			SetError(23,pCursorResourceInfo[i3].FileName,-1);
+			return buffer;
+		}
+		i4=GetFileSize(hFile,NULL);
+		temporary=(char *)HeapAlloc(hHeap,0,i4);
+		ReadFile(hFile,temporary,i4,(DWORD *)&i5,NULL);
+		CloseHandle(hFile);
+
+		pCursorDir=(CURSORDIR *)temporary;
+
+		for(i5=0;i5<pCursorDir->idCount;i5++,i6++){
+			pCursorDirEntry=(CURSORDIRENTRY *)(temporary+sizeof(CURSORDIR)+sizeof(CURSORDIRENTRY)*i5);
+
+			//データエントリ
+			pImgDataEntry=(IMAGE_RESOURCE_DATA_ENTRY *)(buffer+dwDataEntrySchedule[CursorEntryBase+i6]);
+			pImgDataEntry->OffsetToData=i2;
+			pImgDataEntry->Size=pCursorDirEntry->dwBytesInRes+sizeof(WORD)*2;
+			AddRSrcAddrSchedule(dwDataEntrySchedule[CursorEntryBase+i6]);
+
+			//RT_CURSOR バイナリ データ
+			*(WORD *)(buffer+i2)=0x001F;
+			i2+=sizeof(WORD);
+			*(WORD *)(buffer+i2)=0x001F;
+			i2+=sizeof(WORD);
+			memcpy(buffer+i2,temporary+pCursorDirEntry->dwImageOffset,pCursorDirEntry->dwBytesInRes);
+			i2+=pCursorDirEntry->dwBytesInRes;
+
+			i4=i2%8;
+			if(i4){
+				memset(buffer+i2,0,8-i4);
+				i2+=8-i4;
+			}
+
+			while(i2+8192>BufSize){
+				BufSize+=8192;
+				buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufSize);
+			}
+		}
+
+		//データエントリ
+		pImgDataEntry=(IMAGE_RESOURCE_DATA_ENTRY *)(buffer+dwDataEntrySchedule[CursorGroupEntryBase+i3]);
+		pImgDataEntry->OffsetToData=i2;
+		pImgDataEntry->Size=sizeof(CURSORDIR)+0xE*pCursorDir->idCount;
+		AddRSrcAddrSchedule(dwDataEntrySchedule[CursorGroupEntryBase+i3]);
+
+		//RT_GROUP_CURSORヘッダデータ（CURSORDIR）
+		memcpy(buffer+i2,temporary,sizeof(CURSORDIR));
+		i2+=sizeof(CURSORDIR);
+
+		for(i5=0;i5<pCursorDir->idCount;i5++,i7++){
+			pCursorDirEntry=(CURSORDIRENTRY *)(temporary+sizeof(CURSORDIR)+sizeof(CURSORDIRENTRY)*i5);
+			CursorDirEntry_Res.wWidth=pCursorDirEntry->bWidth;
+			CursorDirEntry_Res.wHeight=CursorDirEntry_Res.wWidth*2;
+			CursorDirEntry_Res.wXHotspot=pCursorDirEntry->wXHotspot;
+			CursorDirEntry_Res.wYHotspot=pCursorDirEntry->wYHotspot;
+			CursorDirEntry_Res.dwBytesInRes=pCursorDirEntry->dwBytesInRes+sizeof(WORD)*2;
+			CursorDirEntry_Res.wCursorNum=i7+1;
+
+			//RT_GROUP_CURSORヘッダデータ（CURSORDIRENTRY_RES）
+			memcpy(buffer+i2,&CursorDirEntry_Res,0xE);
+			i2+=0xE;
+
+			while(i2+8192>BufSize){
+				BufSize+=8192;
+				buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufSize);
+			}
+		}
+		i4=i2%8;
+		if(i4){
+			memset(buffer+i2,0,8-i4);
+			i2+=8-i4;
+		}
+
+		HeapDefaultFree(temporary);
+	}
+
+	//ビットマップリソース
+	for(i3=0;i3<BitmapResourceNum;i3++){
+		hFile=CreateFile(pBitmapResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		if(hFile==INVALID_HANDLE_VALUE){
+			SetError(23,pBitmapResourceInfo[i3].FileName,-1);
+			return buffer;
+		}
+		i4=GetFileSize(hFile,NULL);
+		temporary=(char *)HeapAlloc(hHeap,0,i4);
+		ReadFile(hFile,temporary,i4,(DWORD *)&i5,NULL);
+		CloseHandle(hFile);
+
+		BufSize+=i4;
+		buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufSize);
+
+		//データエントリ
+		pImgDataEntry=(IMAGE_RESOURCE_DATA_ENTRY *)(buffer+dwDataEntrySchedule[BitmapEntryBase+i3]);
+		pImgDataEntry->OffsetToData=i2;
+		pImgDataEntry->Size=i4-sizeof(BITMAPFILEHEADER);
+		AddRSrcAddrSchedule(dwDataEntrySchedule[BitmapEntryBase+i3]);
+
+		//RT_BITMAP バイナリ データ
+		memcpy(buffer+i2,temporary+sizeof(BITMAPFILEHEADER),i4-sizeof(BITMAPFILEHEADER));
+		i2+=i4-sizeof(BITMAPFILEHEADER);
+
+		HeapDefaultFree(temporary);
+	}
+
+	//アイコンリソース
+	for(i3=0,i6=0;i3<IconResourceNum;i3++){
+		hFile=CreateFile(pIconResourceInfo[i3].FileName,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		if(hFile==INVALID_HANDLE_VALUE){
+			SetError(23,pIconResourceInfo[i3].FileName,-1);
+			return buffer;
+		}
+		i4=GetFileSize(hFile,NULL);
+		temporary=(char *)HeapAlloc(hHeap,0,i4);
+		ReadFile(hFile,temporary,i4,(DWORD *)&i5,NULL);
+		CloseHandle(hFile);
+
+		pIconDir=(ICONDIR *)temporary;
+
+		for(i5=0;i5<pIconDir->idCount;i5++,i6++){
+			pIconDirEntry=(ICONDIRENTRY *)(temporary+sizeof(ICONDIR)+sizeof(ICONDIRENTRY)*i5);
+
+			//データエントリ
+			pImgDataEntry=(IMAGE_RESOURCE_DATA_ENTRY *)(buffer+dwDataEntrySchedule[IconEntryBase+i6]);
+			pImgDataEntry->OffsetToData=i2;
+			pImgDataEntry->Size=pIconDirEntry->dwBytesInRes;
+			AddRSrcAddrSchedule(dwDataEntrySchedule[IconEntryBase+i6]);
+
+			//RT_ICON バイナリ データ
+			memcpy(buffer+i2,temporary+pIconDirEntry->dwImageOffset,pIconDirEntry->dwBytesInRes);
+			i2+=pIconDirEntry->dwBytesInRes;
+
+			i4=i2%8;
+			if(i4){
+				memset(buffer+i2,0,8-i4);
+				i2+=8-i4;
+			}
+
+			while(i2+8192>BufSize){
+				BufSize+=8192;
+				buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufSize);
+			}
+		}
+
+		//データエントリ
+		pImgDataEntry=(IMAGE_RESOURCE_DATA_ENTRY *)(buffer+dwDataEntrySchedule[IconGroupEntryBase+i3]);
+		pImgDataEntry->OffsetToData=i2;
+		pImgDataEntry->Size=sizeof(ICONDIR)+0xE*pIconDir->idCount;
+		AddRSrcAddrSchedule(dwDataEntrySchedule[IconGroupEntryBase+i3]);
+
+		//RT_GROUP_ICONヘッダデータ（ICONDIR）
+		memcpy(buffer+i2,temporary,sizeof(ICONDIR));
+		i2+=sizeof(ICONDIR);
+
+		for(i5=0;i5<pIconDir->idCount;i5++,i7++){
+			pIconDirEntry=(ICONDIRENTRY *)(temporary+sizeof(ICONDIR)+sizeof(ICONDIRENTRY)*i5);
+			IconDirEntry_Res.bWidth=pIconDirEntry->bWidth;
+			IconDirEntry_Res.bHeight=pIconDirEntry->bHeight;
+			IconDirEntry_Res.bColorCount=pIconDirEntry->bColorCount;
+			IconDirEntry_Res.bReserved=0;
+			IconDirEntry_Res.wPlanes=1;
+			if(pIconDirEntry->bColorCount==16)
+				IconDirEntry_Res.wBitCount=4;
+			else if(pIconDirEntry->bColorCount==0)
+				IconDirEntry_Res.wBitCount=8;
+			IconDirEntry_Res.dwBytesInRes=pIconDirEntry->dwBytesInRes;
+			IconDirEntry_Res.wIconNum=i7+1;
+
+			//RT_GROUP_ICONヘッダデータ（ICONDIRENTRY_RES）
+			memcpy(buffer+i2,&IconDirEntry_Res,0xE);
+			i2+=0xE;
+
+			while(i2+8192>BufSize){
+				BufSize+=8192;
+				buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufSize);
+			}
+		}
+		i4=i2%8;
+		if(i4){
+			memset(buffer+i2,0,8-i4);
+			i2+=8-i4;
+		}
+
+		HeapDefaultFree(temporary);
+	}
+
+	//XPManifestリソース
+	for(i3=0;i3<XPManiResourceNum;i3++){
+		extern char BasicCurDir[MAX_PATH];
+		extern char szManifestPath[MAX_PATH];
+		char temp2[MAX_PATH];
+		lstrcpy(temp2,szManifestPath);
+		GetFullPath(temp2,BasicCurDir);
+		hFile=CreateFile(temp2,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		if(hFile==INVALID_HANDLE_VALUE){
+			SetError(59,temp2,-1);
+			return buffer;
+		}
+		i4=GetFileSize(hFile,NULL);
+		temporary=(char *)HeapAlloc(hHeap,0,i4+1);
+		ReadFile(hFile,temporary,i4,(DWORD *)&i5,NULL);
+		temporary[i4]=0;
+		CloseHandle(hFile);
+
+		//プラットフォームをセット
+#ifdef _AMD64_
+		temporary=PermutationString(temporary,"#PLATFORM#","amd64");
+#else
+		temporary=PermutationString(temporary,"#PLATFORM#","x86");
+#endif
+
+		//アプリケーション名をセット
+		extern char OutputFileName[MAX_PATH];
+		char szAppliName[MAX_PATH];
+		_splitpath(OutputFileName,NULL,NULL,szAppliName,temp2);
+		lstrcat(szAppliName,temp2);
+		temporary=PermutationString(temporary,"#APPLI_FILE_NAME#",szAppliName);
+
+		i4=lstrlen(temporary)+1;
+
+		BufSize+=i4;
+		buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufSize);
+
+		//データエントリ
+		pImgDataEntry=(IMAGE_RESOURCE_DATA_ENTRY *)(buffer+dwDataEntrySchedule[XPManiEntryBase+i3]);
+		pImgDataEntry->OffsetToData=i2;
+		pImgDataEntry->Size=i4-1;	//※NULL文字はサイズに含めない
+		AddRSrcAddrSchedule(dwDataEntrySchedule[XPManiEntryBase+i3]);
+
+		//XMLデータ
+		memcpy(buffer+i2,temporary,i4);
+		i2+=i4;
+
+		HeapDefaultFree(temporary);
+	}
+
+	*pLen=i2;
+
+	return buffer;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Resource.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Resource.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Resource.cpp	(revision 178)
@@ -0,0 +1,129 @@
+#include "common.h"
+
+void GetResourceData(char *FileName){
+	extern HANDLE hHeap;
+	extern char BasicCurDir[MAX_PATH];
+	int i2,i3;
+	char *buffer,temporary[MAX_PATH],temp2[MAX_PATH];
+	HANDLE hFile;
+	DWORD dwId;
+
+	extern RESOURCEDATAINFO *pCursorResourceInfo;
+	extern int CursorResourceNum;
+	extern RESOURCEDATAINFO *pBitmapResourceInfo;
+	extern int BitmapResourceNum;
+	extern RESOURCEDATAINFO *pIconResourceInfo;
+	extern int IconResourceNum;
+	pCursorResourceInfo=(RESOURCEDATAINFO *)HeapAlloc(hHeap,0,1);
+	CursorResourceNum=0;
+	pBitmapResourceInfo=(RESOURCEDATAINFO *)HeapAlloc(hHeap,0,1);
+	BitmapResourceNum=0;
+	pIconResourceInfo=(RESOURCEDATAINFO *)HeapAlloc(hHeap,0,1);
+	IconResourceNum=0;
+
+	extern char szManifestPath[MAX_PATH];
+	extern int XPManiResourceNum;
+	szManifestPath[0]=0;
+	XPManiResourceNum=0;
+
+	hFile=CreateFile(FileName,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);
+	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])){
+				temporary[i3]=0;
+				break;
+			}
+			temporary[i3]=buffer[i2];
+		}
+		if(temporary[0]=='\0') break;
+
+		_int64 i64data;
+		Type resultType;
+		if( !StaticCalculation(true, temporary,0,&i64data,resultType) ){
+			return;
+		}
+		if(resultType.IsReal()){
+			SetError(9,temporary,0);
+			return;
+		}
+		dwId=(DWORD)i64data;
+
+		//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];
+		}
+		GetFullPath(temp2,BasicCurDir);
+
+		if(lstrcmpi(temporary,"CURSOR")==0){
+			pCursorResourceInfo=(RESOURCEDATAINFO *)HeapReAlloc(hHeap,0,pCursorResourceInfo,(CursorResourceNum+1)*sizeof(RESOURCEDATAINFO));
+			pCursorResourceInfo[CursorResourceNum].dwId=dwId;
+			lstrcpy(pCursorResourceInfo[CursorResourceNum].FileName,temp2);
+			CursorResourceNum++;
+		}
+		else if(lstrcmpi(temporary,"BITMAP")==0){
+			pBitmapResourceInfo=(RESOURCEDATAINFO *)HeapReAlloc(hHeap,0,pBitmapResourceInfo,(BitmapResourceNum+1)*sizeof(RESOURCEDATAINFO));
+			pBitmapResourceInfo[BitmapResourceNum].dwId=dwId;
+			lstrcpy(pBitmapResourceInfo[BitmapResourceNum].FileName,temp2);
+			BitmapResourceNum++;
+		}
+		else if(lstrcmpi(temporary,"ICON")==0){
+			pIconResourceInfo=(RESOURCEDATAINFO *)HeapReAlloc(hHeap,0,pIconResourceInfo,(IconResourceNum+1)*sizeof(RESOURCEDATAINFO));
+			pIconResourceInfo[IconResourceNum].dwId=dwId;
+			lstrcpy(pIconResourceInfo[IconResourceNum].FileName,temp2);
+			IconResourceNum++;
+		}
+		else if(lstrcmpi(temporary,"RT_MANIFEST")==0){
+			if(XPManiResourceNum) goto error;
+
+			lstrcpy(szManifestPath,temp2);
+
+			XPManiResourceNum++;
+		}
+		else{
+error:
+			SetError(17,NULL,0);
+			return;
+		}
+
+		i2++;
+		while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+		if(buffer[i2]=='\0') break;
+		else if(buffer[i2]!='\n'){
+			SetError(17,NULL,0);
+			return;
+		}
+		i2++;
+	}
+
+	HeapDefaultFree(buffer);
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/StrOperation.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/StrOperation.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/StrOperation.cpp	(revision 178)
@@ -0,0 +1,768 @@
+#include "../BasicCompiler_Common/common.h"
+
+void KillSpaces(char *str1,char *str2){
+	int i,i2,i3,IsStr;
+	for(i=0,i2=0,IsStr=0;;i++,i2++){
+		if((str1[i]==' '||str1[i]=='\t')&&IsStr==0){
+			i3=i+1;
+			while(str1[i3]==' '||str1[i3]=='\t') i3++;
+			if(i!=0){
+				if(i==1){
+					if(IsVariableChar(str1[i-1])&&
+						IsVariableChar(str1[i3])){
+						//識別子間にある省略すべきでない空白
+						str2[i2++]=' ';
+					}
+				}
+				else{
+					if(str1[i-2]!=1&&IsVariableChar(str1[i-1])&&
+						IsVariableChar(str1[i3])){
+						//識別子間にある省略すべきでない空白
+						str2[i2++]=' ';
+					}
+				}
+			}
+			i=i3;
+		}
+		if(str1[i]=='\"') IsStr^=1;
+		str2[i2]=str1[i];
+		if(str1[i]=='\0') break;
+	}
+}
+void KillStringSpaces(char *str){
+	char *s2;
+
+	extern HANDLE hHeap;
+	s2=(char *)HeapAlloc(hHeap,0,lstrlen(str)+1);
+	lstrcpy(s2,str);
+	KillSpaces(s2,str);
+	HeapDefaultFree(s2);
+	return;
+}
+BOOL RemoveStringQuotes(char *str){
+	int i;
+	if(str[0]!='\"') return 0;
+	for(i=0;;i++){
+		str[i]=str[i+1];
+		if(str[i]=='\"') break;
+	}
+	str[i]=0;
+	if(str[i+2]!='\0') return 0;
+	return 1;
+}
+void RemoveStringPare(char *str){
+	int i;
+	i=lstrlen(str);
+	if(str[0]!='('||str[i-1]!=')') return;
+	SlideString(str+1,-1);
+	str[i-2]=0;
+}
+void RemoveStringBracket(char *str){
+	int i;
+	i=lstrlen(str);
+	if(str[0]!='['||str[i-1]!=']') return;
+	SlideString(str+1,-1);
+	str[i-2]=0;
+}
+void SetStringQuotes(char *str){
+	int i;
+	if(str[0]=='\"') return;
+	i=lstrlen(str);
+	SlideString(str,1);
+	str[0]='\"';
+	str[i+1]='\"';
+	str[i+2]=0;
+}
+int FormatString_EscapeSequence(char *buffer){
+	int i2,i3,i4;
+
+	for(i2=0,i3=0;;i2++,i3++){
+		if(IsDBCSLeadByte(buffer[i3])){
+			buffer[i2++]=buffer[i3++];
+			buffer[i2]=buffer[i3];
+			if(buffer[i3]=='\0') break;
+			continue;
+		}
+		if(buffer[i3]=='\\'){
+			switch(buffer[i3+1]){
+				case '\\':
+					buffer[i2]='\\';
+					i3++;
+					break;
+				case '0':
+					buffer[i2]='\0';
+					i3++;
+					break;
+				case 'n':
+					buffer[i2]='\n';
+					i3++;
+					break;
+				case 'q':
+					buffer[i2]='\"';
+					i3++;
+					break;
+				case 'r':
+					buffer[i2]='\r';
+					i3++;
+					break;
+				case 't':
+					buffer[i2]='\t';
+					i3++;
+					break;
+				case 'x':
+					//16進表記
+					char temporary[8];
+					temporary[0]=buffer[i3+2];
+					temporary[1]=buffer[i3+3];
+					temporary[2]=0;
+					CharUpper(temporary);
+
+					i4=temporary[0]-0x30;
+					if(i4<0||9<i4){
+						i4=temporary[0]-0x41+10;
+						if(i4<0xA||0xF<i4){
+							buffer[i2]=buffer[i3];
+							break;
+						}
+					}
+					temporary[0]=i4;
+
+					i4=temporary[1]-0x30;
+					if(i4<0||9<i4){
+						i4=temporary[1]-0x41+10;
+						if(i4<0xA||0xF<i4){
+							buffer[i2]=buffer[i3];
+							break;
+						}
+					}
+					temporary[1]=i4;
+
+					buffer[i2]=temporary[0]*0x10+temporary[1];
+					i3+=3;
+					break;
+				default:
+					buffer[i2]=buffer[i3];
+					break;
+			}
+		}
+		else{
+			buffer[i2]=buffer[i3];
+			if(buffer[i3]=='\0') break;
+		}
+	}
+	return i2;
+}
+void SlideString(char *buffer, int slide){
+	char *temp;
+	temp=(char *)malloc(lstrlen(buffer)+1);
+	lstrcpy(temp,buffer);
+	lstrcpy(buffer+slide,temp);
+	free(temp);
+}
+void SlideBuffer(char *buffer,int length,int slide){
+	void *temp;
+	temp=malloc(length+1);
+	memcpy(temp,buffer,length);
+	memcpy(buffer+slide,temp,length);
+	free(temp);
+}
+_int8 IsCommandDelimitation(char c){
+	if(c=='\n'||c==':'||c=='\0') return 1;
+	return 0;
+}
+BOOL IsBlank(char c){
+	if(c==' '||c=='\t') return 1;
+	return 0;
+}
+int GetOneParameter(const char *Parameter,int pos,char *retAns){
+	int i,i2,i3,IsStr;
+	for(i=pos,i2=0,IsStr=0;;i++,i2++){
+		if(Parameter[i]=='\"') IsStr^=1;
+		else if(Parameter[i]=='('&&IsStr==0){
+			i3=GetStringInPare(retAns+i2,Parameter+i);
+			i+=i3-1;
+			i2+=i3-1;
+			continue;
+		}
+		else if(Parameter[i]=='['&&IsStr==0){
+			i3=GetStringInBracket(retAns+i2,Parameter+i);
+			i+=i3-1;
+			i2+=i3-1;
+			continue;
+		}
+		else if(Parameter[i]==','&&IsStr==0){
+			retAns[i2]=0;
+			i++;
+			break;
+		}
+
+		if(IsCommandDelimitation(Parameter[i])&&IsStr==0
+			|| Parameter[i] == ')' && IsStr == 0 ){
+				retAns[i2]=0;
+				break;
+		}
+
+		retAns[i2]=Parameter[i];
+	}
+	return i;
+}
+int JumpOneParameter(char *Parameter,int i){
+	int i2,IsStr;
+	for(i2=0,IsStr=0;;i++,i2++){
+		if(Parameter[i]=='\"') IsStr^=1;
+		else if(Parameter[i]=='('&&IsStr==0){
+			i=JumpStringInPare(Parameter,i+1);
+			continue;
+		}
+		else if(Parameter[i]=='['&&IsStr==0){
+			i=JumpStringInBracket(Parameter,i+1);
+			continue;
+		}
+		else if(Parameter[i]==','&&IsStr==0){
+			i++;
+			break;
+		}
+		if(IsCommandDelimitation(Parameter[i])) break;
+	}
+	return i;
+}
+int GetStringInQuotation(char *buffer,char *ReadBuffer){
+	int i;
+
+	if(ReadBuffer[0]=='\"'){
+		buffer[0]=ReadBuffer[0];
+		i=1;
+	}
+	else i=0;
+
+	for(;;i++){
+		buffer[i]=ReadBuffer[i];
+		if(IsDBCSLeadByte(ReadBuffer[i])){
+			i++;
+			buffer[i]=ReadBuffer[i];
+			continue;
+		}
+		if(ReadBuffer[i]=='\"'){
+			i++;
+			buffer[i]=0;
+			break;
+		}
+		if(ReadBuffer[i]=='\0') return 0;
+	}
+	return i;
+}
+int GetStringInPare(char *buffer,const char *ReadBuffer){
+	int i,IsStr,PareNum;
+	for(i=0,IsStr=0,PareNum=0;;i++){
+		buffer[i]=ReadBuffer[i];
+		if(IsDBCSLeadByte(ReadBuffer[i])){
+			i++;
+			buffer[i]=ReadBuffer[i];
+			continue;
+		}
+		if(ReadBuffer[i]=='\"') IsStr^=1;
+		else if(ReadBuffer[i]=='('&&IsStr==0) PareNum++;
+		else if(ReadBuffer[i]==')'&&IsStr==0){
+			PareNum--;
+			if(PareNum==0){
+				i++;
+				buffer[i]=0;
+				break;
+			}
+		}
+		else if(ReadBuffer[i]=='\0') return 0;
+	}
+	return i;
+}
+int GetStringInPare_RemovePare(char *buffer,char *ReadBuffer){
+	int i,IsStr,PareNum;
+	for(i=0,IsStr=0,PareNum=1;;i++){
+		buffer[i]=ReadBuffer[i];
+		if(IsDBCSLeadByte(ReadBuffer[i])){
+			i++;
+			buffer[i]=ReadBuffer[i];
+			continue;
+		}
+		if(ReadBuffer[i]=='\"') IsStr^=1;
+		else if(ReadBuffer[i]=='('&&IsStr==0) PareNum++;
+		else if(ReadBuffer[i]==')'&&IsStr==0){
+			PareNum--;
+			if(PareNum==0){
+				buffer[i]=0;
+				break;
+			}
+		}
+		else if(ReadBuffer[i]=='\0') return 0;
+	}
+	return i;
+}
+int GetStringInBracket(char *buffer,const char *ReadBuffer){
+	int i,IsStr,PareNum;
+	for(i=0,IsStr=0,PareNum=0;;i++){
+		buffer[i]=ReadBuffer[i];
+		if(IsDBCSLeadByte(ReadBuffer[i])){
+			i++;
+			buffer[i]=ReadBuffer[i];
+			continue;
+		}
+		if(ReadBuffer[i]=='\"') IsStr^=1;
+		else if(ReadBuffer[i]=='['&&IsStr==0) PareNum++;
+		else if(ReadBuffer[i]==']'&&IsStr==0){
+			PareNum--;
+			if(PareNum==0){
+				i++;
+				buffer[i]=0;
+				break;
+			}
+		}
+		else if(ReadBuffer[i]=='\0') return 0;
+	}
+	return i;
+}
+int JumpStringInPare(const char *buffer,int pos){
+	int PareNum;
+	for(PareNum=1;;pos++){
+		if(buffer[pos]=='\"'){
+			for(pos++;;pos++){
+				if(buffer[pos]=='\"') break;
+			}
+			continue;
+		}
+		else if(buffer[pos]=='(') PareNum++;
+		else if(buffer[pos]==')'){
+			PareNum--;
+			if(PareNum==0) return pos;
+		}
+		else if(buffer[pos]=='\0') break;
+	}
+	return 0;
+}
+int JumpStringInBracket(const char *buffer,int pos){
+	int PareNum;
+	for(PareNum=1;;pos++){
+		if(buffer[pos]=='\"'){
+			for(pos++;;pos++){
+				if(buffer[pos]=='\"') break;
+			}
+			continue;
+		}
+		else if(buffer[pos]=='[') PareNum++;
+		else if(buffer[pos]==']'){
+			PareNum--;
+			if(PareNum==0) return pos;
+		}
+		else if(buffer[pos]=='\0') break;
+	}
+	return 0;
+}
+
+int GetCpFromLine(int LineNum){
+	extern char *basbuf;
+
+	int i,nCount=0;
+	for(i=0;;i++){
+		if(basbuf[i]=='\n'){
+			nCount++;
+			if(LineNum==nCount){
+				for(i++;;i++){
+					if(IsCommandDelimitation(basbuf[i])) break;
+				}
+				return i;
+			}
+		}
+	}
+}
+BOOL GetLineNum(int pos,int *pLine,char *FileName){
+	extern INCLUDEFILEINFO IncludeFileInfo;
+	extern char *basbuf;
+	int i,i2,i3,i4,i5;
+
+	i=pos;
+	if(basbuf[i]=='\n') i--;
+	for(i3=0,i2=0;i3<i;i3++){
+		if(basbuf[i3]=='\n') i2++;
+		if(basbuf[i3]=='\0') return 0;
+	}
+	i4=0;
+	while(IncludeFileInfo.LineOfFile[i2]!=IncludeFileInfo.LineOfFile[i4]) i4++;
+	for(i3=0,i5=0;i5<i4;i3++){
+		if(basbuf[i3]=='\n') i5++;
+		if(basbuf[i3]=='\0') return 0;
+	}
+	for(i5=0;i4<i2;i3++){
+		if(basbuf[i3]=='\n'){
+			i4++;
+			i5++;
+			if(IncludeFileInfo.LineOfFile[i2]<IncludeFileInfo.LineOfFile[i4]){
+				for(;IncludeFileInfo.LineOfFile[i2]!=IncludeFileInfo.LineOfFile[i4];i3++){
+					if(basbuf[i3]=='\n') i4++;
+				}
+			}
+		}
+		if(basbuf[i3]=='\0') return 0;
+	}
+
+	if(IncludeFileInfo.LineOfFile[i2]==-1){
+		//ファイル・行番号を特定できなかった場合
+		*pLine=-1;
+		FileName[0]=0;
+	}
+	else{
+		//行番号をセット
+		*pLine=i5;
+
+		//ファイル名をセット
+		lstrcpy(FileName,IncludeFileInfo.ppFileNames[IncludeFileInfo.LineOfFile[i2]]);
+	}
+
+	return 1;
+}
+
+char GetEndXXXCommand(char es){
+	switch(es){
+		case ESC_SUB:
+			return ESC_ENDSUB;
+		case ESC_FUNCTION:
+			return ESC_ENDFUNCTION;
+		case ESC_MACRO:
+			return ESC_ENDMACRO;
+		case ESC_TYPE:
+			return ESC_ENDTYPE;
+		case ESC_CLASS:
+			return ESC_ENDCLASS;
+		case ESC_INTERFACE:
+			return ESC_ENDINTERFACE;
+		case ESC_ENUM:
+			return ESC_ENDENUM;
+	}
+	return 0;
+}
+void GetDefaultNameFromES(char es,char *name){
+	name[0]=0;
+	switch(es){
+		case ESC_PSMEM:
+			lstrcpy(name,"->");
+			break;
+		case ESC_MOD:
+			lstrcpy(name,"Mod");
+			break;
+		case ESC_AND:
+			lstrcpy(name,"And");
+			break;
+		case ESC_OR:
+			lstrcpy(name,"Or");
+			break;
+		case ESC_XOR:
+			lstrcpy(name,"Xor");
+			break;
+		case ESC_NOT:
+			lstrcpy(name,"Not");
+			break;
+		case ESC_AS:
+			lstrcpy(name,"As");
+			break;
+		case ESC_THEN:
+			lstrcpy(name,"Then");
+			break;
+		case ESC_ELSE:
+			lstrcpy(name,"Else");
+			break;
+		case ESC_IF:
+			lstrcpy(name,"If");
+			break;
+		case ESC_ELSEIF:
+			lstrcpy(name,"ElseIf");
+			break;
+		case ESC_ENDIF:
+			lstrcpy(name,"End If");
+			break;
+		case ESC_DEF:
+			lstrcpy(name,"Def");
+			break;
+		case ESC_DECLARE:
+			lstrcpy(name,"Declare");
+			break;
+		case ESC_ABSTRACT:
+			lstrcpy(name,"Abstract");
+			break;
+		case ESC_VIRTUAL:
+			lstrcpy(name,"Virtual");
+			break;
+		case ESC_OVERRIDE:
+			lstrcpy(name,"Override");
+			break;
+		case ESC_SUB:
+			lstrcpy(name,"Sub");
+			break;
+		case ESC_ENDSUB:
+			lstrcpy(name,"End Sub");
+			break;
+		case ESC_EXITSUB:
+			lstrcpy(name,"Exit Sub");
+			break;
+		case ESC_FUNCTION:
+			lstrcpy(name,"Function");
+			break;
+		case ESC_ENDFUNCTION:
+			lstrcpy(name,"End Function");
+			break;
+		case ESC_EXITFUNCTION:
+			lstrcpy(name,"Exit Function");
+			break;
+		case ESC_BYVAL:
+			lstrcpy(name,"ByVal ");
+			break;
+		case ESC_BYREF:
+			lstrcpy(name,"ByRef ");
+			break;
+		case ESC_TYPE:
+			lstrcpy(name,"Type");
+			break;
+		case ESC_ENDTYPE:
+			lstrcpy(name,"End Type");
+			break;
+		case ESC_EXITFOR:
+			lstrcpy(name,"Exit For");
+			break;
+		case ESC_EXITWHILE:
+			lstrcpy(name,"Exit While");
+			break;
+		case ESC_EXITDO:
+			lstrcpy(name,"Exit Do");
+			break;
+		case ESC_SELECTCASE:
+			lstrcpy(name,"Select Case");
+			break;
+		case ESC_CASE:
+			lstrcpy(name,"Case");
+			break;
+		case ESC_CASEELSE:
+			lstrcpy(name,"Case Else");
+			break;
+		case ESC_ENDSELECT:
+			lstrcpy(name,"End Select");
+			break;
+		case ESC_CONST:
+			lstrcpy(name,"Const");
+			break;
+		case ESC_TYPEDEF:
+			lstrcpy(name,"TypeDef");
+			break;
+		case ESC_WITH:
+			lstrcpy(name,"With");
+			break;
+		case ESC_ENDWITH:
+			lstrcpy(name,"End With");
+			break;
+		case ESC_CDECL:
+			lstrcpy(name,"cdecl");
+			break;
+		case ESC_MACRO:
+			lstrcpy(name,"Macro");
+			break;
+		case ESC_ENDMACRO:
+			lstrcpy(name,"End Macro");
+			break;
+		case ESC_EXITMACRO:
+			lstrcpy(name,"Exit Macro");
+			break;
+		case ESC_EXPORT:
+			lstrcpy(name,"Export");
+			break;
+		case ESC_CONTINUE:
+			lstrcpy(name,"Continue");
+			break;
+		case ESC_CLASS:
+			lstrcpy(name,"Class");
+			break;
+		case ESC_ENDCLASS:
+			lstrcpy(name,"End Class");
+			break;
+		case ESC_INTERFACE:
+			lstrcpy(name,"Interface");
+			break;
+		case ESC_ENDINTERFACE:
+			lstrcpy(name,"End Interface");
+			break;
+		case ESC_ENUM:
+			lstrcpy(name,"Enum");
+			break;
+		case ESC_ENDENUM:
+			lstrcpy(name,"End Enum");
+			break;
+	}
+}
+void GetCalcName(int idCalc,char *name){
+	switch(idCalc){
+		case CALC_XOR:
+			lstrcpy(name,"xor");
+			break;
+		case CALC_OR:
+			lstrcpy(name,"or");
+			break;
+		case CALC_AND:
+			lstrcpy(name,"and");
+			break;
+		case CALC_NOT:
+			lstrcpy(name,"Not");
+			break;
+
+		case CALC_PE:
+			lstrcpy(name,"<=");
+			break;
+		case CALC_QE:
+			lstrcpy(name,">=");
+			break;
+		case CALC_NOTEQUAL:
+			lstrcpy(name,"<>");
+			break;
+		case CALC_SUBSITUATION:
+		case CALC_EQUAL:
+			lstrcpy(name,"=");
+			break;
+		case CALC_P:
+			lstrcpy(name,"<");
+			break;
+		case CALC_Q:
+			lstrcpy(name,">");
+			break;
+
+		case CALC_SHL:
+			lstrcpy(name,"<<");
+			break;
+		case CALC_SHR:
+			lstrcpy(name,">>");
+			break;
+		case CALC_ADDITION:
+			lstrcpy(name,"+");
+			break;
+		case CALC_SUBTRACTION:
+			lstrcpy(name,"-");
+			break;
+		case CALC_MOD:
+			lstrcpy(name,"mod");
+			break;
+		case CALC_PRODUCT:
+			lstrcpy(name,"*");
+			break;
+		case CALC_QUOTIENT:
+			lstrcpy(name,"/");
+			break;
+		case CALC_INTQUOTIENT:
+			lstrcpy(name,"\\");
+			break;
+		case CALC_AS:
+			lstrcpy(name,"As");
+			break;
+		case CALC_BYVAL:
+			lstrcpy(name,"ByVal");
+			break;
+		case CALC_MINUSMARK:
+			lstrcpy(name,"-");
+			break;
+		case CALC_POWER:
+			lstrcpy(name,"^");
+			break;
+
+		case CALC_ARRAY_GET:
+			lstrcpy(name,"[]");
+			break;
+		case CALC_ARRAY_SET:
+			lstrcpy(name,"[]=");
+			break;
+	}
+}
+
+BOOL IsFile(char *path){
+	WIN32_FIND_DATA wfd;
+	HANDLE hFind;
+
+	hFind=FindFirstFile(path,&wfd);
+	if(hFind==INVALID_HANDLE_VALUE){
+		return 0;
+	}
+	FindClose(hFind);
+
+	return 1;
+}
+BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle){
+	BROWSEINFO BrowseInfo;
+	LPITEMIDLIST pidlBrowse;
+	LPMALLOC g_pMalloc;
+	char temporary[MAX_PATH];
+
+	BrowseInfo.hwndOwner=hWnd;
+	BrowseInfo.pszDisplayName=temporary;
+	BrowseInfo.pidlRoot=NULL;
+	BrowseInfo.lpszTitle=OpenFolderTitle;
+	BrowseInfo.ulFlags=BIF_RETURNONLYFSDIRS;
+	BrowseInfo.lpfn=NULL;
+	BrowseInfo.lParam=(LPARAM)0;
+	BrowseInfo.iImage=0;
+	pidlBrowse=SHBrowseForFolder(&BrowseInfo);
+	if(pidlBrowse){
+		if(SHGetMalloc(&g_pMalloc)!=0) return 0;
+		SHGetPathFromIDList(pidlBrowse,folder);
+		g_pMalloc->Free(pidlBrowse);
+		g_pMalloc->Release();
+		return 1;
+	}
+	return 0;
+}
+
+void ShortPathToLongPath(const char *ShortPath,char *LongPath){
+	HANDLE hFind;
+	WIN32_FIND_DATA wfd;
+	int i;
+	char dummy[MAX_PATH];
+	for(i=0;i<MAX_PATH;i++){
+		LongPath[i]=ShortPath[i];
+		if((ShortPath[i-1]==':'&&ShortPath[i]=='\\')||(ShortPath[i-1]=='\\'&&ShortPath[i]=='\\')){
+			LongPath[i+1]=0;
+			break;
+		}
+	}
+	if(ShortPath[i-1]=='\\'&&ShortPath[i]=='\\'){
+		for(i++;i<MAX_PATH;i++){
+			if(IsDBCSLeadByte(ShortPath[i])){
+				i++;
+				continue;
+			}
+			LongPath[i]=ShortPath[i];
+			if(ShortPath[i]=='\\'){
+				LongPath[i+1]=0;
+				break;
+			}
+		}
+		for(i++;i<MAX_PATH;i++){
+			if(IsDBCSLeadByte(ShortPath[i])){
+				i++;
+				continue;
+			}
+			LongPath[i]=ShortPath[i];
+			if(ShortPath[i]=='\\'){
+				LongPath[i+1]=0;
+				break;
+			}
+		}
+	}
+	for(i++;i<MAX_PATH;i++){
+		if(IsDBCSLeadByte(ShortPath[i])){
+			i++;
+			continue;
+		}
+		if(ShortPath[i]=='\\'||ShortPath[i]=='\0'){
+			strncpy(dummy,ShortPath,i);
+			dummy[i]=0;
+			if((hFind=FindFirstFile(dummy,&wfd))!=INVALID_HANDLE_VALUE) FindClose(hFind);
+			lstrcat(LongPath,wfd.cFileName);
+
+			if(ShortPath[i]=='\0') break;
+			lstrcat(LongPath,"\\");
+
+			if(ShortPath[i]=='\\'&&ShortPath[i+1]=='\0'){
+				break;
+			}
+		}
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Subroutine.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Subroutine.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Subroutine.cpp	(revision 178)
@@ -0,0 +1,901 @@
+#include "../BasicCompiler_Common/common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+int GetCallProcName(char *buffer,char *name){
+	int i2,i3,IsStr=0;
+
+	for(i2=0;;i2++){
+		if(buffer[i2]=='\"') IsStr^=1;
+		if(IsDBCSLeadByte(buffer[i2])){
+			name[i2]=buffer[i2];
+			i2++;
+			name[i2]=buffer[i2];
+			continue;
+		}
+		if(buffer[i2]=='['&&IsStr==0){
+			i3=GetStringInBracket(name+i2,buffer+i2);
+			i2+=i3-1;
+			continue;
+		}
+		if(buffer[i2]=='('&&IsStr==0){
+			name[i2]=0;
+			break;
+		}
+		if(buffer[i2]=='='&&IsStr==0){
+			name[i2]=0;
+			break;
+		}
+
+		name[i2]=buffer[i2];
+		if(buffer[i2]=='\0') break;
+	}
+	return i2;
+}
+
+int GetProc(char *name,void **ppInfo){
+
+	//ユーザー定義関数
+	*ppInfo=(void *)GetSubHash(name);
+	if(*ppInfo) return PROC_DEFAULT;
+
+	//DLL関数
+	*ppInfo=(void *)GetDeclareHash(name);
+	if(*ppInfo) return PROC_DLL;
+
+	//コンパイラ埋め込み型
+	*ppInfo=(void *)(_int64)GetFunctionFromName(name);
+	if(*ppInfo) return PROC_BUILTIN;
+
+	//関数ポインタ
+	Type type;
+	if( !GetVarType( name, type, false ) ){
+		return 0;
+	}
+	if( type.IsProcPtr() ){
+		return PROC_PTR;
+	}
+
+	return 0;
+}
+
+void SplitObjectName(const char *name,char *ObjectName,int *pRefType){
+	int i4;
+	for(i4=lstrlen(name)-1;i4>=0;i4--){
+		if(name[i4]=='.'||(name[i4]==1&&name[i4+1]==ESC_PSMEM))
+			break;
+	}
+	if(i4==-1) ObjectName[0]=0;
+	else{
+		//参照タイプを判別
+		if(name[i4]=='.') *pRefType=DEF_OBJECT;
+		else *pRefType=DEF_PTR_OBJECT;
+
+		if(i4==0) GetWithName(ObjectName);
+		else{
+			memcpy(ObjectName,name,i4);
+			ObjectName[i4]=0;
+		}
+	}
+}
+bool SplitMemberName( const char *desc, char *object, char *member, CClass::RefType &refType ){
+	int lastIndex = -1;
+	for( int i=0; desc[i]; i++ ){
+		if( desc[i] == '(' ){
+			i=JumpStringInPare(desc,i+1);
+			continue;
+		}
+		else if( desc[i] == '[' ){
+			i=JumpStringInBracket(desc,i+1);
+			continue;
+		}
+		else if(desc[i]=='.'||(desc[i]==1&&desc[i+1]==ESC_PSMEM)){
+			lastIndex = i;
+		}
+	}
+	if( lastIndex == -1 ){
+		lstrcpy( member, desc );
+		return false;
+	}
+
+	if(desc[lastIndex]=='.'){
+		lstrcpy(member,desc+lastIndex+1);
+		refType = CClass::Dot;
+	}
+	else{
+		lstrcpy(member,desc+lastIndex+2);
+		refType = CClass::Pointer;
+	}
+
+	if( object ){
+		lstrcpy( object, desc );
+		object[lastIndex]=0;
+	}
+
+	return true;
+}
+bool SplitMemberName( const char *desc, char *object, char *member ){
+	CClass::RefType dummyRefType;
+	return SplitMemberName( desc, object, member, dummyRefType );
+}
+
+bool CallProc( int kind, const void *pProc, const char *fullCallName, const char *lpszParms, Type &resultType, bool isCallOn ){
+
+	//GetSubHash内でエラー提示が行われた場合
+	if(pProc==(Procedure *)-1){
+		return false;
+	}
+
+	if(kind==PROC_DEFAULT){
+		/////////////////////
+		// ユーザー定義関数
+		/////////////////////
+
+		UserProc *pUserProc = (UserProc *)pProc;
+
+		//オブジェクト名を取得
+		char ObjectName[VN_SIZE];
+		int RefType;
+		SplitObjectName(fullCallName,ObjectName,&RefType);
+
+
+		////////////////////////
+		// オーバーロードを解決
+		////////////////////////
+
+		std::vector<UserProc *> subs;
+		GetOverloadSubHash(fullCallName,subs);
+		if(subs.size()){
+			//オーバーロードを解決
+			pUserProc=OverloadSolutionWithStrParam(fullCallName,subs,lpszParms,ObjectName);
+
+			if(!pUserProc){
+				return false;
+			}
+		}
+
+		resultType = pUserProc->ReturnType();
+
+		if( isCallOn ){
+			if( !Opcode_CallProc(lpszParms,pUserProc,0,ObjectName,RefType) ){
+				return false;
+			}
+		}
+	}
+	else if(kind==PROC_DLL){
+		/////////////////////////
+		// DLL関数
+		/////////////////////////
+		DllProc *pDllProc = (DllProc *)pProc;
+
+		resultType = pDllProc->ReturnType();
+
+		if( isCallOn ){
+			if( !Opcode_CallDllProc(lpszParms,pDllProc) ){
+				return false;
+			}
+		}
+	}
+	else if(kind==PROC_BUILTIN){
+		/////////////////////////
+		// 組み込み関数
+		/////////////////////////
+		int FuncId = (int)(_int64)pProc;
+
+		if( !Opcode_CallFunc( lpszParms, FuncId, resultType, isCallOn ) ){
+			return false;
+		}
+	}
+	else if(kind==PROC_PTR){
+		/////////////////
+		// 関数ポインタ
+		/////////////////
+
+		Type type;
+		GetVarType(fullCallName,type,false);
+
+		ProcPointer *pProcPtr = Smoothie::meta.procPointers[type.GetIndex()];
+		resultType = pProcPtr->ReturnType();
+
+		if( isCallOn ){
+			if( !Opcode_CallProcPtr(fullCallName,lpszParms,pProcPtr) ){
+				return false;
+			}
+		}
+	}
+	else{
+		return false;
+	}
+
+	return true;
+}
+bool CallPropertyMethod( const char *variable, const char *rightSide, Type &resultType){
+	//プロパティ用のメソッドを呼び出す
+
+	//配列要素を取得
+	char VarName[VN_SIZE],ArrayElements[VN_SIZE];
+	GetArrayElement(variable,VarName,ArrayElements);
+
+	//オブジェクト名を取得
+	char ObjectName[VN_SIZE];
+	int RefType;
+	SplitObjectName(VarName,ObjectName,&RefType);
+
+	//オーバーロード用の関数リストを作成
+	std::vector<UserProc *> subs;
+	GetOverloadSubHash(VarName,subs);
+	if(subs.size()==0){
+		return false;
+	}
+
+	//パラメータを整備
+	char *Parameter;
+	Parameter=(char *)HeapAlloc(hHeap,0,lstrlen(ArrayElements)+lstrlen(rightSide)+32);
+	lstrcpy(Parameter,ArrayElements);
+	if(rightSide){
+		if(Parameter[0]&&rightSide[0]) lstrcat(Parameter,",");
+		lstrcat(Parameter,rightSide);
+	}
+
+	//オーバーロードを解決
+	UserProc *pUserProc;
+	pUserProc=OverloadSolutionWithStrParam(VarName,subs,Parameter,ObjectName);
+
+	if(pUserProc){
+		//呼び出し
+		Opcode_CallProc(Parameter,pUserProc,0,ObjectName,RefType);
+
+		resultType = pUserProc->ReturnType();
+	}
+
+	HeapDefaultFree(Parameter);
+
+	return true;
+}
+
+bool GetReturnTypeOfPropertyMethod( const char *variable, const char *rightSide, Type &resultType ){
+	//プロパティ用のメソッドを呼び出す
+
+	//配列要素を取得
+	char VarName[VN_SIZE],ArrayElements[VN_SIZE];
+	GetArrayElement(variable,VarName,ArrayElements);
+
+	//オブジェクト名を取得
+	char ObjectName[VN_SIZE];
+	int RefType;
+	SplitObjectName(VarName,ObjectName,&RefType);
+
+	//オーバーロード用の関数リストを作成
+	std::vector<UserProc *> subs;
+	GetOverloadSubHash(VarName,subs);
+	if(subs.size()==0){
+		return 0;
+	}
+
+	//パラメータを整備
+	char *Parameter;
+	Parameter=(char *)HeapAlloc(hHeap,0,lstrlen(ArrayElements)+lstrlen(rightSide)+32);
+	lstrcpy(Parameter,ArrayElements);
+	if(rightSide){
+		if(Parameter[0]&&rightSide[0]) lstrcat(Parameter,",");
+		lstrcat(Parameter,rightSide);
+	}
+
+	//オーバーロードを解決
+	UserProc *pUserProc;
+	pUserProc=OverloadSolutionWithStrParam(VarName,subs,Parameter,ObjectName);
+
+	if(pUserProc){
+		resultType = pUserProc->ReturnType();
+	}
+
+	return 1;
+}
+
+//インデクサ（getter）の戻り値を取得
+bool GetReturnTypeOfIndexerGetterProc( const CClass &objClass, Type &resultType ){
+	vector<UserProc *> subs;
+	objClass.GetMethods().Enum( CALC_ARRAY_GET, subs );
+	if( subs.size() == 0 ){
+		return false;
+	}
+
+	resultType = subs[0]->ReturnType();
+
+	return true;
+}
+
+
+void AddDeclareData(const NamespaceScopes &namespaceScopes, char *buffer,int nowLine){
+	extern HANDLE hHeap;
+	int i2;
+
+	int i=0;
+
+	//Sub/Function
+	Procedure::Kind kind = Procedure::Sub;
+	if(buffer[i]==ESC_SUB){
+	}
+	else if(buffer[i]==ESC_FUNCTION){
+		kind = Procedure::Function;
+	}
+	else{
+		SetError(1,NULL,nowLine);
+		return;
+	}
+	i++;
+
+	//プロシージャ名
+	char procName[VN_SIZE];
+	bool isCdecl = false;
+	for(i2=0;;i++,i2++){
+		if(buffer[i]==1&&buffer[i+1]==ESC_CDECL){
+			isCdecl = true;
+
+			i+=2;
+			procName[i2]=0;
+			break;
+		}
+		if(buffer[i]==','){
+			procName[i2]=0;
+			break;
+		}
+		if(buffer[i]=='\0'){
+			SetError(1,NULL,nowLine);
+			return;
+		}
+		procName[i2]=buffer[i];
+	}
+	i++;
+
+	//ユーザー定義関数との重複チェック
+	if(GetSubHash(procName)){
+		SetError(15,procName,nowLine);
+		return;
+	}
+
+
+	//ライブラリ
+	char dllFileName[MAX_PATH];
+	i = GetOneParameter( buffer, i, dllFileName );
+	Type resultType;
+	_int64 i64data;
+	if( !StaticCalculation( true, dllFileName, 0, &i64data, resultType ) ){
+		return;
+	}
+	if( resultType.GetBasicType() != typeOfPtrChar ){
+		SetError(1,NULL,nowLine);
+		return;
+	}
+	lstrcpy( dllFileName, (char *)i64data );
+	CharUpper(dllFileName);
+	if(!strstr(dllFileName,".")){
+		lstrcat(dllFileName,".DLL");
+		if(lstrlen(dllFileName)>=16){
+			SetError(7,NULL,nowLine);
+			return;
+		}
+	}
+
+	//エイリアス
+	char alias[VN_SIZE];
+	i = GetOneParameter( buffer, i, alias );
+	if( alias[0] ){
+		if( !StaticCalculation( true, alias, 0, &i64data, resultType ) ){
+			return;
+		}
+		if( resultType.GetBasicType() != typeOfPtrChar ){
+			SetError(1,NULL,nowLine);
+			return;
+		}
+		lstrcpy( alias, (char *)i64data );
+	}
+	else{
+		//省略されたときは関数名
+		lstrcpy( alias, procName );
+	}
+
+
+	// オブジェクトを生成
+	DllProc *pDllProc = new DllProc( namespaceScopes, procName, kind, isCdecl, dllFileName, alias );
+
+	// パラメータを解析
+	// ※第1パラメータにに指定するデータの例："( s As String ) As String"
+	pDllProc->SetParamsAndReturnType( buffer + i, nowLine );
+
+	// パラメータのエラーチェック
+	foreach( const Parameter *pParam, pDllProc->Params() ){
+		if( pParam->IsObject() ){
+			SetError(25,pParam->GetVarName(),nowLine);
+		}
+		if( !pParam->IsRef() ){
+			if( pParam->IsStruct() ){
+				SetError(28,pParam->GetVarName(),nowLine);
+			}
+		}
+	}
+
+	//戻り値のエラーチェック
+	if( pDllProc->IsFunction() ){
+		// Function定義
+
+		if( pDllProc->ReturnType().IsObject() ){
+			// DLL関数ではオブジェクトを戻り値にできない
+			SetError(40,pDllProc->GetName(),nowLine);
+		}
+	}
+
+
+	/////////////////////////////////
+	// 格納位置を計算してppDeclareHashにセット
+	/////////////////////////////////
+
+	//ハッシュ値を取得
+	int key;
+	key=hash_default(procName);
+
+	extern DllProc **ppDeclareHash;
+	if(ppDeclareHash[key]){
+		DllProc *pTempProc = ppDeclareHash[key];
+		while(1){
+			if( pTempProc->IsEqualSymbol( pDllProc->GetNamespaceScopes(), pDllProc->GetName() ) ){
+				//重複エラー
+				SetError(15,procName,nowLine);
+				return;
+			}
+
+			if(pTempProc->pNextData==0){
+				pTempProc->pNextData=pDllProc;
+				break;
+			}
+			pTempProc=pTempProc->pNextData;
+		}
+		pTempProc=pTempProc->pNextData;
+	}
+	else{
+		ppDeclareHash[key]=pDllProc;
+	}
+}
+
+GlobalProc *AddSubData( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, char *buffer,int nowLine,bool isVirtual,CClass *pobj_c, bool isStatic){
+	int i2,i3;
+	char temporary[8192];
+
+	int i=1;
+
+	Procedure::Kind kind = Procedure::Sub;
+	bool isMacro = false;
+	if(buffer[i]==ESC_FUNCTION) kind = Procedure::Function;
+	if(buffer[i]==ESC_MACRO){
+		isMacro = true;
+	}
+
+	i++;
+
+	bool isCdecl = false;
+	bool isExport = false;
+	while(1){
+		if(buffer[i]==1&&buffer[i+1]==ESC_CDECL&& isCdecl == false ){
+			isCdecl = true;
+
+			i+=2;
+		}
+		else if(buffer[i]==1&&buffer[i+1]==ESC_EXPORT&& isExport == false ){
+			isExport = true;
+
+			i+=2;
+		}
+		else break;
+	}
+
+	i2=0;
+	if(buffer[i]==1&&buffer[i+1]==ESC_OPERATOR){
+		if(!pobj_c){
+			SetError(126,NULL,nowLine);
+			return 0;
+		}
+
+		//オペレータの場合
+		temporary[i2++]=buffer[i++];
+		temporary[i2++]=buffer[i++];
+
+		int iCalcId;
+		if(buffer[i]=='='&&buffer[i+1]=='='){
+			iCalcId=CALC_EQUAL;
+			i3=2;
+		}
+		else if(buffer[i]=='='){
+			iCalcId=CALC_SUBSITUATION;
+			i3=1;
+		}
+		else if(buffer[i]=='('){
+			iCalcId=CALC_AS;
+			i3=0;
+		}
+		else if(buffer[i]=='['&&buffer[i+1]==']'&&buffer[i+2]=='='){
+			iCalcId=CALC_ARRAY_SET;
+			i3=3;
+		}
+		else if(buffer[i]=='['&&buffer[i+1]==']'){
+			iCalcId=CALC_ARRAY_GET;
+			i3=2;
+		}
+		else{
+			iCalcId=GetCalcId(buffer+i,&i3);
+			i3++;
+		}
+		if(!iCalcId){
+			SetError(1,NULL,nowLine);
+			return 0;
+		}
+		temporary[i2++]=iCalcId;
+		temporary[i2]=0;
+
+		i+=i3;
+	}
+	else{
+		if(pobj_c){
+			//クラスメンバの場合、デストラクタには~が付くことを考慮
+			if(buffer[i]=='~'){
+				temporary[i2]='~';
+				i++;
+				i2++;
+			}
+		}
+
+		for(;;i++,i2++){
+			if(!IsVariableChar(buffer[i])){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=buffer[i];
+		}
+	}
+
+	if( isMacro ){
+		//大文字に変換
+		CharUpper(temporary);
+
+		//マクロ関数の場合は名前リストに追加
+		extern char **ppMacroNames;
+		extern int MacroNum;
+		ppMacroNames=(char **)HeapReAlloc(hHeap,0,ppMacroNames,(MacroNum+1)*sizeof(char *));
+		ppMacroNames[MacroNum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+		lstrcpy(ppMacroNames[MacroNum],temporary);
+		MacroNum++;
+	}
+
+	if(!pobj_c){
+		//クラスメンバ以外の場合のみ
+		//重複チェック
+
+		if(GetDeclareHash(temporary)){
+			SetError(15,temporary,nowLine);
+			return 0;
+		}
+	}
+
+	extern int SubNum;
+	SubNum++;
+
+	GlobalProc *pUserProc = new GlobalProc( namespaceScopes, importedNamespaces, temporary, kind, isMacro, isCdecl, isExport );
+	pUserProc->SetParentClass( pobj_c );
+	if( Smoothie::isFullCompile ){
+		// すべての関数・メソッドをコンパイルする
+		pUserProc->Using();
+	}
+
+	//ID
+	static int id_base=0;
+	pUserProc->id = (id_base++);
+
+	if(isExport){
+		pUserProc->Using();
+	}
+
+	// パラメータを解析
+	// ※第1パラメータにに指定するデータの例："( s As String ) As String"
+	pUserProc->SetParamsAndReturnType( buffer + i, nowLine, isStatic );
+
+	pUserProc->_paramStr = buffer + i;
+
+
+	/////////////////////////////////
+	// ハッシュデータに追加
+	/////////////////////////////////
+
+	int key;
+	key=hash_default(pUserProc->GetName().c_str());
+
+	extern GlobalProc **ppSubHash;
+	if(ppSubHash[key]){
+		GlobalProc *psi2;
+		psi2=ppSubHash[key];
+		while(1){
+			if(pobj_c==psi2->GetParentClassPtr()){
+				//重複エラーチェックを行う
+				if( pUserProc->IsEqualSymbol( *psi2 ) ){
+					if( psi2->Params().Equals( pUserProc->Params() ) ){
+						SetError(15,pUserProc->GetName().c_str(),nowLine);
+						return 0;
+					}
+				}
+			}
+
+			if(psi2->pNextData==0) break;
+			psi2=psi2->pNextData;
+		}
+		psi2->pNextData=pUserProc;
+	}
+	else{
+		ppSubHash[key]=pUserProc;
+	}
+
+	return pUserProc;
+}
+
+void GetSubInfo(void){	//サブルーチン情報を取得
+	extern HANDLE hHeap;
+	extern char *basbuf;
+	int i,i2,i3;
+	char temporary[8192];
+
+	//Declare（DLL関数）情報を初期化
+	extern DllProc **ppDeclareHash;
+	ppDeclareHash=(DllProc **)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,MAX_HASH*sizeof(DllProc *));
+
+	//サブルーチン（ユーザー定義）情報を初期化
+	extern GlobalProc **ppSubHash;
+	extern int SubNum;
+	ppSubHash=(GlobalProc **)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,MAX_HASH*sizeof(GlobalProc *));
+	SubNum=0;
+
+	//マクロ関数の名前リストを初期化
+	extern char **ppMacroNames;
+	extern int MacroNum;
+	ppMacroNames=(char **)HeapAlloc(hHeap,0,1);
+	MacroNum=0;
+
+	// 名前空間管理
+	NamespaceScopes &namespaceScopes = Smoothie::Lexical::liveingNamespaceScopes;
+	namespaceScopes.clear();
+
+	// Importsされた名前空間の管理
+	NamespaceScopesCollection &importedNamespaces = Smoothie::Temp::importedNamespaces;
+	importedNamespaces.clear();
+
+	i=-1;
+	while(1){
+		i++;
+
+		if(basbuf[i]==1&&(basbuf[i+1]==ESC_CLASS||basbuf[i+1]==ESC_INTERFACE)){
+			/*	Class ～ End Class
+				Interface ～ End Interface
+				を飛び越す			*/
+			i3=GetEndXXXCommand(basbuf[i+1]);
+			for(i+=2,i2=0;;i++,i2++){
+				if(basbuf[i]=='\0') break;
+				if(basbuf[i]==1&&basbuf[i+1]==(char)i3){
+					i++;
+					break;
+				}
+			}
+			if(basbuf[i]=='\0') break;
+			continue;
+		}
+
+		if( basbuf[i] == 1 && basbuf[i+1] == ESC_NAMESPACE ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( basbuf[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+			}
+			namespaceScopes.push_back( temporary );
+
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
+			if( namespaceScopes.size() <= 0 ){
+				SetError(12, "End Namespace", i );
+			}
+			else{
+				namespaceScopes.pop_back();
+			}
+
+			i += 2;
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_IMPORTS ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( basbuf[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+			}
+			if( !importedNamespaces.Imports( temporary ) )
+			{
+				SetError(64,temporary,cp );
+			}
+
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_CLEARNAMESPACEIMPORTED ){
+			importedNamespaces.clear();
+			continue;
+		}
+
+		if(basbuf[i]==1&&basbuf[i+1]==ESC_DECLARE){
+			for(i+=2,i2=0;;i2++,i++){
+				if(basbuf[i]=='\n'){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+				if(basbuf[i]=='\0') break;
+			}
+			AddDeclareData(namespaceScopes,temporary,i);
+
+			continue;
+		}
+		if(basbuf[i]==1&&(basbuf[i+1]==ESC_SUB||basbuf[i+1]==ESC_FUNCTION||basbuf[i+1]==ESC_MACRO)){
+			char statementChar = basbuf[i+1];
+
+			for(i2=0;;i2++,i++){
+				if(IsCommandDelimitation(basbuf[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+				if(basbuf[i]=='\0') break;
+			}
+			AddSubData(namespaceScopes, importedNamespaces, temporary,i,0,0);
+
+			/*	Sub ～ End Sub
+				Function ～ End Function
+				Macro ～ End Macro
+				を飛び越す			*/
+			char endStatementChar = GetEndXXXCommand( statementChar );
+			for(i2=0;;i++,i2++){
+				if( basbuf[i] == '\0' ) break;
+				if( basbuf[i] == 1 && basbuf[i+1] == endStatementChar ){
+					i++;
+					break;
+				}
+			}
+			if(basbuf[i]=='\0') break;
+			continue;
+		}
+
+		//次の行
+		for(;;i++){
+			if(IsCommandDelimitation(basbuf[i])) break;
+		}
+		if(basbuf[i]=='\0') break;
+	}
+
+	////////////
+	// 特殊関数
+	////////////
+	namespaceScopes.clear();
+	importedNamespaces.clear();
+
+	sprintf(temporary,"%c%c_allrem()",1,ESC_SUB);
+	AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0);
+
+	sprintf(temporary,"%c%c_aullrem()",1,ESC_SUB);
+	AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0);
+
+	sprintf(temporary,"%c%c_allmul()",1,ESC_SUB);
+	AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0);
+
+	sprintf(temporary,"%c%c_alldiv()",1,ESC_SUB);
+	AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0);
+
+	sprintf(temporary,"%c%c_aulldiv()",1,ESC_SUB);
+	AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0);
+
+	sprintf(temporary,"%c%c_allshl()",1,ESC_SUB);
+	AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0);
+
+	sprintf(temporary,"%c%c_allshr()",1,ESC_SUB);
+	AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0);
+
+	sprintf(temporary,"%c%c_aullshr()",1,ESC_SUB);
+	AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0);
+
+	sprintf(temporary,"%c%c_System_InitStaticLocalVariables()",1,ESC_SUB);
+	AddSubData( namespaceScopes, importedNamespaces, temporary,0,0,0);
+}
+void Delete_si(GlobalProc *pUserProc){
+	if(pUserProc->pNextData) Delete_si(pUserProc->pNextData);
+	delete pUserProc;
+}
+void DeleteSubInfo(GlobalProc **ppSubHash,char **ppMacroNames,int MacroNum){	//サブルーチン情報のメモリ解放
+	int i;
+	for(i=0;i<MAX_HASH;i++){
+		if(!ppSubHash[i]) continue;
+
+		Delete_si(ppSubHash[i]);
+	}
+	HeapDefaultFree(ppSubHash);
+
+	//マクロの名前リスト
+	if(ppMacroNames){
+		for(i=0;i<MacroNum;i++){
+			HeapDefaultFree(ppMacroNames[i]);
+		}
+		HeapDefaultFree(ppMacroNames);
+	}
+}
+void Delete_di(DllProc *pDllProc){
+	if(pDllProc->pNextData) Delete_di(pDllProc->pNextData);
+
+	delete pDllProc;
+}
+void DeleteDeclareInfo(void){
+	//DLL情報を解放
+	extern DllProc **ppDeclareHash;
+	int i;
+	for(i=0;i<MAX_HASH;i++){
+		if(!ppDeclareHash[i]) continue;
+
+		Delete_di(ppDeclareHash[i]);
+	}
+	HeapDefaultFree(ppDeclareHash);
+}
+
+
+
+///////////////////////
+// 関数ポインタの管理
+///////////////////////
+
+int AddProcPtrInfo( const string &typeExpression, int nowLine ){
+	DWORD dwProcType = (DWORD)typeExpression[2];
+	const string &paramStr = typeExpression.substr( 3 );
+
+	Procedure::Kind kind = Procedure::Sub;
+	if( dwProcType == ESC_FUNCTION ){
+		kind = Procedure::Function;
+	}
+
+	ProcPointer *pProcPointer = new ProcPointer( kind );
+
+	//buffer[0]は'('となっている
+	pProcPointer->SetParamsAndReturnType( paramStr.c_str(), nowLine );
+
+	Smoothie::meta.procPointers.push_back( pProcPointer );
+
+	return (int)Smoothie::meta.procPointers.size()-1;
+}
+void DeleteProcPtrInfo(void){
+	BOOST_FOREACH( ProcPointer *pProcPointer, Smoothie::meta.procPointers ){
+		delete pProcPointer;
+	}
+
+	Smoothie::meta.procPointers.clear();
+}
+
+
+
+bool IsNeedProcCompile(){
+	for(int i2=0;i2<MAX_HASH;i2++){
+		extern GlobalProc **ppSubHash;
+		GlobalProc *pUserProc=ppSubHash[i2];
+		while(pUserProc){
+			if( pUserProc->IsUsing() && pUserProc->IsCompiled() == false ){
+				return true;
+			}
+
+			pUserProc=pUserProc->pNextData;
+		}
+	}
+	return false;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Type.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Type.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Type.cpp	(revision 178)
@@ -0,0 +1,536 @@
+#include "common.h"
+
+const int Type::basicTypeList[] = {
+	DEF_BYTE,
+	DEF_SBYTE,
+	DEF_WORD,
+	DEF_INTEGER,
+	DEF_DWORD,
+	DEF_LONG,
+	DEF_QWORD,
+	DEF_INT64,
+
+	DEF_SINGLE,
+	DEF_DOUBLE,
+
+	DEF_BOOLEAN,
+
+	DEF_PTR_VOID,
+
+	DEF_ANY,
+
+	DEF_NON
+};
+
+const string Type::basicTypeNameList[] = {
+	"Byte",
+	"SByte",
+	"Word",
+	"Integer",
+	"DWord",
+	"Long",
+	"QWord",
+	"Int64",
+
+	"Single",
+	"Double",
+
+	"Boolean",
+
+	"VoidPtr",
+
+	"Any",
+
+	""
+};
+
+bool Type::StringToBasicType( const string &typeName, int &basicType ){
+	for( int i=0; ; i++ ){
+		if( basicTypeList[i] == DEF_NON ){
+			break;
+		}
+		if( basicTypeNameList[i] == typeName ){
+			basicType = basicTypeList[i];
+			return true;
+		}
+	}
+	return false;
+}
+bool Type::StringToType( const string &typeName, Type &type ){
+	type.index = -1;
+
+	if( typeName[0] == '*' ){
+		if( typeName.size() >= 3
+			&& typeName[1] == 1 && ( typeName[2] == ESC_FUNCTION || typeName[2] == ESC_SUB ) ){
+				//関数ポインタ（*Function）
+				type.basicType = DEF_PTR_PROC;
+				type.index = AddProcPtrInfo( typeName, cp );
+				return true;
+		}
+
+		const string &nextTypeName = typeName.substr( 1 );
+
+		if( !StringToType( nextTypeName, type ) ){
+			return false;
+		}
+
+		type.PtrLevelUp();
+
+		return true;
+	}
+
+	if( StringToBasicType( typeName, type.basicType ) ){
+		// 基本型だったとき
+		return true;
+	}
+
+
+	// Object型だったとき
+	if( typeName == "Object" ){
+		type.SetType( DEF_OBJECT, pobj_DBClass->GetObjectClassPtr() );
+		return true;
+	}
+
+	// String型だったとき
+	if( typeName == "String" ){
+		type.SetType( DEF_OBJECT, pobj_DBClass->GetStringClassPtr() );
+		return true;
+	}
+
+
+	////////////////////
+	// TypeDefされた型
+	////////////////////
+	int i=Smoothie::meta.typeDefs.GetIndex( typeName );
+	if(i!=-1){
+		type = Smoothie::meta.typeDefs[i].GetBaseType();
+		return true;
+	}
+
+	//クラス
+	const CClass *pobj_c = pobj_DBClass->Find( typeName );
+	if(pobj_c){
+		type.pClass = pobj_c;
+
+		if( pobj_c->IsStructure() ){
+			type.basicType = DEF_STRUCT;
+		}
+		else{
+			type.basicType = DEF_OBJECT;
+		}
+		return true;
+	}
+
+	return false;
+}
+
+int Type::GetBasicSize( int basicType )
+{
+
+	// 基本型
+	switch( basicType ){
+		case DEF_SBYTE:
+		case DEF_BYTE:
+		case DEF_BOOLEAN:
+			return sizeof(BYTE);
+
+		case DEF_INTEGER:
+		case DEF_WORD:
+			return sizeof(WORD);
+
+		case DEF_LONG:
+		case DEF_DWORD:
+			return sizeof(DWORD);
+
+		case DEF_INT64:
+		case DEF_QWORD:
+			return sizeof(_int64);
+
+		case DEF_DOUBLE:
+			return sizeof(double);
+		case DEF_SINGLE:
+			return sizeof(float);
+	}
+
+	// ポインタ
+	if(IsPtrType(basicType)){
+		return PTR_SIZE;
+	}
+
+	// オブジェクト
+	if(basicType==DEF_OBJECT){
+		return PTR_SIZE;
+	}
+
+	SetError();
+	return 0;
+}
+
+
+bool Type::Equals( const Type &type ) const
+{
+	if( basicType == type.basicType ){
+		if( NATURAL_TYPE( basicType ) == DEF_OBJECT
+			|| NATURAL_TYPE( basicType ) == DEF_STRUCT ){
+
+				if( index == type.index ){
+					return true;
+				}
+
+		}
+		else{
+			return true;
+		}
+	}
+	return false;
+}
+
+int Type::GetBasicSize() const
+{
+	return GetBasicSize( basicType );
+}
+int Type::GetSize() const
+{
+
+	// 基本型
+	switch( basicType ){
+		case DEF_LONG:
+			if(index==LITERAL_NULL||index==LITERAL_M128_0||index==LITERAL_0_255){
+				return sizeof(BYTE);
+			}
+			else if(index==LITERAL_M32768_0||index==LITERAL_0_65535){
+				return sizeof(WORD);
+			}
+			return sizeof(DWORD);
+
+		case DEF_SBYTE:
+		case DEF_BYTE:
+		case DEF_BOOLEAN:
+			return sizeof(BYTE);
+
+		case DEF_INTEGER:
+		case DEF_WORD:
+			return sizeof(WORD);
+
+		case DEF_DWORD:
+			return sizeof(DWORD);
+
+		case DEF_INT64:
+		case DEF_QWORD:
+			return sizeof(_int64);
+
+		case DEF_DOUBLE:
+			return sizeof(double);
+		case DEF_SINGLE:
+			return sizeof(float);
+	}
+
+	// ポインタ
+	if(IsPtrType(basicType)){
+		return PTR_SIZE;
+	}
+
+	// 構造体
+	if( basicType == DEF_STRUCT ){
+		if( !pClass ){
+			SetError();
+			return 0;
+		}
+
+		return pClass->GetSize();
+	}
+
+	// オブジェクト
+	if(basicType==DEF_OBJECT){
+		if( GetClass().IsInterface() ){
+			// vtblOffsetのサイズを含める
+			return PTR_SIZE*2;
+		}
+		return PTR_SIZE;
+	}
+
+	SetError();
+	return 0;
+}
+
+bool Type::IsNull() const{
+  if( basicType == DEF_NON ){
+	  return true;
+  }
+  return false;
+}
+
+bool Type::IsByte() const{
+  if( basicType == DEF_BYTE ){
+	  return true;
+  }
+  return false;
+}
+bool Type::IsSByte() const{
+  if( basicType == DEF_SBYTE ){
+	  return true;
+  }
+  return false;
+}
+bool Type::IsWord() const{
+  if( basicType == DEF_WORD ){
+	  return true;
+  }
+  return false;
+}
+bool Type::IsInteger() const{
+  if( basicType == DEF_INTEGER ){
+	  return true;
+  }
+  return false;
+}
+bool Type::IsDWord() const{
+  if( basicType == DEF_DWORD ){
+	  return true;
+  }
+  return false;
+}
+bool Type::IsLong() const{
+  if( basicType == DEF_LONG ){
+	  return true;
+  }
+  return false;
+}
+bool Type::IsQWord() const{
+  if( basicType == DEF_QWORD ){
+	  return true;
+  }
+  return false;
+}
+bool Type::IsInt64() const{
+  if( basicType == DEF_INT64 ){
+	  return true;
+  }
+  return false;
+}
+bool Type::IsSingle() const{
+  if( basicType == DEF_SINGLE ){
+	  return true;
+  }
+  return false;
+}
+bool Type::IsDouble() const{
+  if( basicType == DEF_DOUBLE ){
+	  return true;
+  }
+  return false;
+}
+bool Type::IsBoolean() const{
+  if( basicType == DEF_BOOLEAN ){
+	  return true;
+  }
+  return false;
+}
+
+bool Type::IsPointer() const
+{
+	if(PTR_LEVEL( basicType )|| basicType == DEF_PTR_VOID || basicType == DEF_PTR_PROC
+		|| ( basicType & FLAG_PTR ) ){
+			return true;
+	}
+
+	return false;
+}
+bool Type::IsSigned() const
+{
+	switch( basicType ){
+		case DEF_SBYTE:
+		case DEF_INTEGER:
+		case DEF_LONG:
+		case DEF_INT64:
+		case DEF_SINGLE:
+		case DEF_DOUBLE:
+			return true;
+		default:
+			break;
+	}
+	return false;
+}
+bool Type::IsNaturalWhole() const
+{
+	switch( basicType ){
+		case DEF_SBYTE:
+		case DEF_BYTE:
+		case DEF_INTEGER:
+		case DEF_WORD:
+		case DEF_LONG:
+		case DEF_DWORD:
+		case DEF_INT64:
+		case DEF_QWORD:
+			return true;
+		default:
+			break;
+	}
+	return false;
+}
+bool Type::IsWhole() const
+{
+	return (
+		IsNaturalWhole()
+		|| IsPtrType( basicType )
+		|| basicType == DEF_BOOLEAN
+		);
+}
+bool Type::IsReal() const
+{
+	switch( basicType ){
+		case DEF_SINGLE:
+		case DEF_DOUBLE:
+			return true;
+		default:
+			break;
+	}
+	return false;
+}
+bool Type::Is64() const
+{
+	switch( basicType ){
+		case DEF_QWORD:
+		case DEF_INT64:
+			return true;
+		default:
+			break;
+	}
+	return false;
+}
+bool Type::IsProcPtr() const
+{
+	if( basicType == DEF_PTR_PROC ){
+		return true;
+	}
+	return false;
+}
+bool Type::IsStruct() const
+{
+	if( basicType == DEF_STRUCT ){
+		return true;
+	}
+	return false;
+}
+bool Type::IsStructPtr() const
+{
+	if( basicType == DEF_PTR_STRUCT ){
+		return true;
+	}
+	return false;
+}
+bool Type::IsObject() const
+{
+	if( basicType == DEF_OBJECT ){
+		return true;
+	}
+	return false;
+}
+bool Type::IsObjectPtr() const
+{
+	if( basicType == DEF_PTR_OBJECT ){
+		return true;
+	}
+	return false;
+}
+bool Type::IsObjectClass() const
+{
+	if( basicType == DEF_OBJECT ){
+		if( pClass->GetName() == "Object" ){
+			return true;
+		}
+	}
+	return false;
+}
+bool Type::IsStringClass() const
+{
+	if( basicType == DEF_OBJECT ){
+		if( pClass->GetName() == "String" ){
+			return true;
+		}
+	}
+	return false;
+}
+bool Type::IsVoidPtr() const
+{
+	if( basicType == DEF_PTR_VOID ){
+		return true;
+	}
+	return false;
+}
+
+bool Type::IsAny() const
+{
+	if( basicType == DEF_ANY ){
+		return true;
+	}
+	return false;
+}
+
+bool Type::HasMember() const
+{
+	if( NATURAL_TYPE( basicType ) == DEF_OBJECT
+		|| NATURAL_TYPE( basicType ) == DEF_STRUCT ){
+			return true;
+	}
+	return false;
+}
+
+const string Type::ToString() const
+{
+	if( PTR_LEVEL( basicType ) ){
+		//ポインタレベルが1以上の場合
+		Type type( *this );
+		type.PtrLevelDown();
+
+		return (string)"*" + type.ToString();
+	}
+	else if( IsObject() || IsStruct() ){
+		//オブジェクトまたは構造体
+
+		if( !( index == 0 || index == -1 ) ){
+			if( pClass->GetNamespaceScopes().size() >= 1 )
+			{
+				return pClass->GetNamespaceScopes().ToString() + "." + pClass->GetName();
+			}
+			return pClass->GetName();
+		}
+	}
+	else if( IsProcPtr() ){
+		if( index == 0 || index == -1 ){
+			return "VoidPtr";
+		}
+		else{
+			if( Smoothie::meta.procPointers[index]->ReturnType().IsNull() ){
+				return "*Sub";
+			}
+			return "*Function";
+		}
+	}
+	else{
+		// 基本型
+
+		for( int i=0; ; i++ ){
+			if( basicTypeList[i] == DEF_NON ){
+				break;
+			}
+			if( basicTypeList[i] == basicType ){
+				return basicTypeNameList[i];
+			}
+		}
+	}
+
+	extern int cp;
+	SetError(1,NULL,cp);
+
+	return (string)"(null)";
+}
+
+Type Type::String(){
+	return Type( DEF_OBJECT, *pobj_DBClass->GetStringClassPtr() );
+}
+
+const string BlittableType::GetCreateStaticMethodFullName() const
+{
+	return pClass->GetNamespaceScopes().ToString() + "." + pClass->GetName() + "._Create";
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Type.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Type.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Type.h	(revision 178)
@@ -0,0 +1,191 @@
+#pragma once
+
+class CClass;
+
+class Type{
+	int basicType;
+	union{
+		LONG_PTR index;
+		const CClass *pClass;
+	};
+
+public:
+	static int GetBasicSize( int basicType );
+
+	Type():
+	  basicType( DEF_NON ),
+	  index( -1 ){}
+	Type( int basicType ):
+	  basicType( basicType ),
+	  index( -1 ){}
+
+	Type( int basicType, LONG_PTR index ):
+	  basicType( basicType ),
+	  index( index ){}
+
+	Type( int basicType, const CClass &objClass ):
+	  basicType( basicType ),
+	  index( (LONG_PTR)&objClass ){}
+
+	Type( const Type &type ):
+	  basicType( type.basicType ),
+	  index( type.index ){}
+
+	__inline int GetBasicType() const
+	{
+		return basicType;
+	}
+	LONG_PTR GetIndex() const
+	{
+		return index;
+	}
+	const CClass &GetClass() const
+	{
+		return *pClass;
+	}
+
+	void SetBasicType( int basicType ){
+		this->basicType = basicType;
+	}
+	void SetIndex( LONG_PTR index ){
+		this->index = index;
+	}
+	void SetNull(){
+		SetBasicType( DEF_NON );
+		SetIndex( -1 );
+	}
+	void SetType( int basicType, LONG_PTR index ){
+		SetBasicType( basicType );
+		SetIndex( index );
+	}
+	void SetType( int basicType, const CClass *pClass ){
+		SetBasicType( basicType );
+		this->pClass = pClass;
+	}
+
+	int PtrLevel() const
+	{
+		return PTR_LEVEL( basicType );
+	}
+	void PtrLevelUp(){
+		PTR_LEVEL_UP( basicType );
+	}
+	void PtrLevelDown(){
+		PTR_LEVEL_DOWN( basicType );
+	}
+
+	bool Equals( const Type &type ) const;
+
+	int GetBasicSize() const;
+	int GetSize() const;
+
+	bool IsNull() const;
+
+	bool IsByte() const;
+	bool IsSByte() const;
+	bool IsWord() const;
+	bool IsInteger() const;
+	bool IsDWord() const;
+	bool IsLong() const;
+	bool IsQWord() const;
+	bool IsInt64() const;
+	bool IsSingle() const;
+	bool IsDouble() const;
+	bool IsBoolean() const;
+
+	bool IsPointer() const;
+	bool IsSigned() const;
+	bool IsNaturalWhole() const;
+	bool IsWhole() const;
+	bool IsReal() const;
+	bool Is64() const;
+	bool IsProcPtr() const;
+	bool IsStruct() const;
+	bool IsStructPtr() const;
+	bool IsObject() const;
+	bool IsObjectPtr() const;
+	bool IsObjectClass() const;
+	bool IsStringClass() const;
+	bool IsVoidPtr() const;
+	bool IsAny() const;
+
+	// オブジェクトや構造体など、メンバを持つ型かどうかを判別する
+	bool HasMember() const;
+
+	const string ToString() const;
+
+	void operator= ( const Type &type ){
+		basicType = type.basicType;
+		index = type.index;
+	}
+
+	static Type String();
+
+
+private:
+	static const int basicTypeList[];
+	static const string basicTypeNameList[];
+public:
+	static bool StringToBasicType( const string &typeName, int &basicType );
+	static bool StringToType( const string &typeName, Type &type );
+};
+
+class BlittableType
+{
+	Type basicType;
+	CClass *pClass;
+public:
+	BlittableType( const Type &basicType, CClass *pClass )
+		: basicType( basicType )
+		, pClass( pClass )
+	{
+	}
+	BlittableType(){}
+	const Type &GetBasicType() const
+	{
+		return basicType;
+	}
+	const CClass *GetClassPtr() const
+	{
+		return pClass;
+	}
+	const string GetCreateStaticMethodFullName() const;
+};
+class BlittableTypes : public vector<BlittableType>
+{
+public:
+	bool IsExist( Type type ) const
+	{
+		const BlittableTypes &blittableTypes = *this;
+		BOOST_FOREACH( const BlittableType &blittableType, blittableTypes ){
+			if( blittableType.GetBasicType().Equals( type ) ){
+				return true;
+			}
+		}
+		return false;
+	}
+	const BlittableType &Find( const Type &type ) const
+	{
+		const BlittableTypes &blittableTypes = *this;
+		BOOST_FOREACH( const BlittableType &blittableType, blittableTypes ){
+			if( blittableType.GetBasicType().Equals( type ) ){
+				return blittableType;
+			}
+		}
+		throw "Blittable型ではない";
+	}
+	const CClass *GetClassPtr( const Type &type ) const
+	{
+		const BlittableTypes &blittableTypes = *this;
+		BOOST_FOREACH( const BlittableType &blittableType, blittableTypes ){
+			if( blittableType.GetBasicType().Equals( type ) ){
+				return blittableType.GetClassPtr();
+			}
+		}
+		return NULL;
+	}
+	const CClass &GetClass( const Type &type ) const
+	{
+		return *GetClassPtr( type );
+	}
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/TypeDef.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/TypeDef.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/TypeDef.cpp	(revision 178)
@@ -0,0 +1,242 @@
+#include "common.h"
+
+
+TypeDef::TypeDef( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName )
+	: namespaceScopes( namespaceScopes )
+	, name( name )
+	, baseName( baseName )
+{
+	if( !Type::StringToType( baseName, baseType ) ){
+		SetError(3, baseName, cp );
+		return;
+	}
+}
+TypeDef::~TypeDef(){
+}
+
+bool TypeDef::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	if( GetName() != name ){
+		return false;
+	}
+	return NamespaceScopes::IsSameArea( this->namespaceScopes, namespaceScopes );
+}
+bool TypeDef::IsEqualSymbol( const string &fullName ) const
+{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
+
+	if( IsEqualSymbol( NamespaceScopes( AreaName ), NestName ) ){
+		return true;
+	}
+
+	if( isNest ){
+		// 静的メンバを考慮
+
+		char AreaName2[VN_SIZE] = "";		//オブジェクト変数
+		char NestName2[VN_SIZE] = "";		//入れ子メンバ
+		bool isNest = SplitMemberName( AreaName, AreaName2, NestName2 );
+		lstrcat( NestName2, "." );
+		lstrcat( NestName2, NestName );
+
+		return IsEqualSymbol( NamespaceScopes( AreaName2 ), NestName2 );
+	}
+
+	return false;
+}
+
+
+
+TypeDefCollection::TypeDefCollection(){
+}
+TypeDefCollection::~TypeDefCollection(){
+}
+void TypeDefCollection::Add( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName ){
+	TypeDef typeDef( namespaceScopes, name, baseName );
+	this->push_back( typeDef );
+}
+int TypeDefCollection::GetIndex( const NamespaceScopes &namespaceScopes, const string &name ) const{
+	int max = (int)(*this).size();
+	for( int i=0; i<max; i++ ){
+		if( (*this)[i].IsEqualSymbol( namespaceScopes, name ) ){
+			return i;
+		}
+	}
+	return -1;
+}
+int TypeDefCollection::GetIndex( const string &fullName ) const{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
+
+	return GetIndex( NamespaceScopes( AreaName ), NestName );
+}
+
+void TypeDefCollection::Add( const NamespaceScopes &namespaceScopes, const string &expression, int nowLine ){
+	int i;
+	char temporary[VN_SIZE];
+
+	for(i=0;;i++){
+		if(expression[i]=='='||expression[i]=='\0'){
+			temporary[i]=0;
+			break;
+		}
+		temporary[i]=expression[i];
+	}
+
+	if(expression[i]!='='){
+		SetError(10,"TypeDef",nowLine);
+		return;
+	}
+
+	const char *pTemp=expression.c_str()+i+1;
+
+	//識別文字のエラーチェック（新しい型）
+	i=0;
+	for(;;i++){
+		if(temporary[i]=='\0') break;
+		if(!IsVariableChar(temporary[i])){
+			SetError(10,"TypeDef",nowLine);
+			return;
+		}
+	}
+
+	//識別文字のエラーチェック（コピー元の型）
+	if(pTemp[0]=='*'&&pTemp[1]==1&&(pTemp[2]==ESC_FUNCTION||pTemp[2]==ESC_SUB)){
+		//関数ポインタ
+		if(pTemp[3]!='('){
+			SetError(10,"TypeDef",nowLine);
+			return;
+		}
+	}
+	else{
+		i=0;
+		while(pTemp[i]=='*') i++;
+		for(;;i++){
+			if(pTemp[i]=='\0') break;
+			if(!IsVariableChar(pTemp[i])){
+				SetError(10,"TypeDef",nowLine);
+				return;
+			}
+		}
+	}
+
+	//識別子が重複している場合はエラーにする
+	if(lstrcmp(temporary,pTemp)==0){
+		SetError(1,NULL,nowLine);
+		return;
+	}
+
+
+
+	//////////////////////////
+	// TypeDef情報を追加
+	//////////////////////////
+
+	//エラー用
+	extern int cp;
+	cp = nowLine;
+
+	Add( namespaceScopes, temporary, pTemp );
+}
+
+void TypeDefCollection::Init(){
+	// 初期化
+	clear();
+
+	// 名前空間管理
+	NamespaceScopes &namespaceScopes = Smoothie::Lexical::liveingNamespaceScopes;
+	namespaceScopes.clear();
+
+	// Importsされた名前空間の管理
+	NamespaceScopesCollection &importedNamespaces = Smoothie::Temp::importedNamespaces;
+	importedNamespaces.clear();
+
+	int i=-1, i2;
+	char temporary[VN_SIZE];
+	while(1){
+		extern char *basbuf;
+
+		i++;
+
+		if( basbuf[i] == 1 && basbuf[i+1] == ESC_NAMESPACE ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( basbuf[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+			}
+			namespaceScopes.push_back( temporary );
+
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_ENDNAMESPACE ){
+			if( namespaceScopes.size() <= 0 ){
+				SetError(12, "End Namespace", i );
+			}
+			else{
+				namespaceScopes.pop_back();
+			}
+
+			i += 2;
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_IMPORTS ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( basbuf[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=basbuf[i];
+			}
+			if( !importedNamespaces.Imports( temporary ) )
+			{
+				SetError(64,temporary,cp );
+			}
+
+			continue;
+		}
+		else if( basbuf[i] == 1 && basbuf[i+1] == ESC_CLEARNAMESPACEIMPORTED ){
+			importedNamespaces.clear();
+			continue;
+		}
+
+		if( basbuf[i]==1 ){
+			char temporary[VN_SIZE];
+			if(basbuf[i+1]==ESC_TYPEDEF){
+				int i2 = 0;
+				for(i+=2;;i2++,i++){
+					if(basbuf[i]=='\n'){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=basbuf[i];
+					if(basbuf[i]=='\0') break;
+				}
+				Add( namespaceScopes, temporary, i );
+
+				continue;
+			}
+			else if( basbuf[i+1] == ESC_CONST && basbuf[i+2] == 1 && basbuf[i+3] == ESC_ENUM ){
+				int i2 = 0;
+				for(i+=4;;i2++,i++){
+					if(!IsVariableChar(basbuf[i])){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=basbuf[i];
+					if(basbuf[i]=='\0') break;
+				}
+				Add( namespaceScopes, temporary, "Long" );
+			}
+		}
+
+		//次の行
+		for(;;i++){
+			if(IsCommandDelimitation(basbuf[i])) break;
+		}
+		if(basbuf[i]=='\0') break;
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/TypeDef.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/TypeDef.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/TypeDef.h	(revision 178)
@@ -0,0 +1,55 @@
+#pragma once
+
+#include <vector>
+#include <string>
+
+#include "../Type.h"
+
+using namespace std;
+
+class TypeDefCollection;
+
+class TypeDef{
+	friend TypeDefCollection;
+
+	NamespaceScopes namespaceScopes;
+
+	string name;
+	string baseName;
+	Type baseType;
+public:
+	TypeDef( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName );
+	~TypeDef();
+
+	const string &GetName() const
+	{
+		return name;
+	}
+	const string &GetBaseName() const
+	{
+		return baseName;
+	}
+	const Type &GetBaseType() const
+	{
+		return baseType;
+	}
+
+	bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	bool IsEqualSymbol( const string &name ) const;
+};
+
+class TypeDefCollection : public vector<TypeDef>
+{
+public:
+	TypeDefCollection();
+	~TypeDefCollection();
+
+	void Add( const NamespaceScopes &namespaceScopes, const string &name, const string &baseName );
+	int GetIndex( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	int GetIndex( const string &fullName ) const;
+
+private:
+	void Add( const NamespaceScopes &namespaceScopes, const string &expression, int nowLine );
+public:
+	void Init();
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/VarList.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/VarList.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/VarList.cpp	(revision 178)
@@ -0,0 +1,1334 @@
+#include "../BasicCompiler_Common/common.h"
+
+//デバッグ用
+#include "../BasicCompiler_Common/debug.h"
+
+//変数リストのツリーハンドル
+HWND hVarTree_Global,hVarTree_Local,hVarTree_This;
+
+int VarList_Array(HWND hVarTree,HTREEITEM hParent,LONG_PTR offset,const Type &type,const int *SubScripts);
+void VarList_Member(HWND hVarTree,HTREEITEM hParent,LONG_PTR pTopOffset,const CClass &objClass,BOOL bPtr);
+void VarList_Insert(HWND hVarTree,TV_INSERTSTRUCT *lptv,const char *VarName,const Type &type,LONG_PTR offset){
+	extern HANDLE hDebugProcess;
+	int i2;
+	char temporary[255],temp2[255];
+	LONG_PTR pData;
+	SIZE_T accessBytes;
+	double dbl;
+	float flt;
+	WORD wData;
+	BYTE byteData;
+	HTREEITEM hParent;
+	_int64 i64data;
+
+	if( type.IsObject() || type.IsStruct() ){
+		i2=1;
+		if( type.IsObject() ){
+			// 参照型ということを考慮する
+			i2=ReadProcessMemory(hDebugProcess,(void *)offset,&pData,sizeof(void *),&accessBytes);
+			offset = pData;
+		}
+
+		sprintf(lptv->item.pszText,"%s %s(&H%X)",VarName,STRING_OBJECT,(ULONG_PTR)offset);
+		lptv->item.iImage=1;
+		lptv->item.iSelectedImage=1;
+		hParent=TreeView_InsertItem(hVarTree,lptv);
+
+		if(i2 && offset) VarList_Member(hVarTree,hParent,offset,type.GetClass(),0);
+		return;
+	}
+	else if( type.IsObjectPtr() || type.IsStructPtr() ){
+		i2=ReadProcessMemory(hDebugProcess,(void *)offset,&pData,sizeof(void *),&accessBytes);
+
+		sprintf(lptv->item.pszText,"%s %s(&H%X)",VarName,STRING_POINTEROFOBJECT,(ULONG_PTR)pData);
+		lptv->item.iImage=4;
+		lptv->item.iSelectedImage=4;
+		hParent=TreeView_InsertItem(hVarTree,lptv);
+
+		if(i2) VarList_Member(hVarTree,hParent,pData,type.GetClass(),1);
+		return;
+	}
+	else{
+		if(type.GetBasicType()==MAKE_PTR_TYPE(DEF_SBYTE,1)||type.GetBasicType()==MAKE_PTR_TYPE(DEF_BYTE,1)){
+			if(ReadProcessMemory(hDebugProcess,(void *)offset,&pData,sizeof(void *),&accessBytes)){
+				for(i2=0;;i2++){
+					if(!ReadProcessMemory(hDebugProcess,(void *)(pData+i2),&temporary[i2],1,&accessBytes)){
+						i2=-1;
+						break;
+					}
+					if(temporary[i2]=='\0') break;
+					if(i2==64){
+						lstrcpy(temporary+i2,"...");
+						break;
+					}
+				}
+				if(i2==-1) sprintf(lptv->item.pszText,"%s %d(&H%X)",VarName,(ULONG_PTR)pData,(ULONG_PTR)pData);
+				else sprintf(lptv->item.pszText,"%s %d(&H%X) \"%s\"",VarName,(ULONG_PTR)pData,(ULONG_PTR)pData,temporary);
+			}
+			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
+		}
+		else if(type.IsDouble()){
+			if(ReadProcessMemory(hDebugProcess,(void *)offset,&dbl,sizeof(double),&accessBytes)){
+				sprintf(lptv->item.pszText,"%s %.15g",VarName,dbl);
+			}
+			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
+		}
+		else if(type.IsSingle()){
+			if(ReadProcessMemory(hDebugProcess,(void *)offset,&flt,sizeof(float),&accessBytes)){
+				sprintf(lptv->item.pszText,"%s %.6g",VarName,flt);
+			}
+			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
+		}
+		else if(type.IsInt64()){
+			_int64 i64data;
+			if(ReadProcessMemory(hDebugProcess,(void *)offset,&i64data,sizeof(_int64),&accessBytes)){
+				_i64toa(i64data,temporary,10);
+				_i64toa(i64data,temp2,16);
+				CharUpper(temp2);
+				sprintf(lptv->item.pszText,"%s %s(&H%s)",VarName,temporary,temp2);
+			}
+			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
+		}
+		else if(type.IsQWord()||(type.IsPointer()&&PTR_SIZE==sizeof(_int64))){
+			if(ReadProcessMemory(hDebugProcess,(void *)offset,&i64data,sizeof(_int64),&accessBytes)){
+				_ui64toa(i64data,temporary,10);
+				_ui64toa(i64data,temp2,16);
+				CharUpper(temp2);
+				sprintf(lptv->item.pszText,"%s %s(&H%s)",VarName,temporary,temp2);
+			}
+			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
+		}
+		else if(type.IsLong()){
+			long l;
+			if(ReadProcessMemory(hDebugProcess,(void *)offset,&l,sizeof(long),&accessBytes)){
+				sprintf(lptv->item.pszText,"%s %d(&H%X)",VarName,l,l);
+			}
+			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
+		}
+		else if(type.IsDWord()||(type.IsPointer()&&PTR_SIZE==sizeof(long))){
+			if(ReadProcessMemory(hDebugProcess,(void *)offset,&i64data,sizeof(_int64),&accessBytes)){
+				sprintf(lptv->item.pszText,"%s %u(&H%X)",VarName,(int)i64data,(int)i64data);
+			}
+			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
+		}
+		else if(type.IsInteger()){
+			if(ReadProcessMemory(hDebugProcess,(void *)offset,&wData,sizeof(WORD),&accessBytes)){
+				sprintf(lptv->item.pszText,"%s %d(&H%X)",VarName,(short)wData,(short)wData);
+			}
+			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
+		}
+		else if(type.IsWord()){
+			if(ReadProcessMemory(hDebugProcess,(void *)offset,&wData,sizeof(WORD),&accessBytes)){
+				sprintf(lptv->item.pszText,"%s %u(&H%X)",VarName,wData,wData);
+			}
+			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
+		}
+		else if(type.IsSByte()){
+			if(ReadProcessMemory(hDebugProcess,(void *)offset,&byteData,sizeof(BYTE),&accessBytes)){
+				temporary[0]=byteData;
+				temporary[1]=0;
+				sprintf(lptv->item.pszText,"%s %d(&H%X)'%s'",VarName,(char)byteData,byteData,temporary);
+			}
+			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
+		}
+		else if(type.IsByte()){
+			if(ReadProcessMemory(hDebugProcess,(void *)offset,&byteData,sizeof(BYTE),&accessBytes)){
+				temporary[0]=byteData;
+				temporary[1]=0;
+				sprintf(lptv->item.pszText,"%s %d(&H%X)'%s'",VarName,byteData,byteData,temporary);
+			}
+			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
+		}
+		else if(type.IsBoolean()){
+			if(ReadProcessMemory(hDebugProcess,(void *)offset,&byteData,sizeof(BYTE),&accessBytes)){
+				if( byteData ) lstrcpy( temporary, "True" );
+				else lstrcpy( temporary, "False" );
+
+				wsprintf(lptv->item.pszText,"%s %s",VarName,temporary);
+			}
+			else sprintf(lptv->item.pszText,"%s %s",VarName,STRING_CANNOTACCESS);
+		}
+		lptv->item.iImage=2;
+		lptv->item.iSelectedImage=2;
+	}
+	TreeView_InsertItem(hVarTree,lptv);
+}
+void VarList_Member(HWND hVarTree,HTREEITEM hParent,LONG_PTR pTopOffset,const CClass &objClass,BOOL bPtr){
+	char VarData[VN_SIZE],VarName[VN_SIZE];
+	TV_INSERTSTRUCT tv;
+
+	memset(&tv,0,sizeof(TV_INSERTSTRUCT));
+	tv.hInsertAfter=TVI_LAST;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+	tv.hParent=hParent;
+	tv.item.pszText=VarData;
+
+	BOOST_FOREACH( CMember *pMember, objClass.GetDynamicMembers() ){
+		if(bPtr){
+			lstrcpy(VarName,"->");
+			lstrcat(VarName,pMember->GetName().c_str());
+		}
+		else{
+			lstrcpy(VarName,".");
+			lstrcat(VarName,pMember->GetName().c_str());
+		}
+
+		LONG_PTR offset;
+		int i2;
+		offset=objClass.GetMemberOffset( pMember->GetName().c_str(), &i2 );
+
+		if(pMember->SubScripts[0]!=-1){
+			//構造体内の配列
+			sprintf(VarData,"%s %s(&H%X)",VarName,STRING_ARRAY,pTopOffset+offset);
+			tv.item.iImage=0;
+			tv.item.iSelectedImage=0;
+			hParent=TreeView_InsertItem(hVarTree,&tv);
+
+			VarList_Array(hVarTree,hParent,
+				pTopOffset+offset,
+				pMember->GetType(),
+				pMember->SubScripts);
+		}
+		else{
+			//メンバ変数
+			VarList_Insert(hVarTree,
+				&tv,
+				VarName,
+				pMember->GetType(),
+				pTopOffset+offset);
+		}
+	}
+}
+int VarList_Array(HWND hVarTree,HTREEITEM hParent,LONG_PTR offset,const Type &type,const int *SubScripts ){
+	int i,i2,i3,ElementNum,MemCounter,UseCount[255];
+	char temporary[VN_SIZE],temp2[DIGIT_SIZE];
+
+	TV_INSERTSTRUCT tv;
+	memset(&tv,0,sizeof(TV_INSERTSTRUCT));
+	tv.hInsertAfter=TVI_LAST;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+	tv.hParent=hParent;
+	tv.item.pszText=temporary;
+
+	for(i=0;i<255;i++){
+		if(SubScripts[i]==-1) break;
+		UseCount[i]=0;
+	}
+	UseCount[i]=-2;
+	MemCounter=0;
+	while(1){
+		UseCount[i]++;
+		for(ElementNum=0;SubScripts[i-ElementNum]<UseCount[i-ElementNum];ElementNum++){
+			UseCount[i-ElementNum]=0;
+			if(i-ElementNum-1<0) return MemCounter;
+			UseCount[i-ElementNum-1]++;
+		}
+
+		if(MemCounter<50){
+			temporary[0]='[';
+			temporary[1]=0;
+			for(i2=0;i2<i;i2++){
+				sprintf(temp2,"%d",UseCount[i2]);
+				lstrcat(temporary,temp2);
+				lstrcat(temporary,",");
+			}
+			i3=lstrlen(temporary);
+			temporary[i3-1]=']';
+			temporary[i3]=0;
+
+			VarList_Insert(hVarTree,&tv,temporary,type,
+				offset+MemCounter*type.GetSize());
+		}
+
+		MemCounter++;
+		if(MemCounter==50){
+			lstrcpy(tv.item.pszText,"...");
+			TreeView_InsertItem(hVarTree,&tv);
+		}
+	}
+	return 0;
+}
+void RefreshGlobalVar(void){
+	extern DWORD ImageBase;
+	char temporary[VN_SIZE];
+	TV_INSERTSTRUCT tv;
+	HTREEITEM hParent;
+
+	TreeView_DeleteAllItems(hVarTree_Global);
+
+	memset(&tv,0,sizeof(TV_INSERTSTRUCT));
+	tv.hInsertAfter=TVI_LAST;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+	tv.hParent=TVI_ROOT;
+	tv.item.pszText=temporary;
+
+	extern HANDLE hDebugProcess;
+	extern int MemPos_RWSection;
+
+	foreach( Variable *pVar, globalVars ){
+
+		//スコープ外の場合は無視
+		if(pVar->ScopeLevel!=0){
+			if(rva_to_real(pVar->ScopeStartAddress) <= pobj_dti->lplpObp[0]  &&
+				pobj_dti->lplpObp[0] < rva_to_real(pVar->ScopeEndAddress)){
+				//範囲内
+			}
+			else{
+				//範囲外
+				continue;
+			}
+		}
+
+
+		if(!pobj_nv->bShow_DefaultSystem_Var){
+			if(memcmp(pVar->GetName().c_str(),"_System_",8)==0||
+				memcmp(pVar->GetName().c_str(),"_DebugSys_",10)==0||
+				memcmp(pVar->GetName().c_str(),"_PromptSys_",11)==0) continue;
+		}
+		if(!pobj_nv->bShow_Rad_Var){
+			if(memcmp(pVar->GetName().c_str(),"_RadSys_",8)==0) continue;
+		}
+		if(!pobj_nv->bShow_GUID_Var){
+			if(memcmp(pVar->GetName().c_str(),"GUID_",5)==0||
+				memcmp(pVar->GetName().c_str(),"IID_",4)==0||
+				memcmp(pVar->GetName().c_str(),"CLSID_",6)==0) continue;
+		}
+
+		//静的メンバ
+		if(strstr(pVar->GetName().c_str(),".")) continue;
+
+		if(pVar->IsArray()){
+			sprintf(temporary,"%s %s(&H%X)",
+				pVar->GetName().c_str(),
+				STRING_ARRAY,
+				ImageBase+MemPos_RWSection+pVar->offset);
+			tv.item.iImage=0;
+			tv.item.iSelectedImage=0;
+			hParent=TreeView_InsertItem(hVarTree_Global,&tv);
+
+			VarList_Array(hVarTree_Global,hParent,
+				(LONG_PTR)(ImageBase+MemPos_RWSection+pVar->offset),
+				*pVar,
+				pVar->GetSubScriptsPtr());
+		}
+		else{
+			VarList_Insert(hVarTree_Global,
+				&tv,
+				pVar->GetName().c_str(),
+				*pVar,
+				(LONG_PTR)(ImageBase+MemPos_RWSection+pVar->offset));
+		}
+	}
+}
+void RefreshLocalVar(void){
+	int i2,i3,sw;
+	char temporary[VN_SIZE];
+	TV_INSERTSTRUCT tv;
+	HTREEITEM hParent;
+	LONG_PTR offset;
+	SIZE_T accessBytes;
+	LONG_PTR lpData;
+
+	TreeView_DeleteAllItems(hVarTree_Local);
+
+	memset(&tv,0,sizeof(TV_INSERTSTRUCT));
+	tv.hInsertAfter=TVI_LAST;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+	tv.hParent=TVI_ROOT;
+	tv.item.pszText=temporary;
+
+	extern HANDLE hDebugProcess;
+	extern HWND hDebugWnd;
+	i2=(int)SendDlgItemMessage(hDebugWnd,IDC_PROCCOMBO,CB_GETCURSEL,0,0);
+	i2=pobj_dti->iProcLevel-i2;
+
+	if(pobj_dti->lplpSpBase[i2]==0) return;
+
+	extern GlobalProc **ppSubHash;
+	GlobalProc *pUserProc;
+	for(i3=0,sw=0;i3<MAX_HASH;i3++){
+		pUserProc=ppSubHash[i3];
+		while(pUserProc){
+			if(rva_to_real(pUserProc->beginOpAddress) <= pobj_dti->lplpObp[i2]  &&
+				pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->endOpAddress)){
+				sw=1;
+				break;
+			}
+
+			pUserProc=pUserProc->pNextData;
+		}
+		if(sw) break;
+	}
+	if(!pUserProc) return;
+
+	foreach( Variable *pVar, pUserProc->localVars ){
+
+		//スコープ外の場合は無視
+		if(pVar->ScopeLevel!=0){
+			if(rva_to_real(pVar->ScopeStartAddress) <= pobj_dti->lplpObp[i2]  &&
+				pobj_dti->lplpObp[i2] < rva_to_real(pVar->ScopeEndAddress)){
+				//範囲内
+			}
+			else{
+				//範囲外
+				continue;
+			}
+		}
+
+		if(pVar->IsArray()){
+			sprintf(temporary,"%s %s(&H%X)",
+				pVar->GetName().c_str(),
+				STRING_ARRAY,
+				pobj_dti->lplpSpBase[i2]+pVar->offset);
+			tv.item.iImage=0;
+			tv.item.iSelectedImage=0;
+			hParent=TreeView_InsertItem(hVarTree_Local,&tv);
+
+			VarList_Array(hVarTree_Local,hParent,
+				pobj_dti->lplpSpBase[i2]+pVar->offset,
+				*pVar,
+				pVar->GetSubScriptsPtr());
+		}
+		else{
+			offset=pobj_dti->lplpSpBase[i2]+pVar->offset;
+			if(pVar->IsRef()){
+				ReadProcessMemory(hDebugProcess,(void *)offset,&lpData,sizeof(LONG_PTR),&accessBytes);
+				offset=lpData;
+			}
+			VarList_Insert(hVarTree_Local,&tv,
+				pVar->GetName().c_str(),
+				*pVar,
+				offset);
+		}
+	}
+
+
+
+	/////////////////////////////
+	// Thisオブジェクトのリスト
+	/////////////////////////////
+
+	TreeView_DeleteAllItems(hVarTree_This);
+	if(!pUserProc->GetParentClassPtr()) return;
+
+	//Thisポインタを取得
+	LONG_PTR pThis;
+	const Variable *pVar = pUserProc->localVars.Find( Symbol( "_System_LocalThis" ) );
+	if( !pVar ){
+		return;
+	}
+	lpData=pobj_dti->lplpSpBase[i2]+pVar->offset;
+	ReadProcessMemory(hDebugProcess,(void *)lpData,&pThis,sizeof(LONG_PTR),&accessBytes);
+
+	BOOST_FOREACH( CMember *pMember, pUserProc->GetParentClassPtr()->GetDynamicMembers() ){
+		offset=pUserProc->GetParentClassPtr()->GetMemberOffset( pMember->GetName().c_str(),&i2);
+
+		if(pMember->SubScripts[0]!=-1){
+			//配列
+			sprintf(temporary,"%s %s(&H%X)",
+				pMember->GetName().c_str(),
+				STRING_ARRAY,
+				(ULONG_PTR)offset);
+			tv.item.iImage=0;
+			tv.item.iSelectedImage=0;
+			hParent=TreeView_InsertItem(hVarTree_This,&tv);
+
+			VarList_Array(hVarTree_This,hParent,
+				pThis+offset,
+				pMember->GetType(),
+				pMember->SubScripts);
+		}
+		else{
+			VarList_Insert(hVarTree_This,&tv,
+				pMember->GetName().c_str(),
+				pMember->GetType(),
+				pThis+offset);
+		}
+	}
+}
+void RefreshGlobalVar_with_WindowLock(void){
+	extern HWND hDebugWnd;
+
+	//処理時間を短くするため、一時的に非表示にする
+	LockWindowUpdate(hDebugWnd);
+	ShowWindow(GetParent(hVarTree_Global),SW_HIDE);
+
+	//リフレッシュ
+	RefreshGlobalVar();
+
+	LockWindowUpdate(NULL);
+	ShowWindow(GetParent(hVarTree_Global),SW_SHOW);
+}
+void RefreshLocalVar_with_WindowLock(void){
+	extern HWND hDebugWnd;
+
+	//処理時間を短くするため、一時的に非表示にする
+	LockWindowUpdate(hDebugWnd);
+	ShowWindow(GetParent(hVarTree_Local),SW_HIDE);
+
+	//リフレッシュ
+	RefreshLocalVar();
+
+	LockWindowUpdate(NULL);
+	ShowWindow(GetParent(hVarTree_Local),SW_SHOW);
+}
+
+void SetCalcToWatchList(HWND hListView,int iItem,char *buffer){
+	char temporary[255],temp2[255];
+
+	//エスケープシーケンスをセット
+	SetEscapeSequenceFormat(buffer);
+
+	KillStringSpaces(buffer);
+
+	//カッコを相互チェック
+	if(!CheckParenthesis2(buffer)){
+		
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+		ListView_SetItemText(hListView,iItem,1,"式の解析に失敗");
+		return;
+	}
+
+	double dbl;
+	_int64 i64data;
+	Type resultType;
+	bool isMemoryAccessError;
+	if( !StaticCalculation(true, buffer,0,&i64data,resultType,1,&isMemoryAccessError) ){
+		ListView_SetItemText(hListView,iItem,1,"式の解析に失敗");
+	}
+	else if(isMemoryAccessError){
+		ListView_SetItemText(hListView,iItem,1,"アクセスできません");
+	}
+	else{
+		if(resultType.IsReal()){
+			memcpy(&dbl,&i64data,sizeof(double));
+			sprintf(temporary,"%.15g (&H%08X)",dbl,(int)dbl);
+		}
+		else if(resultType.Is64()){
+			_i64toa(i64data,temporary,10);
+			_i64toa(i64data,temp2,16);
+			CharUpper(temp2);
+			sprintf(temporary+lstrlen(temporary)," (&H%s)",temp2);
+		}
+		else sprintf(temporary,"%d (&H%08X)",(long)i64data,(long)i64data);
+
+		ListView_SetItemText(hListView,iItem,1,temporary);
+	}
+}
+void RefreshWatchList(void){
+	extern HWND hDebugWnd;
+	HWND hListView;
+	int i,i2;
+	char temporary[VN_SIZE];
+
+	hListView=GetDlgItem(hDebugWnd,IDC_WATCHLIST);
+	i2=ListView_GetItemCount(hListView);
+	for(i=0;i<i2-1;i++){
+		ListView_GetItemText(hListView,i,0,temporary,VN_SIZE);
+
+		//演算結果を表示
+		SetCalcToWatchList(hListView,i,temporary);
+	}
+}
+
+BOOL SetDebugProcCombo(HWND hProcCombo){
+	int i2,i3;
+	char temporary[255];
+
+	extern DWORD ImageBase;
+	extern int MemPos_CodeSection;
+
+	//行番号情報
+	extern int MaxLineInfoNum;
+	extern LINEINFO *pLineInfo;
+	for(i3=0;i3<(int)pobj_dti->iProcLevel+1;i3++){
+		for(i2=0;i2<MaxLineInfoNum-1;i2++){
+			if((ULONG_PTR)(pLineInfo[i2].TopObp+ImageBase+MemPos_CodeSection)<=pobj_dti->lplpObp[i3]&&
+				pobj_dti->lplpObp[i3]<=(ULONG_PTR)(pLineInfo[i2+1].TopObp+ImageBase+MemPos_CodeSection)) break;
+		}
+		if(i2==MaxLineInfoNum) pobj_dti->lpdwCp[i3]=-1;
+		else pobj_dti->lpdwCp[i3]=pLineInfo[i2].TopCp;
+	}
+	for(i3=0;i3<(int)pobj_dti->iProcLevel+1;i3++){
+		if(pobj_dti->lpdwCp[i3]==-1){
+			pobj_dti->iProcLevel--;
+			for(i2=i3;i2<(int)pobj_dti->iProcLevel+1;i2++){
+				pobj_dti->lplpObp[i2]=pobj_dti->lplpObp[i2+1];
+				pobj_dti->lplpSpBase[i2]=pobj_dti->lplpSpBase[i2+1];
+				pobj_dti->lpdwCp[i2]=pobj_dti->lpdwCp[i2+1];
+			}
+			i3--;
+			continue;
+		}
+	}
+
+	if(!GetLineNum(pobj_dti->lpdwCp[pobj_dti->iProcLevel],&i2,temporary)){
+		extern HWND hMainDlg;
+		//"デバッグ情報の取得に失敗"
+		MessageBox(hMainDlg,STRING_DEBUG_FAILED,"ActiveBasic error",MB_OK);
+		return 0;
+	}
+	ShowErrorLine(i2,temporary);
+
+	//プロシージャ コンボボックス
+	extern GlobalProc **ppSubHash;
+	GlobalProc *pUserProc;
+	int sw;
+	SendMessage(hProcCombo,CB_RESETCONTENT,0,0);
+	for(i2=pobj_dti->iProcLevel;i2>=0;i2--){
+		for(i3=0,sw=0;i3<MAX_HASH;i3++){
+			pUserProc=ppSubHash[i3];
+			while(pUserProc){
+				if(rva_to_real(pUserProc->beginOpAddress) <= pobj_dti->lplpObp[i2]  &&
+					pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->endOpAddress)){
+						lstrcpy(temporary,pUserProc->GetName().c_str());
+						sw=1;
+						break;
+				}
+				pUserProc=pUserProc->pNextData;
+			}
+			if(sw) break;
+		}
+		if(!pUserProc){
+			if(i2==0){
+				lstrcpy(temporary,"Global");
+				pobj_dti->lplpSpBase[i2]=0;
+			}
+			else lstrcpy(temporary,"error");
+		}
+		SendMessage(hProcCombo,CB_ADDSTRING,0,(LPARAM)temporary);
+	}
+	SendMessage(hProcCombo,CB_SETCURSEL,0,0);
+
+	return pobj_dti->iProcLevel;
+}
+
+//IDC_THREADCOMBOプロシージャ
+LRESULT CALLBACK ThreadComboProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern WNDPROC OldThreadComboProc;
+	int i2;
+	DWORD dwThreadID;
+	char temporary[255];
+
+	switch(message){
+		case WM_COMMAND:
+			if(HIWORD(wParam)==CBN_SELCHANGE){
+				SendMessage(hwnd,CB_GETLBTEXT,SendMessage(hwnd,CB_GETCURSEL,0,0),(LPARAM)temporary);
+				sscanf(temporary+2,"%X",&dwThreadID);
+
+				extern DWORD _DebugSys_dwThreadID[256];
+				i2=0;
+				while(_DebugSys_dwThreadID[i2]!=dwThreadID) i2++;
+
+				//次回のステップ実行対象を指定
+				extern int NextStepThreadNum;
+				NextStepThreadNum=i2;
+
+				//スレッド情報をリフレッシュ
+				pobj_dti->Reflesh(i2);
+
+				SetDebugProcCombo(GetDlgItem(GetParent(hwnd),IDC_PROCCOMBO));
+
+				SendDlgItemMessage(GetParent(hwnd),IDC_PROCCOMBO,WM_COMMAND,MAKELONG(0,CBN_SELCHANGE),0);
+			}
+			break;
+	}
+	return CallWindowProc(OldThreadComboProc,hwnd,message,wParam,lParam);
+}
+//IDC_PROCCOMBOプロシージャ
+LRESULT CALLBACK ProcComboProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern WNDPROC OldProcComboProc;
+	int i2,i3;
+	char temporary[MAX_PATH];
+
+	switch(message){
+		case WM_COMMAND:
+			if(HIWORD(wParam)==CBN_SELCHANGE){
+				i2=(int)SendMessage(hwnd,CB_GETCURSEL,0,0);
+				GetLineNum(pobj_dti->lpdwCp[pobj_dti->iProcLevel-i2],&i3,temporary);
+				ShowErrorLine(i3,temporary);
+
+				RefreshLocalVar_with_WindowLock();
+			}
+			break;
+	}
+	return CallWindowProc(OldProcComboProc,hwnd,message,wParam,lParam);
+}
+void InitVarList(DWORD dwThreadId){
+	extern HWND hDebugWnd;
+	int i2,i3,i5;
+	char temporary[255];
+
+
+	//スレッド
+	SendDlgItemMessage(hDebugWnd,IDC_THREADCOMBO,CB_RESETCONTENT,0,0);
+	extern DWORD _DebugSys_dwThreadID[256];
+	for(i2=0;i2<256;i2++){
+		if(_DebugSys_dwThreadID[i2]){
+			sprintf(temporary,"&H%08X",_DebugSys_dwThreadID[i2]);
+			SendDlgItemMessage(hDebugWnd,IDC_THREADCOMBO,CB_ADDSTRING,0,(LPARAM)temporary);
+			if(_DebugSys_dwThreadID[i2]==dwThreadId){
+				extern int NextStepThreadNum;
+				NextStepThreadNum=i2;
+			}
+		}
+	}
+	sprintf(temporary,"&H%08X",dwThreadId);
+	i5=(int)SendDlgItemMessage(hDebugWnd,IDC_THREADCOMBO,CB_FINDSTRING,0,(LPARAM)temporary);
+	SendDlgItemMessage(hDebugWnd,IDC_THREADCOMBO,CB_SETCURSEL,i5,0);
+
+	i2=SetDebugProcCombo(GetDlgItem(hDebugWnd,IDC_PROCCOMBO));
+
+
+	///////////////////////////////////////////////
+	// 実行中のプロシージャのローカル変数をセット
+	///////////////////////////////////////////////
+
+	int sw;
+
+	i2=(int)SendDlgItemMessage(hDebugWnd,IDC_PROCCOMBO,CB_GETCURSEL,0,0);
+	i2=pobj_dti->iProcLevel-i2;
+
+	if(pobj_dti->lplpSpBase[i2]){
+		extern GlobalProc **ppSubHash;
+		GlobalProc *pUserProc;
+		for(i3=0,sw=0;i3<MAX_HASH;i3++){
+			pUserProc=ppSubHash[i3];
+			while(pUserProc){
+				if(rva_to_real(pUserProc->beginOpAddress) <= pobj_dti->lplpObp[i2]  &&
+					pobj_dti->lplpObp[i2] < rva_to_real(pUserProc->endOpAddress)){
+					sw=1;
+					break;
+				}
+
+				pUserProc=pUserProc->pNextData;
+			}
+			if(sw) break;
+		}
+
+
+		if(pUserProc){
+			pobj_CompilingClass = pUserProc->GetParentClassPtr();
+			UserProc::CompileStartForUserProc( pUserProc );
+		}
+	}
+
+
+	////////////////////////
+	// 変数リストを再表示
+	////////////////////////
+
+	//処理時間を短くするため、一時的に非表示にする
+	LockWindowUpdate(hDebugWnd);
+	ShowWindow(GetParent(hVarTree_Global),SW_HIDE);
+	ShowWindow(GetDlgItem(hDebugWnd,IDC_WATCHLIST),SW_HIDE);
+
+	//リフレッシュ
+	RefreshLocalVar();
+	RefreshGlobalVar();
+	RefreshWatchList();
+
+	LockWindowUpdate(NULL);
+	ShowWindow(GetParent(hVarTree_Global),SW_SHOW);
+	ShowWindow(GetDlgItem(hDebugWnd,IDC_WATCHLIST),SW_SHOW);
+}
+
+
+
+
+//////////////////////////////////////
+// エディタに埋め込み表示のデバッガ
+//////////////////////////////////////
+
+BOOL CALLBACK DebuggerButtonsProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HINSTANCE hInst;
+	extern DWORD dwStepRun;
+
+	//デバッガ用ツールバー
+#define BMPNUM_DEBUGGERTOOLBAR 3
+#define BTNNUM_DEBUGGERTOOLBAR 4
+	TBBUTTON DebuggerToolBar[]={
+		{0,IDC_DEBUG_START,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0},
+		{0,0,TBSTATE_ENABLED,TBSTYLE_SEP,0,0},
+		{1,IDC_DEBUG_STEPOVER,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0},
+		{2,IDC_DEBUG_STEPIN,TBSTATE_ENABLED,TBSTYLE_BUTTON,0,0},
+	};
+	TOOLTIPTEXT *pTipText;
+
+	static HIMAGELIST hImageList,hImageList_Disabled;
+
+	switch(message){
+		case WM_INITDIALOG:
+			//ツールバーを生成
+			extern HWND hDebuggerToolbar;
+			hDebuggerToolbar=CreateToolbarEx(hwnd,WS_CHILD|WS_VISIBLE|CCS_NODIVIDER|TBSTYLE_FLAT|TBSTYLE_TOOLTIPS|WS_CLIPSIBLINGS,
+				NULL,
+				0,0,0,
+				DebuggerToolBar,
+				BTNNUM_DEBUGGERTOOLBAR,	/*アイテムの個数*/
+				0,0,16,15,sizeof(TBBUTTON));
+
+			hImageList = ImageList_LoadImage(hInst, MAKEINTRESOURCE(IDR_DEBUGGERTOOLBAR),
+				16, 0, RGB(192,192,192),IMAGE_BITMAP, LR_CREATEDIBSECTION);
+			SendMessage(hDebuggerToolbar, TB_SETIMAGELIST, 0, (LPARAM)hImageList);
+			hImageList_Disabled = ImageList_LoadImage(hInst, MAKEINTRESOURCE(IDR_DEBUGGERTOOLBAR_DISABLED),
+				16, 0, RGB(192,192,192),IMAGE_BITMAP, LR_CREATEDIBSECTION);
+			SendMessage(hDebuggerToolbar, TB_SETDISABLEDIMAGELIST, 0, (LPARAM)hImageList_Disabled);
+
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_DEBUG_START:
+					DestroyWindow(GetParent(hwnd));
+					return 1;
+				case IDC_DEBUG_STEPIN:
+					dwStepRun=1;
+					return 1;
+				case IDC_DEBUG_STEPOVER:
+					dwStepRun=2;
+					return 1;
+			}
+			break;
+		case WM_NOTIFY:
+			pTipText=(TOOLTIPTEXT *)lParam;
+			if(pTipText->hdr.code==TTN_NEEDTEXT){
+				//ツールチップを表示
+				switch(pTipText->hdr.idFrom){
+					case IDC_DEBUG_START:
+						pTipText->lpszText="実行";
+						break;
+					case IDC_DEBUG_STEPOVER:
+						pTipText->lpszText="ステップ アウト";
+						break;
+					case IDC_DEBUG_STEPIN:
+						pTipText->lpszText="ステップ イン";
+						break;
+				}
+			}
+			break;
+		case WM_SIZE:
+			MoveWindow(hDebuggerToolbar,0,0,LOWORD(lParam),HIWORD(lParam),1);
+			return 1;
+
+		case WM_DESTROY:
+			ImageList_Destroy(hImageList);
+			ImageList_Destroy(hImageList_Disabled);
+			return 1;
+	}
+	return 0;
+}
+
+WNDPROC OldTabProc;
+LRESULT CALLBACK TabProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HINSTANCE hInst;
+
+	static HMENU hDummyMenu,hMenu=0;
+
+	switch(message){
+		case WM_CONTEXTMENU:
+			if(hMenu==0){
+				hDummyMenu=LoadMenu(hInst,MAKEINTRESOURCE(IDR_DEBUGGER_VARLIST_MENU));
+				hMenu=GetSubMenu(hDummyMenu,0);
+			}
+
+			MENUITEMINFO mi;
+			mi.cbSize=sizeof(MENUITEMINFO);
+			mi.fMask=MIIM_STATE;
+			mi.fState=MFS_CHECKED;
+
+			if(pobj_nv->bShow_DefaultSystem_Var)
+				SetMenuItemInfo(hMenu,IDM_SHOW_DEFAULTSYSTEM_VAR,0,&mi);
+			if(pobj_nv->bShow_Rad_Var)
+				SetMenuItemInfo(hMenu,IDM_SHOW_RAD_VAR,0,&mi);
+			if(pobj_nv->bShow_GUID_Var)
+				SetMenuItemInfo(hMenu,IDM_SHOW_GUID_VAR,0,&mi);
+
+			TrackPopupMenu(hMenu,TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+
+			break;
+		case WM_COMMAND:
+			mi.cbSize=sizeof(MENUITEMINFO);
+			mi.fMask=MIIM_STATE;
+			switch(LOWORD(wParam)){
+				case IDM_SHOW_DEFAULTSYSTEM_VAR:
+					if(pobj_nv->bShow_DefaultSystem_Var){
+						pobj_nv->bShow_DefaultSystem_Var=0;
+						mi.fState=MFS_UNCHECKED;
+					}
+					else{
+						pobj_nv->bShow_DefaultSystem_Var=1;
+						mi.fState=MFS_CHECKED;
+					}
+					SetMenuItemInfo(hMenu,IDM_SHOW_DEFAULTSYSTEM_VAR,0,&mi);
+					RefreshGlobalVar_with_WindowLock();
+					break;
+				case IDM_SHOW_RAD_VAR:
+					if(pobj_nv->bShow_Rad_Var){
+						pobj_nv->bShow_Rad_Var=0;
+						mi.fState=MFS_UNCHECKED;
+					}
+					else{
+						pobj_nv->bShow_Rad_Var=1;
+						mi.fState=MFS_CHECKED;
+					}
+					SetMenuItemInfo(hMenu,IDM_SHOW_RAD_VAR,0,&mi);
+					RefreshGlobalVar_with_WindowLock();
+					break;
+				case IDM_SHOW_GUID_VAR:
+					if(pobj_nv->bShow_GUID_Var){
+						pobj_nv->bShow_GUID_Var=0;
+						mi.fState=MFS_UNCHECKED;
+					}
+					else{
+						pobj_nv->bShow_GUID_Var=1;
+						mi.fState=MFS_CHECKED;
+					}
+					SetMenuItemInfo(hMenu,IDM_SHOW_GUID_VAR,0,&mi);
+					RefreshGlobalVar_with_WindowLock();
+					break;
+			}
+			break;
+		case WM_DESTROY:
+			DestroyMenu(hMenu);
+			hMenu=0;
+			break;
+	}
+	return CallWindowProc(OldTabProc,hwnd,message,wParam,lParam);
+}
+
+BOOL CALLBACK DlgDebugger(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern HINSTANCE hInst;
+	extern DWORD dwStepRun;
+	extern double width_ratio_VarList;
+	RECT rect;
+	int i,i2,i3;
+	char temporary[VN_SIZE];
+	LV_DISPINFO *lvinfo;
+	LVITEM ListView_Item;
+
+	static POINT pos_VarList;
+	static POINT pos_WatchList;
+
+	switch(message){
+		case WM_INITDIALOG:
+			extern HWND hDebugWnd;
+			hDebugWnd=hwnd;
+
+			//変数リストの初期位置を取得
+			GetWindowRect(GetDlgItem(hwnd,IDC_VARPOS),&rect);
+			pos_VarList.x=rect.left;
+			pos_VarList.y=rect.top;
+			ScreenToClient(hwnd,&pos_VarList);
+
+			//ウォッチリストの初期位置を取得
+			pos_WatchList.x=pos_VarList.x+(rect.right-rect.left)+LEVER_THICK;
+			pos_WatchList.y=0;
+
+			//ツールバーのベースウィンドウを生成
+			static HWND hBase_ToolBar;
+			hBase_ToolBar=CreateDialog(hInst,MAKEINTRESOURCE(IDD_DEBUGGER_TOOLBARBASE),hwnd,(DLGPROC)DebuggerButtonsProc);
+			MoveWindow(hBase_ToolBar,50,0,20*BTNNUM_DEBUGGERTOOLBAR,22,1);
+
+			extern WNDPROC OldThreadComboProc;
+			OldThreadComboProc=(WNDPROC)GetWindowLongPtr(GetDlgItem(hwnd,IDC_THREADCOMBO),GWLP_WNDPROC);
+			SetWindowLongPtr(GetDlgItem(hwnd,IDC_THREADCOMBO),GWLP_WNDPROC,(LONG_PTR)ThreadComboProc);
+
+			extern WNDPROC OldProcComboProc;
+			OldProcComboProc=(WNDPROC)GetWindowLongPtr(GetDlgItem(hwnd,IDC_PROCCOMBO),GWLP_WNDPROC);
+			SetWindowLongPtr(GetDlgItem(hwnd,IDC_PROCCOMBO),GWLP_WNDPROC,(LONG_PTR)ProcComboProc);
+
+
+			///////////////////////////
+			// タブコントロールを生成
+			///////////////////////////
+
+			static HWND hTab;
+			HFONT hFont;
+			hFont=(HFONT)SendMessage(hwnd,WM_GETFONT,0,0);
+			hTab=CreateWindow(WC_TABCONTROL,NULL,
+				WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,
+				0,0,0,0,hwnd,0,hInst,0);
+			SendMessage(hTab,WM_SETFONT,(WPARAM)hFont,0);
+			OldTabProc=(WNDPROC)GetWindowLongPtr(hTab,GWLP_WNDPROC);
+			SetWindowLongPtr(hTab,GWLP_WNDPROC,(LONG_PTR)TabProc);
+
+			//タブを設定
+			TC_ITEM tcItem;
+			tcItem.mask=TCIF_TEXT;
+			tcItem.pszText="グローバル";
+			SendMessage(hTab,TCM_INSERTITEM,0,(LPARAM)&tcItem);
+			tcItem.mask=TCIF_TEXT;
+			tcItem.pszText="ローカル";
+			SendMessage(hTab,TCM_INSERTITEM,1,(LPARAM)&tcItem);
+			tcItem.mask=TCIF_TEXT;
+			tcItem.pszText="This";
+			SendMessage(hTab,TCM_INSERTITEM,2,(LPARAM)&tcItem);
+
+			//グローバル変数リストのツリーを作成
+			hVarTree_Global=CreateWindowEx(WS_EX_CLIENTEDGE,WC_TREEVIEW,"",
+				WS_CHILD|TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT|TVS_SHOWSELALWAYS,
+				0,0,0,0,
+				hTab,0,hInst,0);
+
+			//ローカル変数リストのツリーを作成
+			hVarTree_Local=CreateWindowEx(WS_EX_CLIENTEDGE,WC_TREEVIEW,"",
+				WS_CHILD|TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT|TVS_SHOWSELALWAYS,
+				0,0,0,0,
+				hTab,0,hInst,0);
+
+			//This変数リストのツリーを作成
+			hVarTree_This=CreateWindowEx(WS_EX_CLIENTEDGE,WC_TREEVIEW,"",
+				WS_CHILD|TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT|TVS_SHOWSELALWAYS,
+				0,0,0,0,
+				hTab,0,hInst,0);
+
+			ShowWindow(hVarTree_Global,SW_SHOW);
+
+
+			//イメージリスト読み込み、設定
+			static HIMAGELIST hVariOrderImageList;
+			hVariOrderImageList=ImageList_Create(16,16,ILC_COLOR4|ILC_MASK,4,0);
+			ImageList_AddIcon(hVariOrderImageList,LoadIcon(hInst,MAKEINTRESOURCE(IDI_VARARRAY)));
+			ImageList_AddIcon(hVariOrderImageList,LoadIcon(hInst,MAKEINTRESOURCE(IDI_VARSTRUCT)));
+			ImageList_AddIcon(hVariOrderImageList,LoadIcon(hInst,MAKEINTRESOURCE(IDI_VARDATA)));
+			ImageList_AddIcon(hVariOrderImageList,LoadIcon(hInst,MAKEINTRESOURCE(IDI_VARSTR)));
+			ImageList_AddIcon(hVariOrderImageList,LoadIcon(hInst,MAKEINTRESOURCE(IDI_VARPTRSTRUCT)));
+			TreeView_SetImageList(hVarTree_Global,hVariOrderImageList,TVSIL_NORMAL);
+			TreeView_SetImageList(hVarTree_Local,hVariOrderImageList,TVSIL_NORMAL);
+			TreeView_SetImageList(hVarTree_This,hVariOrderImageList,TVSIL_NORMAL);
+
+
+			/////////////////////////
+			// ウォッチリスト
+			/////////////////////////
+
+			//コラムの設定
+			static HWND hListView;
+			LV_COLUMN ListView_Column;
+			DWORD dwStyle;
+
+			hListView=GetDlgItem(hwnd,IDC_WATCHLIST);
+			GetClientRect(hListView,&rect);
+			dwStyle=ListView_GetExtendedListViewStyle(hListView);
+			dwStyle|=LVS_EX_FULLROWSELECT;
+			ListView_SetExtendedListViewStyle(hListView,dwStyle);
+
+			ListView_Column.mask=LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
+			ListView_Column.fmt=LVCFMT_LEFT;
+
+			extern int width_WatchColumn_Expression;
+			ListView_Column.cx=width_WatchColumn_Expression;
+			ListView_Column.pszText="ウォッチ式";
+			ListView_Column.iSubItem=0;
+			ListView_InsertColumn(hListView,0,&ListView_Column);
+
+			extern int width_WatchColumn_Value;
+			ListView_Column.cx=width_WatchColumn_Value;
+			ListView_Column.pszText="値";
+			ListView_Column.iSubItem=1;
+			ListView_InsertColumn(hListView,1,&ListView_Column);
+
+			//アイテムの設定
+			ListView_Item.mask=LVIF_TEXT;
+			ListView_Item.iSubItem=0;
+			for(i=0;i<pobj_nv->WatchNum;i++){
+				ListView_Item.pszText=pobj_nv->ppWatchStr[i];
+				ListView_Item.iItem=i;
+				ListView_InsertItem(hListView,&ListView_Item);
+			}
+			ListView_Item.pszText="...";
+			ListView_Item.iItem=i;
+			ListView_InsertItem(hListView,&ListView_Item);
+
+
+			///////////////////////
+			// 変数リストの初期化
+			///////////////////////
+			InitVarList((DWORD)lParam);
+
+			break;
+		case WM_NOTIFY:
+			NMHDR *hdr;
+			hdr=(NMHDR *)lParam;
+			if(hdr->hwndFrom==hTab&&hdr->code==TCN_SELCHANGE){
+				i=TabCtrl_GetCurSel(hTab);
+
+				if(i==0){
+					//グローバル変数を表示
+					ShowWindow(hVarTree_Global,SW_SHOW);
+					ShowWindow(hVarTree_Local,SW_HIDE);
+					ShowWindow(hVarTree_This,SW_HIDE);
+				}
+				else if(i==1){
+					//ローカル変数を表示
+					ShowWindow(hVarTree_Global,SW_HIDE);
+					ShowWindow(hVarTree_Local,SW_SHOW);
+					ShowWindow(hVarTree_This,SW_HIDE);
+				}
+				else if(i==2){
+					//This変数を表示
+					ShowWindow(hVarTree_Global,SW_HIDE);
+					ShowWindow(hVarTree_Local,SW_HIDE);
+					ShowWindow(hVarTree_This,SW_SHOW);
+				}
+			}
+
+			if(hdr->hwndFrom==hListView){
+				lvinfo=(LV_DISPINFO *)hdr;
+				if(hdr->code==NM_DBLCLK){
+					i2=ListView_GetItemCount(hListView);
+					for(i=0;i<i2;i++){
+						if(ListView_GetItemState(hListView,i,LVIS_SELECTED)) break;
+					}
+					if(i==i2) break;
+
+					ListView_EditLabel(hListView,i);
+				}
+
+				static HWND hEdit;
+				if(hdr->code==LVN_BEGINLABELEDIT){
+					hEdit=ListView_GetEditControl(hListView);
+
+					GetWindowText(hEdit,temporary,VN_SIZE);
+					if(lstrcmp(temporary,"...")==0) SetWindowText(hEdit,"");
+				}
+				if(hdr->code==LVN_ENDLABELEDIT){
+					GetWindowText(hEdit,temporary,VN_SIZE);
+					if(temporary[0]=='\0'){
+						if(ListView_GetItemCount(hListView)-1==lvinfo->item.iItem) break;
+
+						//空白入力の場合はそのアイテムを削除する
+						ListView_DeleteItem(hListView,lvinfo->item.iItem);
+						break;
+					}
+					ListView_SetItemText(hListView,lvinfo->item.iItem,0,temporary);
+
+					//演算結果を表示
+					SetCalcToWatchList(hListView,lvinfo->item.iItem,temporary);
+
+					if(lvinfo->item.iItem==ListView_GetItemCount(hListView)-1){
+						//リストアイテムを追加
+						ListView_Item.mask=LVIF_TEXT;
+						ListView_Item.pszText="...";
+						ListView_Item.iItem=lvinfo->item.iItem+1;
+						ListView_Item.iSubItem=0;
+						ListView_InsertItem(hListView,&ListView_Item);
+					}
+				}
+
+				if(hdr->code==LVN_KEYDOWN){
+					LV_KEYDOWN *plvKeydown;
+					plvKeydown=(LV_KEYDOWN *)hdr;
+					if(plvKeydown->wVKey==VK_DELETE){
+						i2=ListView_GetItemCount(hListView);
+						for(i=i2-2;i>=0;i--){
+							if(ListView_GetItemState(hListView,i,LVIS_SELECTED)){
+								ListView_DeleteItem(hListView,i);
+								i3=i;
+							}
+						}
+
+						ListView_SetItemState(hListView,i3,LVIS_SELECTED,LVIS_SELECTED);
+					}
+				}
+			}
+			break;
+
+		case WM_SIZE:
+			//変数リストの位置
+			int width_VarList;
+			width_VarList=
+				(int)((double)(LOWORD(lParam)-pos_VarList.x)*width_ratio_VarList);
+
+			MoveWindow(hTab,
+				pos_VarList.x,
+				pos_VarList.y,
+				width_VarList,
+				HIWORD(lParam)-pos_VarList.y,
+				1);
+
+			GetClientRect(hTab,&rect);
+			TabCtrl_AdjustRect(hTab,FALSE,&rect);
+			rect.left-=2;
+			rect.right++;
+			rect.bottom++;
+
+			MoveWindow(hVarTree_Global,
+				rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,1);
+			MoveWindow(hVarTree_Local,
+				rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,1);
+			MoveWindow(hVarTree_This,
+				rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,1);
+
+			pos_WatchList.x=pos_VarList.x+width_VarList+LEVER_THICK;
+			pos_WatchList.y=0;
+
+			//ウォッチリストの位置
+			MoveWindow(GetDlgItem(hwnd,IDC_WATCHLIST),
+				pos_WatchList.x,
+				pos_WatchList.y,
+				LOWORD(lParam)-pos_WatchList.x,
+				HIWORD(lParam)-pos_WatchList.y,
+				1);
+
+			return 1;
+
+		case WM_VARLIST_CLOSE:
+			DestroyWindow(hwnd);
+			return 1;
+		case WM_DESTROY:
+			ImageList_Destroy(hVariOrderImageList);
+
+
+			//////////////////////////////////////////////////////////////
+			// ウォッチリストの以前の内容を破棄し、新しい内容に書き換える
+			//////////////////////////////////////////////////////////////
+
+			for(i=0;i<pobj_nv->WatchNum;i++){
+				HeapDefaultFree(pobj_nv->ppWatchStr[i]);
+			}
+			HeapDefaultFree(pobj_nv->ppWatchStr);
+
+			pobj_nv->WatchNum=ListView_GetItemCount(hListView)-1;
+			pobj_nv->ppWatchStr=(char **)HeapAlloc(hHeap,0,pobj_nv->WatchNum*sizeof(char *)+1);
+			for(i=0;i<pobj_nv->WatchNum;i++){
+				ListView_GetItemText(hListView,i,0,temporary,VN_SIZE);
+				pobj_nv->ppWatchStr[i]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+				lstrcpy(pobj_nv->ppWatchStr[i],temporary);
+			}
+
+
+			//////////////////////////////
+			// デバッグダイアログを破棄
+			//////////////////////////////
+
+			hDebugWnd=0;
+
+			extern BOOL bClipCompileView;
+			if(bClipCompileView){
+				extern HWND hOwnerEditor;
+				SendMessage(hOwnerEditor,WM_DESTROYDEBUGGERVIEW,0,0);
+			}
+
+			return 1;
+
+
+
+		///////////////////////
+		// デバッグコマンド
+		///////////////////////
+
+		case WM_DEBUG_CONTINUE:
+			DestroyWindow(hwnd);
+			return 1;
+		case WM_STEP_IN:
+			Debugger_StepIn();
+			return 1;
+		case WM_STEP_OVER:
+			Debugger_StepOver();
+			return 1;
+		case WM_STEP_CURSOR:
+			Debugger_StepCursor();
+			return 1;
+	}
+	return 0;
+}
+
+
+
+
+//////////////////////////////////
+// ポップアップ表示の変数リスト
+//////////////////////////////////
+
+BOOL CALLBACK DlgVarList(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern HINSTANCE hInst;
+	extern DWORD dwStepRun;
+	RECT rect;
+	POINT pos;
+	SIZE size;
+
+	switch(message){
+		case WM_INITDIALOG:
+			extern HWND hDebugWnd;
+			hDebugWnd=hwnd;
+
+			pos.x=pobj_nv->VarDlgRect.left;
+			pos.y=pobj_nv->VarDlgRect.top;
+			size.cx=pobj_nv->VarDlgRect.right-pobj_nv->VarDlgRect.left;
+			size.cy=pobj_nv->VarDlgRect.bottom-pobj_nv->VarDlgRect.top;
+			MoveWindow(hwnd,pos.x,pos.y,size.cx,size.cy,1);
+
+			extern WNDPROC OldThreadComboProc;
+			OldThreadComboProc=(WNDPROC)GetWindowLongPtr(GetDlgItem(hwnd,IDC_THREADCOMBO),GWLP_WNDPROC);
+			SetWindowLongPtr(GetDlgItem(hwnd,IDC_THREADCOMBO),GWLP_WNDPROC,(LONG_PTR)ThreadComboProc);
+
+			extern WNDPROC OldProcComboProc;
+			OldProcComboProc=(WNDPROC)GetWindowLongPtr(GetDlgItem(hwnd,IDC_PROCCOMBO),GWLP_WNDPROC);
+			SetWindowLongPtr(GetDlgItem(hwnd,IDC_PROCCOMBO),GWLP_WNDPROC,(LONG_PTR)ProcComboProc);
+
+			//イメージリスト読み込み、設定
+			static HIMAGELIST hVariOrderImageList;
+			hVariOrderImageList=ImageList_Create(16,16,ILC_COLOR4|ILC_MASK,4,0);
+			ImageList_AddIcon(hVariOrderImageList,LoadIcon(hInst,MAKEINTRESOURCE(IDI_VARARRAY)));
+			ImageList_AddIcon(hVariOrderImageList,LoadIcon(hInst,MAKEINTRESOURCE(IDI_VARSTRUCT)));
+			ImageList_AddIcon(hVariOrderImageList,LoadIcon(hInst,MAKEINTRESOURCE(IDI_VARDATA)));
+			ImageList_AddIcon(hVariOrderImageList,LoadIcon(hInst,MAKEINTRESOURCE(IDI_VARSTR)));
+			ImageList_AddIcon(hVariOrderImageList,LoadIcon(hInst,MAKEINTRESOURCE(IDI_VARPTRSTRUCT)));
+			TreeView_SetImageList(GetDlgItem(hwnd,IDC_VARTREE),hVariOrderImageList,TVSIL_NORMAL);
+
+			InitVarList((DWORD)lParam);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDCANCEL:
+					DestroyWindow(hwnd);
+					return 1;
+				case IDC_STEPIN:
+					dwStepRun=1;
+					return 1;
+				case IDC_STEPOVER:
+					dwStepRun=2;
+					return 1;
+			}
+			break;
+		case WM_SIZE:
+			GetWindowRect(GetDlgItem(hwnd,IDC_VARTREE),&rect);
+			pos.x=rect.left;
+			pos.y=rect.top;
+			ScreenToClient(hwnd,&pos);
+			MoveWindow(GetDlgItem(hwnd,IDC_VARTREE),0,pos.y,LOWORD(lParam),HIWORD(lParam)-pos.y,TRUE);
+			SetWindowPos(GetDlgItem(hwnd,IDCANCEL),0,LOWORD(lParam)-91,9,0,0,SWP_NOSIZE);
+			return 1;
+		case WM_VARLIST_CLOSE:
+			DestroyWindow(hwnd);
+			return 1;
+		case WM_DESTROY:
+			ImageList_Destroy(hVariOrderImageList);
+
+			GetWindowRect(hwnd,&pobj_nv->VarDlgRect);
+
+			hDebugWnd=0;
+
+			return 1;
+	}
+	return 0;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Variable.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Variable.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Variable.cpp	(revision 178)
@@ -0,0 +1,21 @@
+#include "common.h"
+
+bool Variable::IsEqualSymbol( const Symbol &symbol, bool isSupportStaticMember ) const
+{
+	if( GetName() == symbol.GetName()
+		&& NamespaceScopes::IsSameArea( this->namespaceScopes, symbol.GetNamespaceScopes() ) )
+	{
+		return true;
+	}
+
+	if( isSupportStaticMember && symbol.GetNamespaceScopes().size() >= 1 )
+	{
+		// 静的メンバを考慮
+		NamespaceScopes namespaceScopes( symbol.GetNamespaceScopes() );
+		string name = namespaceScopes[namespaceScopes.size()-1] + "." + symbol.GetName();
+		namespaceScopes.pop_back();
+
+		return IsEqualSymbol( Symbol( namespaceScopes, name ), false );
+	}
+	return false;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/Variable.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/Variable.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/Variable.h	(revision 178)
@@ -0,0 +1,207 @@
+#pragma once
+
+#include "Type.h"
+#include <Symbol.h>
+
+class Variable : public Type
+{
+	const NamespaceScopes namespaceScopes;
+	string name;
+	bool isConst;
+	bool isRef;
+	bool isArray;
+	int subScripts[MAX_ARRAYDIM];
+
+	bool isParameter;
+
+public:
+	Variable( const string &name, const Type &type, bool isConst = false, bool isRef = false )
+		: Type( type )
+		, name( name )
+		, isConst( isConst )
+		, isRef( isRef )
+		, isArray( false )
+		, isParameter( false)
+	{
+		subScripts[0] = -1;
+	}
+	Variable( const NamespaceScopes &namespaceScopes, const string &name, const Type &type, bool isConst = false, bool isRef = false )
+		: namespaceScopes( namespaceScopes )
+		, Type( type )
+		, name( name )
+		, isConst( isConst )
+		, isRef( isRef )
+		, isArray( false )
+		, isParameter( false)
+	{
+		subScripts[0] = -1;
+	}
+	Variable( const Variable &var )
+		: Type( var )
+		, name( var.name )
+		, isConst( var.isConst )
+		, isRef( var.isRef )
+		, isArray( false )
+		, isParameter( false )
+	{
+		subScripts[0] = -1;
+		if( var.isArray ){
+			SetArray( var.subScripts );
+		}
+	}
+	~Variable(){}
+
+	void SetArray( const int *pSubScripts ){
+		isArray = true;
+		memcpy( this->subScripts, pSubScripts, sizeof(int) * MAX_ARRAYDIM );
+	}
+
+	const string &GetName() const
+	{
+		return name;
+	}
+
+	bool IsEqualSymbol( const Symbol &symbol, bool isSupportStaticMember = true ) const;
+
+	void ConstOff(){
+		isConst = false;
+	}
+	void ConstOn(){
+		isConst = true;
+	}
+	bool IsConst() const
+	{
+		return isConst;
+	}
+	bool IsRef() const
+	{
+		return isRef;
+	}
+	bool IsArray()const
+	{
+		return isArray;
+	}
+	const int *GetSubScriptsPtr() const
+	{
+		return subScripts;
+	}
+
+	void ThisIsParameter(){
+		isParameter = true;
+	}
+	bool IsParameter() const
+	{
+		return isParameter;
+	}
+
+
+	int GetMemorySize() const
+	{
+		if( isRef || isParameter ){
+			return PTR_SIZE;
+		}
+
+		int size = Type::GetSize();
+
+		if( isArray ){
+			int num = 1;
+			for( int i=0; i<MAX_ARRAYDIM; i++){
+				if(subScripts[i]==-1) break;
+				num *= subScripts[i]+1;
+			}
+			size *= num;
+		}
+
+		if( size % PTR_SIZE ){
+			size += PTR_SIZE-(size%PTR_SIZE);
+		}
+
+		return size;
+	}
+
+
+	/* --- オフセット ---
+
+		※グローバル変数で初期バッファがない場合は最上位ビットに1がセットされ、
+		初期バッファの有無が識別される。
+		（その後、スケジュール実行により、実際の配置に並び替えられる）*/
+	int offset;
+
+	//コンストラクタ用パラメータ
+	string paramStrForConstructor;
+
+	//レキシカルスコープ用
+	int ScopeStartAddress;
+	int ScopeEndAddress;
+	int ScopeLevel;
+	BOOL bLiving;
+
+
+	int source_code_address;
+};
+
+class Variables : public vector<Variable *>
+{
+public:
+	Variables(){}
+	~Variables(){
+		clear();
+	}
+
+	void clear(){
+		for( int i=0; i<(int)this->size(); i++ ){
+			delete (*this)[i];
+		}
+
+		vector<Variable *>::clear();
+	}
+
+	bool DuplicateCheck( const Symbol &symbol ) const
+	{
+		//レキシカルスコープを考慮して重複判定
+		for( int i=(int)this->size()-1; i>=0 ; i-- ){
+			Variable &var = *(*this)[i];
+			if( var.bLiving											//現在のスコープで有効なもの
+				&& var.ScopeLevel == obj_LexScopes.GetNowLevel()	//現在のスコープと同一レベル
+				){
+					if( var.IsEqualSymbol( symbol ) ){
+						return true;
+					}
+			}
+		}
+		return false;
+	}
+
+	const Variable *BackSearch( const Symbol &symbol ) const
+	{
+		//レキシカルスコープを考慮してバックサーチ
+		for( int i=(int)this->size()-1; i>=0 ; i-- ){
+			Variable &var = *(*this)[i];
+			if( var.bLiving											//現在のスコープで有効なもの
+				&& var.ScopeLevel <= obj_LexScopes.GetNowLevel()	//現在のスコープレベルを超さないもの（Returnによる解放処理中を考慮）
+				){
+					if( var.IsEqualSymbol( symbol ) ){
+						return &var;
+					}
+			}
+		}
+		return NULL;
+	}
+
+	const Variable *Find( const Symbol &symbol )const
+	{
+		int max = (int)this->size();
+		for( int i=0; i<max; i++ ){
+			Variable *pVar = (*this)[i];
+			if( pVar->IsEqualSymbol( symbol ) ){
+				return pVar;
+			}
+		}
+		return NULL;
+	}
+};
+
+extern Variables globalVars;
+
+
+
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/VariableOpe.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/VariableOpe.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/VariableOpe.cpp	(revision 178)
@@ -0,0 +1,1283 @@
+#include "../BasicCompiler_Common/common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+BOOL IsVariableTopChar(char c){
+	if((c>='A'&&c<='Z')||(c>='a'&&c<='z')||c=='_') return 1;
+	return 0;
+}
+BOOL IsVariableChar(char c){
+	if((c>='A'&&c<='Z')||(c>='a'&&c<='z')||(c>='0'&&c<='9')||
+		c=='%'||c=='!'||c=='#'||c=='$'||
+		c=='_'||c=='.') return 1;
+	return 0;
+}
+BOOL IsPtrType(int type){
+	if(type==-1) return 0;
+
+	if(PTR_LEVEL(type)||type==DEF_PTR_VOID||type==DEF_PTR_PROC||
+		(type&FLAG_PTR) ) return 1;
+
+	return 0;
+}
+BOOL IsSignedType(int type){
+	switch(type){
+		case DEF_SBYTE:
+		case DEF_INTEGER:
+		case DEF_LONG:
+		case DEF_INT64:
+		case DEF_SINGLE:
+		case DEF_DOUBLE:
+		case DEF_CHAR:
+			return 1;
+		default:
+			break;
+	}
+	return 0;
+}
+BOOL IsNaturalWholeNumberType(int type){
+	switch(type){
+		case DEF_SBYTE:
+		case DEF_BYTE:
+		case DEF_INTEGER:
+		case DEF_WORD:
+		case DEF_LONG:
+		case DEF_DWORD:
+		case DEF_INT64:
+		case DEF_QWORD:
+		case DEF_CHAR:
+			return 1;
+		default:
+			break;
+	}
+	return 0;
+}
+BOOL IsWholeNumberType(int type){
+	return (
+		IsNaturalWholeNumberType(type)
+		|| IsPtrType(type)
+		|| type == DEF_BOOLEAN
+		);
+}
+BOOL IsRealNumberType(int type){
+	switch(type){
+		case DEF_DOUBLE:
+		case DEF_SINGLE:
+			return 1;
+		default:
+			break;
+	}
+	return 0;
+}
+BOOL Is64Type(int type){
+	switch(type){
+		case DEF_INT64:
+		case DEF_QWORD:
+			return 1;
+		default:
+			break;
+	}
+#ifdef _AMD64_
+	return IsPtrType(type);
+#else
+	return 0;
+#endif
+}
+int GetSignedType(int type){
+	switch(type){
+		case DEF_BYTE:
+			return DEF_SBYTE;
+		case DEF_WORD:
+			return DEF_INTEGER;
+		case DEF_DWORD:
+			return DEF_LONG;
+		case DEF_QWORD:
+			return DEF_INT64;
+		default:
+			break;
+	}
+#ifdef _AMD64_
+	if(IsPtrType(type)) return DEF_INT64;
+#else
+	if(IsPtrType(type)) return DEF_LONG;
+#endif
+	return type;
+}
+int GetUnsignedType(int type){
+	switch(type){
+		case DEF_SBYTE:
+			return DEF_BYTE;
+		case DEF_INTEGER:
+			return DEF_WORD;
+		case DEF_LONG:
+			return DEF_DWORD;
+		case DEF_INT64:
+			return DEF_QWORD;
+		case DEF_CHAR:
+			if( isUnicode ) return DEF_WORD;
+			return DEF_BYTE;
+	}
+	return type;
+}
+int GetTypeSize(int type,LONG_PTR lpIndex){
+	if(type==DEF_LONG){
+		if(lpIndex==LITERAL_NULL||lpIndex==LITERAL_M128_0||lpIndex==LITERAL_0_255)
+			return sizeof(BYTE);
+		else if(lpIndex==LITERAL_M32768_0||lpIndex==LITERAL_0_65535)
+			return sizeof(WORD);
+
+		return sizeof(DWORD);
+	}
+
+	//整数型
+	if(type==DEF_INT64||type==DEF_QWORD)
+		return sizeof(_int64);
+	else if(type==DEF_LONG||type==DEF_DWORD)
+		return sizeof(DWORD);
+	else if(type==DEF_INTEGER||type==DEF_WORD)
+		return sizeof(WORD);
+	else if(type==DEF_SBYTE||type==DEF_BYTE || type == DEF_BOOLEAN)
+		return sizeof(BYTE);
+
+	//実数型
+	else if(type==DEF_DOUBLE)		return sizeof(double);
+	else if(type==DEF_SINGLE)		return sizeof(float);
+
+	//文字型
+	else if( type == DEF_CHAR ){
+		if( isUnicode ) return sizeof( WORD );
+		return sizeof( BYTE );
+	}
+
+	//ポインタ型
+	else if(IsPtrType(type))		return PTR_SIZE;
+
+	else if( type == DEF_STRUCT ){
+		if(lpIndex == 0 || lpIndex == -1){
+			SetError(300,NULL,cp);
+			return 0;
+		}
+
+		const CClass *pobj_c=(CClass *)lpIndex;
+
+		return pobj_c->GetSize();
+	}
+
+	else if(type==DEF_OBJECT){
+		return PTR_SIZE;
+	}
+	else{
+		SetError(300,NULL,cp);
+	}
+	return 0;
+}
+int GetPtrType(int type){
+	return MAKE_PTR_TYPE(NATURAL_TYPE(type),PTR_LEVEL(type)+1);
+}
+BOOL GetTypeName(int type,LONG_PTR lpIndex,char *name){
+	if(PTR_LEVEL(type)){
+		//ポインタ型
+		name[0]='*';
+		return GetTypeName(MAKE_PTR_TYPE(NATURAL_TYPE(type),PTR_LEVEL(type)-1),lpIndex,name+1);
+	}
+
+	//整数型
+	if(type==DEF_SBYTE)				lstrcpy(name,"SByte");
+	else if(type==DEF_BYTE)			lstrcpy(name,"Byte");
+	else if(type==DEF_INTEGER)		lstrcpy(name,"Integer");
+	else if(type==DEF_WORD)			lstrcpy(name,"Word");
+	else if(type==DEF_LONG)			lstrcpy(name,"Long");
+	else if(type==DEF_DWORD)		lstrcpy(name,"DWord");
+	else if(type==DEF_INT64)		lstrcpy(name,"Int64");
+	else if(type==DEF_QWORD)		lstrcpy(name,"QWord");
+
+	//実数型
+	else if(type==DEF_SINGLE)		lstrcpy(name,"Single");
+	else if(type==DEF_DOUBLE)		lstrcpy(name,"Double");
+
+	//文字型
+	//else if(type==DEF_CHAR)				lstrcpy(name,"Char");
+
+	//bool型
+	else if(type==DEF_BOOLEAN)		lstrcpy(name,"Boolean");
+
+	//オブジェクト
+	else if(type==DEF_OBJECT || type==DEF_STRUCT){
+		if(lpIndex==0) lstrcpy(name,"non");
+		else{
+			lstrcpy(name,((CClass *)lpIndex)->GetName().c_str());
+		}
+	}
+
+	//ポインタ型
+	else if(type==DEF_PTR_VOID)		lstrcpy(name,"VoidPtr");
+
+	else if(type==DEF_PTR_PROC){
+		if(lpIndex==-1) lstrcpy(name,"VoidPtr");
+		else{
+			if( Smoothie::meta.procPointers[lpIndex]->ReturnType().IsNull() )
+				lstrcpy(name,"*Sub");
+			else lstrcpy(name,"*Function");
+		}
+	}
+
+	else{
+		extern int cp;
+		SetError(1,NULL,cp);
+		return 0;
+	}
+	return 1;
+}
+
+Type GetStringTypeInfo(){
+	Type type( DEF_OBJECT, *pobj_DBClass->GetStringClassPtr() );
+	return type;
+}
+
+void GetWithName(char *buffer){
+	extern WITHINFO WithInfo;
+	int i;
+
+	buffer[0]=0;
+	for(i=0;i<WithInfo.num;i++)
+		lstrcat(buffer,WithInfo.ppName[i]);
+}
+
+/*TODO: 消す
+bool FormatUseProcReturnObject( const char *term, char *procName, char *parameter, CClass::RefType &refType, char *member ){
+	int p1 = 0, p2 = 0;
+
+	for( int i=0; term[i]!='\0' ; i++ ){
+
+		if( term[i] == '[' ){
+			i = JumpStringInBracket( term, i + 1 );
+			if( term[i] == '\0' ) break;
+			continue;
+		}
+		if( term[i] == '(' ){
+			int temp_p = i;
+			i = JumpStringInPare( term, i + 1 ) + 1;
+			if( term[i] == '\0' ) break;
+			if( term[i] == '.'
+				|| term[i] == 1 && term[i] == ESC_PSMEM ){
+					p1 = temp_p;
+					p2 = i;
+			}
+			continue;
+		}
+	}
+	if( !p1 ) return false;
+
+	//メソッド名
+	memcpy( procName, term, p1 );
+	procName[p1] = 0;
+
+	//パラメータ
+	memcpy( parameter, term + p1 + 1, p2 - p1 - 2 );
+	parameter[ p2 - p1 - 2 ] = 0;
+
+	//参照タイプ
+	if( term[p2] == '.' ){
+		refType = CClass::Dot;
+	}
+	else{
+		refType = CClass::Pointer;
+		p2++;
+	}
+
+	//メンバ
+	lstrcpy( member, term + p2 + 1 );
+
+	return true;
+}*/
+
+BOOL GetVarFormatString(char *buffer,char *array,char *array2,char *NestMember,CClass::RefType &refType){
+	extern int cp;
+	int i,i2,i3;
+	char cPare_Open,cPare_Close;
+
+	array[0]=0;
+	array2[0]=0;
+	NestMember[0]=0;
+	for(i=0;;i++){
+		if(buffer[i]=='\"'){
+			for(i++;;i++){
+				if(IsDBCSLeadByte(buffer[i])){
+					i++;
+					continue;
+				}
+				if(buffer[i]=='\"') break;
+			}
+		}
+		if(buffer[i]=='['||buffer[i]=='('){
+			if(buffer[i]=='['){
+				cPare_Open='[';
+				cPare_Close=']';
+			}
+			else{
+				cPare_Open='(';
+				cPare_Close=')';
+			}
+			buffer[i]=0;
+			for(i++,i2=0;;i++,i2++){
+				if(buffer[i]==cPare_Open){
+					if(cPare_Open=='[') i3=GetStringInBracket(array+i2,buffer+i);
+					else i3=GetStringInPare(array+i2,buffer+i);
+					i+=i3-1;
+					i2+=i3-1;
+					continue;
+				}
+				if(buffer[i]==cPare_Close){
+					array[i2]=0;
+					break;
+				}
+				array[i2]=buffer[i];
+			}
+			if(buffer[i+1]==cPare_Open){
+				for(i+=2,i2=0;;i++,i2++){
+					if(buffer[i]==cPare_Open){
+						if(cPare_Open=='[') i3=GetStringInBracket(array2+i2,buffer+i);
+						else i3=GetStringInPare(array2+i2,buffer+i);
+						i+=i3-1;
+						i2+=i3-1;
+						continue;
+					}
+					if(buffer[i]==cPare_Close){
+						array2[i2]=0;
+						break;
+					}
+					array2[i2]=buffer[i];
+				}
+				if(buffer[i+1]==cPare_Open){
+					SetError(14,buffer,cp);
+					return 0;
+				}
+			}
+			continue;
+		}
+		if(buffer[i]=='.'){
+			lstrcpy(NestMember,buffer+i+1);
+			refType = CClass::Dot;
+			buffer[i]=0;
+			break;
+		}
+		if(buffer[i]==1&&buffer[i+1]==ESC_PSMEM){
+			lstrcpy(NestMember,buffer+i+2);
+			refType = CClass::Pointer;
+			buffer[i]=0;
+			break;
+		}
+		if(buffer[i]=='\0') break;
+	}
+	return 1;
+}
+
+void GetArrayElement( const char *buffer,char *variable,char *array_element){
+	array_element[0]=0;
+
+	if(buffer[lstrlen(buffer)-1]!=']'){
+		lstrcpy(variable,buffer);
+		return;
+	}
+
+	int i,i2;
+	for(i=0;;i++){
+		if(buffer[i]=='\0') break;
+		if(buffer[i]=='['){
+			i2=GetStringInBracket(array_element,buffer+i);
+			i+=i2-1;
+			continue;
+		}
+	}
+
+	lstrcpy(variable,buffer);
+	variable[lstrlen(variable)-lstrlen(array_element)]=0;
+
+	RemoveStringBracket(array_element);
+}
+
+BOOL CheckVarNameError(char *name,int nowLine){
+	int i2;
+
+	if(!IsVariableTopChar(name[0])){
+		SetError(1,NULL,nowLine);
+		return 0;
+	}
+	for(i2=1;;i2++){
+		if(name[i2]=='\0') break;
+		if(!IsVariableChar(name[i2])){
+			SetError(1,NULL,nowLine);
+			return 0;
+		}
+	}
+	return 1;
+}
+
+int JumpSubScripts(const int *ss){
+	//DIMで定義された並んだ配列の数だけアドレスを進める
+	int i,i2;
+	for(i=0,i2=1;i<255;i++){
+		if(ss[i]==-1) break;
+		i2*=ss[i]+1;
+	}
+	return i2;
+}
+void GetArrange(char *variable,char *variAnswer,int *SubScripts){
+	extern int cp;
+	int i,i2,i3,i4;
+	double dbl;
+	_int64 i64data;
+	BOOL bBracket;
+	char temporary[VN_SIZE];
+
+	for(i=0;;i++){
+		if(variable[i]=='('||variable[i]=='['){
+			if(variable[i]=='[') bBracket=1;
+			else bBracket=0;
+
+			variAnswer[i]=0;
+			for(i++,i2=0,i3=0;;i++,i2++){
+				if(variable[i]==','){
+					temporary[i2]=0;
+
+					Type resultType;
+					if( !StaticCalculation(true, temporary,0,&i64data,resultType) ){
+						return;
+					}
+					if(resultType.IsReal()){
+						memcpy(&dbl,&i64data,sizeof(double));
+						i64data=(_int64)dbl;
+					}
+
+					if(i64data<0){
+						//error
+						SubScripts[i3]=0;
+					}
+					else SubScripts[i3]=(int)i64data;
+					i3++;
+					i2=-1;
+					continue;
+				}
+				if(variable[i]=='('){
+					i4=GetStringInPare(temporary+i2,variable+i);
+					i2+=i4-1;
+					i+=i4-1;
+					continue;
+				}
+				if(variable[i]=='['){
+					i4=GetStringInBracket(temporary+i2,variable+i);
+					i2+=i4-1;
+					i+=i4-1;
+					continue;
+				}
+				if(variable[i]==')'&&bBracket==0||
+					variable[i]==']'&&bBracket){
+					temporary[i2]=0;
+					if(i2==0){
+						SubScripts[i3]=-2;
+						break;
+					}
+
+					Type resultType;
+					if( !StaticCalculation(true, temporary,0,&i64data,resultType) ){
+						return;
+					}
+					if(resultType.IsReal()){
+						memcpy(&dbl,&i64data,sizeof(double));
+						i64data=(_int64)dbl;
+					}
+
+					if(i64data<0){
+						//error
+						SubScripts[i3]=0;
+					}
+					else SubScripts[i3]=(int)i64data;
+					SubScripts[i3+1]=-1;
+					break;
+				}
+				if(variable[i]=='\"'){
+					SetError(1,NULL,cp);
+					return;
+				}
+				temporary[i2]=variable[i];
+			}
+			break;
+		}
+		variAnswer[i]=variable[i];
+		if(variable[i]=='\0'){
+			SubScripts[0]=-1;
+			break;
+		}
+	}
+}
+
+int GetTypeFromSimpleName(char *variable){
+	extern char DefIntVari[26],DefSngVari[26],DefStrVari[26],divNum,dsvNum,dStrvNum;
+	int i;
+	char name[VN_SIZE];
+
+	//構造体メンバの場合を考慮
+	for(i=lstrlen(variable);i>0;i--){
+		if(variable[i]=='.'){
+			i++;
+			break;
+		}
+	}
+
+	for(;;i++){
+		if(variable[i]=='('||variable[i]=='\0'){
+			name[i]=0;
+			break;
+		}
+		name[i]=variable[i];
+	}
+	//変数名から選択
+	i--;
+	if(name[i]=='#') return DEF_DOUBLE;
+	if(name[i]=='!') return DEF_SINGLE;
+	if(name[i]=='%') return DEF_INTEGER;
+	return DEF_DOUBLE;
+}
+
+
+bool GetMemberType( const CClass &objClass, const char *lpszMember, Type &resultType, BOOL bPrivateAccess, bool isErrorEnabled){
+	extern int cp;
+
+	//クラス、配列の構成要素を解析する
+	char VarName[VN_SIZE];		//変数名
+	char array[VN_SIZE];		//第1次配列
+	char lpPtrOffset[VN_SIZE];		//第2次配列
+	char NestMember[VN_SIZE];	//入れ子メンバ
+	CClass::RefType refType = CClass::Non;
+	lstrcpy(VarName,lpszMember);
+	if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,refType)) return false;
+
+	bool isFound = false;
+	CMember *pMember = NULL;
+	BOOST_FOREACH( pMember, objClass.GetDynamicMembers() ){
+		if( pMember->GetName() == VarName ){
+			isFound = true;
+			break;
+		}
+	}
+	if( !isFound ){
+		if(isErrorEnabled) SetError(103,VarName,cp);
+		return false;
+	}
+
+	//アクセシビリティをチェック
+	if( &objClass == pobj_CompilingClass ){
+		//同一クラスオブジェクトの場合はプライベートアクセスを容認する
+		if( pMember->IsNoneAccess() ){
+			if(isErrorEnabled) SetError(107,VarName,cp);
+			return false;
+		}
+	}
+	else{
+		if(( bPrivateAccess==0 && pMember->IsPrivate() )||
+			pMember->IsNoneAccess() ){
+			if(isErrorEnabled) SetError(107,VarName,cp);
+			return false;
+		}
+		else if( bPrivateAccess==0 && pMember->IsProtected() ){
+			if(isErrorEnabled) SetError(108,VarName,cp);
+			return false;
+		}
+	}
+
+	resultType = pMember->GetType();
+
+	//ポインタ変数の場合
+	if( resultType.IsPointer() ){
+		if(pMember->SubScripts[0]==-1){
+			lstrcpy(lpPtrOffset,array);
+			array[0]=0;
+		}
+	}
+	else{
+		if(lpPtrOffset[0]){
+			if(isErrorEnabled) SetError(16,lpszMember,cp);
+			return false;
+		}
+	}
+
+	if( refType != CClass::Non ){
+		//入れ子構造の場合
+
+		return GetMemberType( pMember->GetType().GetClass(),
+			NestMember,
+			resultType,
+			0,
+			isErrorEnabled);
+	}
+
+	if(array[0]==0&&pMember->SubScripts[0]!=-1){
+		resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR );
+		return true;
+	}
+
+	if(lpPtrOffset[0]){
+		if( resultType.PtrLevel() ){
+			resultType.PtrLevelDown();
+		}
+		else{
+			//エラー
+			if(isErrorEnabled) SetError(1,NULL,cp);
+			return false;
+		}
+	}
+
+	return true;
+}
+bool GetVarType( const char *nameBuffer, Type &resultType, bool isErrorEnabled){
+	char variable[VN_SIZE];
+
+	if(nameBuffer[0]=='.'){
+		GetWithName(variable);
+		lstrcat(variable,nameBuffer);
+	}
+	else lstrcpy(variable,nameBuffer);
+
+	// 名前空間を分離
+	char namespaceStr[VN_SIZE]="", simpleName[VN_SIZE];
+	Smoothie::meta.namespaceScopesCollection.SplitNamespace( variable, namespaceStr, simpleName );
+
+	// 先頭オブジェクトまたはクラス名と入れ子メンバに分割
+	CClass::RefType refType;
+	char member[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE];
+	GetVarFormatString(simpleName,array,lpPtrOffset,member,refType);
+
+	// 名前空間を分離していた場合は結合
+	char VarName[VN_SIZE];
+	if( namespaceStr[0] ){
+		sprintf( VarName, "%s.%s", namespaceStr, simpleName );
+	}
+	else{
+		lstrcpy( VarName, simpleName );
+	}
+
+	const Variable *pVar = NULL;
+	const int *pSubScripts;
+
+	if( UserProc::IsLocalAreaCompiling() ){
+		/////////////////
+		// ローカル変数
+		/////////////////
+
+		pVar = UserProc::CompilingUserProc().localVars.BackSearch( Symbol( VarName ) );
+		if( pVar ){
+			goto ok;
+		}
+	}
+
+	if(pobj_CompilingClass){
+		///////////////////////
+		// クラスメンバの参照
+		///////////////////////
+
+		if(lstrcmpi(variable,"This")==0){
+			//Thisオブジェクト
+			resultType.SetType( DEF_OBJECT, pobj_CompilingClass );
+			return true;
+		}
+
+		if(memicmp(variable,"This.",5)==0){
+			//Thisオブジェクトのメンバを参照するとき
+			SlideString(variable+5,-5);
+			lstrcpy(VarName,variable);
+		}
+		else{
+			//クラス内メンバを参照するとき（通常）
+
+			bool isFound = false;
+			BOOST_FOREACH( CMember *pMember, pobj_CompilingClass->GetDynamicMembers() ){
+				if( pMember->GetName() == VarName ){
+					isFound = true;
+					break;
+				}
+			}
+			if( !isFound ) goto NonClassMember;
+		}
+
+		return GetMemberType(*pobj_CompilingClass,variable,resultType,1,isErrorEnabled);
+	}
+
+NonClassMember:
+
+	//////////////////////////
+	// 静的ローカル変数
+	// ※"Static.Object.Method.Variable"
+	//////////////////////////
+
+	char temporary[VN_SIZE];
+	if( UserProc::IsLocalAreaCompiling() ){
+		GetNowStaticVarFullName(VarName,temporary);
+
+		pVar = globalVars.Find( Symbol( temporary ) );
+		if( pVar ){
+			goto ok;
+		}
+	}
+
+
+	//////////////////////////
+	// クラスの静的メンバ
+	//////////////////////////
+
+	if(member[0]){
+		lstrcpy(temporary,member);
+		char tempMember[VN_SIZE];
+		char tempArray[VN_SIZE];
+		{
+			CClass::RefType refType;
+			GetVarFormatString(temporary,tempArray,lpPtrOffset,tempMember,refType);
+		}
+
+		int typeDefIndex = Smoothie::meta.typeDefs.GetIndex( VarName );
+		if( typeDefIndex != -1 ){
+			// TypeDef後の型名だったとき
+			lstrcpy( VarName, Smoothie::meta.typeDefs[typeDefIndex].GetBaseName().c_str() );
+		}
+
+		char temp2[VN_SIZE];
+		sprintf(temp2,"%s.%s",VarName,temporary);
+
+		pVar = globalVars.Find( Symbol( temp2 ) );
+		if( pVar ){
+			lstrcpy(member,tempMember);
+			lstrcpy(array,tempArray);
+			goto ok;
+		}
+	}
+
+	if(pobj_CompilingClass){
+		//自身のクラスから静的メンバを参照する場合
+		char temp2[VN_SIZE];
+		sprintf(temp2,"%s.%s",pobj_CompilingClass->GetName().c_str(),VarName);
+
+		pVar = globalVars.Find( Symbol( temp2 ) );
+		if( pVar ){
+			goto ok;
+		}
+	}
+
+
+	////////////////////
+	// グローバル変数
+	////////////////////
+
+	pVar = globalVars.BackSearch( Symbol( VarName ) );
+	if( pVar ){
+		goto ok;
+	}
+
+	//変数として見つからなかったとき
+	if(isErrorEnabled) SetError(3,variable,cp);
+	return false;
+
+ok:
+
+	//ポインタ変数の場合
+	if( pVar->IsPointer() ){
+		if( !pVar->IsArray() ){
+			lstrcpy(lpPtrOffset,array);
+			array[0]=0;
+		}
+	}
+	else{
+		if(lpPtrOffset[0]){
+			if(isErrorEnabled) SetError(16,variable,cp);
+			return false;
+		}
+	}
+
+	resultType = (*pVar);
+	pSubScripts=pVar->GetSubScriptsPtr();
+
+
+	if(member[0]){
+		if( NATURAL_TYPE( resultType.GetBasicType() )==DEF_OBJECT
+			|| NATURAL_TYPE( resultType.GetBasicType() )==DEF_STRUCT){
+				return GetMemberType(resultType.GetClass(),member,resultType,0,isErrorEnabled);
+		}
+	}
+
+	if(array[0]==0&&pSubScripts[0]!=-1){
+		//配列の先頭ポインタを示す場合
+		resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR );
+	}
+
+	if(lpPtrOffset[0]){
+		if( resultType.PtrLevel() ){
+			resultType.PtrLevelDown();
+		}
+		else{
+			//エラー
+			if(isErrorEnabled) SetError(1,NULL,cp);
+			return false;
+		}
+	}
+
+	return true;
+}
+
+bool GetVarOffsetReadOnly(const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss ){
+	//読み取り専用で変数へアクセス
+	return GetVarOffset(
+		true,		//エラー表示有効
+		false,		//書き込みアクセスは無し
+		NameBuffer,
+		pRelativeVar,
+		resultType,
+		pss);
+}
+bool GetVarOffsetReadWrite(const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss ){
+	//読み書き両用で変数へアクセス
+	return GetVarOffset(
+		true,		//エラー表示有効
+		true,		//書き込みアクセス
+		NameBuffer,
+		pRelativeVar,
+		resultType,
+		pss);
+}
+
+
+
+bool GetDimentionFormat( const char *buffer,
+						char *VarName,
+						int *SubScripts,
+						Type &type,
+						char *InitBuf,
+						char *ConstractParameter ){
+	int i,i2,i3,IsStr;
+	char variable[VN_SIZE],temporary[8192];
+
+	for(i=0;;i++){
+		if((buffer[i]==1&&buffer[i+1]==ESC_AS)||
+			buffer[i]=='='||
+			buffer[i]=='\0'){
+			variable[i]=0;
+			break;
+		}
+		variable[i]=buffer[i];
+	}
+
+	if(buffer[i]=='='){
+		////////////////////////////////////
+		// 初期化データが指定されいるとき
+		////////////////////////////////////
+		i++;
+
+		if( buffer[i]=='[' ){
+			// 構造初期データの場合
+
+			i3=GetStringInBracket(InitBuf,buffer+i);
+			i+=i3;
+		}
+		else{
+			// 代入初期データの場合
+
+			for(i2=0,IsStr=0;;i++,i2++){
+				if(buffer[i]=='\"') IsStr^=1;
+				if(buffer[i]=='('&&IsStr==0){
+					i3=GetStringInPare(InitBuf+i2,buffer+i);
+					i+=i3-1;
+					i2+=i3-1;
+					continue;
+				}
+				if(buffer[i]=='['&&IsStr==0){
+					i3=GetStringInBracket(InitBuf+i2,buffer+i);
+					i+=i3-1;
+					i2+=i3-1;
+					continue;
+				}
+				if((buffer[i]==','&&IsStr==0)||
+					buffer[i]=='\0'){
+					InitBuf[i2]=0;
+					break;
+				}
+				InitBuf[i2]=buffer[i];
+			}
+		}
+	}
+	else{
+		//初期化データなし
+		InitBuf[0]=0;
+	}
+
+	ConstractParameter[0]=0;
+	if(buffer[i]==1&&buffer[i+1]==ESC_AS){
+		/////////////////////////////
+		// "As ～" による型指定あり
+		/////////////////////////////
+
+		for(i+=2,i2=0;;i++,i2++){
+			if(buffer[i]==','||buffer[i]=='('||buffer[i]=='\0'){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=buffer[i];
+		}
+		if(temporary[0]=='*'&&
+			temporary[1]==1&&
+			(temporary[2]==ESC_FUNCTION||temporary[2]==ESC_SUB)){
+			if(buffer[i]!='('){
+				SetError(10,temporary,cp);
+				return false;
+			}
+			i3=GetStringInPare(temporary+3,buffer+i);
+			i+=i3;
+			i2+=i3;
+
+			if(temporary[2]==ESC_FUNCTION&&buffer[i]==1&&buffer[i+1]==ESC_AS){
+				temporary[i2++]=buffer[i++];
+				temporary[i2++]=buffer[i++];
+				for(;;i++,i2++){
+					if(!IsVariableChar(buffer[i])){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+			}
+		}
+
+		if( !Type::StringToType( temporary, type ) ){
+			SetError(3,temporary,cp);
+			type.SetBasicType( DEF_LONG );
+		}
+
+		if(buffer[i]=='('){
+			//コンストラクタに渡すパラメータを取得
+			i2=GetStringInPare(ConstractParameter,buffer+i);
+			i+=i2;
+			RemoveStringPare(ConstractParameter);
+
+			if( !type.IsObject() ){
+				SetError(112,variable,cp);
+				return false;
+			}
+		}
+	}
+	else{
+		/////////////////
+		// As指定なし
+		/////////////////
+
+		if( InitBuf[0] == '\0' ){
+			//As指定も、初期値指定もない場合
+			type.SetBasicType( GetTypeFromSimpleName(variable) );
+
+			i2=lstrlen(variable)-1;
+			if(i2>=0){
+				if(!(variable[i2]=='#'||variable[i2]=='!'||variable[i2]=='%'||variable[i2]=='$'))
+					SetError(-103,variable,cp);
+			}
+		}
+		else{
+			//初期値の型を判別して自動的に型情報を付加する
+			if( !NumOpe_GetType( InitBuf, GetStringTypeInfo(), type ) ){
+				// エラーの場合
+				return false;
+			}
+
+			if( IS_LITERAL( type.GetIndex() ) ){
+				type.SetIndex( -1 );
+			}
+		}
+
+	}
+
+	if( InitBuf[0] != '\0' && ConstractParameter[0] != '\0' ){
+		//初期値とコンストラクタパラメータが同時に呼び出されているとき
+		SetError(132, NULL, cp);
+	}
+
+	GetArrange(variable,VarName,SubScripts);
+	return true;
+}
+
+BOOL GetNowStaticVarFullName(char *VarName,char *FullName){
+	if( UserProc::IsGlobalAreaCompiling() ){
+		// グローバル領域をコンパイル中のとき
+		return 0;
+	}
+
+	UserProc &proc = UserProc::CompilingUserProc();
+
+	//Static識別
+	lstrcpy(FullName,"Static%");
+
+	//クラス名
+	if(pobj_CompilingClass){
+		lstrcat(FullName,pobj_CompilingClass->GetName().c_str());
+		lstrcat(FullName,"%");
+	}
+
+	//関数（またはメソッド）名
+	lstrcat(FullName,proc.GetName().c_str());
+	lstrcat(FullName,"%");
+
+	//ID
+	char temp[255];
+	sprintf(temp,"%x",proc.id);
+	lstrcat(FullName,temp);
+	lstrcat(FullName,"%");
+
+	//変数名
+	lstrcat(FullName,VarName);
+
+	return 1;
+}
+
+
+void AddGlobalVariable( const char *name,int *SubScripts, const Type &type,const char *InitBuf,const char *ConstractParameter,DWORD dwFlag){
+	/////////////////////////
+	// グローバル変数を追加
+	/////////////////////////
+	extern int AllInitGlobalVarSize;
+	extern int AllGlobalVarSize;
+
+	if( globalVars.DuplicateCheck( Symbol( name ) ) ){
+		//２重定義のエラー
+		SetError(15,name,cp);
+		return;
+	}
+
+	bool isConst = ( dwFlag & DIMFLAG_CONST ) ? true:false;
+
+	Variable *pVar = new Variable( Smoothie::Lexical::liveingNamespaceScopes, name, type, isConst );
+
+	if( SubScripts[0] != -1 ){
+		//配列あり
+		pVar->SetArray( SubScripts );
+	}
+
+	//コンストラクタ用パラメータ
+	pVar->paramStrForConstructor = ConstractParameter;
+
+	//レキシカルスコープ
+	pVar->ScopeLevel=obj_LexScopes.GetNowLevel();
+	pVar->ScopeStartAddress=obj_LexScopes.GetStartAddress();
+	pVar->bLiving=TRUE;
+
+	//エラー用
+	pVar->source_code_address=cp;
+
+	// 変数を追加
+	globalVars.push_back( pVar );
+
+	//アラインメントを考慮
+	int alignment = 0;
+	if( pVar->IsStruct() ){
+		alignment = pVar->GetClass().iAlign;
+	}
+
+	if(InitBuf[0]||dwFlag==DIMFLAG_INITDEBUGVAR){
+		//初期バッファがあるとき
+
+		if( alignment ){
+			if( AllInitGlobalVarSize % alignment ){
+				AllInitGlobalVarSize += alignment - (AllInitGlobalVarSize % alignment);
+			}
+		}
+
+		pVar->offset=AllInitGlobalVarSize;
+		AllInitGlobalVarSize += pVar->GetMemorySize();
+	}
+	else{
+		//初期バッファがないとき
+
+		if( alignment ){
+			if( AllGlobalVarSize % alignment ){
+				AllGlobalVarSize += alignment - (AllGlobalVarSize % alignment);
+			}
+		}
+
+		pVar->offset=AllGlobalVarSize | 0x80000000;
+		AllGlobalVarSize += pVar->GetMemorySize();
+	}
+
+	if(InitBuf[0]){
+		int result = 0;
+		if( !pVar->IsObject() ){
+			//初期バッファにデータをセット
+			extern BYTE *initGlobalBuf;
+			initGlobalBuf=(BYTE *)HeapReAlloc(hHeap,
+				HEAP_ZERO_MEMORY,
+				initGlobalBuf,
+				AllInitGlobalVarSize);
+
+			result = SetInitGlobalData(pVar->offset,
+				*pVar,
+				pVar->GetSubScriptsPtr(),
+				InitBuf);
+		}
+
+		if(!result){
+			//動的な式だった場合は代入演算を行う
+
+			//初期代入時のみ、書き込みアクセスを許可する
+			if( isConst ){
+				pVar->ConstOff();
+			}
+
+			//代入
+			char temporary[8192];
+			sprintf(temporary,"%s=%s",name,InitBuf);
+			OpcodeCalc(temporary);
+
+			//アクセス制限を元に戻す
+			if( isConst ){
+				pVar->ConstOn();
+			}
+		}
+	}
+
+
+	if( type.IsObject() ){
+		//デストラクタの利用フラグをオンにする
+		const CMethod *method = type.GetClass().GetDestructorMethod();
+		if( method ){
+			method->pUserProc->Using();
+		}
+	}
+}
+
+void dim(char *Parameter,DWORD dwFlags){
+	extern HANDLE hHeap;
+	int i2;
+	char VarName[VN_SIZE];
+
+	i2 = 0;
+
+	if( Parameter[i2] == 1 && Parameter[i2+1] == ESC_BYREF ){
+		//参照型
+		SetError();
+		Parameter += 2;
+	}
+
+	if(dwFlags & DIMFLAG_CONST){
+
+		//////////////////////////////////
+		// 定数変数の場合を考慮
+		//////////////////////////////////
+		for(;;i2++){
+			if(Parameter[i2] == '=' ||
+				Parameter[i2] == 1 && Parameter[i2] == ESC_AS ||
+				Parameter[i2] =='('){
+					VarName[i2] = 0;
+					break;
+			}
+			VarName[i2] = Parameter[i2];
+		}
+
+		//定数と２重定義されていないる場合は抜け出す
+		if(CDBConst::obj.GetBasicType(VarName)){
+			return;
+		}
+
+		//定数マクロとして定義されている場合は抜け出す
+		if(GetConstHash(VarName)){
+			return;
+		}
+	}
+
+	//構文を解析
+	int SubScripts[MAX_ARRAYDIM];
+	Type type;
+	char InitBuf[8192];
+	char ConstractParameter[VN_SIZE];
+	if(!GetDimentionFormat(Parameter, VarName,SubScripts,type,InitBuf,ConstractParameter))
+		return;
+
+
+	//定数と２重定義されていないかを調べる
+	if(CDBConst::obj.GetBasicType(VarName)){
+		SetError(15,VarName,cp);
+		return;
+	}
+
+	//定数マクロとして定義されている場合
+	if(GetConstHash(VarName)){
+		SetError(15,VarName,cp);
+		return;
+	}
+
+	if( type.IsObject() ){
+		if( type.GetClass().IsBlittableType() ){
+			// Blittable型のときは基本型として扱う
+			// ※ただし、コンパイル中のメソッドがBlittable型クラスに属していないこと
+			if( UserProc::IsLocalAreaCompiling()
+				&& UserProc::CompilingUserProc().HasParentClass()
+				&& UserProc::CompilingUserProc().GetParentClass().IsBlittableType() )
+			{
+				// コンパイル中のメソッドがBlittable型クラスに属している
+			}
+			else{
+				type = type.GetClass().GetBlittableType();
+			}
+		}
+	}
+
+	if(dwFlags&DIMFLAG_STATIC){
+		if( UserProc::IsGlobalAreaCompiling() ){
+			SetError(60,NULL,cp);
+			return;
+		}
+
+		/////////////////////
+		// Static変数
+		// ※"Static.Object.Method.Variable"
+		/////////////////////
+
+		char temporary[VN_SIZE];
+		GetNowStaticVarFullName(VarName,temporary);
+
+		dim( temporary,SubScripts,type,InitBuf,ConstractParameter,dwFlags );
+
+		/*
+		Note: 静的変数のコンストラクタ呼び出しは
+			_System_InitStaticLocalVariables関数内で一括して行う
+		*/
+	}
+	else{
+		dim( VarName,SubScripts,type,InitBuf,ConstractParameter,dwFlags );
+	}
+}
+void OpcodeDim(char *Parameter,DWORD dwFlags){
+	int i,i2,i3,IsStr=0;
+	char temporary[8192];
+
+	for(i=0,i2=0;;i++,i2++){
+		if(Parameter[i]=='\"') IsStr^=1;
+		if(Parameter[i]=='('&&IsStr==0){
+			i3=GetStringInPare(temporary+i2,Parameter+i);
+			i+=i3-1;
+			i2+=i3-1;
+			continue;
+		}
+		if(Parameter[i]=='['&&IsStr==0){
+			i3=GetStringInBracket(temporary+i2,Parameter+i);
+			i+=i3-1;
+			i2+=i3-1;
+			continue;
+		}
+		if((Parameter[i]==','&&IsStr==0)||
+			Parameter[i]=='\0'){
+			temporary[i2]=0;
+
+			dim(temporary,dwFlags);
+
+			if(Parameter[i]=='\0') break;
+			i2=-1;
+			continue;
+		}
+		temporary[i2]=Parameter[i];
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/VariableOpe.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/VariableOpe.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/VariableOpe.h	(revision 178)
@@ -0,0 +1,36 @@
+
+
+BOOL IsVariableTopChar(char c);
+BOOL IsVariableChar(char c);
+BOOL IsPtrType(int type);
+BOOL IsSignedType(int type);
+BOOL IsNaturalWholeNumberType(int type);
+BOOL IsWholeNumberType(int type);
+BOOL IsRealNumberType(int type);
+BOOL Is64Type(int type);
+int GetSignedType(int type);
+int GetUnsignedType(int type);
+int GetTypeSize(int type,LONG_PTR lpIndex);
+int GetPtrType(int type);
+BOOL GetTypeName(int type,LONG_PTR lpIndex,char *name);
+void GetWithName(char *buffer);
+BOOL GetVarFormatString(char *buffer,char *array,char *array2,char *NestMember, CClass::RefType &refType );
+void GetArrayElement( const char *buffer,char *variable,char *array_element);
+BOOL CheckVarNameError(char *name,int nowLine);
+int JumpSubScripts(const int *ss);
+void GetArrange(char *variable,char *variAnswer,int *SubScripts);
+int GetTypeFromSimpleName(char *variable);
+bool GetMemberType( const CClass &objClass, const char *lpszMember, Type &resultType, BOOL bPrivateAccess, bool isErrorEnabled);
+bool GetVarType( const char *nameBuffer, Type &resultType, bool isError);
+bool GetVarOffsetReadOnly(const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss = NULL );
+bool GetVarOffsetReadWrite(const char *NameBuffer,RELATIVE_VAR *pRelativeVar,Type &resultType,int *pss = NULL );
+bool GetDimentionFormat( const char *buffer,
+						char *VarName,
+						int *SubScripts,
+						Type &type,
+						char *InitBuf,
+						char *ConstractParameter );
+BOOL GetNowStaticVarFullName(char *VarName,char *FullName);
+void AddGlobalVariable( const char *name,int *SubScripts, const Type &type,const char *InitBuf,const char *ConstractParameter,DWORD dwFlag);
+void dim(char *Parameter,DWORD dwFlags);
+void OpcodeDim(char *Parameter,DWORD dwFlags);
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/WatchList.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/WatchList.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/WatchList.cpp	(revision 178)
@@ -0,0 +1,544 @@
+#include "common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+//デバッグ用
+#include "debug.h"
+
+int Debugging_GetArray( const int *SubScripts,char *array,const Type &type,LONG_PTR *plpOffset);
+
+ULONG_PTR Debugging_GetVarPtr(RELATIVE_VAR *pRelativeVar){
+	extern DWORD ImageBase;
+	extern int MemPos_RWSection;
+	int i2;
+
+	if(pRelativeVar->dwKind==VAR_GLOBAL){
+		return ImageBase+MemPos_RWSection+pRelativeVar->offset;
+	}
+	else if( pRelativeVar->dwKind == VAR_REFGLOBAL ){
+		extern HANDLE hDebugProcess;
+		LONG_PTR lpData;
+		SIZE_T accessBytes;
+		ReadProcessMemory(hDebugProcess,
+			(void *)(ImageBase+MemPos_RWSection+pRelativeVar->offset),
+			&lpData,
+			sizeof(LONG_PTR),
+			&accessBytes);
+
+		return lpData;
+	}
+	else if(pRelativeVar->dwKind==VAR_LOCAL){
+		extern HWND hDebugWnd;
+		i2=(int)SendDlgItemMessage(hDebugWnd,IDC_PROCCOMBO,CB_GETCURSEL,0,0);
+		i2=pobj_dti->iProcLevel-i2;
+
+		if(pobj_dti->lplpSpBase[i2]==0) return 0;
+
+		return pobj_dti->lplpSpBase[i2]+pRelativeVar->offset;
+	}
+	else if( pRelativeVar->dwKind == VAR_REFLOCAL ){
+		extern HWND hDebugWnd;
+		i2=(int)SendDlgItemMessage(hDebugWnd,IDC_PROCCOMBO,CB_GETCURSEL,0,0);
+		i2=pobj_dti->iProcLevel-i2;
+
+		if(pobj_dti->lplpSpBase[i2]==0) return 0;
+
+		extern HANDLE hDebugProcess;
+		LONG_PTR lpData;
+		SIZE_T accessBytes;
+		ReadProcessMemory(hDebugProcess,
+			(void *)(pobj_dti->lplpSpBase[i2]+(int)pRelativeVar->offset),
+			&lpData,
+			sizeof(LONG_PTR),
+			&accessBytes);
+
+		return lpData;
+	}
+	else if(pRelativeVar->dwKind==VAR_DIRECTMEM){
+		return pRelativeVar->offset;
+	}
+
+	return 0;
+}
+
+bool Debugging_SetRelativeOffset( Type &type,RELATIVE_VAR *pRelativeVar,char *lpPtrOffset){
+	int array_num;
+
+	_int64 i64data;
+	if( !StaticCalculation( true, lpPtrOffset, 0, &i64data, Type(), 1 ) ){
+		return false;
+	}
+	if( type.IsReal() ){
+		double dbl;
+		memcpy(&dbl,&i64data,sizeof(double));
+		i64data=(_int64)dbl;
+	}
+
+	array_num=(int)i64data;
+
+	if( type.PtrLevel() ){
+		type.PtrLevelDown();
+		array_num *= type.GetSize();
+	}
+	else{
+		//エラー
+		return false;
+	}
+
+	extern HANDLE hDebugProcess;
+	LONG_PTR lpData;
+	SIZE_T accessBytes;
+	lpData=Debugging_GetVarPtr(pRelativeVar);
+	if(!ReadProcessMemory(hDebugProcess,(void *)lpData,&pRelativeVar->offset,sizeof(LONG_PTR),&accessBytes)){
+		return false;
+	}
+	pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+	pRelativeVar->offset+=array_num;
+	return true;
+}
+
+int Debugging_GetMember( const CClass &objClass,char *member,RELATIVE_VAR *pRelativeVar, Type &resultType, BOOL bPrivateAccess){
+	int i2;
+
+	//直接参照に切り替え
+	pRelativeVar->offset=(LONG_PTR)Debugging_GetVarPtr(pRelativeVar);
+	pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+	//クラス、配列の構成要素を解析する
+	char VarName[VN_SIZE];		//変数名
+	char array[VN_SIZE];		//第1次配列
+	char lpPtrOffset[VN_SIZE];	//第2次配列
+	char NestMember[VN_SIZE];	//入れ子メンバ
+	CClass::RefType refType;
+	lstrcpy(VarName,member);
+	if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember, refType ) ) return 0;
+
+
+	////////////////////////////
+	// メンバオフセットを取得
+	////////////////////////////
+
+	int memberIndex;
+	int offset = objClass.GetMemberOffset( VarName, &memberIndex );
+	if(memberIndex==objClass.GetDynamicMembers().size()) return 0;
+
+	CMember *pMember = objClass.GetDynamicMembers()[memberIndex];
+
+
+	//アクセシビリティをチェック
+	if(( bPrivateAccess==0 && pMember->IsPrivate() )||
+		pMember->IsNoneAccess() ){
+		return 0;
+	}
+	else if(bPrivateAccess==0&&pMember->IsProtected())
+		return 0;
+
+	resultType = pMember->GetType();
+
+	//ポインタ変数の場合
+	if( resultType.IsPointer() ){
+		if(pMember->SubScripts[0]==-1){
+			lstrcpy(lpPtrOffset,array);
+			array[0]=0;
+		}
+	}
+	else{
+		if(lpPtrOffset[0]) return 0;
+	}
+
+	pRelativeVar->offset+=offset;
+
+	if(array[0]){
+		//配列オフセット
+		i2=Debugging_GetArray(
+			pMember->SubScripts,
+			array,
+			resultType,
+			&pRelativeVar->offset);
+		if(i2==0){
+			//式エラー
+			return 0;
+		}
+		if(i2==-1){
+			//アクセスエラー
+			return -1;
+		}
+	}
+	else if(pMember->SubScripts[0]!=-1){
+		resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR );
+	}
+
+	if(NestMember[0]){
+		//入れ子構造の場合
+
+		if( resultType.IsObject() || resultType.IsStruct() ){
+			if( refType != CClass::Dot ) return 0;
+
+			if( resultType.IsObject() ){
+				extern HANDLE hDebugProcess;
+				LONG_PTR lpData;
+				SIZE_T accessBytes;
+				lpData=Debugging_GetVarPtr(pRelativeVar);
+				if(!ReadProcessMemory(hDebugProcess,(void *)lpData,&pRelativeVar->offset,sizeof(LONG_PTR),&accessBytes)) return -1;
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+			}
+		}
+		else if( resultType.IsObjectPtr() || resultType.IsStructPtr() ){
+			//構造体ポインタ型メンバ変数
+
+			if(lpPtrOffset[0]){
+				if( refType != CClass::Dot ) return 0;
+
+				//直接参照に切り替え
+				Debugging_SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+
+				lpPtrOffset[0]=0;
+			}
+			else{
+				if( refType != CClass::Pointer ) return 0;
+
+				extern HANDLE hDebugProcess;
+				LONG_PTR lpData;
+				SIZE_T accessBytes;
+				lpData=Debugging_GetVarPtr(pRelativeVar);
+				if(!ReadProcessMemory(hDebugProcess,(void *)lpData,&pRelativeVar->offset,sizeof(LONG_PTR),&accessBytes)) return -1;
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+			}
+		}
+
+		i2=Debugging_GetMember(pMember->GetType().GetClass(),
+			NestMember,
+			pRelativeVar,
+			resultType,
+			0);
+		if(i2==0){
+			//式エラー
+			return 0;
+		}
+		if(i2==-1){
+			//アクセスエラー
+			return -1;
+		}
+	}
+
+	if(lpPtrOffset[0]){
+		Debugging_SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+	}
+
+	return 1;
+}
+int Debugging_GetArray( const int *SubScripts,char *array,const Type &type,LONG_PTR *plpOffset){
+	extern HANDLE hHeap;
+	int i,i2,i3,i4,i5,array_offset;
+	char temporary[VN_SIZE],*pParm[MAX_PARMS];
+
+	for(i=0,i2=0,i3=0;;i++,i2++){
+		if(array[i]=='('){
+			i4=GetStringInPare(temporary+i2,array+i);
+			i+=i4-1;
+			i2+=i4-1;
+			continue;
+		}
+		if(array[i]=='['){
+			i4=GetStringInBracket(temporary+i2,array+i);
+			i+=i4-1;
+			i2+=i4-1;
+			continue;
+		}
+		if(array[i]==','||array[i]=='\0'){
+			if(SubScripts[i3]==-1){
+				for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]);
+				return 0;
+			}
+
+			temporary[i2]=0;
+
+			pParm[i3]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+			lstrcpy(pParm[i3],temporary);
+
+			i3++;
+
+			if(array[i]=='\0'){
+				if(SubScripts[i3]!=-1){
+					for(i3--;i3>=0;i3--) HeapDefaultFree(pParm[i3]);
+					return 0;
+				}
+				break;
+			}
+
+			i2=-1;
+			continue;
+		}
+		temporary[i2]=array[i];
+	}
+
+	array_offset=0;
+
+	for(i=i3-1;i>=0;i--){
+		_int64 i64data;
+		Type resultType;
+		bool isMemoryAccessError;
+		if( !StaticCalculation(true, pParm[i],0,&i64data,resultType,1, &isMemoryAccessError ) ){
+			//式エラー
+			return 0;
+		}
+		if(isMemoryAccessError){
+			//アクセスエラー
+			return -1;
+		}
+
+		if(resultType.IsReal()){
+			double dbl;
+			memcpy(&dbl,&i64data,sizeof(double));
+			i64data=(_int64)dbl;
+		}
+		i5=(int)i64data;
+
+		for(i2=i+1,i4=1;i2<i3;i2++) i4*=SubScripts[i2]+1;
+
+		array_offset+=i5*i4;
+
+		HeapDefaultFree(pParm[i]);
+	}
+
+	array_offset *= type.GetSize();
+
+	*plpOffset+=array_offset;
+
+	return 1;
+}
+ULONG_PTR Debugging_GetThisPtrOffset(LONG_PTR obp_Rip){
+	GlobalProc *pUserProc = GetSubFromObp(obp_Rip);
+
+	foreach( Variable *pVar, pUserProc->localVars ){
+		if( pVar->GetName() == "_System_LocalThis" ){
+			return pVar->offset;
+		}
+	}
+	return 0;
+}
+int Debugging_GetVarOffset( char *variable,RELATIVE_VAR *pRelativeVar, Type &resultType, int *pss){
+	extern HANDLE hDebugProcess;
+	int i2,i3;
+	char member[VN_SIZE],VarName[VN_SIZE],array[VN_SIZE],lpPtrOffset[VN_SIZE];
+	LONG_PTR lpData;
+	SIZE_T accessBytes;
+
+	lstrcpy(VarName,variable);
+	CClass::RefType refType;
+	GetVarFormatString(VarName,array,lpPtrOffset,member,refType);
+
+	const int *pSubScripts;
+	bool isArray;
+
+
+	/////////////////
+	// ローカル変数
+	/////////////////
+	if( UserProc::IsLocalAreaCompiling() ){
+		const Variable *pVar = UserProc::CompilingUserProc().localVars.Find( Symbol( VarName ) );
+
+		if( pVar ){
+			//ポインタ変数の場合
+			if( pVar->IsPointer() ){
+				if( !pVar->IsArray() ){
+					lstrcpy(lpPtrOffset,array);
+					array[0]=0;
+				}
+			}
+			else{
+				if(lpPtrOffset[0]) return 0;
+			}
+
+			pRelativeVar->offset = pVar->offset;
+			if( pVar->IsRef() ){
+				pRelativeVar->dwKind=VAR_REFLOCAL;
+			}
+			else{
+				pRelativeVar->dwKind=VAR_LOCAL;
+			}
+			resultType = *pVar;
+			isArray = pVar->IsArray();
+			pSubScripts = pVar->GetSubScriptsPtr();
+		}
+	}
+
+	if(pobj_CompilingClass){
+		///////////////////////
+		// クラスメンバの参照
+		///////////////////////
+
+		if(memicmp(variable,"This.",5)==0){
+			//Thisオブジェクトのメンバを参照するとき
+			SlideString(variable+5,-5);
+			lstrcpy(VarName,variable);
+		}
+		else{
+			//クラス内メンバを参照するとき（通常）
+
+			bool isFound = false;
+			BOOST_FOREACH( CMember *pMember, pobj_CompilingClass->GetDynamicMembers() ){
+				if( pMember->GetName() == VarName ){
+					isFound = true;
+					break;
+				}
+			}
+			if( !isFound ) goto NonClassMember;
+		}
+
+		/////////////////////////////
+		// thisポインタを取得
+
+		extern HWND hDebugWnd;
+		i2=(int)SendDlgItemMessage(hDebugWnd,IDC_PROCCOMBO,CB_GETCURSEL,0,0);
+		i2=pobj_dti->iProcLevel-i2;
+
+		lpData=Debugging_GetThisPtrOffset(pobj_dti->lplpObp[i2]);
+		if(!lpData){
+			//式エラー
+			return 0;
+		}
+		lpData+=pobj_dti->lplpSpBase[i2];
+		if(!ReadProcessMemory(hDebugProcess,(void *)lpData,&pRelativeVar->offset,sizeof(LONG_PTR),&accessBytes)){
+			//メモリにアクセスできないとき
+			return -1;
+		}
+
+		pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+		i3=Debugging_GetMember(*pobj_CompilingClass,variable,pRelativeVar,resultType,1);
+		if(i3==0){
+			//式エラー
+			return 0;
+		}
+		if(i3==-1){
+			//アクセスエラー
+			return -1;
+		}
+
+		return 1;
+	}
+
+NonClassMember:
+
+	{
+		///////////////////
+		// グローバル変数
+		///////////////////
+
+		const Variable *pVar = globalVars.Find( VarName );
+		if( !pVar ){
+			//一致しないとき
+			return 0;
+		}
+
+		//ポインタ変数の場合
+		if( pVar->IsPointer() ){
+			if( !pVar->IsArray() ){
+				lstrcpy(lpPtrOffset,array);
+				array[0]=0;
+			}
+		}
+		else{
+			if(lpPtrOffset[0]) return 0;
+		}
+
+		pRelativeVar->offset=pVar->offset;
+		if(pVar->IsRef()) pRelativeVar->dwKind=VAR_REFGLOBAL;
+		else pRelativeVar->dwKind=VAR_GLOBAL;
+		resultType = *pVar;
+		isArray = pVar->IsArray();
+		pSubScripts=pVar->GetSubScriptsPtr();
+	}
+
+
+	if(array[0]==0&&isArray){
+		//配列の先頭ポインタを示す場合
+		resultType.SetBasicType( resultType.GetBasicType() | FLAG_PTR );
+		if(pss) memcpy(pss,pSubScripts,MAX_ARRAYDIM*sizeof(int));
+		return 1;
+	}
+
+	if(array[0]){
+		i3=Debugging_GetArray(pSubScripts,array,resultType,&pRelativeVar->offset);
+		if(i3==0){
+			//式エラー
+			return 0;
+		}
+		if(i3==-1){
+			//アクセスエラー
+			return -1;
+		}
+	}
+	if(member[0]){
+		if( resultType.IsObject() || resultType.IsStruct() ){
+			//実態オブジェクトのメンバを参照（obj.member）
+			if( refType != CClass::Dot ){
+				return 0;
+			}
+
+			i3=Debugging_GetMember(resultType.GetClass(),member,pRelativeVar,resultType,0);
+			if(i3==0){
+				//式エラー
+				return 0;
+			}
+			if(i3==-1){
+				//アクセスエラー
+				return -1;
+			}
+		}
+		else if( resultType.IsObjectPtr() || resultType.IsStructPtr() ){
+			//ポインタオブジェクトが示すメンバを参照
+			if(lpPtrOffset[0]){
+				//pObj[n].member
+				if( refType != CClass::Dot ) return 0;
+				Debugging_SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset);
+
+				i3=Debugging_GetMember(resultType.GetClass(),member,pRelativeVar,resultType,0);
+				if(i3==0){
+					//式エラー
+					return 0;
+				}
+				if(i3==-1){
+					//アクセスエラー
+					return -1;
+				}
+			}
+			else{
+				//pObj->member
+				if( refType != CClass::Pointer ) return 0;
+
+				pRelativeVar->offset=Debugging_GetVarPtr(pRelativeVar);
+				pRelativeVar->dwKind=VAR_DIRECTMEM;
+
+				if(!ReadProcessMemory(hDebugProcess,(void *)pRelativeVar->offset,&lpData,sizeof(LONG_PTR),&accessBytes)) return -1;
+				pRelativeVar->offset=lpData;
+
+				i3=Debugging_GetMember(resultType.GetClass(),member,pRelativeVar,resultType,0);
+				if(i3==0){
+					//式エラー
+					return 0;
+				}
+				if(i3==-1){
+					//アクセスエラー
+					return -1;
+				}
+			}
+		}
+		else{
+			return 0;
+		}
+		return 1;
+	}
+
+	if(lpPtrOffset[0]){
+		if(!Debugging_SetRelativeOffset(resultType,pRelativeVar,lpPtrOffset)) return 0;
+	}
+
+	return 1;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/calculation.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/calculation.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/calculation.cpp	(revision 178)
@@ -0,0 +1,1547 @@
+#include "../BasicCompiler_Common/common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+double dbl_stack[255];
+_int64 i64stack[255];
+
+bool IsNumberTopChar(const char *buffer){
+	int c = buffer[0];
+	if('0' <= c && c <= '9') return true;
+	if(c == '&' && (buffer[1] == 'h' || buffer[1] == 'H' || buffer[1] == 'o' || buffer[1] == 'O')) return true;
+
+	return false;
+}
+bool IsNumberChar(const char c){
+	if('0' <= c && c <= '9') return true;
+	if('a' <= c && c <= 'f') return true;
+	if('A' <= c && c <= 'F') return true;
+	if(c=='.' || c=='e'||c=='E') return true;
+
+	return false;
+}
+BOOL IsJudgMark(const char *Command,int p){
+	if(Command[p]==1){
+		if(Command[p+1]==ESC_AND) return 1;
+		if(Command[p+1]==ESC_OR) return 1;
+		if(Command[p+1]==ESC_XOR) return 1;
+		if(Command[p+1]==ESC_NOT) return 1;
+	}
+	return 0;
+}
+BOOL IsNumCalcMark(const char *Command,int p){
+	if(Command[p]=='^'||Command[p]=='*'||Command[p]=='/'||Command[p]=='\\'||
+		(Command[p]==1&&Command[p+1]==ESC_MOD)||Command[p]=='+'||Command[p]=='-'||
+		Command[p]=='='||Command[p]=='<'||Command[p]=='>'||
+		IsJudgMark(Command,p)||
+		(Command[p]==1&&Command[p+1]==ESC_AS)||
+		(Command[p]==1&&Command[p+1]==ESC_BYVAL)) return 1;
+	return 0;
+}
+BOOL IsNumCalcMark_Back(const char *Command,int p){
+	if(p==0){
+		if(Command[p]=='^'||Command[p]=='*'||Command[p]=='/'||Command[p]=='\\'||
+			Command[p]=='+'||Command[p]=='-'||
+			Command[p]=='='||Command[p]=='<'||Command[p]=='>') return 1;
+	}
+	else{
+		if(Command[p]=='^'||Command[p]=='*'||Command[p]=='/'||Command[p]=='\\'||
+			(Command[p-1]==1&&Command[p]==ESC_MOD)||Command[p]=='+'||Command[p]=='-'||
+			Command[p]=='='||Command[p]=='<'||Command[p]=='>'||
+			IsJudgMark(Command,p-1)||
+			(Command[p-1]==1&&Command[p]==ESC_AS)) return 1;
+	}
+	return 0;
+}
+BOOL IsStrCalcMark(const char c){
+	if(c=='+'||c=='&') return 1;
+	return 0;
+}
+BOOL IsExponent(const char *Command,int p){
+	int i,sw;
+	for(i=p-2,sw=FALSE;i>=0;i--){
+		if(Command[i]>='0'&&Command[i]<='9') sw=TRUE;
+		if(!((Command[i]>='0'&&Command[i]<='9')||Command[i]=='.')){
+			if((IsNumCalcMark(Command,i)||Command[i]=='('||Command[i]==')')&&sw) return TRUE;
+			return FALSE;
+		}
+		if(i==0&&sw) return TRUE;
+	}
+	return FALSE;
+}
+
+int CompStr(char *str1,int len1,char *str2,int len2){
+	int i,len;
+
+	if(len1<len2) len=len1;
+	else len=len2;
+
+	for(i=0;i<len;i++){
+		if((unsigned char *)str1[i]>(unsigned char *)str2[i]) return 1;
+		else if((unsigned char *)str1[i]<(unsigned char *)str2[i]) return -1;
+	}
+	if(len1>len2) return 1;
+	else if(len1<len2) return -1;
+	return 0;
+}
+void TypeErrorCheck(_int64 *stack,int sp,long calc){
+	extern int cp;
+	if(sp==0||calc==0) return;
+	if(sp==1){
+		if(stack[0]){
+			SetError(9,NULL,cp);
+			return;
+		}
+		return;
+	}
+	if(CALC_PE<=calc&&calc<=CALC_Q||calc==CALC_ADDITION){
+		//文字列演算が可能な演算子
+		if((stack[sp-2]&&stack[sp-1]==0)||(stack[sp-2]==0&&stack[sp-1])){
+			SetError(9,NULL,cp);
+			return;
+		}
+	}
+	else{
+		//文字列演算ができない演算子
+		if(stack[sp-2]||stack[sp-1]){
+			SetError(9,NULL,cp);
+			return;
+		}
+	}
+}
+
+
+int GetLiteralIndex(_int64 i64data){
+	if(i64data==0) return LITERAL_NULL;
+	else if(-128<=i64data&&i64data<0) return LITERAL_M128_0;
+	else if(0<i64data&&i64data<256) return LITERAL_0_255;
+	else if(-32768<=i64data&&i64data<0) return LITERAL_M32768_0;
+	else if(0<i64data&&i64data<65536) return LITERAL_0_65535;
+	else if(i64data<0) return LITERAL_OTHER_MINUS;
+	return LITERAL_OTHER_PLUS;
+}
+
+
+int NeutralizationType(int type1,LONG_PTR index1,int type2,LONG_PTR index2){
+
+	if(type1==DEF_DOUBLE||type2==DEF_DOUBLE) return DEF_DOUBLE;
+	if(type1==DEF_SINGLE||type2==DEF_SINGLE) return DEF_SINGLE;
+
+	int size1,size2;
+	size1=GetTypeSize(type1,index1);
+	size2=GetTypeSize(type2,index2);
+	if(size1<size2){
+		size1=size2;
+	}
+	else if(type1==type2) return type1;
+
+	if(IsPtrType(type1)||IsPtrType(type2)){
+		if(IsPtrType(type1)) return type1;
+		else return type2;
+	}
+
+
+	/////////////////////////////
+	// 片方がリテラル値の場合
+	// ※柔軟に符号を除去する
+	/////////////////////////////
+	if(IsSignedType(type1)&&IS_POSITIVE_LITERAL(index1)&&
+		IsSignedType(type2)==0){
+		type1=GetUnsignedType(type1);
+	}
+	if(IsSignedType(type1)==0&&
+		IsSignedType(type2)&&IS_POSITIVE_LITERAL(index2)){
+		type2=GetUnsignedType(type2);
+	}
+
+
+	if(IsSignedType(type1)||IsSignedType(type2)){
+		//符号あり
+		if(size1==sizeof(char))		return DEF_SBYTE;
+		if(size1==sizeof(short))	return DEF_INTEGER;
+		if(size1==sizeof(long))		return DEF_LONG;
+		if(size1==sizeof(_int64))	return DEF_INT64;
+	}
+	else{
+		//符号なし
+		if(size1==sizeof(char))		return DEF_BYTE;
+		if(size1==sizeof(short))	return DEF_WORD;
+		if(size1==sizeof(long))		return DEF_DWORD;
+		if(size1==sizeof(_int64))	return DEF_QWORD;
+	}
+
+	extern int cp;
+	SetError(300,NULL,cp);
+	return 0;
+}
+
+void StaticTwoTerm(int idCalc,int *type_stack,LONG_PTR *index_stack,int *pStackPointer,int BaseType){
+	int sp,AnswerType;
+
+	sp=*pStackPointer;
+ 
+	AnswerType=NeutralizationType(type_stack[sp-2],index_stack[sp-2],type_stack[sp-1],index_stack[sp-1]);
+
+	if(IsRealNumberType(BaseType)&&idCalc==CALC_QUOTIENT) AnswerType=BaseType;
+
+	if(IsRealNumberType(AnswerType)){
+		///////////////
+		// 実数演算
+		///////////////
+
+		if(IsWholeNumberType(type_stack[sp-2])) dbl_stack[sp-2]=(double)i64stack[sp-2];
+		if(IsWholeNumberType(type_stack[sp-1])) dbl_stack[sp-1]=(double)i64stack[sp-1];
+
+
+		//比較演算
+		if(idCalc==CALC_PE){
+			if(dbl_stack[sp-2]<=dbl_stack[sp-1]) i64stack[sp-2]=-1;
+			else i64stack[sp-2]=0;
+			AnswerType=DEF_LONG;
+		}
+		else if(idCalc==CALC_QE){
+			if(dbl_stack[sp-2]>=dbl_stack[sp-1]) i64stack[sp-2]=-1;
+			else i64stack[sp-2]=0;
+			AnswerType=DEF_LONG;
+		}
+		else if(idCalc==CALC_P){
+			if(dbl_stack[sp-2]<dbl_stack[sp-1]) i64stack[sp-2]=-1;
+			else i64stack[sp-2]=0;
+			AnswerType=DEF_LONG;
+		}
+		else if(idCalc==CALC_Q){
+			if(dbl_stack[sp-2]>dbl_stack[sp-1]) i64stack[sp-2]=-1;
+			else i64stack[sp-2]=0;
+			AnswerType=DEF_LONG;
+		}
+		else if(idCalc==CALC_NOTEQUAL){
+			if(dbl_stack[sp-2]!=dbl_stack[sp-1]) i64stack[sp-2]=-1;
+			else i64stack[sp-2]=0;
+			AnswerType=DEF_LONG;
+		}
+		else if(idCalc==CALC_EQUAL){
+			if(dbl_stack[sp-2]==dbl_stack[sp-1]) i64stack[sp-2]=-1;
+			else i64stack[sp-2]=0;
+			AnswerType=DEF_LONG;
+		}
+
+		//論理演算
+		else if(idCalc==CALC_XOR)			dbl_stack[sp-2]=(double)((long)dbl_stack[sp-2]^(long)dbl_stack[sp-1]);
+		else if(idCalc==CALC_OR)			dbl_stack[sp-2]=(double)((long)dbl_stack[sp-2]|(long)dbl_stack[sp-1]);
+		else if(idCalc==CALC_AND)			dbl_stack[sp-2]=(double)((long)dbl_stack[sp-2]&(long)dbl_stack[sp-1]);
+
+		//シフト演算
+		else if(idCalc==CALC_SHL)			dbl_stack[sp-2]=(double)((DWORD)dbl_stack[sp-2]<<(DWORD)dbl_stack[sp-1]);
+		else if(idCalc==CALC_SHR)			dbl_stack[sp-2]=(double)((DWORD)dbl_stack[sp-2]>>(DWORD)dbl_stack[sp-1]);
+
+		//算術演算
+		else if(idCalc==CALC_ADDITION)		dbl_stack[sp-2]+=dbl_stack[sp-1];
+		else if(idCalc==CALC_SUBTRACTION)	dbl_stack[sp-2]-=dbl_stack[sp-1];
+		else if(idCalc==CALC_MOD)			dbl_stack[sp-2]=(double)((long)dbl_stack[sp-2]%(long)dbl_stack[sp-1]);
+		else if(idCalc==CALC_PRODUCT)		dbl_stack[sp-2]*=dbl_stack[sp-1];
+		else if(idCalc==CALC_QUOTIENT){
+			if(dbl_stack[sp-1])
+				dbl_stack[sp-2]/=dbl_stack[sp-1];
+			else{
+				//ゼロ割りエラーを検地
+				SetError(56,NULL,cp);
+			}
+		}
+		else if(idCalc==CALC_INTQUOTIENT){
+			if(dbl_stack[sp-1])
+				dbl_stack[sp-2]=(double)(long)(dbl_stack[sp-2]/dbl_stack[sp-1]);
+			else{
+				//ゼロ割りエラーを検地
+				SetError(56,NULL,cp);
+			}
+		}
+		else if(idCalc==CALC_POWER)			dbl_stack[sp-2]=pow(dbl_stack[sp-2],dbl_stack[sp-1]);
+	}
+	else{
+		///////////////
+		// 整数演算
+		///////////////
+
+		if(IsRealNumberType(type_stack[sp-2])) i64stack[sp-2]=(_int64)dbl_stack[sp-2];
+		if(IsRealNumberType(type_stack[sp-1])) i64stack[sp-1]=(_int64)dbl_stack[sp-1];
+
+
+		//比較演算
+		if(idCalc==CALC_PE){
+			if(IsSignedType(AnswerType)){
+				if(i64stack[sp-2]<=i64stack[sp-1]) i64stack[sp-2]=-1;
+				else i64stack[sp-2]=0;
+			}
+			else{
+				if(((unsigned _int64)i64stack[sp-2])<=((unsigned _int64)i64stack[sp-1])) i64stack[sp-2]=-1;
+				else i64stack[sp-2]=0;
+			}
+			AnswerType=DEF_LONG;
+		}
+		else if(idCalc==CALC_QE){
+			if(IsSignedType(AnswerType)){
+				if(i64stack[sp-2]>=i64stack[sp-1]) i64stack[sp-2]=-1;
+				else i64stack[sp-2]=0;
+			}
+			else{
+				if(((unsigned _int64)i64stack[sp-2])>=((unsigned _int64)i64stack[sp-1])) i64stack[sp-2]=-1;
+				else i64stack[sp-2]=0;
+			}
+			AnswerType=DEF_LONG;
+		}
+		else if(idCalc==CALC_P){
+			if(IsSignedType(AnswerType)){
+				if(i64stack[sp-2]<i64stack[sp-1]) i64stack[sp-2]=-1;
+				else i64stack[sp-2]=0;
+			}
+			else{
+				if(((unsigned _int64)i64stack[sp-2])<((unsigned _int64)i64stack[sp-1])) i64stack[sp-2]=-1;
+				else i64stack[sp-2]=0;
+			}
+			AnswerType=DEF_LONG;
+		}
+		else if(idCalc==CALC_Q){
+			if(IsSignedType(AnswerType)){
+				AnswerType=NeutralizationType(type_stack[sp-2],index_stack[sp-2],type_stack[sp-1],index_stack[sp-1]);
+				if(i64stack[sp-2]>i64stack[sp-1]) i64stack[sp-2]=-1;
+				else i64stack[sp-2]=0;
+			}
+			else{
+				if(((unsigned _int64)i64stack[sp-2])>((unsigned _int64)i64stack[sp-1])) i64stack[sp-2]=-1;
+				else i64stack[sp-2]=0;
+			}
+			AnswerType=DEF_LONG;
+		}
+		else if(idCalc==CALC_NOTEQUAL){
+			if(i64stack[sp-2]!=i64stack[sp-1]) i64stack[sp-2]=-1;
+			else i64stack[sp-2]=0;
+			AnswerType=DEF_LONG;
+		}
+		else if(idCalc==CALC_EQUAL){
+			if(i64stack[sp-2]==i64stack[sp-1]) i64stack[sp-2]=-1;
+			else i64stack[sp-2]=0;
+			AnswerType=DEF_LONG;
+		}
+
+		//論理演算
+		else if(idCalc==CALC_XOR)			i64stack[sp-2]^=i64stack[sp-1];
+		else if(idCalc==CALC_OR)			i64stack[sp-2]|=i64stack[sp-1];
+		else if(idCalc==CALC_AND)			i64stack[sp-2]&=i64stack[sp-1];
+
+		//シフト演算
+		else if(idCalc==CALC_SHL){
+			i64stack[sp-2]<<=(DWORD)i64stack[sp-1];
+			if(IsSignedType(AnswerType)) AnswerType=DEF_LONG;
+			else AnswerType=DEF_DWORD;
+		}
+		else if(idCalc==CALC_SHR){
+			i64stack[sp-2]>>=(DWORD)i64stack[sp-1];
+			if(IsSignedType(AnswerType)) AnswerType=DEF_LONG;
+			else AnswerType=DEF_DWORD;
+		}
+
+		//算術演算
+		else if(idCalc==CALC_ADDITION)		i64stack[sp-2]+=i64stack[sp-1];
+		else if(idCalc==CALC_SUBTRACTION)	i64stack[sp-2]-=i64stack[sp-1];
+		else if(idCalc==CALC_MOD)			i64stack[sp-2]%=i64stack[sp-1];
+		else if(idCalc==CALC_PRODUCT)		i64stack[sp-2]*=i64stack[sp-1];
+		else if(idCalc==CALC_QUOTIENT||
+			idCalc==CALC_INTQUOTIENT){
+			if(i64stack[sp-1])
+				i64stack[sp-2]/=i64stack[sp-1];
+			else{
+				//ゼロ割りエラーを検地
+				SetError(56,NULL,cp);
+			}
+		}
+		else if(idCalc==CALC_POWER)			i64stack[sp-2]=(_int64)pow((double)i64stack[sp-2],(double)i64stack[sp-1]);
+
+		if(IsSignedType(AnswerType)){
+			if(AnswerType==DEF_SBYTE&&(i64stack[sp-2]<CHAR_MIN||CHAR_MAX<i64stack[sp-2])){
+				//符号有り8ビット値をはみ出したとき
+				AnswerType=DEF_INTEGER;
+			}
+			if(AnswerType==DEF_INTEGER&&(i64stack[sp-2]<SHRT_MIN||SHRT_MAX<i64stack[sp-2])){
+				//符号有り16ビット値をはみ出したとき
+				AnswerType=DEF_LONG;
+			}
+			if(i64stack[sp-2]<LONG_MIN||LONG_MAX<i64stack[sp-2]){
+				//符号有り32ビット値をはみ出したとき
+				AnswerType=DEF_INT64;
+			}
+		}
+		else{
+			if(UINT_MAX<((unsigned _int64)i64stack[sp-2])){
+				//符号無し32ビット値をはみ出したとき
+				AnswerType=DEF_QWORD;
+			}
+		}
+	}
+
+	type_stack[sp-2]=AnswerType;
+	index_stack[sp-2]=-1;
+
+	sp--;
+	*pStackPointer=sp;
+}
+
+bool StaticCalculation(bool enableerror, const char *Command,int BaseType,_int64 *pi64data,Type &resultType,BOOL bDebuggingWatchList, bool *pIsMemoryAccessError){
+	extern int cp;
+	int i,i2,i3,PareNum;
+	char Parms[1024],temporary[VN_SIZE],temp2[VN_SIZE];
+
+	_int64 i64data;
+	double nums[255];
+	_int64 i64nums[255];
+	char *StrPtr[255];
+	long calc[255];
+	_int64 stack[255];
+	int type[255];
+	LONG_PTR before_index[255];
+	int sp,pnum;
+
+	if( pIsMemoryAccessError ) *pIsMemoryAccessError = false;
+
+	*pi64data=0;
+	if(Command[0]=='\0') return false;
+
+	for(i=0,i2=0,sp=0,pnum=0,PareNum=0;;i++,i2++){
+		if(Command[i]=='\"'){
+			Parms[i2]=Command[i];
+			for(i++,i2++;;i++,i2++){
+				Parms[i2]=Command[i];
+				if(Command[i]=='\"') break;
+			}
+			continue;
+		}
+		else if(Command[i]=='['){
+			i3=GetStringInBracket(Parms+i2,Command+i);
+			i+=i3-1;
+			i2+=i3-1;
+			continue;
+		}
+		else if(Command[i]=='('){
+			if(i==0){
+				PareNum++;
+				i2=-1;
+				continue;
+			}
+			else if(IsNumCalcMark_Back(Command,i-1)||Command[i-1]=='('){
+				PareNum++;
+				i2=-1;
+				continue;
+			}
+			else{
+				//配列変数の場合を考慮
+				i3=GetStringInPare(Parms+i2,Command+i);
+				i+=i3-1;
+				i2+=i3-1;
+				continue;
+			}
+		}
+		else if(Command[i]==')'){
+			PareNum--;
+			i2--;
+			continue;
+		}
+		else if(IsNumCalcMark(Command,i)||Command[i]=='\0'){
+			if((Command[i]=='+'||Command[i]=='-')&&(Command[i-1]=='e'||Command[i-1]=='E')){
+				if(IsExponent(Command,i)){
+					Parms[i2]=Command[i];
+					continue;
+				}
+			}
+			Parms[i2]=0;
+
+			if(stack[sp-1]==CALC_AS&&Command[i]=='*'){
+				for(i3=0;i3<i2;i3++){
+					if(Parms[i2]!='*') break;
+				}
+				if(i3==i2){
+					//"*"をポインタ指定文字として認識する
+					Parms[i2]=Command[i];
+					continue;
+				}
+			}
+
+			calc[pnum]=0;
+			if(i2){
+				before_index[pnum]=-1;
+
+				i3=GetCallProcName(Parms,temporary);
+				if(Parms[i3]=='('){
+					lstrcpy(temp2,Parms+i3+1);
+					temp2[lstrlen(temp2)-1]=0;
+
+					if(lstrcmpi(temporary,"SizeOf")==0){
+						//SizeOf関数
+
+						type[pnum]=DEF_LONG;
+
+						Type tempType;
+						if( !Type::StringToType( temp2, tempType ) ){
+							if(enableerror) SetError(3,temp2,cp);
+							return false;
+						}
+						i64nums[pnum] = tempType.GetSize();
+						StrPtr[pnum]=0;
+					}
+					else{
+						//定数関数
+
+						if(!GetConstCalcBuffer(temporary,temp2,Parms)){
+							if(enableerror) SetError(3,temporary,cp);
+							return false;
+						}
+
+						Type tempType;
+						StaticCalculation(enableerror, Parms,BaseType,&i64data,tempType);
+						type[pnum] = tempType.GetBasicType();
+						before_index[pnum] = tempType.GetIndex();
+						if(tempType.IsReal()){
+							//実数型
+							memcpy(&nums[pnum],&i64data,sizeof(double));
+						}
+						else{
+							//整数型
+							i64nums[pnum]=i64data;
+						}
+
+						StrPtr[pnum]=0;
+					}
+				}
+				else{
+					if(Parms[0]=='\"'){
+						//文字列の場合（比較演算子を考慮）
+						RemoveStringQuotes(Parms);
+						i2=lstrlen(Parms);
+
+						nums[pnum]=i2;
+						StrPtr[pnum]=(char *)HeapAlloc(hHeap,0,i2+1);
+						memcpy(StrPtr[pnum],Parms,i2);
+						StrPtr[pnum][i2]=0;
+
+						type[pnum]=typeOfPtrChar;
+						before_index[pnum]=LITERAL_STRING;
+					}
+					else if((Parms[0]=='e'||Parms[0]=='E')&&
+						(Parms[1]=='x'||Parms[1]=='X')&&
+						Parms[2]=='\"'){
+						//拡張文字列
+						RemoveStringQuotes(Parms+2);
+						i2=FormatString_EscapeSequence(Parms+2);
+						nums[pnum]=i2;
+						StrPtr[pnum]=(char *)HeapAlloc(hHeap,0,(int)i2+1);
+						memcpy(StrPtr[pnum],Parms+2,i2);
+						StrPtr[pnum][i2]=0;
+
+						type[pnum]=typeOfPtrChar;
+						before_index[pnum]=LITERAL_STRING;
+					}
+					else if(IsVariableTopChar(Parms[0])||Parms[0]=='*'||(Parms[0]=='.'&&IsVariableTopChar(Parms[1]))){
+						if(bDebuggingWatchList){
+							//////////////////////////
+							// 変数（デバッグ時のみ）
+							//////////////////////////
+
+							RELATIVE_VAR RelativeVar;
+							int ss[MAX_ARRAYDIM];
+							void *offset;
+							DWORD dwData;
+							SIZE_T accessBytes;
+							float flt;
+
+							extern HANDLE hDebugProcess;
+
+							Type tempType;
+							i3=Debugging_GetVarOffset(Parms,&RelativeVar,tempType,ss);
+							if(i3==0){
+								//式エラー
+								return false;
+							}
+							if(i3==-1){
+								//メモリにアクセスできないとき
+								if( pIsMemoryAccessError ) *pIsMemoryAccessError = true;
+								return false;
+							}
+
+							if(i3){
+								StrPtr[pnum]=0;
+								offset=(void *)Debugging_GetVarPtr(&RelativeVar);
+
+								type[pnum]=tempType.GetBasicType();
+
+								if(tempType.IsDouble()){
+									i3=ReadProcessMemory(hDebugProcess,offset,&nums[pnum],sizeof(double),&accessBytes);
+								}
+								else if(tempType.IsSingle()){
+									if(i3=ReadProcessMemory(hDebugProcess,offset,&flt,sizeof(float),&accessBytes)){
+										nums[pnum]=(double)flt;
+									}
+								}
+								else if(tempType.IsPointer()){
+									LONG_PTR lpData;
+									if(i3=ReadProcessMemory(hDebugProcess,offset,&lpData,sizeof(LONG_PTR),&accessBytes)){
+										i64nums[pnum]=(_int64)lpData;
+									}
+								}
+								else if(tempType.Is64()){
+									type[pnum]=DEF_INT64;
+
+									i3=ReadProcessMemory(hDebugProcess,offset,&i64nums[pnum],sizeof(_int64),&accessBytes);
+								}
+
+								else if(tempType.IsLong()){
+									long lData;
+									if(i3=ReadProcessMemory(hDebugProcess,offset,&lData,sizeof(long),&accessBytes)){
+										i64nums[pnum]=(_int64)lData;
+									}
+								}
+								else if(tempType.IsDWord()){
+									if(i3=ReadProcessMemory(hDebugProcess,offset,&dwData,sizeof(DWORD),&accessBytes)){
+										i64nums[pnum]=(_int64)dwData;
+									}
+								}
+								else if(tempType.IsInteger()){
+									short shortData;
+									if(i3=ReadProcessMemory(hDebugProcess,offset,&shortData,sizeof(short),&accessBytes)){
+										i64nums[pnum]=(_int64)shortData;
+									}
+								}
+								else if(tempType.IsWord()){
+									WORD wData;
+									if(i3=ReadProcessMemory(hDebugProcess,offset,&wData,sizeof(WORD),&accessBytes)){
+										i64nums[pnum]=(_int64)wData;
+									}
+								}
+								else if(tempType.IsSByte()){
+									char charData;
+									if(i3=ReadProcessMemory(hDebugProcess,offset,&charData,sizeof(char),&accessBytes)){
+										i64nums[pnum]=(_int64)charData;
+									}
+								}
+								else if(tempType.IsByte()){
+									BYTE byteData;
+									if(i3=ReadProcessMemory(hDebugProcess,offset,&byteData,sizeof(BYTE),&accessBytes)){
+										i64nums[pnum]=(_int64)byteData;
+									}
+								}
+								else if(tempType.IsBoolean()){
+									BYTE byteData;
+									if(i3=ReadProcessMemory(hDebugProcess,offset,&byteData,sizeof(BYTE),&accessBytes)){
+										i64nums[pnum]=(_int64)byteData;
+									}
+								}
+								else return false;
+
+								if(!i3){
+									//読み込みに失敗
+									if( pIsMemoryAccessError ) *pIsMemoryAccessError = true;
+									return false;
+								}
+								goto JumpConst;
+							}
+						}
+
+
+						/////////
+						//定数
+						/////////
+						StrPtr[pnum]=0;
+						type[pnum] = CDBConst::obj.GetBasicType(Parms);
+						if(type[pnum]){
+							if(IsRealNumberType(type[pnum])){
+								//実数型
+								nums[pnum] = CDBConst::obj.GetDoubleData(Parms);
+							}
+							else if(IsWholeNumberType(type[pnum])){
+								//整数
+								i64nums[pnum] = CDBConst::obj.GetWholeData(Parms);
+							}
+/*							else if(type[pnum]==DEF_STRING){
+								//リテラル文字列
+
+								//バイト数
+								nums[pnum]=dbl;
+								i2=(int)dbl;
+
+								memcpy(Parms,temporary,(int)nums[pnum]);
+								goto StrLiteral;
+							}*/
+							else{
+								//エラー
+								if(enableerror) SetError(300,NULL,cp);
+								return 0;
+							}
+							goto JumpConst;
+						}
+
+
+						//////////////
+						// 型名の場合
+						//////////////
+
+						{
+							Type tempType;
+							if( !Type::StringToType( Parms, tempType ) ){
+								if(bDebuggingWatchList){
+									if( pIsMemoryAccessError ) *pIsMemoryAccessError = true;
+									return false;
+								}
+								//エラー
+								if(enableerror) SetError(3,Parms,cp);
+								return false;
+							}
+
+							if( tempType.IsObject() ){
+								if( tempType.GetClass().IsBlittableType() ){
+									// Blittable型のときは基本型として扱う
+									tempType = tempType.GetClass().GetBlittableType();
+								}
+							}
+
+							type[pnum] = tempType.GetBasicType();
+							before_index[pnum] = tempType.GetIndex();
+						}
+
+JumpConst:;
+					}
+					else{
+						//リテラル値
+						StrPtr[pnum]=0;
+						type[pnum]=GetLiteralValue(Parms,&i64data,BaseType);
+						if(IsRealNumberType(type[pnum])){
+							//実数型
+							memcpy(&nums[pnum],&i64data,sizeof(double));
+						}
+						else{
+							//整数型
+							i64nums[pnum]=i64data;
+							before_index[pnum]=GetLiteralIndex(i64data);
+						}
+					}
+				}
+
+				pnum++;
+			}
+			else{
+				if(!(Command[i]=='+'||Command[i]=='-'||(Command[i]==1&&Command[i+1]==ESC_NOT))){
+					if(enableerror) SetError(1,NULL,cp);
+					return false;
+				}
+				if(Command[i]=='+'){
+					i2=-1;
+					continue;
+				}
+			}
+
+			if(Command[i]=='\0'){
+				for(;sp>0;pnum++){
+					sp--;
+					calc[pnum]=(int)stack[sp];
+				}
+				break;
+			}
+
+			//論理演算子
+			if(Command[i]==1&&Command[i+1]==ESC_XOR) i3=CALC_XOR;
+			else if(Command[i]==1&&Command[i+1]==ESC_OR) i3=CALC_OR;
+			else if(Command[i]==1&&Command[i+1]==ESC_AND) i3=CALC_AND;
+			else if(Command[i]==1&&Command[i+1]==ESC_NOT) i3=CALC_NOT;
+
+			//ビット演算子（優先順位は算術演算子の後部）
+			else if(Command[i]=='<'&&Command[i+1]=='<'){
+				i3=CALC_SHL;
+				i++;
+			}
+			else if(Command[i]=='>'&&Command[i+1]=='>'){
+				i3=CALC_SHR;
+				i++;
+			}
+
+			//比較演算子
+			else if(Command[i]=='<'&&Command[i+1]=='='||
+				Command[i]=='='&&Command[i+1]=='<'){
+				i3=CALC_PE;
+				i++;
+			}
+			else if(Command[i]=='>'&&Command[i+1]=='='||
+				Command[i]=='='&&Command[i+1]=='>'){
+				i3=CALC_QE;
+				i++;
+			}
+			else if(Command[i]=='<'&&Command[i+1]=='>'||
+				Command[i]=='>'&&Command[i+1]=='<'){
+				i3=CALC_NOTEQUAL;
+				i++;
+			}
+			else if(Command[i]=='=') i3=CALC_EQUAL;
+			else if(Command[i]=='<') i3=CALC_P;
+			else if(Command[i]=='>') i3=CALC_Q;
+
+			//算術演算子
+			else if(Command[i]=='+'||Command[i]=='&') i3=CALC_ADDITION;
+			else if(Command[i]=='-'&&i2) i3=CALC_SUBTRACTION;
+			else if(Command[i]==1&&Command[i+1]==ESC_MOD) i3=CALC_MOD;
+			else if(Command[i]=='*') i3=CALC_PRODUCT;
+			else if(Command[i]=='/') i3=CALC_QUOTIENT;
+			else if(Command[i]=='\\') i3=CALC_INTQUOTIENT;
+			else if(Command[i]=='-'&&i2==0) i3=CALC_MINUSMARK;
+			else if(Command[i]=='^') i3=CALC_POWER;
+			else if(Command[i]==1&&Command[i+1]==ESC_AS) i3=CALC_AS;
+			else if(Command[i]==1&&Command[i+1]==ESC_BYVAL) i3=CALC_BYVAL;
+
+			i3+=PareNum*100;
+			if(sp){
+				if(stack[sp-1]>i3-3&&
+					(!(
+					(stack[sp-1]%100==CALC_MINUSMARK||stack[sp-1]%100==CALC_NOT)&&
+					(i3%100==CALC_MINUSMARK||i3%100==CALC_NOT)
+					))
+					){
+					for(;sp>0;){
+						sp--;
+						calc[pnum]=(int)stack[sp];
+						pnum++;
+						if(!(stack[sp-1]>i3-3)) break;
+					}
+				}
+			}
+			stack[sp]=i3;
+			sp++;
+
+			if(Command[i]==1) i++;
+			i2=-1;
+			continue;
+		}
+		Parms[i2]=Command[i];
+	}
+
+	int type_stack[255];
+	LONG_PTR index_stack[255];
+	int idCalc;
+	for(i=0,sp=0;i<pnum;i++){
+
+		if( enableerror ){
+			//型チェック（正常でない場合はエラーにする）
+			TypeErrorCheck(stack,sp,calc[i]%100);
+		}
+
+		idCalc=calc[i]%100;
+
+		switch(idCalc){
+			//数値
+			case 0:
+				dbl_stack[sp]=nums[i];
+				i64stack[sp]=i64nums[i];
+				type_stack[sp]=type[i];
+				index_stack[sp]=before_index[i];
+
+				stack[sp]=(_int64)StrPtr[i];
+				sp++;
+				break;
+
+			//論理演算
+			case CALC_NOT:
+				if(IsRealNumberType(type_stack[sp-1])){
+					//実数演算
+					dbl_stack[sp-1]=(double)(~(long)dbl_stack[sp-1]);
+				}
+				else{
+					//整数演算
+					i64stack[sp-1]=~i64stack[sp-1];
+				}
+				break;
+
+			//比較演算
+			case CALC_PE:
+			case CALC_QE:
+			case CALC_P:
+			case CALC_Q:
+			case CALC_NOTEQUAL:
+			case CALC_EQUAL:
+
+			//論理演算
+			case CALC_XOR:
+			case CALC_OR:
+			case CALC_AND:
+
+			//シフト演算
+			case CALC_SHL:
+			case CALC_SHR:
+
+			//算術演算
+			case CALC_ADDITION:
+			case CALC_SUBTRACTION:
+			case CALC_MOD:
+			case CALC_PRODUCT:
+			case CALC_QUOTIENT:
+			case CALC_INTQUOTIENT:
+			case CALC_POWER:
+				StaticTwoTerm(idCalc,type_stack,index_stack,&sp,BaseType);
+				break;
+
+			case CALC_MINUSMARK:
+				if(IsRealNumberType(type_stack[sp-1])){
+					//実数演算
+					dbl_stack[sp-1]=-dbl_stack[sp-1];
+				}
+				else{
+					//整数演算
+					i64stack[sp-1]=-i64stack[sp-1];
+				}
+				break;
+			case CALC_AS:
+				if(IsWholeNumberType(type_stack[sp-2])){
+					if(IsRealNumberType(type_stack[sp-1])){
+						dbl_stack[sp-2]=(double)i64stack[sp-2];
+					}
+				}
+				if(IsRealNumberType(type_stack[sp-2])){
+					if(IsWholeNumberType(type_stack[sp-1])){
+						i64stack[sp-2]=(_int64)dbl_stack[sp-2];
+					}
+				}
+
+				if( type_stack[sp-1] == DEF_OBJECT || type_stack[sp-1] == DEF_STRUCT ){
+					// リテラル値ではないため抜け出す
+					return false;
+				}
+
+				type_stack[sp-2]=type_stack[sp-1];
+				index_stack[sp-2]=index_stack[sp-1];
+				sp--;
+				break;
+			case CALC_BYVAL:
+				//エラー
+				break;
+		}
+	}
+	if(stack[0]){
+		//文字列ポインタ
+		*pi64data=(_int64)stack[0];
+		resultType.SetType( type_stack[0], index_stack[0] );
+		return true;
+	}
+
+	if(IsRealNumberType(type_stack[0])){
+		//実数
+		memcpy(pi64data,&dbl_stack[0],sizeof(double));
+		resultType.SetType( type_stack[0], index_stack[0] );
+		return true;
+	}
+
+	//整数
+	*pi64data=i64stack[0];
+
+	if(index_stack[0]==-1){
+		if(Is64Type(type_stack[0])==0&&IsRealNumberType(type_stack[0])==0){
+			//整数（符号有り/無し）
+			i64data=*pi64data;
+
+			resultType.SetIndex( GetLiteralIndex(i64data) );
+		}
+	}
+	else{
+		resultType.SetIndex( index_stack[0] );
+	}
+
+	resultType.SetBasicType( type_stack[0] );
+	return true;
+}
+
+#pragma optimize("", off)
+#pragma warning(disable : 4748)
+DWORD GetLiteralValue(char *value,_int64 *pi64,int BaseType){
+	extern HANDLE hHeap;
+	extern int cp;
+	int i,i2,i3,sw1,sw2,bDbl;
+	double dbl;
+	char temporary[255];
+
+	if(value[0]=='&'){
+		_int64 i64temp;
+		lstrcpy(temporary,value);
+
+		if(temporary[1]=='o'||temporary[1]=='O'){
+			for(i=2;;i++){
+				i3=temporary[i]-0x30;
+				if(i3<0||7<i3) break;
+				temporary[i]=i3;
+			}
+			if(temporary[i]){
+				SetError(57,NULL,cp);
+				return DEF_BYTE;
+			}
+
+			i64temp=1;
+			*pi64=0;
+			for(i--;i>=2;i--){
+				*pi64=(*pi64)+(_int64)(i64temp*temporary[i]);
+				i64temp*=8;
+			}
+		}
+		else if(temporary[1]=='h'||temporary[1]=='H'){
+			CharUpper(temporary+2);
+			for(i=2;;i++){
+				i3=temporary[i]-0x30;
+				if(i3<0||9<i3){
+					i3=temporary[i]-0x41+10;
+					if(i3<0xA||0xF<i3) break;
+				}
+				temporary[i]=i3;
+			}
+			if(temporary[i]){
+				SetError(58,NULL,cp);
+				return DEF_BYTE;
+			}
+
+			i64temp=1;
+			*pi64=0;
+			for(i--;i>=2;i--){
+				*pi64=(*pi64)+(_int64)(i64temp*temporary[i]);
+				i64temp*=0x10;
+			}
+		}
+		else{
+			SetError(12,"&",cp);
+			return DEF_BYTE;
+		}
+
+		if(BaseType==DEF_INT64||BaseType==DEF_QWORD) return DEF_QWORD;
+
+		if(((unsigned _int64)*pi64)<=UCHAR_MAX){
+			//符号無し8ビット整数のリテラル値
+			return DEF_BYTE;
+		}
+		else if(((unsigned _int64)*pi64)<=USHRT_MAX){
+			//符号無し16ビット整数のリテラル値
+			return DEF_WORD;
+		}
+		else if(((unsigned _int64)*pi64)<=UINT_MAX){
+			//符号無し32ビット整数のリテラル値
+			return DEF_DWORD;
+		}
+		else{
+			//符号無し64ビット整数のリテラル値
+			return DEF_QWORD;
+		}
+	}
+	else if((value[0]>='0'&&value[0]<='9')||value[0]=='+'||value[0]=='-'||(value[0]=='.'&&(!IsVariableTopChar(value[1])))){
+		for(i=0;;i++){
+			if(value[i]!='-') break;
+		}
+		if(value[i]=='.'){
+			SlideString(value+i,1);
+			value[i]='0';
+		}
+
+		//エラーチェック
+		bDbl=0;
+		sw1=0;
+		sw2=0;
+		for(i2=i;;i2++){
+			if(value[i2]=='\0') break;
+			if(value[i2]=='.') bDbl=1;
+			if(!((value[i2]>='0'&&value[i2]<='9')||value[i2]=='.')){
+				if((value[i2]=='e'||value[i2]=='E')&&sw1==0){
+					bDbl=1;
+					sw1=1;
+				}
+				else if((value[i2]=='+'||value[i2]=='-')&&sw1==1&&sw2==0) sw2=1;
+				else{
+					extern BOOL bDebugRun;
+					if(bDebugRun) return DEF_DOUBLE;
+
+					SetError(3,value,cp);
+					return DEF_DOUBLE;
+				}
+			}
+		}
+
+		if(bDbl){
+			//実数のリテラル値
+			if(i%2) dbl=-atof(value+i);
+			else dbl=atof(value+i);
+
+			memcpy(pi64,&dbl,sizeof(double));
+
+			if(BaseType==DEF_SINGLE) return DEF_SINGLE;
+
+			return DEF_DOUBLE;
+		}
+		else{
+			*pi64=_atoi64(value+i);
+			if(i%2) *pi64=-(*pi64);
+
+			if(BaseType==DEF_INT64||BaseType==DEF_QWORD) return BaseType;
+
+			if(LONG_MIN<=*pi64&&*pi64<=LONG_MAX){
+				//符号有り32ビット整数のリテラル値
+				return DEF_LONG;
+			}
+			else if(*pi64<=UINT_MAX){
+				//符号無し32ビット整数のリテラル値
+				return DEF_DWORD;
+			}
+			else{
+				//符号有り64ビット整数のリテラル値
+				return DEF_INT64;
+			}
+		}
+	}
+
+	extern BOOL bDebugRun;
+	if(bDebugRun) return DEF_DOUBLE;
+
+	SetError(33,NULL,cp);
+	return DEF_DOUBLE;
+}
+#pragma optimize("", on)
+
+BOOL GetConstCalcBuffer(const char *name,const char *Parameter,char *pCalcBuffer){
+	extern HANDLE hHeap;
+	int i2,i3,i4,num;
+	char temporary[VN_SIZE];
+	char *pParms[MAX_PARMS];
+
+	CONSTINFO *pci;
+	pci=GetConstHash(name);
+	if(!pci) return 0;
+
+	num=0;
+	i2=0;
+	while(1){
+		i2=GetOneParameter(Parameter,i2,temporary);
+
+		pParms[num]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+		lstrcpy(pParms[num],temporary);
+
+		num++;
+		if(Parameter[i2]=='\0') break;
+	}
+	if(num!=pci->ParmNum){
+		extern int cp;
+		for(i2=0;i2<num;i2++) HeapDefaultFree(pParms[i2]);
+		SetError(10,name,cp);
+		lstrcpy(pCalcBuffer,"0");
+		return 1;
+	}
+
+	i2=0;
+	i4=0;
+	while(1){
+
+		//数式内の項を取得
+		for(i3=0;;i2++,i3++){
+			if(!IsVariableChar(pci->StrValue[i2])){
+				temporary[i3]=0;
+				break;
+			}
+			temporary[i3]=pci->StrValue[i2];
+		}
+
+		//パラメータと照合する
+		for(i3=0;i3<pci->ParmNum;i3++){
+			if(lstrcmp(pci->ppParm[i3],temporary)==0) break;
+		}
+
+		if(i3==pci->ParmNum){
+			//パラメータでないとき
+			lstrcpy(pCalcBuffer+i4,temporary);
+			i4+=lstrlen(temporary);
+		}
+		else{
+			//パラメータのとき
+			lstrcpy(pCalcBuffer+i4,pParms[i3]);
+			i4+=lstrlen(pParms[i3]);
+		}
+
+		//演算子をコピー
+		for(;;i2++,i4++){
+			if(pci->StrValue[i2]==1){
+				pCalcBuffer[i4++]=pci->StrValue[i2++];
+				pCalcBuffer[i4]=pci->StrValue[i2];
+				continue;
+			}
+			if(IsVariableTopChar(pci->StrValue[i2])) break;
+			pCalcBuffer[i4]=pci->StrValue[i2];
+			if(pci->StrValue[i2]=='\0') break;
+		}
+
+		if(pci->StrValue[i2]=='\0') break;
+	}
+
+	for(i2=0;i2<num;i2++) HeapDefaultFree(pParms[i2]);
+
+	return 1;
+}
+DWORD GetConstValue(char *name,double *pDbl,char *buffer,LONG_PTR *plpIndex){
+	CONSTINFO *pci;
+	pci=GetConstHash(name);
+	if(pci){
+		//定数が見つかったとき
+
+		if(pci->StrValue){
+			//文字列定数
+
+			//バイト数
+			*pDbl=pci->DblValue;
+
+			//データ
+			memcpy(buffer,pci->StrValue,(int)pci->DblValue);
+
+			if(plpIndex) *plpIndex=pci->lpIndex;
+
+			return DEF_STRING;
+		}
+		else{
+			if(pci->type==DEF_INT64){
+				memcpy(pDbl,&pci->i64Value,sizeof(_int64));
+				return DEF_INT64;
+			}
+
+			if(plpIndex) *plpIndex=pci->lpIndex;
+
+			*pDbl=pci->DblValue;
+			return pci->type;
+		}
+	}
+
+	if(plpIndex) *plpIndex=-1;
+
+	return -1;
+}
+int IsStrCalculation(char *Command){
+	int i,i2,i3,i4,PareNum;
+	char temporary[VN_SIZE],temp2[8192];
+
+	for(i=0,i2=0;;i++){
+		if(Command[i]=='('){
+			for(i++,PareNum=1;;i++){
+				if(Command[i]=='(') PareNum++;
+				else if(Command[i]==')'){
+					PareNum--;
+					if(PareNum==0) break;
+				}
+			}
+			continue;
+		}
+		if(Command[i]=='['){
+			for(i++,PareNum=1;;i++){
+				if(Command[i]=='[') PareNum++;
+				else if(Command[i]==']'){
+					PareNum--;
+					if(PareNum==0) break;
+				}
+			}
+			continue;
+		}
+		if(Command[i]=='\"'){
+			i++;
+			while(Command[i]!='\"') i++;
+			continue;
+		}
+		if(Command[i]=='\0'){
+			if(IsVariableTopChar(Command[i2])||
+				Command[i2]=='.'&&IsVariableTopChar(Command[i2+1])){
+
+				if((Command[i2]=='e'||Command[i2]=='E')&&
+					(Command[i2+1]=='x'||Command[i2+1]=='X')&&
+					Command[i2+2]=='\"'){
+					//拡張文字列
+					return 1;
+				}
+
+				for(i3=0;;i3++){
+					if(Command[i2+i3]=='('){
+						temporary[i3]=0;
+						break;
+					}
+					temporary[i3]=Command[i2+i3];
+					if(Command[i2+i3]=='\0') break;
+				}
+				if(Command[i2+i3]=='('){
+
+					//DLL関数の場合
+					DllProc *pDllProc;
+					pDllProc=GetDeclareHash(temporary);
+					if(pDllProc){
+						if( pDllProc->ReturnType().IsStringClass() ){
+							return 1;
+						}
+						return 0;
+					}
+
+					//ユーザー定義関数
+					UserProc *pUserProc;
+					pUserProc=GetSubHash(temporary);
+					if(pUserProc){
+						if( pUserProc->ReturnType().IsStringClass() ){
+							return 1;
+						}
+						return 0;
+					}
+
+					//組み込み関数
+					i4=GetFunctionFromName(temporary);
+					if(i4){
+						//組み込み関数は文字列を返さない
+						return 0;
+					}
+
+					//定数
+					CONSTINFO *pci;
+					pci=GetConstHash(temporary);
+					if(pci){
+
+						if(pci->ParmNum){
+							//マクロ関数の場合
+							GetStringInPare_RemovePare(temporary,Command+i2+i3+1);
+							GetConstCalcBuffer(pci->name,temporary,temp2);
+							return IsStrCalculation(temp2);
+						}
+
+						if(pci->type==DEF_STRING) return 1;
+						else return 0;
+					}
+				}
+
+				//定数
+				i3 = CDBConst::obj.GetBasicType(Command+i2);
+				if(i3==DEF_STRING) return 1;	//文字列
+				if(i3) return 0;			//数値
+
+				//変数
+				Type varType;
+				if( !GetVarType(Command+i2,varType,1) ){
+					//エラー
+					return -1;
+				}
+				if( varType.IsStringClass() ){
+					return 1;
+				}
+			}
+			else if(Command[i2]=='\"') return 1;
+			break;
+		}
+		if(IsNumCalcMark(Command,i)||IsStrCalcMark(Command[i])){
+			if(IsStrCalcMark(Command[i])){
+
+				//&H、&O表記の場合を考慮
+				if(i==0) continue;
+				if(IsNumCalcMark(Command,i-1)) continue;
+
+				if(Command[i+1]=='(') break;
+				i2=i+1;
+				continue;
+			}
+			break;
+		}
+	}
+	return 0;
+}
+
+BYTE GetCalcId(const char *Command,int *pi){
+	*pi=0;
+
+	if(Command[0]==1) *pi=1;
+
+	//論理演算子
+	if(Command[0]==1&&Command[1]==ESC_XOR) return CALC_XOR;
+	else if(Command[0]==1&&Command[1]==ESC_OR) return CALC_OR;
+	else if(Command[0]==1&&Command[1]==ESC_AND) return CALC_AND;
+	else if(Command[0]==1&&Command[1]==ESC_NOT) return CALC_NOT;
+
+	//ビット演算子（優先順位は算術演算子の後部）
+	else if(Command[0]=='<'&&Command[1]=='<'){
+		*pi=1;
+		return CALC_SHL;
+	}
+	else if(Command[0]=='>'&&Command[1]=='>'){
+		*pi=1;
+		return CALC_SHR;
+	}
+
+	//比較演算子
+	else if(Command[0]=='<'&&Command[1]=='='||
+		Command[0]=='='&&Command[1]=='<'){
+		*pi=1;
+		return CALC_PE;
+	}
+	else if(Command[0]=='>'&&Command[1]=='='||
+		Command[0]=='='&&Command[1]=='>'){
+		*pi=1;
+		return CALC_QE;
+	}
+	else if(Command[0]=='<'&&Command[1]=='>'||
+		Command[0]=='>'&&Command[1]=='<'){
+		*pi=1;
+		return CALC_NOTEQUAL;
+	}
+	else if(Command[0]=='=') return CALC_EQUAL;
+	else if(Command[0]=='<') return CALC_P;
+	else if(Command[0]=='>') return CALC_Q;
+
+	//算術演算子
+	else if(Command[0]=='+') return CALC_ADDITION;
+	else if(Command[0]=='-') return CALC_SUBTRACTION;
+	else if(Command[0]=='&') return CALC_STRPLUS;
+	else if(Command[0]==1&&Command[1]==ESC_MOD) return CALC_MOD;
+	else if(Command[0]=='*') return CALC_PRODUCT;
+	else if(Command[0]=='/') return CALC_QUOTIENT;
+	else if(Command[0]=='\\') return CALC_INTQUOTIENT;
+	else if(Command[0]=='^') return CALC_POWER;
+	else if(Command[0]==1&&Command[1]==ESC_AS) return CALC_AS;
+	else if(Command[0]==1&&Command[1]==ESC_BYVAL) return CALC_BYVAL;
+
+	return 0;
+}
+BOOL GetNumOpeElements(const char *Command,int *pnum,
+					   char *values[255],long calc[255],long stack[255]){
+	extern int cp;
+	extern HANDLE hHeap;
+	int i,i2,i3,i4,PareNum,sp;
+	char temporary[1024];
+
+	for(i=0,i2=0,sp=0,*pnum=0,PareNum=0;;i++,i2++){
+		if(Command[i]=='\"'){
+			temporary[i2]=Command[i];
+			for(i++,i2++;;i++,i2++){
+				temporary[i2]=Command[i];
+				if(Command[i]=='\"') break;
+			}
+			continue;
+		}
+		else if(Command[i]=='['){
+			i3=GetStringInBracket(temporary+i2,Command+i);
+			i+=i3-1;
+			i2+=i3-1;
+			continue;
+		}
+		else if(Command[i]=='('){
+			if(i==0){
+				PareNum++;
+				i2=-1;
+				continue;
+			}
+			else if(IsNumCalcMark_Back(Command,i-1)||Command[i-1]=='('){
+				PareNum++;
+				i2=-1;
+				continue;
+			}
+			else{
+				//配列変数の場合を考慮
+				i3=GetStringInPare(temporary+i2,Command+i);
+				i+=i3-1;
+				i2+=i3-1;
+				continue;
+			}
+		}
+		else if(Command[i]==')'){
+			PareNum--;
+			i2--;
+			continue;
+		}
+		else if(IsNumCalcMark(Command,i)||(Command[i]=='&'&&i2!=0)){
+			if((Command[i]=='+'||Command[i]=='-')&&(Command[i-1]=='e'||Command[i-1]=='E')){
+				if(IsExponent(Command,i)){
+					temporary[i2]=Command[i];
+					continue;
+				}
+			}
+			temporary[i2]=0;
+
+			if((stack[sp-1]%100)==CALC_AS&&Command[i]=='*'){
+				for(i3=0;i3<i2;i3++){
+					if(temporary[i2]!='*') break;
+				}
+				if(i3==i2){
+					//"*"をポインタ指定文字として認識する
+					temporary[i2]=Command[i];
+					continue;
+				}
+			}
+
+			calc[*pnum]=0;
+			if(i2){
+				values[*pnum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+255);
+				lstrcpy(values[*pnum],temporary);
+				(*pnum)++;
+			}
+			else{
+				if(!(
+						Command[i]=='+'||
+						Command[i]=='-'||
+						(Command[i]==1&&Command[i+1]==ESC_NOT)||
+						(Command[i]==1&&Command[i+1]==ESC_BYVAL)
+					)){
+						SetError(1,NULL,cp);
+						return 0;
+				}
+				if(Command[i]=='+'){
+					i2=-1;
+					continue;
+				}
+			}
+
+			if(Command[i]=='-'&&i2==0){
+				i3=CALC_MINUSMARK;
+			}
+			else{
+				i3=GetCalcId(Command+i,&i4);
+				i+=i4;
+				if(!i3){
+					SetError(1,NULL,cp);
+					return 0;
+				}
+			}
+
+			i3+=PareNum*100;
+			if(sp){
+				if(stack[sp-1]>i3-3&&
+					(!(
+					(stack[sp-1]%100==CALC_MINUSMARK || stack[sp-1]%100==CALC_NOT || stack[sp-1]%100==CALC_POWER)&&
+					(i3%100==CALC_MINUSMARK || i3%100==CALC_NOT)
+					))
+					){
+					for(;sp>0;){
+						sp--;
+						calc[*pnum]=stack[sp];
+						values[*pnum]=0;
+						(*pnum)++;
+						if(!(stack[sp-1]>i3-3)) break;
+					}
+				}
+			}
+			stack[sp]=i3;
+			sp++;
+
+			i2=-1;
+			continue;
+		}
+		temporary[i2]=Command[i];
+		if(Command[i]=='\0'){
+			calc[*pnum]=0;
+
+			values[*pnum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+255);
+			lstrcpy(values[*pnum],temporary);
+			(*pnum)++;
+
+			for(;sp>0;(*pnum)++){
+				sp--;
+				calc[*pnum]=stack[sp];
+				values[*pnum]=0;
+			}
+			break;
+		}
+	}
+
+	calc[*pnum]=0;
+
+	return 1;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/common.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/common.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/common.h	(revision 178)
@@ -0,0 +1,524 @@
+//#define _CRT_SECURE_NO_DEPRECATE
+#pragma warning(disable : 4996)
+
+#include <option.h>
+
+#include <windows.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <commctrl.h>
+#include <time.h>
+#include <limits.h>
+#include <shlobj.h>
+#include <vector>
+#include <string>
+#include <fstream>
+
+//boost libraries
+#include <boost/foreach.hpp>
+
+#define foreach BOOST_FOREACH
+
+using namespace std;
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/resource.h"
+#include "../BasicCompiler64/CommandValue.h"
+#include "../BasicCompiler64/FunctionValue.h"
+#define OPCODE_H_PATH "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/resource.h"
+#include "../BasicCompiler32/CommandValue.h"
+#include "../BasicCompiler32/FunctionValue.h"
+#define OPCODE_H_PATH "../BasicCompiler32/opcode.h"
+#endif
+
+#include "../BasicCompiler_Common/BasicFixed.h"
+#include "../BasicCompiler_Common/NonVolatile.h"
+#include "../BasicCompiler_Common/psapi.h"
+#include "../BasicCompiler_Common/BreakPoint.h"
+#include "../BasicCompiler_Common/LexicalScoping.h"
+
+
+
+#if defined(JPN)
+//日本語
+#include "common_msg_jpn.h"
+#else
+//英語
+#include "common_msg_eng.h"
+#endif
+
+
+#define PTR_SIZE		sizeof(LONG_PTR)
+#define OBJECT_HEAD_SIZE PTR_SIZE*4
+
+#define MAX_LEN			65535
+#define VN_SIZE			512
+#define DIGIT_SIZE		128
+#define MAX_PARMS		64
+#define MAX_ARRAYDIM	16
+#define MAX_HASH		32761
+
+
+#ifdef _AMD64_
+#define PLATFORM	64
+#else
+#define PLATFORM	32
+typedef long LONG_PTR;
+typedef DWORD ULONG_PTR;
+#endif
+
+
+//未定義の定数情報
+#ifndef IMAGE_FILE_MACHINE_AMD64
+	#define IMAGE_FILE_MACHINE_AMD64 0x8664
+#endif
+
+#ifdef _AMD64_
+	#ifndef IMAGE_SIZEOF_NT_OPTIONAL64_HEADER
+		#define IMAGE_SIZEOF_NT_OPTIONAL64_HEADER    240
+	#endif
+#else
+	#ifndef IMAGE_SIZEOF_NT_OPTIONAL32_HEADER
+		#define IMAGE_SIZEOF_NT_OPTIONAL32_HEADER    224
+	#endif
+#endif
+
+
+extern HWND hOwnerEditor;
+extern HANDLE hHeap;
+extern int cp;
+extern bool isUnicode;
+extern int typeOfPtrChar;
+extern int typeOfPtrUChar;
+
+
+
+//////////////////////////////////////////
+// BasicCompiler、ProjectEditor共通の定数
+//////////////////////////////////////////
+
+//サイズ変更枠の太さ
+#define LEVER_THICK 5
+
+#define WM_SHOWERROR			WM_USER+70	//エラー表示メッセージ
+
+#define WM_SETCOMPILEVIEW		WM_USER+71	//コンパイラウィンドウが表示されたとき
+#define WM_DESTROYCOMPILEVIEW	WM_USER+72	//コンパイラウィンドウが破棄されたとき
+
+#define WM_SETDEBUGGERBASE		WM_USER+73	//デバッガベースウィンドウが表示されたとき
+#define WM_DESTROYDEBUGGERBASE	WM_USER+74	//デバッガベースウィンドウが破棄されたとき
+
+#define WM_SETDEBUGGERVIEW		WM_USER+75	//デバッガウィンドウが表示されたとき
+#define WM_DESTROYDEBUGGERVIEW	WM_USER+76	//デバッガウィンドウが表示されたとき
+
+///////////////////////////////////////////
+
+
+#define WM_SHOWVARLIST			WM_USER+80
+#define WM_VARLIST_CLOSE		WM_USER+81	//変数リストの終了メッセージ（破棄のみ、解放なし）
+
+
+
+///////////////////////////////////////////
+// デバッグ コマンド
+
+#define WM_DEBUG_CONTINUE	WM_USER+200
+#define WM_STEP_IN			WM_USER+201
+#define WM_STEP_OVER		WM_USER+202
+#define WM_STEP_CURSOR		WM_USER+203
+#define WM_DEBUG_STOP		WM_USER+204
+#define WM_DEBUG_PAUSE		WM_USER+205
+#define WM_CLOSE_DEBUGGER	WM_USER+206
+
+///////////////////////////////////////////
+
+
+
+
+#define FILE_ALIGNMENT	0x1000
+#define MEM_ALIGNMENT	0x1000
+#define EXE_HEADER_SIZE	0x1000
+
+
+// クラス管理用のクラス
+#include "Class.h"
+
+// 列挙体管理用のクラス
+#include "Enum.h"
+
+// 定数管理用のクラス
+#include "Const.h"
+
+// 変数管理用のクラス
+#include "Variable.h"
+
+// パラメータ管理用のクラス
+#include "Parameter.h"
+
+// プロシージャ管理用のクラス
+#include "Procedure.h"
+
+// コンパイラが必要とするデータハウス
+#include <Smoothie.h>
+
+
+
+struct ERRORINFO{
+	char *FileName;
+	int line;
+};
+struct INCLUDEFILEINFO{
+	char **ppFileNames;
+	int FilesNum;
+	int LineOfFile[MAX_LEN];
+};
+
+//変数の相対情報
+struct RELATIVE_VAR{
+	DWORD dwKind;
+	LONG_PTR offset;
+	BOOL bOffsetOffset;
+};
+
+struct CONSTINFO{
+	char *name;
+	char *StrValue;
+
+	double DblValue;
+	_int64 i64Value;
+	int type;
+	LONG_PTR lpIndex;
+
+	int ParmNum;
+	char **ppParm;
+
+	CONSTINFO *pNextData;
+};
+
+
+#define CODETYPE_SYSTEMPROC		0x0001
+#define CODETYPE_DEBUGPROC		0x0002
+struct LINEINFO{
+	int TopCp;
+	int TopObp;
+	DWORD dwCodeType;
+};
+struct RESOURCEDATAINFO{
+	DWORD dwId;
+	char FileName[MAX_PATH];
+};
+
+
+//////////////////////////////////////////
+// リソース ヘッダ（アイコン、カーソル用）
+typedef struct{
+	WORD idReserved;
+	WORD idType;
+	WORD idCount;
+}ICONDIR,CURSORDIR;
+
+
+/////////////////////////////
+// .curファイルのヘッダ情報
+struct CURSORDIRENTRY{
+	BYTE bWidth;
+	BYTE bHeight;
+	BYTE bColorCount;
+	BYTE bReserved;
+	WORD wXHotspot;
+	WORD wYHotspot;
+	DWORD dwBytesInRes;
+	DWORD dwImageOffset;
+};
+struct CURSORDIRENTRY_RES{
+	WORD wWidth;
+	WORD wHeight;
+	WORD wXHotspot;
+	WORD wYHotspot;
+	DWORD dwBytesInRes;
+	WORD wCursorNum;
+};
+
+
+////////////////////////////
+//.icoファイルのヘッダ情報
+struct ICONDIRENTRY{
+	BYTE bWidth;
+	BYTE bHeight;
+	BYTE bColorCount;
+	BYTE bReserved;
+	WORD wPlanes;
+	WORD wBitCount;
+	DWORD dwBytesInRes;
+	DWORD dwImageOffset;
+};
+struct ICONDIRENTRY_RES{
+	BYTE bWidth;
+	BYTE bHeight;
+	BYTE bColorCount;
+	BYTE bReserved;
+	WORD wPlanes;
+	WORD wBitCount;
+	DWORD dwBytesInRes;
+	WORD wIconNum;
+};
+
+
+
+#include "../BasicCompiler_Common/PESchedule.h"
+#include "../BasicCompiler_Common/DebugSection.h"
+#include "../BasicCompiler_Common/VariableOpe.h"
+#include <Exception.h>
+
+
+
+bool StaticCalculation(bool enableerror, const char *Command,int BaseType,_int64 *pi64data,Type &resultType,BOOL bDebuggingWatchList=0, bool *pIsMemoryAccessError=NULL);
+
+
+//BasicCompiler.cpp
+void HeapDefaultFree(LPVOID lpMem);
+void ts(int i);
+void ts(int i,int i2);
+void ts(char *msg);
+void ts(char *msg,char *title);
+void epi_check();
+void GetRelationalPath(char *path,char *dir);
+void GetFullPath( char *path, const string &baseDirPath );
+void ShowErrorLine(int LineNum,char *FileName);
+BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,BOOL bOpen);
+void MakeMessageText(char *buffer,char *msg,int flag);
+
+//hash.cpp
+int hash_default(const char *name);
+CONSTINFO *GetConstHash(const char *name);
+DllProc *GetDeclareHash(char *name);
+void GetOverloadSubHash( const char *lpszName, std::vector<UserProc *> &subs );
+UserProc *GetSubHash(const char *name,BOOL bError=0);
+UserProc *GetMethodHash(const char *ObjectName,const char *MethodName,const char *Parameter,BOOL bError=0);
+UserProc *GetClassMethod( const char *className, const char *methodName );
+
+//Object.cpp
+void CallConstructor( const char *ObjectName,const int *SubScripts, const Type &type,const char *Parameter);
+bool Operator_New( const char *expression, const Type &baseType, Type &resultType );
+
+//Overload.sbp
+UserProc *OverloadSolutionWithStrParam(
+	const char *name,
+	std::vector<UserProc *> &subs,
+	const char *Parameter,
+	const char *ObjectName);
+UserProc *OverloadSolution(
+	const char *name,
+	std::vector<UserProc *> &subs,
+	const Parameters &params,
+	const Type &returnType );
+
+//Debug.cpp
+void Debugger_StepIn(void);
+void Debugger_StepOver(void);
+void Debugger_StepCursor(void);
+void Debugger_Stop(void);
+void Debugger_Pause(void);
+ULONG_PTR rva_to_real(DWORD p);
+GlobalProc *GetSubFromObp(ULONG_PTR pos);
+void ReadOpBuffer();
+void DebugProgram(void);
+
+//VarList.cpp
+void InitVarList(DWORD dwThreadId);
+BOOL CALLBACK DlgDebugger(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK DlgVarList(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//WatchList.cpp
+ULONG_PTR Debugging_GetVarPtr(RELATIVE_VAR *pRelativeVar);
+ULONG_PTR Debugging_GetThisPtrOffset(LONG_PTR obp_Rip);
+int Debugging_GetVarOffset( char *variable,RELATIVE_VAR *pRelativeVar, Type &resultType, int *pss);
+
+//MakeExe.cpp
+void StepCompileProgress(void);
+void DeleteConstInfo(CONSTINFO **ppConstHash);
+void DeleteDeclareInfo(void);
+void AddSourceCode(char *buffer);
+void OutputExe(void);
+int MainThread(DWORD dummy);
+
+//Intermediate_Step1.cpp
+void ChangeReturnCode(char *buffer);
+void DeleteComment(char *buffer);
+void KillReturnCode(char *buffer);
+void CheckParenthesis(char *buffer);
+BOOL CheckParenthesis2(char *buffer);
+void DirectiveCheck(void);
+void NextCommandFormat(char *buffer);
+void SetEscapeSequenceFormat(char *buffer);
+void DefCommandFormat(char *buffer);
+void IfCommandFormat(char *buffer);
+void CheckPareCommand(void);
+
+//Intermediate_Step2.cpp
+bool GetConstInfo(void);
+void ChangeCommandToCode(char *buffer);
+
+//preprocessor.cpp
+char *OpenBasicFile(char *FileName);
+
+//Resource.cpp
+void GetResourceData(char *FileName);
+
+//CommandFormat.cpp
+void ComOpen(char *Parameter,char *buffer,int nowLine);
+void ComClose(char *Parameter,char *buffer);
+void ComField(char *Parameter,char *buffer);
+void ComLine(char *Parameter,char *buffer,int nowLine);
+void ComCircle(char *Parameter,char *buffer,int nowLine);
+void ComPSet(char *Parameter,char *buffer,int nowLine);
+void ComPaint(char *Parameter,char *buffer,int nowLine);
+
+// StrOperation.cpp
+void KillSpaces(char *str1,char *str2);
+void KillStringSpaces(char *str);
+BOOL RemoveStringQuotes(char *str);
+void RemoveStringPare(char *str);
+void RemoveStringBracket(char *str);
+void SetStringQuotes(char *str);
+int FormatString_EscapeSequence(char *buffer);
+void SlideString(char *str,int slide);
+void SlideBuffer(char *buffer,int length,int slide);
+_int8 IsCommandDelimitation(char c);
+BOOL IsBlank(char c);
+int GetOneParameter(const char *Parameter,int pos,char *retAns);
+int JumpOneParameter(char *Parameter,int i);
+int GetStringInQuotation(char *buffer,char *ReadBuffer);
+int GetStringInPare(char *buffer,const char *ReadBuffer);
+int GetStringInPare_RemovePare(char *buffer,char *ReadBuffer);
+int GetStringInBracket(char *buffer,const char *ReadBuffer);
+int JumpStringInPare(const char *buffer,int pos);
+int JumpStringInBracket(const char *buffer,int pos);
+int GetCpFromLine(int LineNum);
+BOOL GetLineNum(int pos,int *pLine,char *FileName);
+char GetEndXXXCommand(char es);
+void GetDefaultNameFromES(char es,char *name);
+void GetCalcName(int idCalc,char *name);
+BOOL IsFile(char *path);
+BOOL ShortPathToLongPath(char ShortPath[MAX_PATH],char *LongPath);
+BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle);
+void ShortPathToLongPath(const char *ShortPath,char *LongPath);
+
+//calculation.cpp
+bool IsNumberTopChar(const char *buffer);
+bool IsNumberChar(const char c);
+BOOL IsNumCalcMark(const char *Command,int p);
+BOOL IsNumCalcMark_Back(const char *Command,int p);
+BOOL IsStrCalcMark(const char c);
+BOOL IsExponent(const char *Command,int p);
+int GetLiteralIndex(_int64 i64data);
+int NeutralizationType(int type1,LONG_PTR index1,int type2,LONG_PTR index2);
+DWORD GetLiteralValue(char *value,_int64 *pi64,int BaseType);
+BOOL GetConstCalcBuffer(const char *name,const char *Parameter,char *pCalcBuffer);
+DWORD GetConstValue(char *name,double *dbl,char *buffer,LONG_PTR *plpIndex);
+int IsStrCalculation(char *Command);
+BYTE GetCalcId(const char *Command,int *pi);
+BOOL GetNumOpeElements(const char *Command,int *pnum,
+					   char *values[255],long calc[255],long stack[255]);
+
+//NumOpe_GetType.cpp
+int AutoBigCast(int BaseType,int CalcType);
+BOOL CheckCalcType(int idCalc,int *type,int sp);
+bool GetTermType( const char *term, Type &resultType, bool &isLiteral, bool *pIsClassName = NULL );
+bool NumOpe_GetType( const char *expression, const Type &baseType, Type &resultType );
+
+//Subroutine.cpp
+int GetCallProcName(char *buffer,char *name);
+int GetProc(char *name,void **ppInfo);
+void SplitObjectName(const char *name,char *ObjectName,int *pRefType);
+bool SplitMemberName( const char *desc, char *object, char *member, CClass::RefType &refType );
+bool SplitMemberName( const char *desc, char *object, char *member );
+bool CallProc( int kind, const void *pProc, const char *fullCallName, const char *lpszParms, Type &resultType, bool isCallOn = true );
+bool CallPropertyMethod( const char *variable, const char *rightSide, Type &resultType);
+bool GetReturnTypeOfPropertyMethod( const char *variable, const char *rightSide, Type &resultType );
+bool GetReturnTypeOfIndexerGetterProc( const CClass &objClass, Type &resultType );
+GlobalProc *AddSubData( const NamespaceScopes &namespaceScopes, const NamespaceScopesCollection &importedNamespaces, char *buffer,int nowLine,bool isVirtual,CClass *pobj_c, bool isStatic = false );
+void GetSubInfo(void);
+void DeleteSubInfo(GlobalProc **ppSubHash,char **ppMacroNames,int MacroNum);
+void DeleteDeclareInfo(void);
+int AddProcPtrInfo( const string &typeExpression, int nowLine );
+void DeleteProcPtrInfo(void);
+bool IsNeedProcCompile();
+
+//OldStatement.cpp
+void Opcode_Input(const char *Parameter);
+void Opcode_Print(const char *Parameter,BOOL bWrite);
+
+//LoopRefCheck.cpp
+class CLoopRefCheck{
+	char **names;
+	int num;
+	void init();
+public:
+	CLoopRefCheck();
+	~CLoopRefCheck();
+	void add(const char *lpszInheritsClass);
+	void del(const char *lpszInheritsClass);
+	BOOL check(const CClass &inheritsClass) const;
+};
+extern CLoopRefCheck *pobj_LoopRefCheck;
+
+//DataTable.cpp
+class DataTable{
+	void *pdata;
+	int size;
+
+public:
+	DataTable();
+	~DataTable();
+	void Init();
+
+	int AddBinary( const void *pdata, int size );
+	int Add( _int64 i64data );
+	int Add( int i32data );
+	int Add( double dbl );
+	int Add( float flt );
+	int AddString( const char *str, int length );
+	int AddString( const char *str );
+
+	const void *GetPtr() const;
+	int GetSize() const;
+};
+extern DataTable dataTable;
+
+//error.cpp
+void SetError(int ErrorNum,const char *KeyWord,int pos);
+void SetError(int ErrorNum,const string &keyWord,int pos);
+void SetError();
+void CompileMessage(char *buffer);
+bool CheckDifferentType(const int VarType,const LONG_PTR lpVarIndex,const int CalcType,const LONG_PTR lpCalcIndex,const char *pszFuncName,const int ParmNum);
+bool CheckDifferentType( const Type &varType,const Type &calcType,const char *pszFuncName,const int ParmNum);
+
+//Compile.cpp
+void ReallocNativeCodeBuffer();
+void GetIdentifierToken( char *token, const char *source, int &pos );
+int JumpStatement(const char *source, int &pos);
+void DebugVariable(void);
+void Compile(void);
+
+//Diagnose.cpp
+void Diagnose();
+
+//gc.cpp
+void InitGCVariables(void);
+void PerformedGcVarSchedule(void);
+
+
+
+#ifdef _DEBUG
+/*Debug*/
+/*
+#define HeapAlloc CheckHeapAlloc
+#define HeapReAlloc CheckHeapReAlloc
+LPVOID CheckHeapAlloc(HANDLE hHeap,DWORD dwFlags,DWORD dwBytes);
+LPVOID CheckHeapReAlloc(HANDLE hHeap,DWORD dwFlags,LPVOID lpMem,DWORD dwBytes);
+*/
+#endif
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/common_msg_eng.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/common_msg_eng.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/common_msg_eng.h	(revision 178)
@@ -0,0 +1,46 @@
+///////////////////////////////////////////////////////////////
+// アプリケーションで使用する汎用テキストを定義しています
+//
+// 英語
+///////////////////////////////////////////////////////////////
+
+
+////////
+// 汎用
+////////
+#define STRING_COMPILE			"Compile"
+#define STRING_STOP				"Stop"
+#define STRING_CLOSE			"Close"
+#define STRING_CONTINUE			"Continue"
+#define STRING_NOERROR			"No Error"
+#define STRING_NODEBUGMSG		"No Debug Message"
+#define STRING_OBJECT			"object"
+#define STRING_POINTEROFOBJECT	"pointer of object"
+#define STRING_ARRAY			"array"
+#define STRING_CANNOTACCESS		"cannot access"
+
+#define STRING_PARENTHESIS	"parenthesis \'( )\'"
+
+
+/////////////////////////////////////
+// コンパイラ及びデバッガ メッセージ
+/////////////////////////////////////
+#define STRING_COMPILE_CHECK_CODECONDOTION	"Checking code condition..."
+#define STRING_COMPILE_OPTIMIZING			"Optimizing..."
+#define STRING_COMPILE_INTERMEDIATE			"Creating intermediate code..."
+#define STRING_COMPILE_COMPILING			"Compiling..."
+
+#define STRING_COMPILE_STOP					"Compiling was stopped."
+#define STRING_COMPILE_SUCCESS				"Compiling was successful."
+#define STRING_COMPILE_ERROR				"Compile Error（Number of Errors:%d）"
+
+#define STRING_DEBUGGING					"Debugging the program."
+#define STRING_DEBUG_FINISH					"Debugging was finished."
+#define STRING_DEBUG_THREADFINISH			"Thread(&H%X) exited with code &H%X.\r\n"
+#define STRING_DEBUG_PROCESSFINISH			"Program exited with code &H%X.\r\n"
+#define STRING_DEBUG_THREAD_INVALID_HANDLE	"Handle violation.   Thread=&H%X   EPI=&H%08X\r\n"
+#define STRING_DEBUG_THREAD_ACCESSVIOLATION	"Access violation.   Thread=&H%X   EPI=&H%08X\r\n"
+#define STRING_DEBUG_BREAKPOINT				"Breakpoint.         Thread=&H%X   EPI=&H%08X\r\n"
+#define STRING_DEBUG_DIVIDE_BY_ZERO			"Divided by zero.    Thread=&H%X   EPI=&H%08X\r\n"
+#define STRING_DEBUG_ERROR					"Unknown error.\ncode:%X"
+#define STRING_DEBUG_FAILED					"Failed to read the debug information."
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/common_msg_jpn.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/common_msg_jpn.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/common_msg_jpn.h	(revision 178)
@@ -0,0 +1,47 @@
+///////////////////////////////////////////////////////////////
+// アプリケーションで使用する汎用テキストを定義しています
+//
+// 日本語
+///////////////////////////////////////////////////////////////
+
+
+////////
+// 汎用
+////////
+#define STRING_COMPILE			"コンパイル"
+#define STRING_STOP				"中断"
+#define STRING_CLOSE			"閉じる"
+#define STRING_CONTINUE			"継続"
+#define STRING_NOERROR			"エラー無し"
+#define STRING_NODEBUGMSG		"デバッグ情報無し"
+#define STRING_OBJECT			"オブジェクト"
+#define STRING_POINTEROFOBJECT	"オブジェクト ポインタ"
+#define STRING_ARRAY			"配列"
+#define STRING_CANNOTACCESS		"アクセスできません"
+
+#define STRING_PARENTHESIS	"カッコ \'( )\'"
+
+
+/////////////////////////////////////
+// コンパイラ及びデバッガ メッセージ
+/////////////////////////////////////
+#define STRING_COMPILE_CHECK_CODECONDOTION	"整合性チェック..."
+#define STRING_COMPILE_OPTIMIZING			"最適化中..."
+#define STRING_COMPILE_INTERMEDIATE			"中間コードを抽出中..."
+#define STRING_COMPILE_COMPILING			"コンパイル中..."
+
+#define STRING_COMPILE_STOP					"コンパイルはユーザーにより中断されました。"
+#define STRING_COMPILE_SUCCESS				"コンパイルは正常に完了しました（エラー:%d、警告:%d）。"
+#define STRING_COMPILE_ERROR				"コンパイルは中断されました（エラー:%d、警告:%d）。"
+
+#define STRING_DEBUGGING					"プログラムを実行しています（デバッグ中）。"
+#define STRING_DEBUG_FINISH					"デバッグは正常に終了しました。"
+#define STRING_DEBUG_THREADFINISH			"スレッド(&H%X)はコード &H%X で終了しました。\r\n"
+#define STRING_DEBUG_PROCESSFINISH			"プログラムはコード &H%X で終了しました。\r\n"
+#define STRING_DEBUG_THREAD_INVALID_HANDLE	"スレッド(&H%X)でハンドル違反がありました(EPI=&H%08X)。\r\n"
+#define STRING_DEBUG_THREAD_ACCESSVIOLATION	"スレッド(&H%X)でアクセス違反がありました(EPI=&H%08X)。\r\n"
+#define STRING_DEBUG_BREAKPOINT				"スレッド(&H%X)のブレーク ポイント(EPI=&H%08X)。\r\n"
+#define STRING_DEBUG_DIVIDE_BY_ZERO			"0による除算が行われました。スレッド(&H%X) ブレーク ポイント(EPI=&H%08X)。\r\n"
+#define STRING_DEBUG_DIVIDE_NO_MEMORY		"メモリ不足、またはヒープが壊れていることが原因で、メモリの割り当てに失敗しました。スレッド(&H%X) ブレーク ポイント(EPI=&H%08X)。\r\n"
+#define STRING_DEBUG_ERROR					"例外処理(code:&H%08X)\r\n"
+#define STRING_DEBUG_FAILED					"デバッグ情報の取得に失敗"
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/debug.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/debug.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/debug.h	(revision 178)
@@ -0,0 +1,36 @@
+
+class CDebugThreadInfo{
+public:
+	//ソースコードポインタ
+	DWORD *lpdwCp;
+
+	//ネイティブコードポインタ
+	ULONG_PTR *lplpObp;
+
+	//スタックフレームベースポインタ
+	ULONG_PTR *lplpSpBase;
+
+	//プロシージャ呼び出し階層
+	int iProcLevel;
+
+	CDebugThreadInfo();
+	~CDebugThreadInfo();
+
+	BOOL Reflesh(int ThreadNum);
+	void Free();
+};
+
+extern CDebugThreadInfo *pobj_dti;
+
+#define MAX_DEBUG_THREAD 256
+extern DWORD _DebugSys_dwThreadID[MAX_DEBUG_THREAD];
+extern HANDLE array_hDebugThread[MAX_DEBUG_THREAD];
+
+
+#ifdef _AMD64_
+#define EIP_RIP(Context) (Context).Rip
+#define SP_BASE(Context) (Context).Rsp
+#else
+#define EIP_RIP(Context) (Context).Eip
+#define SP_BASE(Context) (Context).Ebp
+#endif
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/error.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/error.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/error.cpp	(revision 178)
@@ -0,0 +1,553 @@
+#include <Program.h>
+
+#include "../BasicCompiler_Common/common.h"
+
+BOOL GetErrorMsg(int num,const char *KeyWord,char *msg,int pos){
+	extern HANDLE hHeap;
+	int i2;
+	char temporary[64];
+
+	char tempKeyWord[1024];
+	if(KeyWord){
+		lstrcpy(tempKeyWord,KeyWord);
+		for(i2=0;;i2++){
+			if(tempKeyWord[i2]=='\0') break;
+			if(tempKeyWord[i2]==1){
+				GetDefaultNameFromES(tempKeyWord[i2+1],temporary);
+				SlideString(tempKeyWord+i2+2,lstrlen(temporary)-2);
+				memcpy(tempKeyWord+i2,temporary,lstrlen(temporary));
+			}
+		}
+	}
+	else{
+		lstrcpy(tempKeyWord,"");
+	}
+
+	if(num==-1||num==-2) lstrcpy(msg,tempKeyWord);	//部分エラー
+
+	if(num==3){
+		temporary[0]=tempKeyWord[0];
+		for(i2=1;;i2++){
+			if((!IsVariableChar(tempKeyWord[i2]))||i2>=255){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=tempKeyWord[i2];
+		}
+
+		extern char **SynonymErrorWords;
+		extern int SynonymErrorNum;
+		for(i2=0;i2<SynonymErrorNum;i2++){
+			if(lstrcmp(SynonymErrorWords[i2],temporary)==0) return 0;
+		}
+
+#if defined(JPN)
+		//日本語
+		sprintf(msg,"\"%s\" 無効な識別子です",temporary);
+#else
+		//英語
+		sprintf(msg,"\"%s\" Invalid identifier.",temporary);
+#endif
+
+		//重複エラー情報を追加
+		SynonymErrorWords=(char **)HeapReAlloc(hHeap,0,SynonymErrorWords,(SynonymErrorNum+1)*sizeof(char *));
+		SynonymErrorWords[SynonymErrorNum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+		lstrcpy(SynonymErrorWords[SynonymErrorNum],temporary);
+		SynonymErrorNum++;
+	}
+	if(num==30){
+#if defined(JPN)
+		//日本語
+		if(temporary[0]) sprintf(msg,"\"%s\" の使い方が不正です",tempKeyWord);
+		else lstrcpy(msg,"文法が間違っています");
+#else
+		//英語
+		if(temporary[0]) sprintf(msg,"How to use the \"%s\" is wrong.",tempKeyWord);
+		else lstrcpy(msg,"Syntax Error.");
+#endif
+	}
+
+
+	/////////////////////
+	// ワーニングエラー
+	/////////////////////
+#if defined(JPN)
+	////////////////////
+	//日本語
+	////////////////////
+	if(num==-101) sprintf(msg,"[警告] %sに強制変換されています。データが失われる可能性があります。",tempKeyWord);
+	if(num==-102) sprintf(msg,"[警告] %sに強制変換されています。",tempKeyWord);
+	if(num==-103) sprintf(msg,"[警告] \"%s\" 型が指定されていません。Double型として扱います。",tempKeyWord);
+	if(num==-104) sprintf(msg,"[警告] \"%s\" 戻り値の型が指定されていません。Double型として扱います。",tempKeyWord);
+	if(num==-105) sprintf(msg,"[警告] 一時オブジェクトの解放を行えません。キャスト用オブジェクトを用意してください。",tempKeyWord);
+	if(num==-106) sprintf(msg,"[警告] DLLファイル \"%s\" が見つかりません。",tempKeyWord);
+	if(num==-107) sprintf(msg,"[警告] DLL関数 \"%s\" を参照できません。",tempKeyWord);
+	if(num==-120) sprintf(msg,"[警告] VarPtr関数の引数にオブジェクト インスタンスが指定されました。オブジェクトの先頭アドレスを取得したいときはObjPtr関数に切り替えをお願いします。m(__)m（この警告はVarPtr→ObjPtrへの切り替えが完了したら消します（切り替えは \"適材箇所に限り\" ですので、ご注意ください！））",tempKeyWord);
+#else
+#endif
+
+
+	///////////////
+	// 一般エラー
+	///////////////
+
+#if defined(JPN)
+	////////////////////
+	//日本語
+	////////////////////
+	if(num==1) lstrcpy(msg,"文法が間違っています。");
+	if(num==2) sprintf(msg,"左のオペランドが、左辺値になっていません。");
+	//num==3は予約されています
+	if(num==4) sprintf(msg,"%sの相互関係が一致しません。",tempKeyWord);
+	if(num==5) sprintf(msg,"ダブルクォートの数が一致しません。");
+	if(num==6) sprintf(msg,"\"%s\" ジャンプ先が不正です。",tempKeyWord);
+	if(num==7) lstrcpy(msg,"DLL名が長すぎます（拡張子を含め、16文字以下にして下さい）。");
+	if(num==8) lstrcpy(msg,"コンパイラが認識できない文字コードが含まれています。");
+	if(num==9) sprintf(msg,"型が違います。");
+	if(num==10) sprintf(msg,"\"%s\" のパラメータ指定が間違っています。",tempKeyWord);
+	if(num==11) sprintf(msg,"\"%s\" 型が違います。",tempKeyWord);
+	if(num==12) sprintf(msg,"\"%s\" の使い方が不正です。",tempKeyWord);
+	if(num==13) sprintf(msg,"\"%s\" を参照できません。",tempKeyWord);
+	if(num==14) sprintf(msg,"\"%s\" 配列指定が不正です。",tempKeyWord);
+	if(num==15) sprintf(msg,"\"%s\" はすでに定義されています。",tempKeyWord);
+	if(num==16) sprintf(msg,"\"%s\" 配列、またはポインタ以外の変数に添え字が指定されています。",tempKeyWord);
+	if(num==17) sprintf(msg,"リソース データが不正です。");
+	if(num==18) sprintf(msg,"\"%s\"はポインタ変数型です。文字列演算を指定することはできません。",tempKeyWord);
+	if(num==19) sprintf(msg,"\"%s\"は値参照型です。ByVal指定することはできません。",tempKeyWord);
+	if(num==20) lstrcpy(msg,"全角スペースが含まれています（全角スペースはコンパイラが認識できないので、半角スペースまたはタブ文字にしてください）。");
+	if(num==21) sprintf(msg,"If制御のブロック指定が不正です。");
+	if(num==22) sprintf(msg,"\"%s\" に対する \"End %s\" が見つかりません。",tempKeyWord,tempKeyWord);
+	if(num==23) sprintf(msg,"リソース ファイル \"%s\" の読み込みに失敗。",tempKeyWord);
+	if(num==24) lstrcpy(msg,"Export指定の関数のパラメータには実体オブジェクトを利用することはできません（BytePtr型などを利用して下さい）。");
+	if(num==25) sprintf(msg,"DLL関数にオブジェクトを引き渡すことはできません(%s)。",tempKeyWord);
+	if(num==26) sprintf(msg,"\"%s\" 戻り値の型が指定されていません。",tempKeyWord);
+	if(num==27) sprintf(msg,"\"%s\" は定義されていません。",tempKeyWord);
+	if(num==28) sprintf(msg,"構造体パラメータは参照渡しにしてください(%s)。",tempKeyWord);
+	if(num==29) sprintf(msg,"配列ポインタを要素と同時に引渡すときは、ポインタ参照（ByRef）にしてください。");
+	//num==30は予約されています
+	if(num==31) sprintf(msg,"\"%s\" は構造体です（メンバの参照はピリオド \".\" で区切ってください）。",tempKeyWord);
+	if(num==32) sprintf(msg,"\"%s\" は構造体ポインタです（メンバの参照は \"->\" で区切ってください）。",tempKeyWord);
+	if(num==33) sprintf(msg,"定数式にリテラル値、または定数以外のものが含まれています。");
+	if(num==34) sprintf(msg,"定数はモジュールレベルで宣言して下さい。");
+	if(num==38) sprintf(msg,"\"%s\" 戻り値が存在しないプロシージャです。",tempKeyWord);
+	if(num==39) sprintf(msg,"\"%s\" はオブジェクトポインタではありません（\"->\" 参照はできません）。",tempKeyWord);
+	if(num==40) lstrcpy(msg,"DLL関数の戻り値としてオブジェクトを受け取ることはできません。");
+	if(num==41) lstrcpy(msg,"初期データが不正です。");
+	if(num==42) lstrcpy(msg,"閉じカッコ \")\" の後に不正な文字が含まれています。");
+	if(num==43) lstrcpy(msg,"ダブルクォートの後に不正な文字が含まれています。");
+	if(num==45) sprintf(msg,"実数に対して \"%s\" 演算子は利用できません。",tempKeyWord);
+	if(num==46) lstrcpy(msg,"配列の添え字に整数以外の値が与えられています。");
+	if(num==47) lstrcpy(msg,"As演算子の右辺値に型名以外の識別子が指定されています。");
+	if(num==48) sprintf(msg,"%s演算子に対して型名が指定されています。",tempKeyWord);
+	if(num==49) lstrcpy(msg,"添え字に整数以外の型が指定されています。");
+	if(num==50) sprintf(msg,"%sに変換できません。",tempKeyWord);
+	if(num==51) lstrcpy(msg,"オブジェクト、構造体のアラインメント値は1,2,4,8,16のいずれかでなければなりません。");
+	if(num==52) sprintf(msg,"\"%s\" オーバーロードを解決できません。",tempKeyWord);
+	if(num==53) sprintf(msg,"\"%s\" 出力ファイルの書き込みに失敗しました。実行されている可能性があります。",tempKeyWord);
+	if(num==54) sprintf(msg,"対応する%sが存在しません。",tempKeyWord);
+	if(num==55) sprintf(msg,"\"%s\" は対応するForステートメントで利用されるカウンタ変数ではありません。",tempKeyWord);
+	if(num==56) lstrcpy(msg,"ゼロ割りが行われました。");
+	if(num==57) lstrcpy(msg,"8進数のリテラル表記が不正です。");
+	if(num==58) lstrcpy(msg,"16進数のリテラル表記が不正です。");
+	if(num==59) sprintf(msg,"マニフェスト ファイル \"%s\" の読み込みに失敗。",tempKeyWord);
+	if(num==60) lstrcpy(msg,"Staticステートメントはグローバル領域では使用できません。");
+	if(num==61) sprintf(msg,"\"%s\" は定数です。書き込みアクセスはできません。",tempKeyWord);
+	if(num==62) sprintf(msg,"グローバル領域でのReturnは禁止されています。",tempKeyWord);
+	if(num==63) lstrcpy(msg,"名前空間が正しく閉じられていません。");
+	if(num==64) sprintf(msg,"\"%s\" 無効な名前空間です。",tempKeyWord);
+	if(num==65) sprintf(msg,"ローカル領域で%sは使用できません。",tempKeyWord);
+
+
+	//オブジェクト関連
+	if(num==102) sprintf(msg,"\"%s\" オブジェクトは定義されていません。",tempKeyWord);
+	if(num==103) sprintf(msg,"\"%s\" メンバは定義されていません。",tempKeyWord);
+	if(num==104) sprintf(msg,"\"%s\" 参照方法が違います。",tempKeyWord);
+	if(num==105) sprintf(msg,"\"%s\" 自身のクラスを継承することはできません。",tempKeyWord);
+	if(num==106) sprintf(msg,"\"%s\" クラスは定義されていません。",tempKeyWord);
+	if(num==107) sprintf(msg,"Privateメンバ \"%s\" にアクセスすることはできません。",tempKeyWord);
+	if(num==108) sprintf(msg,"Protectedメンバ \"%s\" にアクセスすることはできません。",tempKeyWord);
+	if(num==109) sprintf(msg,"Privateメンバ関数 \"%s\" を呼び出すことはできません。",tempKeyWord);
+	if(num==110) sprintf(msg,"Protectedメンバ関数 \"%s\" を呼び出すことはできません。",tempKeyWord);
+	if(num==111) lstrcpy(msg,"InheritsはClass定義内の先頭に記述する必要があります。");
+	if(num==112) sprintf(msg,"\"%s\" はクラス型ではないため、初期パラメータを指定することはできません。",tempKeyWord);
+	if(num==113) sprintf(msg,"\"%s\" コンストラクタへ渡すパラメータが不正です。",tempKeyWord);
+	if(num==114) lstrcpy(msg,"デストラクタはパラメータを持てません。");
+	if(num==115) lstrcpy(msg,"コンストラクタ及びデストラクタは戻り値を持てません。");
+	//if(num==116) lstrcpy(msg,"コンストラクタ及びデストラクタはパブリックアクセスにしなければなりません。");
+	if(num==117) lstrcpy(msg,"デストラクタの名前が \"~クラス名\" になっていません。");
+	if(num==118) lstrcpy(msg,"参照する基底クラスが存在しません。");
+	if(num==119) sprintf(msg,"\"%s\" メンバは基底クラスで定義されていません。",tempKeyWord);
+	if(num==120) lstrcpy(msg,"デストラクトするオブジェクトの型が不明です。");
+	if(num==121) lstrcpy(msg,"New演算子にはクラス以外の型を指定できません。");
+	if(num==122) lstrcpy(msg,"Delete演算子にポインタ以外の型が指定されています。");
+	if(num==123) lstrcpy(msg,"ループ継承が行われました。");
+	if(num==124) lstrcpy(msg,"循環参照が行われました。");
+	if(num==125) sprintf(msg,"\"%s\" は抽象クラスです。インスタンス化することはできません。",tempKeyWord);
+	if(num==126) lstrcpy(msg,"オペレータのオーバーロードをクラスの外で行うことはできません。");
+	if(num==127) lstrcpy(msg,"Override修飾子の指定が無い状況でオーバーライドを行うことはできません。");
+	if(num==128) lstrcpy(msg,"オーバーライドを行うときはアクセシビリティを同一にしなければなりません。");
+	if(num==129) sprintf(msg,"静的メンバ \"%s\" は定義されていません。",tempKeyWord);
+	if(num==130) sprintf(msg,"\"%s\" はオブジェクト定数です。書き込みアクセスはできません。",tempKeyWord);
+	if(num==131) lstrcpy(msg,"Const定義されたメソッド内でクラスメンバへの書き込みアクセスはできません。");
+	if(num==132) lstrcpy(msg,"明示的なコンストラクタ呼び出しと初期値の指定を同時に行うことはできません。");
+	if(num==133) lstrcpy(msg,"Thisに代入はできません。");
+	if(num==134) lstrcpy( msg,"ObjPtr関数にはオブジェクト インスタンス以外を指定できません。" );
+	if(num==135) lstrcpy( msg, "クラスまたはインターフェイス以外の型を継承元として指定することはできません。" );
+
+	//Enum関連
+	if(num==150) sprintf(msg,"\"%s\" 値が定義されていません。",tempKeyWord);
+	if(num==151) sprintf(msg,"\"%s\" 列挙リストに登録されていません。",tempKeyWord);
+
+	//リンカ
+	if(num==200) sprintf(msg,"\"%s\" 未解決です (リンク エラー)。",tempKeyWord);
+	if(num==201) sprintf(msg,"\"%s\" の読み込みに失敗。",tempKeyWord);
+
+	//原因不明
+	if(num==300) lstrcpy(msg,"内部エラー");
+
+#else
+	////////////////////
+	//英語
+	////////////////////
+	if(num==1) lstrcpy(msg,"Syntax Error.");
+	if(num==2) sprintf(msg,"Left operand must be l-value.");
+	//num==3は予約されています
+	if(num==4) sprintf(msg,"Correlation of %s is wrong.",tempKeyWord);
+	if(num==5) sprintf(msg,"Correlation of double quotes is wrong.");
+	if(num==6) sprintf(msg,"\"%s\" Label not found.",tempKeyWord);
+	if(num==7) lstrcpy(msg,"The DLL name is too long. Must be 16 characters or less.");
+	if(num==8) lstrcpy(msg,"The inaccurate characters are contained.");
+	if(num==9) sprintf(msg,"Type is wrong.");
+	if(num==10) sprintf(msg,"\"%s\" Rule of parameter is wrong.",tempKeyWord);
+	if(num==11) sprintf(msg,"\"%s\" Type is wrong.",tempKeyWord);
+	if(num==12) sprintf(msg,"\"%s\" Not a valid use.",tempKeyWord);
+	if(num==13) sprintf(msg,"Cannot refer to \"%s\".",tempKeyWord);
+	if(num==14) sprintf(msg,"\"%s\" Array argument(s) out of bound.",tempKeyWord);
+	if(num==15) sprintf(msg,"\"%s\" is already defined.",tempKeyWord);
+	if(num==16) sprintf(msg,"\"%s\" Argument(s) following variable which is not pointer or array.",tempKeyWord);
+	if(num==17) sprintf(msg,"Invalid resource data.");
+	if(num==18) sprintf(msg,"\"%s\" Invalid operation on a pointer variable.",tempKeyWord);
+	if(num==19) sprintf(msg,"\"%s\" is already to be passed by value. You cannot use \"ByVal\".",tempKeyWord);
+	if(num==21) sprintf(msg,"Wrong structure of \"If\" block.");
+	if(num==22) sprintf(msg,"No matching \"End %s\" found for \"%s\".",tempKeyWord,tempKeyWord);
+	if(num==23) sprintf(msg,"Cannot read the resource file \"%s\".",tempKeyWord);
+	if(num==24) lstrcpy(msg,"Must not use String type as an argument for exported function. (Use BytePtr type instead.)");
+	if(num==27) sprintf(msg,"\"%s\" Undefined procedure.",tempKeyWord);
+	if(num==28) sprintf(msg,"\"%s\" Structure must not be passed by value. (Use \"ByRef\".)",tempKeyWord);
+	if(num==29) sprintf(msg,"Array must not be passed by value. (Use \"ByRef\".)");
+	//num==30は予約されています
+	if(num==31) sprintf(msg,"\"%s\" is a struct. (Use period \".\" to refer to the members.)",tempKeyWord);
+	if(num==32) sprintf(msg,"\"%s\" is a pointer of struct. (Use arrow \"->\" to refer to the members.)",tempKeyWord);
+	if(num==33) sprintf(msg,"Constant formula has a thing that is not literal value or constant value.");
+	if(num==34) sprintf(msg,"Constant formula must be defined in the module level.");
+	if(num==38) sprintf(msg,"\"%s\" is a procedure without a return value.",tempKeyWord);
+	if(num==39) sprintf(msg,"\"%s\" is not object pointer. \"->\" is invalid.",tempKeyWord);
+	if(num==40) lstrcpy(msg,"Cannot set a object to return value.");
+	if(num==41) lstrcpy(msg,"Init data is wrong.");
+	if(num==42) lstrcpy(msg,"The inaccurate characters are contained after the closing parenthesis \")\".");
+	if(num==43) lstrcpy(msg,"The inaccurate characters are contained after the double quote.");
+
+	//オブジェクト関連
+	if(num==102) sprintf(msg,"\"%s\" The object is not defined.",tempKeyWord);
+	if(num==103) sprintf(msg,"\"%s\" The member is not defined.",tempKeyWord);
+	if(num==104) sprintf(msg,"\"%s\" The reference character is different.",tempKeyWord);
+	if(num==105) sprintf(msg,"\"%s\" An own class is not inheritable.",tempKeyWord);
+	if(num==106) sprintf(msg,"\"%s\" It class is not defined.",tempKeyWord);
+	if(num==107) sprintf(msg,"\"%s\" Cannot access the private member.",tempKeyWord);
+	if(num==108) sprintf(msg,"\"%s\" Cannot access the protected member.",tempKeyWord);
+	if(num==109) sprintf(msg,"\"%s\" Cannot call the private member.",tempKeyWord);
+	if(num==110) sprintf(msg,"\"%s\" Cannot call the protected member.",tempKeyWord);
+	if(num==111) lstrcpy(msg,"The Inherits phrase must be described to the 1st line of class module");
+	if(num==112) sprintf(msg,"\"%s\" is not class object. Therefor you cannot set the parameter for constructor.",tempKeyWord);
+	if(num==113) sprintf(msg,"\"%s\" The parameter for constructor is wrong.",tempKeyWord);
+	if(num==114) lstrcpy(msg,"Destructor cannot have a parameter.");
+	if(num==115) lstrcpy(msg,"Constructor and Destructor cannot have a return value.");
+	if(num==116) lstrcpy(msg,"Constructor and Destructor must be public access.");
+	if(num==117) lstrcpy(msg,"Destructors name must be \"~ClassName\".");
+	if(num==118) lstrcpy(msg,"Super class is not found.");
+	if(num==119) sprintf(msg,"\"%s\" The member is not defined in the super class.",tempKeyWord);
+
+	//Enum関連
+	if(num==150) sprintf(msg,"\"%s\" The value is not set",tempKeyWord);
+	if(num==151) sprintf(msg,"\"%s\" is not found from enum lists.",tempKeyWord);
+
+	//リンカ
+	if(num==200) sprintf(msg,"\"%s\" Unknown error.",tempKeyWord);
+#endif
+
+	return 1;
+}
+void SetError(int ErrorNum,const string &keyWord,int pos){
+	SetError( ErrorNum, keyWord.c_str(), pos );
+}
+void SetError(int num,const char *KeyWord,int pos){
+	extern HANDLE hHeap;
+	extern HWND hMainDlg;
+	extern ERRORINFO *pErrorInfo;
+	extern int ErrorNum;
+	char temporary[1024],temp2[1024],temp3[32],FileName[MAX_PATH];
+	BOOL bFirst;
+	int i2;
+
+	extern BOOL bDebugRun;
+	if(bDebugRun) return;
+
+	if(num!=-2){
+		//一般エラーまたは警告
+		i2=0;	//ここにブレークポイントをおく
+
+		if(num>-100){
+			//エラーのみ
+			i2=0;
+		}
+
+	}
+
+	if(!GetErrorMsg(num,KeyWord,temporary,pos)) return;
+
+	if(ErrorNum==0){
+		SetDlgItemText(hMainDlg,IDC_ERRORLIST,"");
+		EnableWindow(GetDlgItem(hMainDlg,IDC_ERRORLIST),1);
+		bFirst=1;
+	}
+	else bFirst=0;
+
+
+	////////////////////
+	// エラー情報を追加
+	pErrorInfo=(ERRORINFO *)HeapReAlloc(hHeap,0,pErrorInfo,(ErrorNum+1)*sizeof(ERRORINFO));
+
+	if(pos==-1){
+		pErrorInfo[ErrorNum].FileName=0;
+		lstrcpy(temp2,temporary);
+	}
+	else{
+		GetLineNum(pos,&pErrorInfo[ErrorNum].line,FileName);
+
+		pErrorInfo[ErrorNum].FileName=(char *)HeapAlloc(hHeap,0,lstrlen(FileName)+1);
+		lstrcpy(pErrorInfo[ErrorNum].FileName,FileName);
+
+		_splitpath(pErrorInfo[ErrorNum].FileName,0,0,temp2,temp3);
+		lstrcat(temp2,temp3);
+
+		if(pErrorInfo[ErrorNum].line==-1)
+			sprintf(temp2+lstrlen(temp2),"(no area) %s",temporary);
+		else
+			sprintf(temp2+lstrlen(temp2),"(%d) - %s",pErrorInfo[ErrorNum].line+1,temporary);
+	}
+
+	i2=GetWindowTextLength(GetDlgItem(hMainDlg,IDC_ERRORLIST));
+	SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_SETSEL,i2,i2);
+	if(bFirst==0){
+		SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_REPLACESEL,0,(LPARAM)"\r\n");
+		i2+=2;
+		SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_SETSEL,i2,i2);
+	}
+	SendDlgItemMessage(hMainDlg,IDC_ERRORLIST,EM_REPLACESEL,0,(LPARAM)temp2);
+
+
+	if(num==-2){
+		//コンパイルメッセージ
+		//※何もしない
+		extern int CompileMsgNum;
+		CompileMsgNum++;
+	}
+	else{
+		if(num>-100){
+			//警告ではなく、エラーの場合はエラーチェックフラグを立てる
+			extern BOOL bError;
+			bError=1;
+
+			// ログに出力
+			trace( "error - " << temp2 );
+		}
+		else{
+			extern int WarningNum;
+			WarningNum++;
+
+			// ログに出力
+			trace( "warning - " << temp2 );
+		}
+	}
+
+	ErrorNum++;
+}
+void SetError(){
+	SetError(300,NULL,cp);
+}
+void CompileMessage(char *buffer){
+	SetError(-2,buffer,-1);
+}
+
+#define STRING_SYSTEM_DECLAREHANDLE "*_System_DeclareHandle_"
+void DifferentTypeError(const int VarType,LONG_PTR VarIndex,const int CalcType,LONG_PTR CalcIndex,const int iWarning,const char *pszFuncName,const int ParmNum){
+	//////////////////////////
+	// キャストに関する警告
+	//////////////////////////
+	char temporary[255],temp2[255],temp3[255];
+
+	if(IS_LITERAL(CalcIndex)) CalcIndex=-1;
+
+	if(pszFuncName)
+		sprintf(temporary,"\"%s\"の第%dパラメータが、",pszFuncName,ParmNum+1);
+	else temporary[0]=0;
+
+	if(!GetTypeName(VarType,VarIndex,temp2)) lstrcpy(temp2,"Any");
+	if(memcmp(temp2,STRING_SYSTEM_DECLAREHANDLE,lstrlen(STRING_SYSTEM_DECLAREHANDLE))==0){
+		memmove(temp2,
+			temp2+lstrlen(STRING_SYSTEM_DECLAREHANDLE),
+			lstrlen(temp2+lstrlen(STRING_SYSTEM_DECLAREHANDLE))+1);
+	}
+	if(!GetTypeName(CalcType,CalcIndex,temp3)) lstrcpy(temp3,"Any");
+	if(memcmp(temp3,STRING_SYSTEM_DECLAREHANDLE,lstrlen(STRING_SYSTEM_DECLAREHANDLE))==0){
+		memmove(temp3,
+			temp3+lstrlen(STRING_SYSTEM_DECLAREHANDLE),
+			lstrlen(temp3+lstrlen(STRING_SYSTEM_DECLAREHANDLE))+1);
+	}
+	sprintf(temporary+lstrlen(temporary),"%sから%s",temp3,temp2);
+
+	extern int cp;
+	if(iWarning==1) SetError(-101,temporary,cp);
+ 	else if(iWarning==2) SetError(-102,temporary,cp);
+ 	else if(iWarning==3) SetError(50,temporary,cp);
+}
+
+bool CheckDifferentType(const int VarType,const LONG_PTR lpVarIndex,int CalcType,const LONG_PTR lpCalcIndex,const char *pszFuncName,const int ParmNum){
+
+	if(VarType==DEF_STRUCT||CalcType==DEF_STRUCT){
+		//いずれかが構造体場合
+		if( VarType != CalcType || lpVarIndex != lpCalcIndex ){
+			DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,3,pszFuncName,ParmNum);
+			return false;
+		}
+	}
+
+	if(VarType==DEF_OBJECT||CalcType==DEF_OBJECT){
+		//いずれかがオブジェクトインスタンスの場合
+		if( VarType != CalcType ){
+			DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,3,pszFuncName,ParmNum);
+			return false;
+		}
+
+		CClass *pClass = (CClass *)lpVarIndex;
+		if( !pClass->IsEqualsOrSubClass( (CClass *)lpCalcIndex ) ){
+			//等しくなく、派生クラスでもないとき
+			DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,3,pszFuncName,ParmNum);
+			return false;
+		}
+	}
+
+	//#strictが指定されていないときは型チェックを行わないようにする
+	extern BOOL bStrict;
+	if(bStrict==0) return true;
+
+	if(CalcType&FLAG_PTR){
+		//配列先頭フラグがたっている場合は、ポインタ型として扱う
+		CalcType=MAKE_PTR_TYPE(NATURAL_TYPE(CalcType),PTR_LEVEL(CalcType)+1);
+	}
+
+	if(IsPtrType(VarType)||IsPtrType(CalcType)){
+		/* 右辺及び左辺のいずれかがポインタ型の場合は、
+			型チェックを行う。
+		・同一の種類のポインタ型以外はエラーとする */
+
+		if(IsPtrType(VarType)&&lpCalcIndex==LITERAL_NULL){
+			//リテラルNULL値の場合
+			return true;
+		}
+
+		if(VarType==DEF_PTR_VOID){
+			//左辺がVoidPtr型の場合は、ポインタ型すべてを受け入れる
+			if(IsPtrType(CalcType)) return true;
+		}
+
+		if(CalcType==DEF_PTR_VOID){
+			//右辺がVoidPtr型の場合は、ポインタ型すべてを受け入れる
+			if(IsPtrType(VarType)) return true;
+		}
+
+		if(VarType!=CalcType){
+			DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,2,pszFuncName,ParmNum);
+			return true;
+		}
+
+		if(VarType==DEF_PTR_OBJECT){
+			//双方がオブジェクトポインタ型の場合
+			if(lpVarIndex!=lpCalcIndex){
+				const CClass *pobj_tempClass;
+				pobj_tempClass=(CClass *)lpCalcIndex;
+				while(pobj_tempClass&&(!IS_LITERAL((LONG_PTR)pobj_tempClass))){
+					pobj_tempClass=pobj_tempClass->pobj_InheritsClass;
+
+					if(lpVarIndex==(LONG_PTR)pobj_tempClass){
+						//継承先が等しいとき
+						return true;
+					}
+				}
+				DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,2,pszFuncName,ParmNum);
+				return true;
+			}
+		}
+	}
+
+	if(VarType==DEF_DOUBLE){
+		if(Is64Type(CalcType)){
+			//64ビット整数値の場合は警告を出す
+			DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,1,pszFuncName,ParmNum);
+		}
+	}
+	else if(VarType==DEF_SINGLE){
+		if(Is64Type(CalcType)||CalcType==DEF_DOUBLE){
+			//64ビット整数値、またはDouble型の場合は警告を出す
+			DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,1,pszFuncName,ParmNum);
+		}
+	}
+	else if(GetTypeSize(VarType,lpVarIndex)==sizeof(char)){
+		if(GetTypeSize(CalcType,lpCalcIndex)>sizeof(char)&&
+			lpCalcIndex!=LITERAL_NULL&&
+			lpCalcIndex!=LITERAL_M128_0&&
+			lpCalcIndex!=LITERAL_0_255){
+			//8ビット整数値より大きな型で、リテラル値でもない場合は警告を出す
+			DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,1,pszFuncName,ParmNum);
+		}
+	}
+	else if(GetTypeSize(VarType,lpVarIndex)==sizeof(short)){
+		if(GetTypeSize(CalcType,lpCalcIndex)>sizeof(short)&&
+			lpCalcIndex!=LITERAL_NULL&&
+			lpCalcIndex!=LITERAL_M128_0&&
+			lpCalcIndex!=LITERAL_0_255&&
+			lpCalcIndex!=LITERAL_M32768_0&&
+			lpCalcIndex!=LITERAL_0_65535){
+			//16ビット整数値より大きな型で、リテラル値でもない場合は警告を出す
+			DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,1,pszFuncName,ParmNum);
+		}
+	}
+	else if(GetTypeSize(VarType,lpVarIndex)==sizeof(long)){
+		if(IsRealNumberType(CalcType)||
+			(IsWholeNumberType(CalcType)&&
+			GetTypeSize(CalcType,lpCalcIndex)>sizeof(long)&&
+			lpCalcIndex!=LITERAL_NULL)
+			){
+			/* 32ビット整数値より大きな型、または実数、
+					またはリテラル値でもない場合は警告を出す */
+			DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,1,pszFuncName,ParmNum);
+		}
+	}
+	else if(GetTypeSize(VarType,lpVarIndex)==sizeof(_int64)){
+		if(IsRealNumberType(CalcType)){
+			//実数の場合は警告を出す
+			DifferentTypeError(VarType,lpVarIndex,CalcType,lpCalcIndex,1,pszFuncName,ParmNum);
+		}
+	}
+
+	return true;
+}
+bool CheckDifferentType( const Type &varType,const Type &calcType,const char *pszFuncName,const int ParmNum){
+	return CheckDifferentType(
+		varType.GetBasicType(),
+		varType.GetIndex(),
+		calcType.GetBasicType(),
+		calcType.GetIndex(),
+		pszFuncName,
+		ParmNum );
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/gc.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/gc.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/gc.cpp	(revision 178)
@@ -0,0 +1,90 @@
+#include "common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+int Schedule_GlobalRoot_StartPtr;
+int Schedule_GlobalRoot_Size;
+
+void InitGCVariables(void){
+	char temporary[255];
+
+
+	///////////////////////////////
+	// グローバル変数の開始位置
+	///////////////////////////////
+
+	sprintf(temporary,"_System_gc_GlobalRoot_StartPtr%c%cVoidPtr",1,ESC_AS);
+	OpcodeDim(temporary,0);
+
+	Type type;
+	RELATIVE_VAR RelativeVar;
+	GetVarOffsetReadWrite("_System_gc_GlobalRoot_StartPtr",&RelativeVar,type);
+
+	//mov rax,ptr
+	op_mov_RV(PTR_SIZE,REG_RAX,0);
+	Schedule_GlobalRoot_StartPtr=obp-sizeof(long);
+
+	//mov ptr[offset],rax/eax
+	op_mov_MR(PTR_SIZE,REG_RAX,0,(int)RelativeVar.offset,MOD_DISP32);
+	obp-=sizeof(long);
+	pobj_GlobalVarSchedule->add();
+	obp+=sizeof(long);
+
+
+	///////////////////////////////
+	// グローバル変数の大きさ
+	///////////////////////////////
+
+	sprintf(temporary,"_System_gc_GlobalRoot_Size%c%cLong",1,ESC_AS);
+	OpcodeDim(temporary,0);
+
+	GetVarOffsetReadWrite("_System_gc_GlobalRoot_Size",&RelativeVar,type);
+
+	//mov rax,ptr
+	op_mov_RV(PTR_SIZE,REG_RAX,0);
+	Schedule_GlobalRoot_Size=obp-sizeof(long);
+
+	//mov ptr[offset],rax/eax
+	op_mov_MR(PTR_SIZE,REG_RAX,0,(int)RelativeVar.offset,MOD_DISP32);
+	obp-=sizeof(long);
+	pobj_GlobalVarSchedule->add();
+	obp+=sizeof(long);
+
+
+
+	///////////////////////////////
+	// スタックフレームの開始位置
+	///////////////////////////////
+
+	sprintf(temporary,"_System_gc_StackRoot_StartPtr%c%c*LONG_PTR",1,ESC_AS);
+	OpcodeDim(temporary,0);
+
+	GetVarOffsetReadWrite("_System_gc_StackRoot_StartPtr",&RelativeVar,type);
+
+	//mov rax,rsp
+	op_mov_RR(REG_RAX,REG_RSP);
+
+	//mov ptr[offset],rax/eax
+	op_mov_MR(PTR_SIZE,REG_RAX,0,(int)RelativeVar.offset,MOD_DISP32);
+	obp-=sizeof(long);
+	pobj_GlobalVarSchedule->add();
+	obp+=sizeof(long);
+
+}
+
+void PerformedGcVarSchedule(void){
+	//グローバル変数領域の開始位置
+	extern DWORD ImageBase;
+	extern int MemPos_RWSection;
+	*((long *)(OpBuffer+Schedule_GlobalRoot_StartPtr))=ImageBase+MemPos_RWSection;
+	pobj_Reloc->AddSchedule_CodeSection(Schedule_GlobalRoot_StartPtr);
+
+	//グローバル変数領域のサイズ
+	extern int AllInitGlobalVarSize;
+	extern int AllGlobalVarSize;
+	*((long *)(OpBuffer+Schedule_GlobalRoot_Size))=AllInitGlobalVarSize+AllGlobalVarSize;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/hash.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/hash.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/hash.cpp	(revision 178)
@@ -0,0 +1,203 @@
+#include "../BasicCompiler_Common/common.h"
+
+#ifdef _AMD64_
+#include "../BasicCompiler64/opcode.h"
+#else
+#include "../BasicCompiler32/opcode.h"
+#endif
+
+int hash_default(const char *name){
+	int key;
+
+	for(key=0;*name!='\0';name++){
+		key=((key<<8)+ *name )%MAX_HASH;
+	}
+
+	return key;
+}
+
+CONSTINFO *GetConstHash(const char *name){
+	//ハッシュ値を取得
+	int key;
+	key=hash_default(name);
+
+	//格納位置を取得
+	extern CONSTINFO **ppConstHash;
+	CONSTINFO *pci;
+	pci=ppConstHash[key];
+	while(pci){
+		if(lstrcmp(pci->name,name)==0) break;
+
+		pci=pci->pNextData;
+	}
+
+	return pci;
+}
+
+DllProc *GetDeclareHash(char *fullName){
+	char ObjName[VN_SIZE];		//オブジェクト変数
+	char NestMember[VN_SIZE];	//入れ子メンバ
+	bool isObjectMember = SplitMemberName( fullName, ObjName, NestMember );
+
+	//ハッシュ値を取得
+	int key;
+	key=hash_default(NestMember);
+
+	//格納位置を取得
+	extern DllProc **ppDeclareHash;
+	DllProc *pDllProc;
+	pDllProc=ppDeclareHash[key];
+	while(pDllProc){
+		// TODO: Declare名前空間対応
+		if( pDllProc->IsEqualSymbol( fullName ) ){
+			break;
+		}
+
+		pDllProc=pDllProc->pNextData;
+	}
+
+	return pDllProc;
+}
+
+void GetOverloadSubHash( const char *lpszName, std::vector<UserProc *> &subs ){
+	char name[VN_SIZE];
+
+	if(lpszName[0]=='.'){
+		GetWithName(name);
+		lstrcat(name,lpszName);
+	}
+	else lstrcpy(name,lpszName);
+
+	char ObjName[VN_SIZE];		//オブジェクト変数
+	char NestMember[VN_SIZE];	//入れ子メンバ
+	bool isObjectMember = SplitMemberName( name, ObjName, NestMember );
+
+	if(isObjectMember){
+		//オブジェクトのメンバ関数の場合
+
+		bool isStatic = false;
+		const CClass *pobj_c = NULL;
+		if(lstrcmpi(ObjName,"Super")==0){
+			//クラスメンバ関数内から基底クラスの呼び出し
+			pobj_c=pobj_CompilingClass;
+		}
+		else{
+			//"->"によってオブジェクトを指定する通常のメンバ関数呼び出し
+			Type type;
+			if( GetVarType(ObjName,type,0) ){
+				pobj_c = &type.GetClass();
+			}
+			else{
+				pobj_c=pobj_DBClass->Find(ObjName);
+				if( pobj_c ){
+					isStatic = true;
+				}
+			}
+		}
+
+		if( pobj_c && pobj_c != (CClass *)-1 ){
+			if( isStatic ){
+				// 静的メソッドから列挙
+				pobj_c->GetStaticMethods().Enum( NestMember, subs );
+			}
+			else{
+				//動的メソッドから列挙
+				pobj_c->GetMethods().Enum( NestMember, subs );
+			}
+			return;
+		}
+	}
+
+
+	if(pobj_CompilingClass){
+		//自身のオブジェクトのメンバ関数を検索
+
+		// 静的メソッド
+		pobj_CompilingClass->GetStaticMethods().Enum( name, subs );
+
+		// 動的メソッド
+		pobj_CompilingClass->GetMethods().Enum( name, subs );
+	}
+
+
+	///////////////////////////
+	// グローバル関数を検索
+	///////////////////////////
+
+	//ハッシュ値を取得
+	int key;
+	key=hash_default(NestMember);
+
+	//格納位置を取得
+	extern GlobalProc **ppSubHash;
+	GlobalProc *pUserProc;
+	pUserProc=ppSubHash[key];
+	while(pUserProc){
+		if(!pUserProc->GetParentClassPtr()){
+			if( pUserProc->IsEqualSymbol( name ) ){
+				subs.push_back( pUserProc );
+			}
+		}
+
+		pUserProc=pUserProc->pNextData;
+	}
+}
+
+//オーバーロードされていない関数を取得（昔のコンパイラソースコードとの互換性保持）
+UserProc *GetSubHash(const char *lpszName,BOOL bError){
+	std::vector<UserProc *> subs;
+	GetOverloadSubHash(lpszName,subs);
+
+	//関数が存在しないとき
+	if(subs.size() == 0){
+		if(bError){
+			SetError(3,lpszName,cp);
+		}
+		return 0;
+	}
+
+	//一つ以上の関数が存在するときは内部エラー（デバッグ用）
+	if(subs.size() > 1){
+		if(bError) SetError(300,NULL,cp);
+	}
+
+	UserProc *pUserProc;
+	pUserProc = subs[0];
+
+	return pUserProc;
+}
+UserProc *GetMethodHash(const char *ObjectName,const char *MethodName,const char *Parameter,BOOL bError){
+	char temporary[VN_SIZE];
+	sprintf(temporary,"%s.%s",ObjectName,MethodName);
+
+	std::vector<UserProc *> subs;
+	UserProc *pUserProc;
+	GetOverloadSubHash(temporary,subs);
+
+	//関数が存在しないとき
+	if(subs.size() == 0){
+		return 0;
+	}
+
+	//オーバーロードを解決
+	pUserProc=OverloadSolutionWithStrParam(temporary,subs,Parameter,ObjectName);
+
+	return pUserProc;
+}
+
+UserProc *GetClassMethod( const char *className, const char *methodName ){
+	const CClass *pClass = pobj_DBClass->Find( className );
+	if( pClass ){
+		vector<UserProc *> userProcs;
+		pClass->GetMethods().Enum( methodName, userProcs );
+		if( userProcs.size() == 1 ){
+			return userProcs[0];
+		}
+	}
+
+	char temporary[VN_SIZE];
+	sprintf( temporary, "%s.%s", className, methodName );
+	SetError(3, temporary, -1 );
+
+	return NULL;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/include/Exception.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/include/Exception.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/include/Exception.h	(revision 178)
@@ -0,0 +1,11 @@
+
+namespace Exception{
+
+	void TryCommand();
+	void CatchCommand();
+	void FinallyCommand();
+	void EndTryCommand();
+
+	void ThrowCommand( const char *Parameter );
+
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/include/Member.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/include/Member.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/include/Member.h	(revision 178)
@@ -0,0 +1,65 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "Type.h"
+
+using namespace std;
+
+class CClass;
+
+class CMember : public MemberPrototype
+{
+	string name;
+	Type type;
+	bool isConst;
+
+	string initializeExpression;
+	string constructParameter;
+public:
+	int SubScripts[MAX_ARRAYDIM];
+
+	int source_code_address;
+
+	const string &GetName() const
+	{
+		return name;
+	}
+	void SetName( const string &name )
+	{
+		this->name = name;
+	}
+
+	Type GetType() const
+	{
+		return type;
+	}
+
+	bool IsConst()
+	{
+		return isConst;
+	}
+
+	const string &GetInitializeExpression() const
+	{
+		return initializeExpression;
+	}
+	const string &GetConstructParameter() const
+	{
+		return constructParameter;
+	}
+
+	CMember( Prototype::Accessibility accessibility, const string &name, const Type &type, bool isConst )
+		: MemberPrototype( accessibility )
+		, name( name )
+		, type( type )
+		, isConst( isConst )
+	{
+	}
+	CMember( CClass *pobj_c, Prototype::Accessibility accessibility, bool idConst, bool isRef, char *buffer, int nowLine=-1 );
+	CMember( CMember &member );
+	~CMember();
+	static void InitStaticMember(void);
+};
+typedef std::vector<CMember *> Members;
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/include/Method.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/include/Method.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/include/Method.h	(revision 178)
@@ -0,0 +1,125 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "../Class.h"
+#include <windows.h>
+
+using namespace std;
+
+class UserProc;
+class CClass;
+void SetError();
+
+class CMethod : public MemberPrototype
+{
+public:
+	UserProc *pUserProc;
+
+	CMethod( UserProc *pUserProc, Prototype::Accessibility accessibility )
+		: MemberPrototype( accessibility )
+		, pUserProc( pUserProc )
+	{
+	}
+
+	virtual bool IsAbstract() const = 0;
+	virtual void Override() = 0;
+	virtual bool IsVirtual() const = 0;
+	virtual bool IsConst() const = 0;
+	virtual bool IsStatic() const = 0;
+	virtual const CClass *GetInheritsClassPtr() const = 0;
+	virtual void SetInheritsClassPtr( const CClass *pInheritsClass ) = 0;
+};
+
+class DynamicMethod : public CMethod
+{
+	bool isAbstract;
+	bool isVirtual;
+	bool isConst;
+	const CClass *pInheritsClass;
+
+public:
+	DynamicMethod( UserProc *pUserProc, Prototype::Accessibility accessibility, bool isAbstract, bool isVirtual, bool isConst, const CClass *pInheritsClass = NULL )
+		: CMethod( pUserProc, accessibility )
+		, isAbstract( isAbstract )
+		, isVirtual( isVirtual )
+		, isConst( isConst )
+		, pInheritsClass( pInheritsClass )
+	{
+	}
+	DynamicMethod( const CMethod &method )
+		: CMethod( method.pUserProc, method.GetAccessibility() )
+		, isAbstract( method.IsAbstract() )
+		, isVirtual( method.IsVirtual() )
+		, isConst( method.IsConst() )
+		, pInheritsClass( method.GetInheritsClassPtr() )
+	{
+	}
+
+	virtual bool IsAbstract() const
+	{
+		return isAbstract;
+	}
+	virtual void Override()
+	{
+		isAbstract = false;
+	}
+	virtual bool IsVirtual() const
+	{
+		return isVirtual;
+	}
+	virtual bool IsConst() const
+	{
+		return isConst;
+	}
+	virtual bool IsStatic() const
+	{
+		return false;
+	}
+	virtual const CClass *GetInheritsClassPtr() const
+	{
+		return pInheritsClass;
+	}
+	virtual void SetInheritsClassPtr( const CClass *pInheritsClass )
+	{
+		this->pInheritsClass = pInheritsClass;
+	}
+};
+class StaticMethod : public CMethod
+{
+public:
+	StaticMethod( UserProc *pUserProc, Prototype::Accessibility accessibility )
+		: CMethod( pUserProc, accessibility )
+	{
+	}
+
+	virtual bool IsAbstract() const{SetError();return false;}
+	virtual void Override(){SetError();}
+	virtual bool IsVirtual() const{
+		return false;
+	}
+	virtual bool IsConst() const{SetError();return false;}
+	virtual bool IsStatic() const
+	{
+		return true;
+	}
+	virtual const CClass *GetInheritsClassPtr() const{SetError();return NULL;}
+	virtual void SetInheritsClassPtr( const CClass *pInheritsClass ){SetError();}
+};
+
+class Methods : public vector<CMethod *>
+{
+public:
+	Methods();
+	~Methods();
+
+	//メンバ、メソッドの追加
+	void Add( UserProc *pUserProc, Prototype::Accessibility accessibility, bool isConst, bool isAbstract, bool isVirtual );
+	void AddStatic(UserProc *pUserProc,Prototype::Accessibility accessibility);
+
+	const CMethod *GetMethodPtr( UserProc *pUserProc ) const;
+	bool IsExist( const char *name ) const;
+	virtual void Enum( const char *methodName, vector<UserProc *> &subs ) const;
+	virtual void Enum( const BYTE idOperatorCalc, vector<UserProc *> &subs ) const;
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/include/Namespace.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/include/Namespace.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/include/Namespace.h	(revision 178)
@@ -0,0 +1,135 @@
+#pragma once
+
+#include <vector>
+#include <string>
+#include <boost/foreach.hpp>
+
+using namespace std;
+
+class NamespaceScopes : public vector<string>
+{
+public:
+	NamespaceScopes(){}
+	NamespaceScopes( const string &namespaceStr );
+	~NamespaceScopes(){}
+
+	string ToString() const
+	{
+		string namespaceStr;
+		const vector<string> &me = *this;
+
+		bool isFirst = true;
+		BOOST_FOREACH( const string &itemStr, me ){
+			if( isFirst ){
+				isFirst = false;
+			}
+			else{
+				namespaceStr += ".";
+			}
+
+			namespaceStr += itemStr;
+		}
+		return namespaceStr;
+	}
+
+	// 等しいかをチェック
+	bool IsEqual( const string &name ) const
+	{
+		if( ToString() == name ){
+			return true;
+		}
+		return false;
+	}
+
+	// 等しいかをチェック
+	bool IsEqual( const NamespaceScopes &namespaceScopes ) const
+	{
+		if( ToString() == namespaceScopes.ToString() ){
+			return true;
+		}
+		return false;
+	}
+
+	// 所属しているかをチェック
+	// 例:
+	// baseNamespaceScopes =  "Discoversoft"
+	// entryNamespaceScopes = "Discoversoft.ActiveBasic"
+	// この場合、entryNamespaceScopes は baseNamespaceScopes に所属している。
+	static bool IsBelong( const NamespaceScopes &baseNamespaceScopes, const NamespaceScopes &entryNamespaceScopes )
+	{
+		if( baseNamespaceScopes.size() > entryNamespaceScopes.size() ){
+			return false;
+		}
+
+		for( int i=0; i<(int)baseNamespaceScopes.size(); i++ ){
+			if( baseNamespaceScopes[i] != entryNamespaceScopes[i] ){
+				return false;
+			}
+		}
+		return true;
+	}
+
+	bool IsImported() const;
+
+	bool IsLiving() const;
+
+	// 包括しているかをチェック
+	// 例:
+	// this =   "Discoversoft.ActiveBasic"
+	// living = "Discoversoft.ActiveBasic"
+	// name =   "ActiveBasic"
+	// この場合、living は name を包括している。
+	bool IsCoverd( const string &name ) const;
+	bool IsCoverd( const NamespaceScopes &namespaceScopes ) const;
+
+	// 指定された名前空間が同一エリアと見なされるかどうかをチェック
+	static bool IsSameArea( const NamespaceScopes &baseNamespaceScopes, const NamespaceScopes &entryNamespaceScopes ){
+		if( entryNamespaceScopes.size() ){
+			if( baseNamespaceScopes.IsCoverd( entryNamespaceScopes ) ){
+				// 包括しているときは同一と見なす
+				return true;
+			}
+		}
+		else{
+			if( baseNamespaceScopes.size() ){
+				// 名前空間の判断が必要なとき
+				if( baseNamespaceScopes.IsImported()
+					|| baseNamespaceScopes.IsLiving() ){
+					// Using指定があるとき
+					// または
+					// 指定された名前空間が現在の名前空間スコープと同一のとき
+					return true;
+				}
+			}
+			else{
+				return true;
+			}
+		}
+
+		return false;
+	}
+};
+
+class NamespaceScopesCollection : public vector<NamespaceScopes>
+{
+public:
+	bool IsExist( const NamespaceScopes &namespaceScopes ) const
+	{
+		const NamespaceScopesCollection &namespaceScopesCollection = *this;
+		BOOST_FOREACH( const NamespaceScopes &tempNamespaceScopes, namespaceScopesCollection ){
+			if( tempNamespaceScopes.IsEqual( namespaceScopes ) ){
+				return true;
+			}
+		}
+		return false;
+	}
+	bool IsExist( const string &namespaceStr ) const
+	{
+		return IsExist( NamespaceScopes( namespaceStr ) );
+	}
+	void SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const;
+
+	bool Imports( const string &namespaceStr );
+
+	static bool CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection );
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/include/ObjectModule.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/include/ObjectModule.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/include/ObjectModule.h	(revision 178)
@@ -0,0 +1,22 @@
+#pragma once
+
+#include "../TypeDef.h"
+#include "Namespace.h"
+
+// プロジェクト中に存在するメタ情報
+class Meta{
+public:
+	// 名前空間
+	NamespaceScopesCollection namespaceScopesCollection;
+
+	// クラス
+
+	// TypeDef
+	TypeDefCollection typeDefs;
+
+	// 関数ポインタ
+	vector<ProcPointer *> procPointers;
+
+	// blittable型
+	BlittableTypes blittableTypes;
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/include/Program.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/include/Program.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/include/Program.h	(revision 178)
@@ -0,0 +1,9 @@
+#pragma once
+
+#include <jenga/include/common/logger.h>
+
+class Program
+{
+public:
+	static Jenga::Common::Logger logger;
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/include/Prototype.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/include/Prototype.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/include/Prototype.h	(revision 178)
@@ -0,0 +1,114 @@
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include <Namespace.h>
+
+using namespace std;
+
+class CMethod;
+class UserProc;
+
+class Prototype
+{
+public:
+	enum Accessibility{
+		None,
+		Private,
+		Protected,
+		Public,
+	};
+
+private:
+	// 名前空間
+	NamespaceScopes namespaceScopes;
+
+	//名前
+	string name;
+
+	mutable bool isUsing;
+
+public:
+
+	Prototype( const NamespaceScopes &namespaceScopes, const string &name )
+		: namespaceScopes( namespaceScopes )
+		, name( name )
+		, isUsing( false )
+	{
+	}
+	~Prototype()
+	{
+	}
+
+	// 名前空間
+	const NamespaceScopes &GetNamespaceScopes() const
+	{
+		return namespaceScopes;
+	}
+
+	const string &GetName() const
+	{
+		return name;
+	}
+
+	//自身と等しいかどうかを確認
+	bool IsEquals( const Prototype *prototype ) const
+	{
+		if( this == prototype ){
+			return true;
+		}
+		return false;
+	}
+
+	// シンボル比較
+	bool IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const;
+	bool IsEqualSymbol( const Prototype &prototype ) const;
+	bool IsEqualSymbol( const string &name ) const;
+
+	// 利用状況
+	bool IsUsing() const
+	{
+		return isUsing;
+	}
+	void Using() const
+	{
+		isUsing = true;
+	}
+
+};
+
+class MemberPrototype
+{
+	Prototype::Accessibility accessibility;
+public:
+	MemberPrototype( Prototype::Accessibility accessibility )
+		: accessibility( accessibility )
+	{
+	}
+
+	Prototype::Accessibility GetAccessibility() const
+	{
+		return accessibility;
+	}
+	void SetAccessibility( Prototype::Accessibility accessibility ){
+		this->accessibility = accessibility;
+	}
+
+	bool IsNoneAccess() const
+	{
+		return ( accessibility == Prototype::None );
+	}
+	bool IsPrivate() const
+	{
+		return ( accessibility == Prototype::Private );
+	}
+	bool IsProtected() const
+	{
+		return ( accessibility == Prototype::Protected );
+	}
+	bool IsPublic() const
+	{
+		return ( accessibility == Prototype::Public );
+	}
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/include/Smoothie.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/include/Smoothie.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/include/Smoothie.h	(revision 178)
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "Source.h"
+#include "ObjectModule.h"
+
+class Smoothie{
+public:
+
+	class Lexical{
+	public:
+		static string baseProjectDirPath;
+		static BasicSource source;
+		static NamespaceScopes liveingNamespaceScopes;
+	};
+
+	// コンパイル中に一時的に利用する
+	class Temp{
+	public:
+		// 現在インポートされている名前空間
+		static NamespaceScopesCollection importedNamespaces;
+	};
+
+	// プロジェクト中に存在するメタ情報
+	static Meta meta;
+
+	static bool isFullCompile;
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/include/Source.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/include/Source.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/include/Source.h	(revision 178)
@@ -0,0 +1,76 @@
+#pragma once
+
+#include <vector>
+#include <string>
+
+#include <windows.h>
+#include <stdlib.h>
+
+using namespace std;
+
+class Text{
+protected:
+	char *buffer;
+	int length;
+
+public:
+
+	Text(){
+		buffer = (char *)calloc( 1, 1 );
+		length = 0;
+	}
+	~Text(){
+		free( buffer );
+	}
+
+	bool ReadFile( const string &filePath );
+};
+
+class BasicSource : public Text
+{
+	static const string generateDirectiveName;
+
+	void Realloc( int newLength ){
+		buffer = (char *)realloc( buffer, newLength + 255 );
+
+		length = newLength;
+
+		extern char *basbuf;
+		basbuf = buffer + 2;
+	}
+
+	void IncludeFiles();
+
+	void ChangeReturnLineChar();
+
+	void RemoveComments();
+
+	bool ReadFile_InIncludeDirective( const string &filePath );
+	void DirectiveIncludeOrRequire();
+
+	void RemoveReturnLineUnderbar();
+
+public:
+	BasicSource(){}
+	~BasicSource(){}
+
+	char *GetBuffer(){
+		return buffer+2;
+	}
+	int GetLength(){
+		return length-2;
+	}
+
+	void SetBuffer( const char *buffer );
+
+	bool ReadFile( const string &filePath );
+
+	bool Generate( const string &genName, const char *buffer );
+
+	void Addition( const char *buffer );
+
+	void operator = ( const BasicSource &source ){
+		Realloc( source.length );
+		lstrcpy( buffer, source.buffer );
+	}
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/include/Symbol.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/include/Symbol.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/include/Symbol.h	(revision 178)
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <vector>
+#include <string>
+
+#include <Namespace.h>
+
+using namespace std;
+
+class Symbol
+{
+	NamespaceScopes namespaceScopes;
+	string name;
+public:
+	Symbol( const NamespaceScopes &namespaceScopes, const string &name )
+		: namespaceScopes( namespaceScopes )
+		, name( name )
+	{
+	}
+	Symbol( const char *fullName );
+	Symbol( const string &fullName );
+
+	const NamespaceScopes &GetNamespaceScopes() const
+	{
+		return namespaceScopes;
+	}
+	const string &GetName() const
+	{
+		return name;
+	}
+};
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/include/option.h
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/include/option.h	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/include/option.h	(revision 178)
@@ -0,0 +1,54 @@
+/////////////////////////////////////////////////////////////////////
+// コンパイル オプション
+/////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////
+// ここから
+
+// バージョン
+#define MAJOR_VER		5
+#define MINOR_VER		00
+#define REVISION_VER	00
+
+// バージョン付加文字列
+#ifdef _AMD64_
+#define VER_INFO		"(x64) (rev.280)"
+#else
+#define VER_INFO		"(rev.280)"
+#endif
+
+
+// ログ関係
+
+// ログ生成しない場合はこの下の行をコメントアウトする
+#define USE_TRACE
+
+// オーバーロードに関するログを生成する
+#define USE_TRACE_FOR_OVERLOAD
+
+// モジュールサイズに関するログを生成する
+#define USE_TRACE_FOR_SIZE
+
+
+// ここまで
+/////////////////////////////
+
+
+#ifdef USE_TRACE
+#define trace(s) Program::logger << s << endl
+#else
+#define trace(s)
+#endif
+
+#ifdef USE_TRACE_FOR_OVERLOAD
+#define trace_for_overload(s) trace(s)
+#else
+#define trace_for_overload(s)
+#endif
+
+#ifdef USE_TRACE_FOR_SIZE
+#define trace_for_size(s) trace(s)
+#else
+#define trace_for_size(s)
+#endif
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/src/Exception.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/src/Exception.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/src/Exception.cpp	(revision 178)
@@ -0,0 +1,19 @@
+#include <Exception.h>
+
+namespace Exception{
+
+
+void TryCommand(){
+}
+void CatchCommand(){
+}
+void FinallyCommand(){
+}
+void EndTryCommand(){
+}
+
+void ThrowCommand( const char *Parameter ){
+}
+
+
+}	// Exception
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/src/Member.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/src/Member.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/src/Member.cpp	(revision 178)
@@ -0,0 +1,92 @@
+#include "../common.h"
+#ifdef _AMD64_
+#include "../../BasicCompiler64/opcode.h"
+#else
+#include "../../BasicCompiler32/opcode.h"
+#endif
+#include <Member.h>
+
+CMember::CMember( CClass *pobj_c, Prototype::Accessibility accessibility, bool isConst, bool isRef, char *buffer, int nowLine )
+	: MemberPrototype( accessibility )
+{
+	extern int cp;
+
+	//構文を解析
+	char VarName[VN_SIZE];
+	char initBuffer[VN_SIZE];
+	char lpszConstructParameter[VN_SIZE];
+	GetDimentionFormat(buffer,VarName,SubScripts,type,initBuffer,lpszConstructParameter);
+
+	//重複チェック
+	if(pobj_c->DupliCheckAll(VarName)){
+		SetError(15,VarName,cp);
+	}
+
+	//メンバ名
+	name = VarName;
+
+	//定数扱いかどうか
+	this->isConst = isConst;
+
+	//初期データ
+	initializeExpression = initBuffer;
+
+	//コンストラクタ用のパラメータ
+	constructParameter = lpszConstructParameter;
+
+	//ソースコードの位置
+	source_code_address=nowLine;
+}
+CMember::CMember(CMember &member)
+	: MemberPrototype( member.GetAccessibility() )
+	, name( member.GetName() )
+	, type( member.GetType() )
+	, isConst( member.IsConst() )
+{
+	//SubScripts
+	memcpy(SubScripts,member.SubScripts,MAX_ARRAYDIM*sizeof(int));
+
+	//ソースコードの位置
+	source_code_address=member.source_code_address;
+}
+CMember::~CMember(){
+}
+
+void CMember::InitStaticMember(void){
+	//静的メンバをグローバル領域に作成
+
+	//イテレータをリセット
+	extern Classes *pobj_DBClass;
+	pobj_DBClass->Iterator_Reset();
+
+	int back_cp=cp;
+
+	while(pobj_DBClass->Iterator_HasNext()){
+		CClass &objClass = *pobj_DBClass->Iterator_GetNext();
+
+		// 名前空間をセット
+		Smoothie::Lexical::liveingNamespaceScopes = objClass.GetNamespaceScopes();
+
+		int i=0;
+		foreach( CMember *member, objClass.staticMembers ){
+			char temporary[VN_SIZE];
+			sprintf(temporary,"%s.%s",objClass.GetName().c_str(),member->GetName().c_str());
+			dim(
+				temporary,
+				member->SubScripts,
+				member->GetType(),
+				member->GetInitializeExpression().c_str(),
+				member->GetConstructParameter().c_str(),
+				0);
+
+			//ネイティブコードバッファの再確保
+			ReallocNativeCodeBuffer();
+
+			i++;
+		}
+	}
+
+	Smoothie::Lexical::liveingNamespaceScopes.clear();
+
+	cp=back_cp;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/src/Method.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/src/Method.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/src/Method.cpp	(revision 178)
@@ -0,0 +1,70 @@
+#include "../common.h"
+#include <Method.h>
+
+
+Methods::Methods()
+{
+}
+Methods::~Methods()
+{
+	Methods &methods = *this;
+	BOOST_FOREACH( CMethod *pMethod, methods ){
+		delete pMethod;
+	}
+}
+
+void Methods::Add( UserProc *pUserProc,Prototype::Accessibility accessibility, bool isConst, bool isAbstract, bool isVirtual ){
+	CMethod *pMethod = new DynamicMethod( pUserProc, accessibility, isAbstract, isVirtual, isConst );
+	this->push_back( pMethod );
+	pUserProc->SetMethod( pMethod );
+}
+void Methods::AddStatic(UserProc *pUserProc, Prototype::Accessibility accessibility ){
+	CMethod *pMethod = new StaticMethod( pUserProc, accessibility );
+	this->push_back( pMethod );
+	pUserProc->SetMethod( pMethod );
+}
+
+const CMethod *Methods::GetMethodPtr( UserProc *pUserProc ) const
+{
+	const Methods &methods = *this;
+	for( int i=(int)methods.size()-1; i>=0; i-- ){
+		if( pUserProc == methods[i]->pUserProc ){
+			return methods[i];
+		}
+	}
+	return NULL;
+}
+bool Methods::IsExist( const char *name ) const
+{
+	const Methods &methods = *this;
+	foreach( const CMethod *pMethod, methods ){
+		if( pMethod->pUserProc->GetName() == name ) return true;
+	}
+	return false;
+}
+void Methods::Enum( const char *methodName, vector<UserProc *> &subs ) const
+{
+	//オブジェクトのメンバ関数の場合
+	//※オーバーライドされた関数を先にサーチする必要があるため、バックサーチを行う
+	const Methods &methods = *this;
+	for( int i=(int)methods.size()-1; i>=0; i-- ){
+		if( methods[i]->pUserProc->GetName() == methodName ){
+			subs.push_back( methods[i]->pUserProc );
+		}
+	}
+}
+void Methods::Enum( const BYTE idOperatorCalc, vector<UserProc *> &subs ) const
+{
+	//オブジェクトのメンバ関数の場合
+	//※オーバーライドされた関数を先にサーチする必要があるため、バックサーチを行う
+	const Methods &methods = *this;
+	for( int i=(int)methods.size()-1; i>=0; i-- ){
+		UserProc *pUserProc = methods[i]->pUserProc;
+		const char *temp = pUserProc->GetName().c_str();
+		if(temp[0]==1&&temp[1]==ESC_OPERATOR){
+			if((BYTE)temp[2]==idOperatorCalc){
+				subs.push_back( pUserProc );
+			}
+		}
+	}
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/src/Namespace.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/src/Namespace.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/src/Namespace.cpp	(revision 178)
@@ -0,0 +1,162 @@
+#include "../common.h"
+
+
+NamespaceScopes::NamespaceScopes( const string &namespaceStr ){
+	if( namespaceStr.size() == 0 ){
+		return;
+	}
+
+	string::size_type i = 0;
+	while( true ){
+		string::size_type i2 = namespaceStr.find( '.', i );
+
+		string tempName = namespaceStr.substr( i, i2-i );
+
+		push_back( tempName );
+
+		if( i2 == string::npos ){
+			break;
+		}
+
+		i = i2 + 1;
+	}
+}
+
+bool NamespaceScopes::IsImported() const
+{
+	BOOST_FOREACH( const NamespaceScopes &namespaceScopes, Smoothie::Temp::importedNamespaces ){
+		if( this->IsEqual( namespaceScopes ) ){
+			return true;
+		}
+	}
+	return false;
+}
+bool NamespaceScopes::IsLiving() const
+{
+	if( IsBelong( *this, Smoothie::Lexical::liveingNamespaceScopes ) ){
+		return true;
+	}
+	return false;
+}
+
+// 包括しているかをチェック
+// 例:
+// this =   "Discoversoft.ActiveBasic"
+// living = "Discoversoft.ActiveBasic"
+// name =   "ActiveBasic"
+// この場合、living は name を包括している。
+bool NamespaceScopes::IsCoverd( const string &name ) const
+{
+	if( IsEqual( name ) ){
+		return true;
+	}
+
+	string thisStr = ToString();
+
+	NamespaceScopes tempLivingNamespaceScopes = Smoothie::Lexical::liveingNamespaceScopes;
+
+	while( tempLivingNamespaceScopes.size() ){
+		NamespaceScopes tempNamespaceScopes = tempLivingNamespaceScopes;
+
+		string tempStr = tempNamespaceScopes.ToString() + "." + name;
+		if( thisStr == tempStr ){
+			return true;
+		}
+
+		tempLivingNamespaceScopes.pop_back();
+	}
+	return false;
+}
+bool NamespaceScopes::IsCoverd( const NamespaceScopes &namespaceScopes ) const
+{
+	return IsCoverd( namespaceScopes.ToString() );
+}
+
+
+void NamespaceScopesCollection::SplitNamespace( const char *fullName, char *namespaceStr, char *simpleName ) const
+{
+	NamespaceScopes namespaceScopes( fullName );
+	bool hasSimpleName = false;
+	while( namespaceScopes.size() > 0 ){
+		if( IsExist( namespaceScopes ) ){
+			break;
+		}
+		namespaceScopes.pop_back();
+
+		hasSimpleName = true;
+	}
+
+	lstrcpy( namespaceStr, namespaceScopes.ToString().c_str() );
+
+	bool hasNamespace = false;
+	if( namespaceStr[0] ){
+		hasNamespace = true;
+	}
+
+	int dotLength = 0;
+	if( hasSimpleName && hasNamespace ){
+		dotLength = 1;
+	}
+
+	lstrcpy( simpleName, fullName + lstrlen( namespaceStr ) + dotLength );
+}
+bool NamespaceScopesCollection::Imports( const string &namespaceStr ){
+	NamespaceScopes namespaceScopes( namespaceStr );
+	if( !Smoothie::meta.namespaceScopesCollection.IsExist( namespaceScopes ) ){
+		return false;
+	}
+
+	this->push_back( namespaceScopes );
+
+	return true;
+}
+bool NamespaceScopesCollection::CollectNamespaces( const char *source, NamespaceScopesCollection &namespaceScopesCollection )
+{
+	int i, i2;
+	char temporary[VN_SIZE];
+
+	bool isSuccessful = true;
+
+	// 名前空間管理
+	NamespaceScopes namespaceScopes;
+
+	for(i=0;;i++){
+		if(source[i]=='\0') break;
+
+		if( source[i] == 1 && source[i+1] == ESC_NAMESPACE ){
+			for(i+=2,i2=0;;i2++,i++){
+				if( IsCommandDelimitation( source[i] ) ){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=source[i];
+			}
+			namespaceScopes.push_back( temporary );
+
+			if( !namespaceScopesCollection.IsExist( namespaceScopes ) ){
+				namespaceScopesCollection.push_back( namespaceScopes );
+			}
+
+			continue;
+		}
+		else if( source[i] == 1 && source[i+1] == ESC_ENDNAMESPACE ){
+			if( namespaceScopes.size() <= 0 ){
+				SetError(12, "End Namespace", i );
+				isSuccessful = false;
+			}
+			else{
+				namespaceScopes.pop_back();
+			}
+
+			i += 2;
+			continue;
+		}
+	}
+
+	if( namespaceScopes.size() > 0 ){
+		SetError(63,NULL,-1);
+		isSuccessful = false;
+	}
+
+	return isSuccessful;
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/src/Program.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/src/Program.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/src/Program.cpp	(revision 178)
@@ -0,0 +1,5 @@
+#include <jenga/include/common/Environment.h>
+
+#include <Program.h>
+
+Jenga::Common::Logger Program::logger( Jenga::Common::Environment::GetAppDir() + "\\logger.log" );
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/src/Prototype.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/src/Prototype.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/src/Prototype.cpp	(revision 178)
@@ -0,0 +1,23 @@
+#include "../common.h"
+#include <Prototype.h>
+
+bool Prototype::IsEqualSymbol( const NamespaceScopes &namespaceScopes, const string &name ) const
+{
+	if( GetName() != name ){
+		return false;
+	}
+
+	return NamespaceScopes::IsSameArea( GetNamespaceScopes(), namespaceScopes );
+}
+bool Prototype::IsEqualSymbol( const Prototype &prototype ) const
+{
+	return IsEqualSymbol( prototype.GetNamespaceScopes(), prototype.GetName() );
+}
+bool Prototype::IsEqualSymbol( const string &fullName ) const
+{
+	char AreaName[VN_SIZE] = "";		//オブジェクト変数
+	char NestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName.c_str(), AreaName, NestName );
+
+	return IsEqualSymbol( NamespaceScopes( AreaName ), NestName );
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/src/Smoothie.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/src/Smoothie.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/src/Smoothie.cpp	(revision 178)
@@ -0,0 +1,9 @@
+#include <..\common.h>
+
+BasicSource Smoothie::Lexical::source;
+NamespaceScopes Smoothie::Lexical::liveingNamespaceScopes;
+
+Meta Smoothie::meta;
+NamespaceScopesCollection Smoothie::Temp::importedNamespaces;
+
+bool Smoothie::isFullCompile = false;
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/src/Source.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/src/Source.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/src/Source.cpp	(revision 178)
@@ -0,0 +1,913 @@
+#include <Source.h>
+
+#include "../common.h"
+#include <windows.h>
+
+
+const string BasicSource::generateDirectiveName = "#generate";
+
+
+class CDefine{
+	vector<string> names;
+public:
+	CDefine();
+	~CDefine();
+	void Free();
+	void Init();
+
+	BOOL add(char *name);
+	BOOL undef(char *name);
+	BOOL check(char *name);
+	void preprocessor_ifdef(char *buffer,bool isNot);
+	void DirectiveIfdef(char *buffer);
+};
+CDefine objDefine;
+
+
+//////////////////////////////////////
+// #requireの管理
+//////////////////////////////////////
+class CRequireFiles{
+	char **ppFilePath;
+	int count;
+public:
+	CRequireFiles(){
+		ppFilePath = (char **)malloc( 1 );
+		count = 0;
+	}
+	~CRequireFiles(){
+		for( int i = 0; i < count; i++ ){
+			free( ppFilePath[i] );
+		}
+		free( ppFilePath );
+	}
+	void clear(){
+		for( int i = 0; i < count; i++ ){
+			free( ppFilePath[i] );
+		}
+		free( ppFilePath );
+
+		ppFilePath = (char **)malloc( 1 );
+		count = 0;
+	}
+	bool IsIncluded( const char *includeFilePath ){
+		// '/' → '\\'
+		char tempPath[MAX_PATH];
+		lstrcpy( tempPath, includeFilePath );
+		for( int i=0; tempPath[i]; i++ ){
+			if( tempPath[i] == '/' ){
+				tempPath[i] = '\\';
+			}
+		}
+
+		for( int i=0; i<count; i++ ){
+			if( lstrcmpi( ppFilePath[i], tempPath ) == 0 ){
+				return true;
+			}
+		}
+		return false;
+	}
+	void Add( const char *includeFilePath ){
+		// '/' → '\\'
+		char tempPath[MAX_PATH];
+		lstrcpy( tempPath, includeFilePath );
+		for( int i=0; tempPath[i]; i++ ){
+			if( tempPath[i] == '/' ){
+				tempPath[i] = '\\';
+			}
+		}
+
+		//既に読み込まれているとき
+		if( IsIncluded( tempPath ) ) return;
+
+		//追加
+		ppFilePath = (char **)realloc(ppFilePath, ( count + 1 ) * sizeof(char *) );
+		ppFilePath[count] = (char *)malloc( lstrlen(tempPath) + 1 );
+		lstrcpy( ppFilePath[count], tempPath );
+		count++;
+	}
+};
+CRequireFiles requireFiles;
+
+
+//////////////////////////////////////
+// #define間するクラス
+//////////////////////////////////////
+
+CDefine::CDefine(){
+	Init();
+}
+CDefine::~CDefine(){
+}
+void CDefine::Init(){
+	names.clear();
+
+	extern BOOL bDebugCompile;
+	if(bDebugCompile) add("_DEBUG");
+
+#ifdef _AMD64_
+	add("_WIN64");
+#endif
+
+	extern BOOL bDll;
+	if( bDll ){
+		add("_DLL");
+	}
+
+	extern bool isUnicode;
+	if( isUnicode ){
+		add( "UNICODE" );
+	}
+
+	char temporary[255];
+	sprintf(temporary,"_AB_VER%d",MAJOR_VER);
+	add(temporary);
+}
+BOOL CDefine::add(char *name){
+	extern HANDLE hHeap;
+
+	//重複チェック
+	if(check(name)) return 0;
+
+	//追加
+	names.push_back( name );
+
+	return 1;
+}
+BOOL CDefine::undef(char *name){
+	vector<string>::iterator i = names.begin();
+	foreach( const string &temp, names ){
+		if( temp == name ){
+			names.erase( i );
+			return 1;
+		}
+		i++;
+	}
+
+	return 0;
+}
+BOOL CDefine::check(char *name){
+
+	//重複チェック
+	foreach( const string &temp, names ){
+		if( temp == name ){
+			return 1;
+		}
+	}
+	return 0;
+}
+
+int Search_endif(char *buffer,int i, int *pLine = 0){
+	for(;;i++){
+		if(buffer[i]=='\0') break;
+
+		if( buffer[i] == '\n' ){
+			if( pLine ){
+				(*pLine)++;
+			}
+		}
+
+		if(buffer[i-1]=='\n'){
+			if(memicmp(buffer+i,"#ifdef",6)==0||memicmp(buffer+i,"#ifndef",7)==0){
+				i=Search_endif(buffer,i+6, pLine);
+				if(buffer[i]=='\0') break;
+				continue;
+			}
+			else if(memicmp(buffer+i,"#endif",6)==0){
+				break;
+			}
+		}
+	}
+	return i;
+}
+
+void CDefine::preprocessor_ifdef(char *buffer,bool isNot){
+	int i,i2,i3;
+	char temporary[VN_SIZE];
+
+	if(isNot) i=lstrlen("#ifndef");
+	else i=lstrlen("#ifdef");
+	while(buffer[i]==' '||buffer[i]=='\t') i++;
+
+	for(i2=0;;i++,i2++){
+		if(buffer[i]=='\n'||buffer[i]=='\0'){
+			temporary[i2]=0;
+			break;
+		}
+		temporary[i2]=buffer[i];
+	}
+
+	int sw=0;
+	if(check(temporary)) sw=1;
+
+	if(isNot){
+		//#ifndefのとき（反対にする）
+		if(sw) sw=0;
+		else sw=1;
+	}
+
+	//#ifdefの行を消去
+	SlideString(buffer+i,-i);
+	i=0;
+
+	BOOL bElse=0;
+	if(sw){
+		//TRUEのとき
+
+		//#else、#endifを探索
+		for(;;i++){
+			if(buffer[i]=='\0') break;
+
+			if(i==0||buffer[i-1]=='\n'){
+				if(memicmp(buffer+i,"#ifdef",6)==0||memicmp(buffer+i,"#ifndef",7)==0){
+					i=Search_endif(buffer,i+6);
+					if(buffer[i]=='\0') break;
+					continue;
+				}
+				else if(memicmp(buffer+i,"#else",5)==0){
+					i2=5;
+					bElse=1;
+					break;
+				}
+				else if(memicmp(buffer+i,"#endif",6)==0){
+					i2=6;
+					bElse=0;
+					break;
+				}
+			}
+		}
+
+		//行を消去
+		SlideString(buffer+i+i2,-i2);
+
+		if(bElse){
+			//#elseがある場合はその区間を消去
+
+			for(i2=i,i3=0;;i2++){
+				if(buffer[i2]=='\0') break;
+
+				if(buffer[i2]=='\n') i3++;
+
+				if(i2==0||buffer[i2-1]=='\n'){
+					if(memicmp(buffer+i2,"#ifdef",6)==0||memicmp(buffer+i2,"#ifndef",7)==0){
+						i2=Search_endif(buffer,i2+6, &i3 );
+						if(buffer[i2]=='\0') break;
+						continue;
+					}
+					if(memicmp(buffer+i2,"#endif",6)==0){
+						i2+=6;
+						break;
+					}
+				}
+			}
+
+			//ソースコード区間を消去し、改行コードを挿入
+			SlideString(buffer+i2,i-i2+i3);
+			memset(buffer+i,'\n',i3);
+		}
+	}
+	else{
+		//FALSEのとき
+
+		//#else、#endifを探索
+		for(i2=i,i3=0;;i2++){
+			if(buffer[i2]=='\0') break;
+
+			if(buffer[i2]=='\n') i3++;
+
+			if(i2==0||buffer[i2-1]=='\n'){
+				if(memicmp(buffer+i2,"#ifdef",6)==0||memicmp(buffer+i2,"#ifndef",7)==0){
+					i2=Search_endif(buffer,i2+6, &i3 );
+					if(buffer[i2]=='\0') break;
+					continue;
+				}
+				else if(memicmp(buffer+i2,"#else",5)==0){
+					i2+=5;
+					bElse=1;
+					break;
+				}
+				else if(memicmp(buffer+i2,"#endif",6)==0){
+					i2+=6;
+					bElse=0;
+					break;
+				}
+			}
+		}
+
+		//ソースコード区間を消去し、改行コードを挿入
+		SlideString(buffer+i2,i-i2+i3);
+		memset(buffer+i,'\n',i3);
+
+		if(bElse){
+			//#endifを探索
+			for(;;i++){
+				if(buffer[i]=='\0') break;
+
+				if(i==0||buffer[i-1]=='\n'){
+					if(memicmp(buffer+i,"#ifdef",6)==0||memicmp(buffer+i,"#ifndef",7)==0){
+						i=Search_endif(buffer,i+6);
+						if(buffer[i]=='\0') break;
+						continue;
+					}
+					else if(memicmp(buffer+i,"#endif",6)==0){
+						i2=6;
+						bElse=0;
+						break;
+					}
+				}
+			}
+
+			//行を消去
+			SlideString(buffer+i+i2,-i2);
+		}
+	}
+}
+
+
+void CDefine::DirectiveIfdef(char *buffer){
+	int i,i2,i3,sw;
+	char temporary[VN_SIZE];
+
+	for(i=0;;i++){
+		if(buffer[i]=='\0') break;
+
+		if(i==0||(i>=1&&buffer[i-1]=='\n')){
+			sw=0;
+			if(memicmp(buffer+i,"#define",7)==0){
+				i2=i+7;
+				while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+
+				for(i3=0;;i2++,i3++){
+					if(buffer[i2]=='\n'||buffer[i2]=='\0'){
+						temporary[i3]=0;
+						break;
+					}
+					temporary[i3]=buffer[i2];
+				}
+
+				add(temporary);
+
+				i2-=i;
+
+				//ディレクティブを消去
+				SlideString(buffer+i+i2,-i2);
+			}
+			if(memicmp(buffer+i,"#undef",6)==0){
+				i2=i+7;
+				while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+
+				for(i3=0;;i2++,i3++){
+					if(buffer[i2]=='\n'||buffer[i2]=='\0'){
+						temporary[i3]=0;
+						break;
+					}
+					temporary[i3]=buffer[i2];
+				}
+
+				undef(temporary);
+
+				i2-=i;
+
+				//ディレクティブを消去
+				SlideString(buffer+i+i2,-i2);
+			}
+			else if(memicmp(buffer+i,"#ifdef",6)==0){
+				preprocessor_ifdef(buffer+i,false);
+				continue;
+			}
+			else if(memicmp(buffer+i,"#ifndef",7)==0){
+				preprocessor_ifdef(buffer+i,true);
+				continue;
+			}
+			else continue;
+		}
+	}
+}
+
+
+
+
+bool Text::ReadFile( const string &filePath ){
+	//ファイルオープン
+	HANDLE hFile=CreateFile(filePath.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE){
+		return false;
+	}
+
+	length = GetFileSize( hFile, NULL );
+
+	buffer = (char *)realloc( buffer, length + 1 );
+
+	//読み込み
+	DWORD dwAccBytes;
+	::ReadFile(hFile,buffer,length,&dwAccBytes,0);
+	buffer[dwAccBytes]=0;
+
+	//ファイルクローズ
+	CloseHandle(hFile);
+
+	return true;
+}
+
+void BasicSource::ChangeReturnLineChar(){
+	int i,i2;
+
+#ifdef _DEBUG
+	//改行コードの整合性チェック
+	for( i=0; ; i++ ){
+		if( buffer[i] == '\0' ){
+			break;
+		}
+		if( buffer[i]!='\r' && buffer[i+1]=='\n'
+			||  buffer[i]=='\r' && buffer[i+1]!='\n' ){
+				char temporary[255];
+				strncpy( temporary, buffer + i-100, 130 );
+				temporary[130] = 0;
+				for(int i2=0; ;i2++){
+					if(temporary[i2]=='\r') temporary[i2]='A';
+					if(temporary[i2]=='\n') temporary[i2]='B';
+					if(temporary[i2]=='\0') break;
+				}
+
+				extern HWND hOwnerEditor;
+				MessageBox( hOwnerEditor, temporary, "改行コードの整合性チェック", MB_OK | MB_ICONEXCLAMATION );
+		}
+	}
+#endif
+
+	//改行コードのCRLFをLFに変換
+	for(i=0,i2=0;;i++,i2++){
+		if(buffer[i]=='\r'&&buffer[i+1]=='\n') i++;
+		buffer[i2]=buffer[i];
+		if(buffer[i]=='\0') break;
+	}
+
+	length = i;
+}
+
+void BasicSource::RemoveComments(){
+	int i,i2,i3,IsStr;
+	char *temporary;
+	temporary=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(buffer)+1);
+	for(i=0,i2=0,i3=0,IsStr=0;;i++,i2++){
+		if(buffer[i]=='\"') IsStr^=1;
+		if(buffer[i]=='\n'||buffer[i]=='\0'){
+			i2--;
+			while(temporary[i2]==' '||temporary[i2]=='\t') i2--;
+			i2++;
+
+			if(i3){
+				//複数行に渡る注釈文の中に改行が存在するとき
+				memset(temporary+i2,'\n',i3);
+				i2+=i3;
+				i3=0;
+			}
+		}
+		if(buffer[i]=='\''&&IsStr==0){
+			//注釈文
+			i2--;
+			while(temporary[i2]==' '||temporary[i2]=='\t') i2--;
+			i2++;
+			while(buffer[i]!='\n'&&buffer[i]!='\0') i++;
+		}
+		if(buffer[i]=='/'&&buffer[i+1]=='*'&&IsStr==0){
+			//注釈文（複数行）
+			i+=2;
+			i3=0;
+			while(!(buffer[i]=='*'&&buffer[i+1]=='/')){
+				if(buffer[i]=='\n') i3++;
+				if(buffer[i]=='\0') break;
+				i++;
+			}
+			if(buffer[i]){
+				i+=2;
+			}
+			i--;
+			i2--;
+			continue;
+		}
+		temporary[i2]=buffer[i];
+		if(buffer[i]=='\0') break;
+	}
+	lstrcpy(buffer,temporary);
+	GlobalFree(temporary);
+}
+
+bool BasicSource::ReadFile_InIncludeDirective( const string &filePath ){
+	if( !Text::ReadFile( filePath ) ){
+		return false;
+	}
+
+	// 改行コードをCRLFからLFに変換
+	ChangeReturnLineChar();
+
+	// コメントを削除
+	RemoveComments();
+
+	// #ifdefディレクティブを処理
+	objDefine.DirectiveIfdef( buffer );
+
+	// アンダーバーによる改行を正規表現に戻す
+	RemoveReturnLineUnderbar();
+
+	// ダミー改行をセット
+	Realloc( length + 2 );
+	SlideString( buffer, 2 );
+	buffer[0] = '\n';
+	buffer[1] = '\n';
+
+	return true;
+}
+
+void BasicSource::DirectiveIncludeOrRequire(){
+	extern HANDLE hHeap;
+	extern char szIncludeDir[MAX_PATH];
+	extern char BasicCurDir[MAX_PATH];
+	extern INCLUDEFILEINFO IncludeFileInfo;
+	int i,i2,i3,sw1,LineNum,FileLayer[255],layer,LastFileByte[255];
+	char temporary[MAX_PATH],temp2[MAX_PATH+255],*LayerDir[255];
+
+	IncludeFileInfo.ppFileNames=(char **)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(char *));
+	extern char SourceFileName[MAX_PATH];
+	IncludeFileInfo.ppFileNames[0]=(char *)HeapAlloc(hHeap,0,lstrlen(SourceFileName)+1);
+	lstrcpy(IncludeFileInfo.ppFileNames[0],SourceFileName);
+	IncludeFileInfo.FilesNum=1;
+
+	layer=0;
+	FileLayer[layer]=0;
+	LastFileByte[layer]=GetLength();
+	LineNum=0;
+
+	//参照ディレクトリ
+	LayerDir[0]=(char *)HeapAlloc(hHeap,0,lstrlen(BasicCurDir)+1);
+	lstrcpy(LayerDir[0],BasicCurDir);
+
+	for(i=0;;i++){
+		if(buffer[i]=='\0'){
+			IncludeFileInfo.LineOfFile[LineNum]=-1;
+			break;
+		}
+		if(buffer[i]=='\n'){
+			IncludeFileInfo.LineOfFile[LineNum]=FileLayer[layer];
+			LineNum++;
+		}
+		if(i>LastFileByte[layer]){
+			HeapDefaultFree(LayerDir[layer]);
+			LayerDir[layer]=0;
+			layer--;
+		}
+		if((buffer[i-1]=='\n'||i==0)&&buffer[i]=='#'){
+			bool isRequire = false;
+			if(memcmp( buffer + i + 1, "include", 7 ) == 0
+				|| memcmp( buffer + i + 1, "require", 7 ) == 0){
+
+					//#requireの場合
+					if( buffer[i + 1] == 'r' ) isRequire = true;
+
+					i2=i+8;
+					while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+
+					if(buffer[i2]=='\"') sw1=0;
+					else if(buffer[i2]=='<') sw1=1;
+					i2++;
+
+					for(i3=0;;i2++,i3++){
+						if((buffer[i2]=='\"'&&sw1==0)||(buffer[i2]=='>'&&sw1==1)||buffer[i2]=='\n'||buffer[i2]=='\0'){
+							temporary[i3]=0;
+							break;
+						}
+						temporary[i3]=buffer[i2];
+					}
+					while(buffer[i2]!='\n'&&buffer[i2]!='\0') i2++;
+
+					if(sw1){
+						sprintf(temp2,"%s%s",szIncludeDir,temporary);
+						lstrcpy(temporary,temp2);
+					}
+					else GetFullPath(temporary,LayerDir[layer]);
+			}
+			else if(memcmp(buffer+i+1,"prompt",6)==0){
+				i2=i+7;
+				sprintf(temporary,"%sbasic\\prompt.sbp",szIncludeDir);
+			}
+			else if(memcmp(buffer+i+1,"N88BASIC",8)==0){
+				i2=i+9;
+				sprintf(temporary,"%sbasic\\prompt.sbp",szIncludeDir);
+			}
+			else if(memcmp(buffer+i+1,"console",7)==0){
+				//サブシステム タイプをCUIに変更
+				extern unsigned short TypeOfSubSystem;
+				TypeOfSubSystem=IMAGE_SUBSYSTEM_WINDOWS_CUI;
+
+				i2=i+8;
+				sprintf(temporary,"%sbasic\\dos_console.sbp",szIncludeDir);
+			}
+			else continue;
+
+			if(i){
+				//ディレクティブが消えるため、一行減ってしまうのを防ぐ（basic.sbpを除く）
+				SlideString(buffer+i2,1);
+				buffer[i2]='\n';
+				for(i3=0;i3<=layer;i3++) LastFileByte[i3]++;
+			}
+
+			IncludeFileInfo.ppFileNames=(char **)HeapReAlloc(hHeap,0,IncludeFileInfo.ppFileNames,(IncludeFileInfo.FilesNum+1)*sizeof(char *));
+			IncludeFileInfo.ppFileNames[IncludeFileInfo.FilesNum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+			lstrcpy(IncludeFileInfo.ppFileNames[IncludeFileInfo.FilesNum],temporary);
+
+			layer++;
+			FileLayer[layer]=IncludeFileInfo.FilesNum;
+			IncludeFileInfo.FilesNum++;
+
+			//#requireの場合では、既に読み込まれているファイルは読み込まないようにする
+			bool isFake = false;
+			if( isRequire ){
+				if( requireFiles.IsIncluded( temporary ) ){
+					//既に読み込まれているとき
+					isFake = true;
+				}
+			}
+
+			BasicSource source;
+
+			if( isFake ){
+				//既に読み込まれているときは空データ
+				source.SetBuffer( "" );
+			}
+			else{
+				//取り込まれたファイルを収集する
+				requireFiles.Add( temporary );
+
+				//インクルードファイルを読み込む
+				if( !source.ReadFile_InIncludeDirective( temporary ) ){
+					sprintf(temp2,"インクルードファイル \"%s\" をオープンできません",temporary);
+					SetError(-1,temp2,i);
+					break;
+				}
+			}
+
+			i3=lstrlen(buffer)+source.GetLength();
+			Realloc( i3 );
+			SlideString(buffer+i2,source.GetLength()+(i-i2));
+			memcpy(buffer+i,source.GetBuffer(),source.GetLength());
+
+			//新しい参照ディレクトリをセット
+			char temp4[MAX_PATH];
+			_splitpath(temporary,temp2,temp4,0,0);
+			lstrcat(temp2,temp4);
+			LayerDir[layer]=(char *)HeapAlloc(hHeap,0,lstrlen(temp2)+1);
+			lstrcpy(LayerDir[layer],temp2);
+
+			//ファイル範囲をスライド
+			LastFileByte[layer]=i+source.GetLength()-1;
+			for(i3=0;i3<layer;i3++) LastFileByte[i3]+=source.GetLength()+(i-i2);
+
+			i--;
+		}
+	}
+
+	HeapDefaultFree(LayerDir[0]);
+
+	length = lstrlen(buffer);
+}
+
+int KillReturnCode_InParameter(char *buffer,int *pRnum,char cBeginPare,char cEndPare){
+	int i,i2,i3,IsStr;
+
+	//カッコ'('直下の改行
+	while(buffer[0]=='\n'){
+		SlideString(buffer+1,-1);
+		(*pRnum)++;
+	}
+
+	for(i=0,IsStr=0;;i++){
+		if(IsDBCSLeadByte(buffer[i])&&buffer[i+1]){
+			i++;
+			continue;
+		}
+
+		if(buffer[i]=='\"') IsStr^=1;
+
+		if(buffer[i]=='\0') break;	//エラー
+		if(buffer[i]=='\n'){
+			i2=0;
+			i3=0;
+			while(buffer[i+i2]=='\n'){
+				i2++;
+				i3++;
+				while(buffer[i+i2]==' '||buffer[i+i2]=='\t') i2++;
+			}
+			while(buffer[i+i2]==' '||buffer[i+i2]=='\t') i2++;
+
+			if(buffer[i+i2]==cEndPare){
+				SlideString(buffer+i+i2,-i2);
+				(*pRnum)+=i3;
+				break;
+			}
+
+			//エラー
+			break;
+		}
+
+		if(buffer[i]==cBeginPare&&IsStr==0){
+			i++;
+			i2=KillReturnCode_InParameter(buffer+i,pRnum,cBeginPare,cEndPare);
+			i+=i2;
+			if(buffer[i]!=cEndPare) break;
+			continue;
+		}
+		if(buffer[i]==cEndPare&&IsStr==0) break;
+
+		if(buffer[i]==','&&buffer[i+1]=='\n'&&IsStr==0){
+			i++;
+			while(buffer[i]=='\n'){
+				SlideString(buffer+i+1,-1);
+				(*pRnum)++;
+			}
+			i--;
+		}
+	}
+	return i;
+}
+void BasicSource::RemoveReturnLineUnderbar(){
+	int i,i2;
+
+	//アンダーバーによる改行
+	for(i=0;;i++){
+		i2=0;
+		while(buffer[i]=='_'&&buffer[i+1]=='\n'){
+			i2++;
+			SlideString(buffer+i+2,-2);
+			while(buffer[i]=='\n'){
+				SlideString(buffer+i+1,-1);
+				i2++;
+			}
+			for(;;i++){
+				if(buffer[i]=='_'&&buffer[i+1]=='\n') break;
+				if(buffer[i]=='\n'||buffer[i]=='\0'){
+					SlideString(buffer+i,i2);
+					memset(buffer+i,'\n',i2);
+					break;
+				}
+			}
+		}
+		if(buffer[i]=='\0') break;
+	}
+
+	//カッコ内パラメータの改行
+	int IsStr,rnum;
+	for(i=0,IsStr=0,rnum=0;;i++){
+		if(IsDBCSLeadByte(buffer[i])&&buffer[i+1]){
+			i++;
+			continue;
+		}
+		if(buffer[i]=='\0') break;
+		if(buffer[i]=='\n'){
+			if(rnum){
+				SlideString(buffer+i+1,rnum);
+				memset(buffer+i+1,'\n',rnum);
+				rnum=0;
+			}
+		}
+		if(buffer[i]=='\"') IsStr^=1;
+		if(buffer[i]=='('&&IsStr==0){
+			i++;
+			i2=KillReturnCode_InParameter(buffer+i,&rnum,'(',')');
+			i+=i2;
+			if(buffer[i]!=')') break;
+		}
+		if(buffer[i]=='['&&IsStr==0){
+			i++;
+			i2=KillReturnCode_InParameter(buffer+i,&rnum,'[',']');
+			i+=i2;
+			if(buffer[i]!=']') break;
+		}
+	}
+
+	length = lstrlen(buffer);
+}
+
+void BasicSource::SetBuffer( const char *buffer ){
+	this->buffer = (char *)calloc( lstrlen(buffer) + 1, 1 );
+	lstrcpy( this->buffer, buffer );
+	length = lstrlen(buffer);
+
+	// ダミー改行をセット
+	Realloc( length + 2 );
+	SlideString( this->buffer, 2 );
+	this->buffer[0] = '\n';
+	this->buffer[1] = '\n';
+}
+
+bool BasicSource::ReadFile( const string &filePath ){
+	if( !Text::ReadFile( filePath ) ){
+		return false;
+	}
+
+	// 改行コードをCRLFからLFに変換
+	ChangeReturnLineChar();
+
+	// basic.sbpをインクルード
+	const char *headCode = "#include <basic.sbp>\n";
+	Realloc( length + lstrlen(headCode) );
+	SlideString( buffer, lstrlen(headCode) );
+	memcpy( buffer, headCode, lstrlen(headCode) );
+
+	// #defineと#requireを初期化
+	objDefine.Init();
+	requireFiles.clear();
+
+	// コメントを削除
+	RemoveComments();
+
+	// #ifdefディレクティブを処理
+	objDefine.DirectiveIfdef( buffer );
+
+	//最終行には文字を含ませないようにする
+	Realloc( length + 1 );
+	lstrcat( buffer, "\n" );
+
+	// #include / #require ディレクティブを処理
+	DirectiveIncludeOrRequire();
+
+	// アンダーバーによる改行を正規表現に戻す
+	RemoveReturnLineUnderbar();
+
+	// ダミー改行をセット
+	Realloc( length + 2 );
+	SlideString( buffer, 2 );
+	buffer[0] = '\n';
+	buffer[1] = '\n';
+
+	extern char *basbuf;
+	basbuf = GetBuffer();
+
+	return true;
+}
+
+bool BasicSource::Generate( const string &genName, const char *genBuffer ){
+	const int genBufferLength = lstrlen( genBuffer );
+
+#ifdef _DEBUG
+	// 挿入ソースに改行コードが含まれていないかを検査する
+	for( int i=0; genBuffer[i] ; i++ ){
+		if( genBuffer[i] == '\n' ){
+			SetError();
+			break;
+		}
+	}
+#endif
+
+	bool isFound = false;
+
+	for( int i=0; ; i++ ){
+		if( i == 0 || buffer[i] == '\n' ){
+			if( buffer[i] == '\n' ){
+				i++;
+			}
+			while( IsBlank( buffer[i] ) ){
+				i++;
+			}
+
+			int startIndex = i;
+
+			if( memicmp( buffer + i, generateDirectiveName.c_str(), generateDirectiveName.size() ) == 0 ){
+				i += (int)generateDirectiveName.size();
+				while( IsBlank( buffer[i] ) ){
+					i++;
+				}
+
+				char temporary[VN_SIZE];
+				for( int i2=0; ; i++, i2++ ){
+					if( buffer[i] == '\n' ){
+						temporary[i2] = 0;
+						break;
+					}
+					temporary[i2] = buffer[i];
+				}
+				if( genName == temporary ){
+					// 一致
+
+					int endIndex = i;
+
+					int lengthOffset = genBufferLength - ( endIndex - startIndex );
+
+					Realloc( length + lengthOffset );
+					SlideString( buffer + endIndex, lengthOffset );
+					memcpy( buffer + startIndex, genBuffer, genBufferLength );
+
+					isFound = true;
+
+					break;
+				}
+			}
+		}
+	}
+
+	return isFound;
+}
+
+void BasicSource::Addition( const char *buffer ){
+	Realloc( length + lstrlen(buffer) );
+	lstrcat( this->buffer, buffer );
+}
Index: tag/abdev(2007.06.20)/BasicCompiler_Common/src/Symbol.cpp
===================================================================
--- tag/abdev(2007.06.20)/BasicCompiler_Common/src/Symbol.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/BasicCompiler_Common/src/Symbol.cpp	(revision 178)
@@ -0,0 +1,21 @@
+#include <../common.h>
+#include <Symbol.h>
+
+Symbol::Symbol( const char *fullName )
+{
+	char areaName[VN_SIZE] = "";		//オブジェクト変数
+	char nestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName, areaName, nestName );
+
+	namespaceScopes = NamespaceScopes( areaName );
+	name = nestName;
+}
+Symbol::Symbol( const string &fullName )
+{
+	char areaName[VN_SIZE] = "";		//オブジェクト変数
+	char nestName[VN_SIZE] = "";		//入れ子メンバ
+	bool isNest = SplitMemberName( fullName.c_str(), areaName, nestName );
+
+	namespaceScopes = NamespaceScopes( areaName );
+	name = nestName;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/Attach.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Attach.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Attach.cpp	(revision 178)
@@ -0,0 +1,328 @@
+#ifndef THETEXT
+
+#include "common.h"
+#include <psapi.h>
+#include <tlhelp32.h>
+
+#pragma comment(lib, "psapi.lib")
+
+
+int GetSelectingProcessId(HWND hListView,DWORD *lpdwPlatform){
+	int nCount;
+	nCount=ListView_GetItemCount(hListView);
+
+	char temporary[255];
+	DWORD dwProcessId;
+	int i;
+	for(i=0;i<nCount;i++){
+		if(ListView_GetItemState(hListView,i,LVIS_SELECTED)){
+			ListView_GetItemText(hListView,i,1,temporary,255);
+			dwProcessId=atoi(temporary);
+
+			ListView_GetItemText(hListView,i,2,temporary,255);
+			if(lstrcmpi(temporary,"Win32")==0) *lpdwPlatform=IMAGE_FILE_MACHINE_I386;
+			else if(lstrcmpi(temporary,"Win64")==0) *lpdwPlatform=IMAGE_FILE_MACHINE_AMD64;
+			break;
+		}
+	}
+	if(i==nCount) return 0;
+
+	return dwProcessId;
+}
+
+void InsertProcess_ToListView(HWND hListView,char *lpszAppPath,int id,char *lpszPlatform,char *lpszTitle){
+	char szAppName[MAX_PATH],temp2[MAX_PATH];
+	_splitpath(lpszAppPath,NULL,NULL,szAppName,temp2);
+	lstrcat(szAppName,temp2);
+
+	//イメージリストを取得
+	HIMAGELIST hImageList;
+	hImageList=ListView_GetImageList(hListView,LVSIL_SMALL );
+
+	//アイコンを取得
+	int iImage;
+	SHFILEINFO shfi;
+	SHGetFileInfo(lpszAppPath, FILE_ATTRIBUTE_ARCHIVE, &shfi, sizeof(SHFILEINFO), SHGFI_ICON | SHGFI_SMALLICON );
+	if(shfi.hIcon){
+		iImage=ImageList_AddIcon(hImageList,shfi.hIcon);
+		DestroyIcon(shfi.hIcon);
+	}
+	else iImage=-1;
+
+	char szId[255];
+	sprintf(szId,"%d",id);
+
+	//リストビューに追加
+	LV_ITEM item;
+	if(iImage==-1) item.mask=LVIF_TEXT;
+	else item.mask=LVIF_TEXT|LVIF_IMAGE;
+	item.iItem=0;
+
+	item.pszText=szAppName;
+	item.iSubItem=0;
+	item.iImage=iImage;
+	ListView_InsertItem(hListView,&item);
+
+	item.mask=LVIF_TEXT ;
+	item.pszText=szId;
+	item.iSubItem++;
+	ListView_SetItem(hListView,&item);
+
+	item.pszText=lpszPlatform;
+	item.iSubItem++;
+	ListView_SetItem(hListView,&item);
+
+	item.pszText=lpszTitle;
+	item.iSubItem++;
+	ListView_SetItem(hListView,&item);
+}
+
+void ListupProcesses64(HWND hListView){
+	char temporary[MAX_PATH];
+
+	ListView_DeleteAllItems(hListView);
+
+
+	/////////////////////////////////////////////////////
+	// 64ビット版プロセス列挙モジュールを呼び出す
+	/////////////////////////////////////////////////////
+
+	sprintf(temporary,"%sSubOperation\\enum_process64\\enum_process64.exe",pj_editor_Dir);
+
+	STARTUPINFO si;
+	PROCESS_INFORMATION pi;
+	memset(&si,0,sizeof(STARTUPINFO));
+	si.cb=sizeof(STARTUPINFO);
+	CreateProcess(NULL,temporary,NULL,NULL,0,NORMAL_PRIORITY_CLASS,NULL,NULL,&si,&pi);
+
+	WaitForSingleObject(pi.hProcess,INFINITE);
+
+
+	//////////////////////////////////
+	// 生成されたファイルの読み込み
+	//////////////////////////////////
+
+	sprintf(temporary,"%sSubOperation\\enum_process64\\list.dat",pj_editor_Dir);
+
+	char *buffer;
+	buffer=ReadBuffer_NonErrMsg(temporary);
+	if(!buffer) return;
+
+	int i=0;
+	while(1){
+		//ファイルパス
+		char szAppPath[MAX_PATH];
+		i=GetOneParameter(buffer,i,szAppPath);
+		if(temporary[0]=='\0') break;
+		RemoveStringQuotes(szAppPath);
+
+		//プロセスID
+		DWORD dwProcessId;
+		i=GetOneParameter(buffer,i,temporary);
+		if(temporary[0]=='\0') break;
+		dwProcessId=(DWORD)atoi(temporary);
+
+		//プラットフォーム
+		char szPlatform[255];
+		i=GetOneParameter(buffer,i,szPlatform);
+		if(temporary[0]=='\0') break;
+
+		//タイトル
+		char szTitle[255];
+		int i2;
+		for(i2=0;;i++,i2++){
+			if(IS_RETURN(buffer,i)||buffer[i]=='\0'){
+				szTitle[i2]=0;
+				break;
+			}
+			szTitle[i2]=buffer[i];
+		}
+
+
+		//リストビューへ追加
+		InsertProcess_ToListView(hListView,szAppPath,dwProcessId,szPlatform,szTitle);
+
+		if(buffer[i]=='\r'&&buffer[i+1]=='\n') i+=2;
+		if(buffer[i]=='\0') break;
+	}
+
+	HeapDefaultFree(buffer);
+}
+
+// EnumWindowsProcコールバック関数
+BOOL CALLBACK FindWindowProc(HWND hwnd, LPARAM lParam)
+{
+    HWND* pphWnd = (HWND*)lParam;
+    *pphWnd = hwnd;
+    return FALSE; /* 列挙を中断 */
+}
+void ListupProcesses(HWND hListView){
+	char temporary[MAX_PATH];
+
+	ListView_DeleteAllItems(hListView);
+
+	DWORD *pdwProcessId;
+	pdwProcessId=(DWORD *)HeapAlloc(hHeap,0,8192*sizeof(DWORD));
+
+	//プロセスを列挙
+	DWORD cbNeeded;
+	EnumProcesses(pdwProcessId,8192*sizeof(DWORD),&cbNeeded);
+
+	char szMyAppPath[MAX_PATH];
+	GetModuleFileName(GetModuleHandle(0),szMyAppPath,MAX_PATH);
+
+	int i;
+	for(i=0;i<(int)(cbNeeded/sizeof(DWORD));i++){
+
+		//プロセスIDを元にハンドルを取得
+		HANDLE hProcess;
+		hProcess=OpenProcess(PROCESS_ALL_ACCESS,0,pdwProcessId[i]);
+		if(!hProcess) continue;
+
+		//そのプロセスにおける実行モジュールのインスタンスハンドルを取得
+		HINSTANCE hModule;
+		DWORD cbReturned;
+		if(!EnumProcessModules( hProcess, &hModule, sizeof(HINSTANCE), &cbReturned ))
+			continue;
+
+		//実行ファイル名を取得
+		GetModuleFileNameEx(hProcess,hModule,temporary,MAX_PATH);
+
+
+		//////////////////////////////
+		// ウィンドウタイトルを取得
+		//////////////////////////////
+
+		//スナップショットを取得
+		HANDLE hSnapshot;
+		hSnapshot=CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);
+
+		THREADENTRY32 te;
+		memset(&te,0,sizeof(THREADENTRY32));
+		te.dwSize=sizeof(THREADENTRY32);
+		if(Thread32First(hSnapshot,&te)){
+			do{
+				if(te.th32OwnerProcessID==pdwProcessId[i]){
+					break;
+				}
+			}while(Thread32Next(hSnapshot,&te));
+		}
+
+		HWND hwnd;
+		hwnd=0;
+		EnumThreadWindows(te.th32ThreadID,FindWindowProc,(LPARAM)&hwnd);
+
+		while(GetParent(hwnd)) hwnd=GetParent(hwnd);
+
+		char szWndTitle[1024];
+		szWndTitle[0]=0;
+		if(hwnd) GetWindowText(hwnd,szWndTitle,1024);
+
+		CloseHandle(hSnapshot);
+
+
+
+		CloseHandle(hProcess);
+
+		if(lstrcmpi(szMyAppPath,temporary)==0){
+			//自分自身（ProjectEditor.exe）は無視
+			continue;
+		}
+
+		//リストビューへ追加
+		InsertProcess_ToListView(hListView,temporary,pdwProcessId[i],"Win32",szWndTitle);
+	}
+
+	HeapDefaultFree(pdwProcessId);
+}
+
+BOOL CALLBACK DlgAttach(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	static HWND hListView;
+	static HIMAGELIST hImageList;
+	static DWORD *lpdwPlatform;
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+
+			lpdwPlatform=(DWORD *)lParam;
+
+			hListView=GetDlgItem(hwnd,IDC_PROCESSLIST);
+
+			//拡張スタイル
+			DWORD dwStyle;
+			dwStyle=ListView_GetExtendedListViewStyle(hListView);
+			dwStyle|=LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES;
+			ListView_SetExtendedListViewStyle(hListView,dwStyle);
+
+
+			//イメージリストの生成と設定
+			hImageList=ImageList_Create(16,16,ILC_COLOR24|ILC_MASK,0,0);
+			ListView_SetImageList(hListView,hImageList,LVSIL_SMALL );
+
+
+			///////////////////////////
+			// カラムをセット
+			///////////////////////////
+
+			LV_COLUMN ListView_Column;
+			ListView_Column.mask=LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
+			ListView_Column.fmt=LVCFMT_LEFT;
+
+			ListView_Column.cx=150;
+			ListView_Column.pszText="プロセス名";
+			ListView_Column.iSubItem=0;
+			ListView_InsertColumn(hListView,ListView_Column.iSubItem,&ListView_Column);
+
+			ListView_Column.cx=70;
+			ListView_Column.pszText="ID";
+			ListView_Column.iSubItem++;
+			ListView_InsertColumn(hListView,ListView_Column.iSubItem,&ListView_Column);
+
+			ListView_Column.cx=50;
+			ListView_Column.pszText="種別";
+			ListView_Column.iSubItem++;
+			ListView_InsertColumn(hListView,ListView_Column.iSubItem,&ListView_Column);
+
+			ListView_Column.cx=200;
+			ListView_Column.pszText="タイトル";
+			ListView_Column.iSubItem++;
+			ListView_InsertColumn(hListView,ListView_Column.iSubItem,&ListView_Column);
+
+
+			//リスビューを更新
+			if(IsWow64()) ListupProcesses64(hListView);
+			else ListupProcesses(hListView);
+
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					EndDialog(hwnd,GetSelectingProcessId(hListView,lpdwPlatform));
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			return 0;
+
+		case WM_NOTIFY:
+			NMLISTVIEW *nmListView;
+			nmListView=(NMLISTVIEW *)lParam;
+			if(nmListView->hdr.hwndFrom==hListView){
+				if(nmListView->hdr.code==NM_DBLCLK){
+					if(nmListView->iItem==-1) return 1;
+					SendMessage(hwnd,WM_COMMAND,IDOK,0);
+					return 1;
+				}
+			}
+			break;
+
+		case WM_DESTROY:
+			ImageList_Destroy(hImageList);
+			return 1;
+	}
+	return 0;
+}
+
+
+#endif //THETEXT
Index: tag/abdev(2007.06.20)/ProjectEditor/Attach.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Attach.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Attach.h	(revision 178)
@@ -0,0 +1,2 @@
+
+BOOL CALLBACK DlgAttach(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
Index: tag/abdev(2007.06.20)/ProjectEditor/BREGEXP.H
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/BREGEXP.H	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/BREGEXP.H	(revision 178)
@@ -0,0 +1,77 @@
+/*
+Visual Basic からお使いのときは次のDeclare文を使ってください。
+Private Declare Function Match Lib "bregexp" _
+      (szRegstr As String, szTarget As String) As String
+
+
+Private Declare Function Replace Lib "bregexp" _
+      (szRegstr As String, szTarget As String) As String
+
+Private Declare Function Translate Lib "bregexp" _
+      (szRegstr As String, szTarget As String, ret As String) As Long
+
+Private Declare Function Split Lib "bregexp" _
+      (szRegstr As String, szTarget As String, limit As Long) As Variant
+
+Private Declare Function MatchEx Lib "bregexp" _
+      (szRegstr As String, szTarget As String, mode As Long) As Variant
+
+*/
+
+
+#ifdef _BREGEXP_
+#define BREGEXPAPI __declspec(dllexport) 
+#else
+#define BREGEXPAPI __declspec(dllimport) 
+#endif
+
+typedef struct bregexp {
+	const char *outp;			/* result string start ptr   */
+	const char *outendp;		/* result string end ptr     */ 
+	const int  splitctr;		/* split result counter     */ 
+	const char **splitp;		/* split result pointer ptr     */ 
+	int     rsv1;				/* reserved for external use    */ 
+} BREGEXP;
+
+#if defined(__cplusplus)
+extern "C"
+{
+#endif
+
+typedef BREGEXPAPI int (*PFUNC_BMatch)(char* str,char *target,char *targetendp,
+								BREGEXP **rxp,char *msg) ;
+typedef BREGEXPAPI int (*PFUNC_BSubst)(char* str,char *target,char *targetendp,
+								BREGEXP **rxp,char *msg) ;
+typedef BREGEXPAPI int (*PFUNC_BTrans)(char* str,char *target,char *targetendp,
+								BREGEXP **rxp,char *msg) ;
+typedef BREGEXPAPI int (*PFUNC_BSplit)(char* str,char *target,char *targetendp,
+						int limit,BREGEXP **rxp,char *msg);
+typedef BREGEXPAPI void (*PFUNC_BRegfree)(BREGEXP* rx);
+
+typedef BREGEXPAPI char *(*PFUNC_BRegexpVersion)(void);
+
+
+class CRegExp{
+	HINSTANCE hLib;
+public:
+	CRegExp();
+	~CRegExp();
+	PFUNC_BMatch BMatch;
+	PFUNC_BSubst BSubst;
+	PFUNC_BTrans BTrans;
+	PFUNC_BSplit BSplit;
+	PFUNC_BRegfree BRegfree;
+	PFUNC_BRegexpVersion BRegexpVersion;
+
+	char *compare(HWND hFindDlg,char *buffer,char *exp,BOOL IsBigSmall, bool isWordUnit, int *pLength);
+	char *GetPermuStr(HWND hFindDlg,char *buffer,char *exp,char *szPermu,BOOL IsBigSmall);
+};
+extern CRegExp obj_RegExp;
+
+
+#if defined(__cplusplus)
+}
+#endif
+
+
+#undef BREGEXPAPI
Index: tag/abdev(2007.06.20)/ProjectEditor/Backup.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Backup.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Backup.cpp	(revision 178)
@@ -0,0 +1,211 @@
+#include "common.h"
+
+
+char szBackupDirPath[MAX_PATH];
+
+void CreateBackupDir(void){
+	//自動バックアップ用のフォルダを取得
+	extern char szBackupDirPath[MAX_PATH];
+	GUID guid;
+	char *temp2;
+	CoCreateGuid(&guid);
+	UuidToString(&guid,(unsigned char **)&temp2);
+
+	char temporary[MAX_PATH];
+	GetTempPath(MAX_PATH,temporary);
+	ShortPathToLongPath(temporary,szBackupDirPath);
+	if(szBackupDirPath[lstrlen(szBackupDirPath)-1]!='\\') lstrcat(szBackupDirPath,"\\");
+
+#ifdef THETEXT
+	lstrcat(szBackupDirPath,"TheText_Temporary_");
+#else
+	lstrcat(szBackupDirPath,"abdev_temporary_");
+#endif
+	lstrcat(szBackupDirPath,temp2);
+	RpcStringFree((unsigned char **)&temp2);
+
+	CreateDirectory(szBackupDirPath,NULL);
+	lstrcat(szBackupDirPath,"\\");
+}
+
+
+void backup(void *dummy){
+	extern char szBackupDirPath[MAX_PATH];
+	int i,iNum=0;
+	char temporary[MAX_PATH];
+
+	lstrcpy( temporary, szBackupDirPath );
+	if( temporary[lstrlen(temporary)-1] == '\\' ) temporary[lstrlen(temporary)-1] = 0;
+	if( !IsExistDirectory( temporary ) ){
+		//バックアップ用一時ディレクトリが存在しないときは作る
+		CreateDirectory( temporary, NULL );
+	}
+
+	char *temp2;
+	temp2=(char *)malloc(8192);
+	sprintf(temp2,"%x\r\n",hOwner);
+
+	for(i=0;i<MAX_WNDNUM;i++){
+		if(MdiInfo[i].hwnd){
+			int WndNum;
+			WndNum=i;
+
+			if(!IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)) continue;
+
+			//ファイルを保存
+			sprintf(temporary,"%sdocument%02d.txt",szBackupDirPath,iNum);
+			WriteBuffer(temporary,MdiInfo[WndNum].pMdiTextEdit->buffer,lstrlen(MdiInfo[WndNum].pMdiTextEdit->buffer), false);
+
+			//情報を追加
+			sprintf(temp2+lstrlen(temp2),"%s\r\n",MdiInfo[WndNum].path);
+
+			iNum++;
+		}
+	}
+
+	//バックアップヘッダ
+	sprintf(temporary,"%sinfo.txt",szBackupDirPath);
+	WriteBuffer_NonErrMsg(temporary,temp2,lstrlen(temp2));
+
+	free(temp2);
+}
+
+
+void RestoreBeforeState(const char *dir_path,char *pHeaderBuffer){
+	int i,i2;
+	for(i=0;;i++){
+		if(pHeaderBuffer[i]=='\0') break;
+		if(pHeaderBuffer[i]=='\r'&&pHeaderBuffer[i+1]=='\n') break;
+	}
+	if(pHeaderBuffer[i]=='\0') return;
+	i+=2;
+
+
+	int iDocNum=0;
+	char temporary[MAX_PATH];
+	while(1){
+		//元のファイルパスを取得
+		char szBeforeFilePath[MAX_PATH];
+		for(i2=0;;i++,i2++){
+			if(pHeaderBuffer[i]=='\r'&&pHeaderBuffer[i+1]=='\n'){
+				szBeforeFilePath[i2]=0;
+				break;
+			}
+			szBeforeFilePath[i2]=pHeaderBuffer[i];
+			if(pHeaderBuffer[i]=='\0') break;
+		}
+		if(pHeaderBuffer[i]=='\0') break;
+
+		sprintf(temporary,"%sdocument%02d.txt",dir_path,iDocNum);
+
+		HWND hChild;
+		hChild=NewTextEditWindow(temporary,WNDTYPE_TEXT);
+		int WndNum;
+		WndNum=GetWndNum(hChild);
+
+		char szOldTitle[MAX_PATH];
+		lstrcpy(szOldTitle,MdiInfo[WndNum].title);
+
+		//ドキュメント セレクト コンボボックスから消去
+		extern HWND hDocCombo;
+		i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[WndNum].title);
+		SendMessage(hDocCombo,CB_DELETESTRING,i2,0);
+
+		//パスを変更
+		GlobalFree(MdiInfo[WndNum].path);
+		MdiInfo[WndNum].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(szBeforeFilePath)+1);
+		lstrcpy(MdiInfo[WndNum].path,szBeforeFilePath);
+
+		//ドキュメント セレクト コンボボックスに挿入
+		char str[MAX_PATH],str2[MAX_PATH];
+		if(szBeforeFilePath[0]){
+			_splitpath(szBeforeFilePath,NULL,NULL,str,str2);
+			lstrcat(str,str2);
+		}
+		else{
+			extern int DocumentCounter;
+			DocumentCounter++;
+			sprintf(str,"Document[%d]",DocumentCounter);
+		}
+		DuplicateTitleCheck(str);
+		GlobalFree(MdiInfo[WndNum].title);
+		MdiInfo[WndNum].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(str)+1);
+		lstrcpy(MdiInfo[WndNum].title,str);
+		SendMessage(hDocCombo,CB_ADDSTRING,0,(long)MdiInfo[WndNum].title);
+		i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[WndNum].title);
+		SendMessage(hDocCombo,CB_SETCURSEL,i2,0);
+
+		//MDIウィンドウのタイトルを再設定
+		SetWindowText(hChild,MdiInfo[WndNum].title);
+
+		//タブコントロールを再設定
+		COLORREF TabColor;
+		TabColor=pobj_nv->pobj_ExtLink->GetTabColorFromFilePath(MdiInfo[WndNum].path);
+		pobj_MainTab->DeleteItem( szOldTitle, false );
+		pobj_MainTab->InsertItem( MdiInfo[WndNum].title, false, TabColor );
+
+		MdiInfo[WndNum].pMdiTextEdit->Modify();
+
+
+		iDocNum++;
+
+		i+=2;
+		if(pHeaderBuffer[i]=='\0') break;
+	}
+
+	RemoveDirectoryStrong(dir_path);
+}
+
+
+BOOL restore(void){
+	HANDLE hFind;
+	WIN32_FIND_DATA wfd;
+	char temporary[MAX_PATH],*temp2;
+
+	char szTempPath[MAX_PATH];
+	GetTempPath(MAX_PATH,temporary);
+	ShortPathToLongPath(temporary,szTempPath);
+	if(szTempPath[lstrlen(szTempPath)-1]!='\\') lstrcat(szTempPath,"\\");
+
+	sprintf(temporary,"%s*",szTempPath);
+	hFind=FindFirstFile(temporary,&wfd);
+	if(hFind!=INVALID_HANDLE_VALUE){
+		do{
+			if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY){
+#ifdef THETEXT
+				if(memcmp(wfd.cFileName,"TheText_Temporary_",18)==0){
+#else
+				if(memcmp(wfd.cFileName,"abdev_temporary_",16)==0){
+#endif
+					sprintf(temporary,"%s%s\\info.txt",szTempPath,wfd.cFileName);
+					temp2=ReadBuffer_NonErrMsg(temporary);
+					if(temp2){
+						HWND hTemp;
+						sscanf(temp2,"%x",&hTemp);
+						if(!IsWindow(hTemp)){
+							sprintf(temporary,"前回、%sが異常終了した可能性があります。データを復元しますか？",APPLICATION_NAME);
+							if(MessageBox(hOwner,temporary,APPLICATION_NAME,MB_YESNO)==IDNO){
+								HeapDefaultFree(temp2);
+
+								sprintf(temporary,"%s%s\\",szTempPath,wfd.cFileName);
+								RemoveDirectoryStrong(temporary);
+								return 0;
+							}
+
+							sprintf(temporary,"%s%s\\",szTempPath,wfd.cFileName);
+							RestoreBeforeState(temporary,temp2);
+
+							HeapDefaultFree(temp2);
+
+							return 1;
+						}
+
+						HeapDefaultFree(temp2);
+					}
+				}
+			}
+		}while(FindNextFile(hFind,&wfd));
+	}
+
+	return 0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/CClassInfo.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/CClassInfo.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/CClassInfo.cpp	(revision 178)
@@ -0,0 +1,297 @@
+#include "Common.h"
+
+#if defined(JPN)
+//日本語
+#include "pj_msg_jpn.h"
+#else
+//英語
+#include "pj_msg_eng.h"
+#endif
+
+
+CClassInfo::CClassInfo(){
+	pMemberInfo=(MEMBERINFO *)HeapAlloc(hHeap,0,1);
+	MemberNum=0;
+}
+CClassInfo::~CClassInfo(){
+	int i;
+	for(i=0;i<MemberNum;i++){
+		HeapDefaultFree(pMemberInfo[i].pName);
+	}
+	HeapDefaultFree(pMemberInfo);
+}
+
+int CClassInfo::Analyze(char *pBuf,int *p){
+	int i,i2;
+	char temporary[VN_SIZE];
+
+	i=*p;
+
+	DWORD dwAccess;
+
+	//種類を取得
+	DWORD dwClassType;
+	if(memicmp(pBuf+i,"Class",5)==0){
+		dwClassType=ESC_CLASS;
+		i+=5;
+
+		dwAccess=ACCESS_PRIVATE;
+	}
+	else if(memicmp(pBuf+i,"Type",4)==0){
+		dwClassType=ESC_TYPE;
+		i+=4;
+
+		dwAccess=ACCESS_PUBLIC;
+	}
+	else if(memicmp(pBuf+i,"Interface",9)==0){
+		dwClassType=ESC_INTERFACE;
+		i+=9;
+
+		dwAccess=ACCESS_PUBLIC;
+	}
+	else return 0;
+	JumpBlank(pBuf,&i);
+
+
+	//クラス名を取得
+	for(i2=0;;i++,i2++){
+		if(!(IsVariableChar(pBuf[i])||pBuf[i]=='~')){
+			ClassName[i2]=0;
+			break;
+		}
+		ClassName[i2]=pBuf[i];
+	}
+	JumpBlank(pBuf,&i);
+
+
+	//メンバ変数、関数を取得
+	while(1){
+		if(pBuf[i]=='\0') break;
+		if(memicmp(pBuf+i,"End",3)==0){
+			/*	End Class
+				End Type
+				の検出 */
+			i2=i+3;
+			while(pBuf[i2]==' '||pBuf[i2]=='\t') i2++;
+
+			if(memicmp(pBuf+i2,"Class",5)==0&&(!IsVariableChar(pBuf[i2+5]))||
+				memicmp(pBuf+i2,"Interface",9)==0&&(!IsVariableChar(pBuf[i2+9]))||
+				memicmp(pBuf+i2,"Type",4)==0&&(!IsVariableChar(pBuf[i2+4]))){
+				while(!IsCommandDelimitation(pBuf,i2)) i2++;
+				i=i2;
+				break;
+			}
+		}
+
+		// Static/Constを飛ばす
+		if( memicmp(pBuf+i,"Static",6)==0 ){
+			// Static
+			i+=6;
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		}
+		if(pBuf[i]=='c'||pBuf[i]=='C'){
+			// Const
+			i+=5;
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		}
+
+		DWORD dwProc;
+		if(memicmp(pBuf+i,"Abstract",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Virtual",7)==0&&(pBuf[i+7]==' '||pBuf[i+7]=='\t')||
+			memicmp(pBuf+i,"Override",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')){
+			//メンバ関数のとき
+
+			if(pBuf[i]=='a'||pBuf[i]=='A'){
+				i+=9;
+				dwProc=ESC_ABSTRACT;
+
+				while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+				if(memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')) i+=9;
+				else if(memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')) i+=4;
+			}
+			else if(pBuf[i]=='v'||pBuf[i]=='V'){
+				i+=8;
+				dwProc=ESC_VIRTUAL;
+
+				while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+				if(memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')) i+=9;
+				else if(memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')) i+=4;
+			}
+			else if(pBuf[i]=='o'||pBuf[i]=='O'){
+				i+=9;
+				dwProc=ESC_OVERRIDE;
+
+				while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+				if(memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')) i+=9;
+				else if(memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')) i+=4;
+			}
+			else if(pBuf[i]=='f'||pBuf[i]=='F'){
+				i+=9;
+				dwProc=ESC_FUNCTION;
+			}
+			else if(pBuf[i]=='s'||pBuf[i]=='S'){
+				i+=4;
+				dwProc=ESC_SUB;
+			}
+
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		}
+		else{
+			//メンバ変数のとき
+			dwProc=0;
+		}
+
+		int code_pos;
+		code_pos=i;
+
+		//変数名または関数名を取得
+		if(pBuf[i]=='~'){
+			temporary[0]='~';
+			i2=1;
+			i++;
+		}
+		else i2=0;
+		for(;;i++,i2++){
+			if(!IsVariableChar(pBuf[i])){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=pBuf[i];
+		}
+
+		//次の行をサーチ
+		for(;;i++){
+			if(pBuf[i]=='\0') break;
+			if(pBuf[i]=='\''||(pBuf[i]=='/'&&pBuf[i+1]=='*')){
+				//コメント中
+				JumpBlank(pBuf,&i);
+				break;
+			}
+			i2=IsCommandDelimitation(pBuf,i);
+			if(i2){
+				i+=i2;
+				break;
+			}
+		}
+		JumpBlank(pBuf,&i);
+
+		if(lstrcmpi(temporary,"Inherits")==0){
+			//継承指定の場合（ツリーに反映すべきデータはないので無視する）
+			continue;
+		}
+
+		//アクセスを変更
+		if(lstrcmpi(temporary,"Private")==0){
+			dwAccess=ACCESS_PRIVATE;
+			continue;
+		}
+		if(lstrcmpi(temporary,"Public")==0){
+			dwAccess=ACCESS_PUBLIC;
+			continue;
+		}
+		if(lstrcmpi(temporary,"Protected")==0){
+			dwAccess=ACCESS_PROTECTED;
+			continue;
+		}
+
+		//重複チェック（オーバーライド関数を考慮）
+		for(i2=0;i2<MemberNum;i2++){
+			if(lstrcmp(pMemberInfo[i2].pName,temporary)==0){
+				lstrcat(temporary," ");
+				break;
+			}
+		}
+
+		pMemberInfo=
+			(MEMBERINFO *)HeapReAlloc(hHeap,
+				0,
+				pMemberInfo,
+				(MemberNum+1)*sizeof(MEMBERINFO));
+
+		//メンバ名
+		pMemberInfo[MemberNum].pName=
+			(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+		lstrcpy(pMemberInfo[MemberNum].pName,
+			temporary);
+
+		//メンバの種類（変数、Virtual、Sub、Function）
+		pMemberInfo[MemberNum].dwProc=dwProc;
+
+		//アクセシビリティ
+		pMemberInfo[MemberNum].dwAccess=dwAccess;
+
+		//コードの位置
+		pMemberInfo[MemberNum].code_pos=code_pos;
+
+		MemberNum++;
+
+		if(dwProc){
+			//Abstract定義以外はEnd Sub、End Functionをサーチする
+			if(dwProc==ESC_ABSTRACT) continue;
+			if(dwClassType==ESC_INTERFACE) continue;
+
+			while(1){
+				if(pBuf[i]=='\0'){
+					i2=0;
+					break;
+				}
+
+				if(memicmp(pBuf+i,"End",3)==0){
+					/*	End Sub
+						End Function
+						の検出 */
+					i+=3;
+					while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+					if(memicmp(pBuf+i,"Sub",3)==0&&(!IsVariableChar(pBuf[i+3]))||
+						memicmp(pBuf+i,"Function",8)==0&&(!IsVariableChar(pBuf[i+8]))){
+						i2=1;
+						break;
+					}
+
+					if(memicmp(pBuf+i,"Class",5)==0&&(!IsVariableChar(pBuf[i+5]))||
+						memicmp(pBuf+i,"Interface",9)==0&&(!IsVariableChar(pBuf[i+9]))||
+						memicmp(pBuf+i,"Type",4)==0&&(!IsVariableChar(pBuf[i+4]))){
+						i2=0;
+						break;
+					}
+				}
+
+				//次の行をサーチ
+				for(;;i++){
+					if(pBuf[i]=='\0') break;
+					i2=IsCommandDelimitation(pBuf,i);
+					if(i2){
+						i+=i2;
+						break;
+					}
+				}
+				JumpBlank(pBuf,&i);
+			}
+
+			if(i2==0){
+				//コード解析が不正に終了
+				*p=i;
+				return 0;
+			}
+
+			//次の行をサーチ
+			for(;;i++){
+				if(pBuf[i]=='\0') break;
+				i2=IsCommandDelimitation(pBuf,i);
+				if(i2){
+					i+=i2;
+					break;
+				}
+			}
+			JumpBlank(pBuf,&i);
+		}
+	}
+
+	*p=i;
+
+	return 1;
+}
+
Index: tag/abdev(2007.06.20)/ProjectEditor/CFileInfo.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/CFileInfo.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/CFileInfo.cpp	(revision 178)
@@ -0,0 +1,99 @@
+#include "common.h"
+
+CFileInfo::CFileInfo(char *path,HTREEITEM hTreeItem){
+	m_path=(char *)HeapAlloc(hHeap,0,lstrlen(path)+1);
+	lstrcpy(m_path,path);
+	m_hTreeItem=hTreeItem;
+}
+CFileInfo::~CFileInfo(){
+	HeapDefaultFree(m_path);
+}
+void CFileInfo::GetFullPath(char *buffer){
+	lstrcpy(buffer,m_path);
+	::GetFullPath(buffer,ProjectInfo.dir);
+}
+
+
+CDBFileInfo::CDBFileInfo(){
+	iNum=0;
+	ppobj_FileInfo=(CFileInfo **)HeapAlloc(hHeap,0,1);
+}
+CDBFileInfo::~CDBFileInfo(){
+	int i;
+	for(i=0;i<iNum;i++){
+		delete ppobj_FileInfo[i];
+	}
+	HeapDefaultFree(ppobj_FileInfo);
+}
+
+void CDBFileInfo::add(char *path,HTREEITEM hTreeItem){
+	ppobj_FileInfo=(CFileInfo **)HeapReAlloc(hHeap,0,ppobj_FileInfo,(iNum+1)*sizeof(CFileInfo *));
+	ppobj_FileInfo[iNum]=new CFileInfo(path,hTreeItem);
+	iNum++;
+}
+void CDBFileInfo::del(HTREEITEM hTreeItem){
+	int i;
+	for(i=0;i<iNum;i++){
+		if(ppobj_FileInfo[i]->m_hTreeItem==hTreeItem) break;
+	}
+	if(i==iNum) return;
+
+	delete ppobj_FileInfo[i];
+
+	iNum--;
+	for(;i<iNum;i++) ppobj_FileInfo[i]=ppobj_FileInfo[i+1];
+}
+char *CDBFileInfo::GetPath(HTREEITEM hTreeItem){
+	int i;
+	for(i=0;i<iNum;i++){
+		if(ppobj_FileInfo[i]->m_hTreeItem==hTreeItem) break;
+	}
+	if(i==iNum) return 0;
+	return ppobj_FileInfo[i]->m_path;
+}
+BOOL CDBFileInfo::IsMainFile(HTREEITEM hTreeItem){
+	int i;
+	for(i=0;i<iNum;i++){
+		if(ppobj_FileInfo[i]->m_hTreeItem==hTreeItem) break;
+	}
+	if(i==0) return 1;
+	return 0;
+}
+void CDBFileInfo::SetTreeItem(int index,HTREEITEM hTreeItem){
+	ppobj_FileInfo[index]->m_hTreeItem=hTreeItem;
+}
+void CDBFileInfo::ResetTree(void){
+	TV_INSERTSTRUCT tv;
+
+	TreeView_DeleteAllItems(pobj_FileTree->hTree);
+
+	tv.hInsertAfter=TVI_SORT;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+
+	tv.hParent=TVI_ROOT;
+	tv.item.iImage=0;
+	tv.item.iSelectedImage=0;
+	tv.item.pszText="Source Files";
+	tv.hParent=TreeView_InsertItem(pobj_FileTree->hTree,&tv);
+
+	int i;
+	char temporary[MAX_PATH],temp2[MAX_PATH];
+	for(i=0;i<iNum;i++){
+		_splitpath(ppobj_FileInfo[i]->m_path,0,0,temporary,temp2);
+		lstrcat(temporary,temp2);
+		tv.item.iImage=2;
+		tv.item.iSelectedImage=2;
+		tv.item.pszText=temporary;
+		ppobj_FileInfo[i]->m_hTreeItem=TreeView_InsertItem(pobj_FileTree->hTree,&tv);
+	}
+}
+BOOL CDBFileInfo::dupli_check(char *path){
+	//重複チェック
+	int i;
+	for(i=0;i<iNum;i++){
+		if(lstrcmpi(ppobj_FileInfo[i]->m_path,path)==0){
+			return 1;
+		}
+	}
+	return 0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/CIEsink.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/CIEsink.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/CIEsink.h	(revision 178)
@@ -0,0 +1,68 @@
+#include <atlbase.h>	// ATL基本機能用ヘッダファイル
+
+// ATLを使用するために必要なグローバル変数
+// この変数名は、必ず、この名前で無ければなりません。
+extern CComModule	_Module;
+
+#include <atlcom.h>		// ATL COM共通用ヘッダファイル
+#include <atlhost.h>	// ATL コンテナ機能サポート用ヘッダファイル
+#include <EXDISPID.H>
+
+// 数字は任意。詳しくはIDispatchImplのドキュメント参照
+#define SINKID_COUNTEREVENTS 0
+
+/* CIESink : シンク(イベント受付窓口)クラス */
+class ATL_NO_VTABLE CIESink :
+	public CComObjectRootEx<CComSingleThreadModel>,
+	public IDispEventImpl<SINKID_COUNTEREVENTS, CIESink, &DIID_DWebBrowserEvents2>
+{
+private:
+	CComPtr<IUnknown> m_pUnkIE;
+
+public:
+	CIESink() {}
+
+	HRESULT AdviseToIE( CComPtr<IUnknown> pUnkIE)
+	{
+		m_pUnkIE = pUnkIE;
+		
+		// タイプ ライブラリへのポインタやバージョン情報の設定
+		AtlGetObjectSourceInterface( pUnkIE, &m_libid, &m_iid, &m_wMajorVerNum, &m_wMinorVerNum) ;
+
+		// イベントをDispatch
+		HRESULT hr = this->DispEventAdvise( pUnkIE);
+
+		return hr ;
+	}
+
+BEGIN_COM_MAP(CIESink)
+	COM_INTERFACE_ENTRY_IID(DIID_DWebBrowserEvents2, CIESink)
+END_COM_MAP()
+
+BEGIN_SINK_MAP(CIESink)
+	SINK_ENTRY_EX(SINKID_COUNTEREVENTS, DIID_DWebBrowserEvents2, DISPID_BEFORENAVIGATE2, &CIESink::OnBeforeNavigate2)
+	SINK_ENTRY_EX(SINKID_COUNTEREVENTS, DIID_DWebBrowserEvents2, DISPID_NEWWINDOW2, &CIESink::OnNewWindow2)
+	SINK_ENTRY_EX(SINKID_COUNTEREVENTS, DIID_DWebBrowserEvents2, DISPID_ONQUIT, &CIESink::OnQuit)
+END_SINK_MAP()
+
+// OnBeforeNavigate2
+void _stdcall OnBeforeNavigate2( IDispatch** ppDisp, VARIANT* pvUrl, VARIANT*, VARIANT* pvTarget, VARIANT*,
+				   VARIANT*, VARIANT_BOOL *pbCancel)
+{
+	return ;
+}
+
+// OnNewWindow2
+void _stdcall OnNewWindow2( IDispatch** ppDisp, VARIANT_BOOL *pbCancel)
+{
+	return ;
+}
+
+// OnQuit
+void _stdcall OnQuit()
+{
+	DispEventUnadvise( m_pUnkIE);
+	return ;
+}
+};
+
Index: tag/abdev(2007.06.20)/ProjectEditor/Caret.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Caret.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Caret.cpp	(revision 178)
@@ -0,0 +1,855 @@
+#include "common.h"
+
+extern int font_width,font_height;
+
+BOOL IsRightTurn(char *pBuf,int i,int now_x){
+	if(pobj_nv->bRightTurn==0) return 0;
+	if(pobj_nv->iMaxOneLineTextLength-1<=now_x && pBuf[i]!='\r') return 1;
+	return 0;
+}
+
+int GetBufferIndexFromCaretPos(char *pBuf,int now_x,int now_y){
+	int i,i2;
+	int x,y;
+
+	// 行の確認
+	for(i=0,x=0,y=0;;i++,x++){
+		if(y>=now_y) break;
+		if(pBuf[i]=='\0') return 0;
+		if(IsRightTurn(pBuf,i,x)){
+			//右端で折り返す
+			y++;
+			x=-1;
+			i--;
+			continue;
+		}
+		if(pBuf[i]=='\t'){
+			//タブ文字
+			int tab;
+			tab=pobj_nv->TabSize;
+
+			if(x%tab==0) i2=tab;
+			else i2=tab-x%tab;
+			x+=i2-1;
+			continue;
+		}
+		else if(IsDBCSLeadByte(pBuf[i])){
+			//マルチバイト文字
+			x++;
+			i++;
+			continue;
+		}
+
+		if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+			y++;
+			i++;
+			x=-1;
+		}
+	}
+
+	//列の確認
+	for(x=0;x<now_x;i++,x++){
+		if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'||pBuf[i]=='\0') return 0;
+
+		if(pBuf[i]=='\t'){
+			//タブ文字
+			int tab;
+			tab=pobj_nv->TabSize;
+
+			if(x%tab==0) i2=tab;
+			else i2=tab-x%tab;
+			x+=i2-1;
+			continue;
+		}
+		else if(IsDBCSLeadByte(pBuf[i])){
+			//マルチバイト文字
+			x++;
+			i++;
+			continue;
+		}
+	}
+
+	return i;
+}
+void GetCaretPosFromBufferIndex(char *pBuf,int index,POINT *pCaretPos){
+	int i,i2;
+
+	pCaretPos->x=0;
+	pCaretPos->y=0;
+	for(i=0;i<index;i++,pCaretPos->x++){
+		if(pBuf[i]=='\0') break;
+		if(IsRightTurn(pBuf,i,pCaretPos->x)){
+			//右端で折り返す
+			pCaretPos->y++;
+			pCaretPos->x=-1;
+			i--;
+			continue;
+		}
+		if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+			pCaretPos->x=-1;
+			pCaretPos->y++;
+			i++;
+			continue;
+		}
+		if(IsDBCSLeadByte(pBuf[i])){
+			i++;
+			pCaretPos->x++;
+			continue;
+		}
+		if(pBuf[i]=='\t'){
+			//タブ文字
+			int tab;
+			tab=pobj_nv->TabSize;
+
+			if(pCaretPos->x%tab==0) i2=tab;
+			else i2=tab-pCaretPos->x%tab;
+			pCaretPos->x+=i2-1;
+			continue;
+		}
+		else if(IsDBCSLeadByte(pBuf[i])){
+			//マルチバイト文字
+			pCaretPos->x++;
+			i++;
+			continue;
+		}
+	}
+}
+
+void TextEdit_GetSel(int WndNum,CHARRANGE *pCharRange){
+	//////////////////////////////////////////
+	// 選択範囲（バッファインデックス）を取得
+	//////////////////////////////////////////
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	pCharRange->cpMin=GetBufferIndexFromCaretPos(
+		MdiInfo[WndNum].pMdiTextEdit->buffer,
+		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+
+	if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
+		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y){
+		//選択されていないとき
+		pCharRange->cpMax=pCharRange->cpMin;
+	}
+	else{
+		pCharRange->cpMax=GetBufferIndexFromCaretPos(
+			MdiInfo[WndNum].pMdiTextEdit->buffer,
+			MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x,
+			MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y);
+	}
+
+	if(pCharRange->cpMin>pCharRange->cpMax){
+		long temp;
+		temp=pCharRange->cpMin;
+		pCharRange->cpMin=pCharRange->cpMax;
+		pCharRange->cpMax=temp;
+	}
+}
+void TextEdit_GetSelText(int WndNum,CHARRANGE *pCharRange,char *buffer){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	memcpy(buffer,
+		MdiInfo[WndNum].pMdiTextEdit->buffer+pCharRange->cpMin,
+		pCharRange->cpMax-pCharRange->cpMin);
+	buffer[pCharRange->cpMax-pCharRange->cpMin]=0;
+}
+
+void GetScrollBaseCaretPos(int WndNum,int *pNaturalBaseX,int *pNaturalBaseY){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	HWND hEdit;
+	hEdit=MdiInfo[WndNum].pMdiTextEdit->hEdit;
+
+	//垂直スクロールバーの位置
+	SCROLLINFO si;
+	si.cbSize=sizeof(SCROLLINFO);
+	si.fMask=SIF_POS;
+	GetScrollInfo(hEdit,SB_VERT,&si);
+	*pNaturalBaseY-=si.nPos;		//文字単位
+
+	//水平スクロールバーの位置
+	GetScrollInfo(hEdit,SB_HORZ,&si);
+	*pNaturalBaseX-=si.nPos;		//文字単位
+}
+
+void GetNaturalBaseCaretPos(int WndNum,int *pScrollBaseX,int *pScrollBaseY){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	HWND hEdit;
+	hEdit=GetWindow(MdiInfo[WndNum].hwnd,GW_CHILD);
+
+	//垂直スクロールバーの位置
+	SCROLLINFO si;
+	si.cbSize=sizeof(SCROLLINFO);
+	si.fMask=SIF_POS;
+	GetScrollInfo(hEdit,SB_VERT,&si);
+	*pScrollBaseY+=si.nPos;		//文字単位
+
+	//水平スクロールバーの位置
+	GetScrollInfo(hEdit,SB_HORZ,&si);
+	*pScrollBaseX+=si.nPos;		//文字単位
+}
+
+void TextEdit_SetSel(int WndNum,int StartIndex,int EndIndex,BOOL bShowCenter){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	GetCaretPosFromBufferIndex(
+		MdiInfo[WndNum].pMdiTextEdit->buffer,
+		StartIndex,
+		&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+
+	GetCaretPosFromBufferIndex(
+		MdiInfo[WndNum].pMdiTextEdit->buffer,
+		EndIndex,
+		&MdiInfo[WndNum].pMdiTextEdit->EndCaretPos);
+
+	HWND hEdit;
+	hEdit=GetWindow(MdiInfo[WndNum].hwnd,GW_CHILD);
+
+	if(!TextEdit_ScrollCaret(WndNum,0,bShowCenter))
+		InvalidateRect(hEdit,NULL,0);
+	ResetCaretPos(WndNum);
+
+	ResetState_EditMenu();
+}
+void TextEdit_SelectOneLine(int WndNum,int code_pos,BOOL bShowCenter){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	///////////////////////
+	// 定義行の選択範囲
+	///////////////////////
+
+	int iStartPos;
+	iStartPos=code_pos;
+	while(MdiInfo[WndNum].pMdiTextEdit->buffer[iStartPos]!='\n'&&iStartPos>0) iStartPos--;
+	if(MdiInfo[WndNum].pMdiTextEdit->buffer[iStartPos]=='\n') iStartPos++;
+
+	int iEndPos;
+	iEndPos=code_pos;
+	while(MdiInfo[WndNum].pMdiTextEdit->buffer[iEndPos]!='\r'&&MdiInfo[WndNum].pMdiTextEdit->buffer[iEndPos]!='\0') iEndPos++;
+
+	TextEdit_SetSel(WndNum,iStartPos,iEndPos,bShowCenter);
+}
+void ResetCaretPos(int WndNum,BOOL bInputAndReset){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int x,y;
+
+	POINT OldPos;
+	GetCaretPos(&OldPos);
+
+	x=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x;
+	y=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y;
+	GetScrollBaseCaretPos(WndNum,&x,&y);
+
+	//エディタ画面左端のコントロールタブ
+	int iControlTabSpace;
+	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+
+	//コントロールタブ上にカーソルがきたときに、非表示にする
+	if(OldPos.x>=iControlTabSpace&&x<0) HideCaret(MdiInfo[WndNum].pMdiTextEdit->hEdit);
+	else if(OldPos.x<iControlTabSpace&&x>=0) ShowCaret(MdiInfo[WndNum].pMdiTextEdit->hEdit);
+
+	SetCaretPos(
+		x*font_width     +iControlTabSpace,
+		y*font_height);
+
+	SetStatusText(NULL);
+
+
+	//////////////////////////////////////////////
+	// Web検索文字列
+	//////////////////////////////////////////////
+	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+		int start,end;
+		if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y){
+			//文字列を選択中でないとき
+
+			int sw=0;
+			if(bInputAndReset){
+				if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x>1){
+					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x-=2;
+					sw=1;
+				}
+			}
+
+			TextEdit_GetWordCaret(
+				MdiInfo[WndNum].pMdiTextEdit->hEdit,
+				WndNum,
+				&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos,
+				&start,&end,
+				WORDCARET_BEFORE);
+
+			if(sw) MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x+=2;
+
+			//半角文字列を選択時の全角とのズレを修正
+			POINT pos;
+			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,start,&pos);
+			start=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,pos.x,pos.y);
+			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,end,&pos);
+			end=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,pos.x,pos.y);
+		}
+		else{
+			//文字列を選択中のとき
+			start=GetBufferIndexFromCaretPos(
+				MdiInfo[WndNum].pMdiTextEdit->buffer,
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+			end=GetBufferIndexFromCaretPos(
+				MdiInfo[WndNum].pMdiTextEdit->buffer,
+				MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x,
+				MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y);
+		}
+
+		if(start>end){
+			int iTemp;
+			iTemp=start;
+			start=end;
+			end=iTemp;
+		}
+
+		char *pTemp;
+		int length;
+		length=end-start;
+		if(length<0) length=0;
+		pTemp=(char *)HeapAlloc(hHeap,0,length+1024);
+		memcpy(pTemp,MdiInfo[WndNum].pMdiTextEdit->buffer+start,length);
+		pTemp[length]=0;
+
+		char *temp2;
+		temp2=strstr(pTemp,"\r\n");
+		if(temp2) temp2[0]=0;
+
+		extern HWND hWebSearchCombo;
+		SetWindowText(GetWindow(hWebSearchCombo,GW_CHILD),pTemp);
+
+		//未完成
+		HeapDefaultFree(pTemp);
+		/*if((!IsHiragana(pTemp))&&pTemp[0]&&pTemp[1]){
+			//バックグラウンドでWeb検索をかける
+			_beginthread(WebSearchThread,0,(void *)pTemp);
+
+			//※pTempはWebSearchThreadスレッド内で破棄する
+		}
+		else{
+			HeapDefaultFree(pTemp);
+		}*/
+	}
+
+
+	////////////////////////////////////////////////////
+	// パラメータヒントを更新
+	////////////////////////////////////////////////////
+
+	extern METHODCHECKINFO MethodCheckInfo;
+	if(MethodCheckInfo.hWnd){
+		if(MdiInfo[WndNum].DocType==WNDTYPE_BASIC)
+			ShowParameterHint(WndNum);
+	}
+
+
+	//////////////////////////////////
+	// コード補完機能を利用中の場合
+	//////////////////////////////////
+
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+	if(ComplementWndInfo.hWnd){
+		int i,i2;
+		char *pTemp,temporary[VN_SIZE];
+
+		i=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+
+		if(i<ComplementWndInfo.iPos||ComplementWndInfo.iPos+ComplementWndInfo.iLength<i){
+			//参照文字列以外にカーソルが移動した場合はコード補完リストを破棄
+
+			DestroyWindow(ComplementWndInfo.hWnd);
+			ComplementWndInfo.hWnd=0;
+		}
+		if(ComplementWndInfo.pMemberInfo[0].dwAccess==ACCESS_PAIRCOMMAND){
+			/////////////////////////////////////
+			// ペアステートメント補完
+			/////////////////////////////////////
+			//※リストを自動選択、場合により破棄
+
+			if(ComplementWndInfo.iLength==0){
+				//自動選択の指標となる文字列がないときは、補完ウィンドウを破棄する
+				DestroyWindow(ComplementWndInfo.hWnd);
+				ComplementWndInfo.hWnd=0;
+				return;
+			}
+
+			pTemp=(char *)HeapAlloc(hHeap,0,ComplementWndInfo.iLength+1);
+			memcpy(pTemp,
+				MdiInfo[WndNum].pMdiTextEdit->buffer+ComplementWndInfo.iPos,
+				ComplementWndInfo.iLength);
+			pTemp[ComplementWndInfo.iLength]=0;
+
+			for(i=0;i<ComplementWndInfo.MemberNum;i++){
+				ListView_GetItemText(ComplementWndInfo.hList,i,0,temporary,VN_SIZE);
+
+				if(memicmp(pTemp,temporary,ComplementWndInfo.iLength)==0){
+					if(lstrcmpi(pTemp,temporary)==0){
+						//完全一致の場合
+						SendMessage(ComplementWndInfo.hList,WM_KEYDOWN,VK_RETURN,0);
+					}
+					break;
+				}
+			}
+			if(i==ComplementWndInfo.MemberNum){
+				//エンドペアステートメントの先端部分と一致しなかったとき
+				DestroyWindow(ComplementWndInfo.hWnd);
+				ComplementWndInfo.hWnd=0;
+			}
+
+			//アイテムを選択
+			ListView_SetItemState(ComplementWndInfo.hList,
+				i,
+				LVIS_SELECTED|LVIS_FOCUSED,
+				LVIS_SELECTED|LVIS_FOCUSED);
+
+			//必要であればスクロール
+			ListView_EnsureVisible(ComplementWndInfo.hList,i,0);
+
+			HeapDefaultFree(pTemp);
+		}
+		else{
+			/////////////////////////////////
+			// クラスメンバのコード補完機能
+			/////////////////////////////////
+			//※リストを自動選択
+
+			if(ComplementWndInfo.iLength==0){
+				//自動選択の指標となる文字列がないとき
+				return;
+			}
+
+			if(ComplementWndInfo.iLength<0){
+				//文字数がマイナス値になったとき（.や>が消されたとき）
+				//  補完ウィンドウを破棄する
+				DestroyWindow(ComplementWndInfo.hWnd);
+				ComplementWndInfo.hWnd=0;
+				return;
+			}
+
+			pTemp=(char *)HeapAlloc(hHeap,0,ComplementWndInfo.iLength+1);
+			memcpy(pTemp,
+				MdiInfo[WndNum].pMdiTextEdit->buffer+ComplementWndInfo.iPos,
+				ComplementWndInfo.iLength);
+			pTemp[ComplementWndInfo.iLength]=0;
+
+			for(i=0;i<ComplementWndInfo.MemberNum;i++){
+				ListView_GetItemText(ComplementWndInfo.hList,i,0,temporary,VN_SIZE);
+
+				i2=lstrcmpi(pTemp,temporary);
+				if(i2<=0) break;
+			}
+			if(i==ComplementWndInfo.MemberNum) i--;
+
+			//アイテムを選択
+			ListView_SetItemState(ComplementWndInfo.hList,
+				i,
+				LVIS_SELECTED|LVIS_FOCUSED,
+				LVIS_SELECTED|LVIS_FOCUSED);
+
+			//必要であればスクロール
+			ListView_EnsureVisible(ComplementWndInfo.hList,i,0);
+
+			HeapDefaultFree(pTemp);
+		}
+	}
+}
+BOOL TextEdit_ScrollCaret(int WndNum,BOOL bScrollOneStep_x,BOOL bShowCenter){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int x,y;
+	BOOL bScroll=0;
+
+	HWND hEdit;
+	hEdit=MdiInfo[WndNum].pMdiTextEdit->hEdit;
+
+	x=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x;
+	y=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y;
+	GetScrollBaseCaretPos(WndNum,&x,&y);
+
+	//垂直方向
+	SCROLLINFO si;
+	si.cbSize=sizeof(SCROLLINFO);
+	si.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
+	GetScrollInfo(hEdit,SB_VERT,&si);
+	if(bShowCenter==0){
+		//通常キャレットスクロール
+		if(y<0){
+			//上へスクロール
+
+			si.nPos+=y;
+			SetScrollInfo(hEdit,SB_VERT,&si,1);
+			InvalidateRect(hEdit,NULL,0);
+			bScroll=1;
+		}
+		if(si.nPage&&y>(int)si.nPage-1){
+			//下へスクロール
+
+			si.nPos+=y-si.nPage;
+
+			SetScrollInfo(hEdit,SB_VERT,&si,1);
+			InvalidateRect(hEdit,NULL,0);
+			bScroll=1;
+		}
+	}
+	else{
+		//上部にキャレットがくるようにスクロール
+
+		if(y<0||
+			si.nPage&&y>(int)si.nPage-1){
+
+			si.nPos+=y-si.nPage/3;
+			SetScrollInfo(hEdit,SB_VERT,&si,1);
+			InvalidateRect(hEdit,NULL,0);
+			bScroll=1;
+		}
+	}
+
+
+	//水平方向
+	GetScrollInfo(hEdit,SB_HORZ,&si);
+	if(x<0){
+		si.nPos+=x-1;
+		if(!bScrollOneStep_x) si.nPos-=si.nPage/4;
+		if(si.nPos<0) si.nPos=0;
+		SetScrollInfo(hEdit,SB_HORZ,&si,1);
+		InvalidateRect(hEdit,NULL,0);
+		bScroll=1;
+	}
+	if(si.nPage&&x>(int)si.nPage){
+		si.nPos+=x-si.nPage;
+		if(!bScrollOneStep_x) si.nPos+=si.nPage/3;
+		SetScrollInfo(hEdit,SB_HORZ,&si,1);
+		InvalidateRect(hEdit,NULL,0);
+		bScroll=1;
+	}
+
+	return bScroll;
+}
+
+void CaretPos_LooseToNatural(int WndNum,int loose_x,int loose_y,POINT *pCaretPos){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2,LastPos;
+	int x,y;
+	char *pBuf;
+
+	//負数の場合は0をセット
+	if(loose_x<0) loose_x=0;
+	if(loose_y<0) loose_y=0;
+
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+	// 行の確認
+	LastPos=0;
+	for(i=0,x=0,y=0;;i++,x++){
+		if(y>=loose_y){
+			pCaretPos->y=y;
+			break;
+		}
+		if(pBuf[i]=='\0'){
+			pCaretPos->y=y;
+			i=LastPos;
+			break;
+		}
+
+		if(IsRightTurn(pBuf,i,x)){
+			LastPos=i;
+
+			//右端で折り返す
+			y++;
+			x=-1;
+			i--;
+			continue;
+		}
+		if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+			LastPos=i+2;
+			y++;
+			i++;
+			x=-1;
+		}
+
+		if(pBuf[i]=='\t'){
+			//タブ文字
+			int tab;
+			tab=pobj_nv->TabSize;
+
+			if(x%tab==0) i2=tab;
+			else i2=tab-x%tab;
+			x+=i2-1;
+			continue;
+		}
+		else if(IsDBCSLeadByte(pBuf[i])){
+			//マルチバイト文字
+			x++;
+			i++;
+			continue;
+		}
+	}
+
+	//列の確認
+	x=0;
+	for(;;i++,x++){
+		if(IsRightTurn(pBuf,i,x)){
+			//折り返しよりも右側が指定場所のとき
+			pCaretPos->x=x;
+			break;
+		}
+
+		if(pBuf[i]=='\t'){
+			//タブ文字
+			int tab;
+			tab=pobj_nv->TabSize;
+
+			if(x%tab==0) i2=tab;
+			else i2=tab-x%tab;
+			if(x+i2-1>=loose_x){
+				//指定場所にキャレットが存在するとき（タブ内）
+				pCaretPos->x=x;
+				break;
+			}
+			x+=i2-1;
+			continue;
+		}
+		else if(IsDBCSLeadByte(pBuf[i])){
+			//マルチバイト文字
+			x++;
+			i++;
+			if(x>=loose_x){
+				//マルチバイト文字の間にキャレットが存在するとき
+				pCaretPos->x=x-1;
+				break;
+			}
+			continue;
+		}
+
+		if(x>=loose_x){
+			//指定場所にキャレットが存在するとき（通常）
+			pCaretPos->x=x;
+			break;
+		}
+
+		if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'||pBuf[i]=='\0'){
+			//改行文字よりも右側が指定場所のとき
+			pCaretPos->x=x;
+			break;
+		}
+	}
+}
+
+void GetNaturalCaretPos_Click(int WndNum,int mouse_x,int mouse_y,POINT *pCaretPos){
+	/////////////////////////////
+	// キャレット移動（クリック）
+	/////////////////////////////
+
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	//ピクセル座標をカーソル座標（文字単位）に変更
+	mouse_x=(int)((double)mouse_x/(double)font_width+0.5);
+	mouse_y/=font_height;
+	GetNaturalBaseCaretPos(WndNum,&mouse_x,&mouse_y);
+
+	CaretPos_LooseToNatural(WndNum,mouse_x,mouse_y,pCaretPos);
+}
+void GetNaturalCaretPos_Left(int WndNum){
+	///////////////////////////
+	// キャレット移動（左キー）
+	///////////////////////////
+
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	int x,y;
+	char *pBuf;
+
+	POINT *pCaretPos;
+	pCaretPos=&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+
+	if(pCaretPos->x==0&&pCaretPos->y==0){
+		//ファイルの先頭から左へは行けない
+		return;
+	}
+
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+	i=GetBufferIndexFromCaretPos(pBuf,
+		pCaretPos->x,
+		pCaretPos->y);
+
+	if(i>=2){
+		if(pBuf[i-2]=='\r'&&pBuf[i-1]=='\n'){
+			//列先頭から前行の終端へ
+			x=INT_MAX;
+			y=pCaretPos->y-1;
+			CaretPos_LooseToNatural(WndNum,
+				x,y,
+				pCaretPos);
+			return;
+		}
+	}
+
+	x=pCaretPos->x-1;
+	y=pCaretPos->y;
+
+	BOOL sw=0;
+	if(x<0){
+		x=INT_MAX;
+		y--;
+
+		sw=1;
+	}
+
+	CaretPos_LooseToNatural(WndNum,
+		x,y,
+		pCaretPos);
+
+	if(sw){
+		GetNaturalCaretPos_Left(WndNum);
+	}
+}
+void GetNaturalCaretPos_Right(int WndNum,POINT *pCaretPos){
+	///////////////////////////
+	// キャレット移動（右キー）
+	///////////////////////////
+
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2;
+	char *pBuf;
+
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+	i=GetBufferIndexFromCaretPos(pBuf,
+		pCaretPos->x,
+		pCaretPos->y);
+
+	if(pBuf[i]=='\0'){
+		//ファイルの終端から右へは行けない
+		return;
+	}
+	else if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+		//改行コードから右へ
+		pCaretPos->x=0;
+		pCaretPos->y++;
+	}
+	else if(pBuf[i]=='\t'){
+		//タブ文字から右へ
+		int tab;
+		tab=pobj_nv->TabSize;
+
+		if(pCaretPos->x%tab==0) i2=tab;
+		else i2=tab-pCaretPos->x%tab;
+		pCaretPos->x+=i2;
+	}
+	else if(IsDBCSLeadByte(pBuf[i])){
+		//マルチバイト文字
+		pCaretPos->x+=2;
+	}
+	else{
+		//右へ（通常）
+		pCaretPos->x++;
+	}
+
+	//折り返し
+	int iMax_OneLine_TextLength;
+	iMax_OneLine_TextLength=40;
+	if(IsRightTurn(pBuf,i,pCaretPos->x)){
+		pCaretPos->x=0;
+		pCaretPos->y++;
+	}
+
+	CaretPos_LooseToNatural(WndNum,
+		pCaretPos->x,
+		pCaretPos->y,
+		pCaretPos);
+}
+void GetNaturalCaretPos_Up(int WndNum,POINT *pCaretPos){
+	///////////////////////////
+	// キャレット移動（上キー）
+	///////////////////////////
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	if(pCaretPos->y==0){
+		//1行目にキャレットがあるとき
+		return;
+	}
+
+	//上下のキャレット移動時には、左右方向の位置を保持する
+	if(MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
+
+	pCaretPos->y--;
+
+	CaretPos_LooseToNatural(WndNum,
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos,
+		pCaretPos->y,
+		pCaretPos);
+}
+void GetNaturalCaretPos_Down(int WndNum,POINT *pCaretPos){
+	///////////////////////////
+	// キャレット移動（下キー）
+	///////////////////////////
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	//上下のキャレット移動時には、左右方向の位置を保持する
+	if(MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
+
+	pCaretPos->y++;
+
+	CaretPos_LooseToNatural(WndNum,
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos,
+		pCaretPos->y,
+		pCaretPos);
+}
+void GetNaturalCaretPos_PageUp(int WndNum,POINT *pCaretPos){
+	///////////////////////////////
+	// キャレット移動（PageUpキー）
+	///////////////////////////////
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	if(pCaretPos->y==0){
+		//1行目にキャレットがあるとき
+		return;
+	}
+
+	//上下のキャレット移動時には、左右方向の位置を保持する
+	if(MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
+
+	SCROLLINFO si;
+	si.cbSize=sizeof(SCROLLINFO);
+	si.fMask=SIF_PAGE;
+	GetScrollInfo(MdiInfo[WndNum].pMdiTextEdit->hEdit,SB_VERT,&si);
+	pCaretPos->y-=si.nPage;
+	if(pCaretPos->y<0) pCaretPos->y=0;
+
+	CaretPos_LooseToNatural(WndNum,
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos,
+		pCaretPos->y,
+		pCaretPos);
+}
+void GetNaturalCaretPos_PageDown(int WndNum,POINT *pCaretPos){
+	///////////////////////////////
+	// キャレット移動（PageUpキー）
+	///////////////////////////////
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	//上下のキャレット移動時には、左右方向の位置を保持する
+	if(MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos==-1)
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=pCaretPos->x;
+
+	SCROLLINFO si;
+	si.cbSize=sizeof(SCROLLINFO);
+	si.fMask=SIF_PAGE;
+	GetScrollInfo(MdiInfo[WndNum].pMdiTextEdit->hEdit,SB_VERT,&si);
+	pCaretPos->y+=si.nPage;
+
+	CaretPos_LooseToNatural(WndNum,
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos,
+		pCaretPos->y,
+		pCaretPos);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/ChildWndOnRebar.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/ChildWndOnRebar.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/ChildWndOnRebar.cpp	(revision 178)
@@ -0,0 +1,410 @@
+#include "Common.h"
+
+
+
+//ファイル選択コンボボックス
+HWND hDocCombo;
+
+//スタンダードツールバー
+HWND hStandardToolbarPager;				//ページャー
+ILuxToolbar *pobj_StandardToolbar;
+
+//デバッガツールバー
+HWND hDebuggerToolbarPager;				//ページャー
+ILuxToolbar *pobj_DebuggerToolbar;
+
+//ビルドツールバー
+HWND hReleaseToolbarPager;
+ILuxToolbar *pobj_ReleaseToolbar;
+
+//プラットフォーム選択コンボボックス
+HWND hSelectCompilerCombo;
+
+//WebSearchコンボボックス
+HWND hWebSearchCombo;
+
+
+
+
+/////////////////
+// レバー追加
+// ※Add～プロシージャを追加
+/////////////////
+
+
+/* 以下は各バンドのメッセージプロシージャ */
+
+//hDocCombo（Rebar）プロシージャ
+LRESULT CALLBACK DocComboProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern WNDPROC OldDocComboProc;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	char str[MAX_PATH];
+	RECT rect;
+	switch(message){
+		case WM_COMMAND:
+			if(HIWORD(wParam)==CBN_SELCHANGE){
+				SendMessage(hwnd,CB_GETLBTEXT,SendMessage(hwnd,CB_GETCURSEL,0,0),(long)str);
+				for(i=0;i<MAX_WNDNUM;i++){
+					if(lstrcmpi(str,MdiInfo[i].title)==0) break;
+				}
+				BringWindowToTop(MdiInfo[i].hwnd);
+			}
+			break;
+		case WM_LBUTTONDOWN:
+			GetClientRect(hwnd,&rect);
+			SetWindowPos(hwnd,NULL,0,0,rect.right,120,SWP_NOMOVE);
+			break;
+		case WM_RBUTTONUP:
+			pobj_Rebar->menu_popup(hwnd,LOWORD(lParam),HIWORD(lParam));
+			break;
+	}
+	return CallWindowProc(OldDocComboProc,hwnd,message,wParam,lParam);
+}
+
+//hStandardToolbar（Rebar）プロシージャ
+LRESULT CALLBACK StandardToolbarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern char CmdMsg[255];
+	extern WNDPROC OldStandardToolbarProc;
+	if(message==WM_RBUTTONUP){
+		pobj_Rebar->menu_popup(hwnd,LOWORD(lParam),HIWORD(lParam));
+		InvalidateRect(hwnd,NULL,0);
+	}
+	return CallWindowProc(OldStandardToolbarProc,hwnd,message,wParam,lParam);
+}
+
+//hSelectCompilerCombo（Rebar）プロシージャ
+LRESULT CALLBACK SelectCompilerComboProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern WNDPROC OldSelectCompilerComboProc;
+	int i;
+	switch(message){
+		case WM_COMMAND:
+			if(HIWORD(wParam)==CBN_SELCHANGE){
+				i=SendMessage(hwnd,CB_GETCURSEL,0,0);
+
+				extern char *lpszCompilerName;
+				if(i==0) lpszCompilerName=WIN32_COMPILER_NAME;
+				if(i==1) lpszCompilerName=WIN64_COMPILER_NAME;
+			}
+			break;
+		case WM_LBUTTONDOWN:
+			RECT rect;
+			GetClientRect(hwnd,&rect);
+			SetWindowPos(hwnd,NULL,0,0,rect.right,120,SWP_NOMOVE);
+			break;
+		case WM_RBUTTONUP:
+			pobj_Rebar->menu_popup(hwnd,LOWORD(lParam),HIWORD(lParam));
+			break;
+	}
+	return CallWindowProc(OldSelectCompilerComboProc,hwnd,message,wParam,lParam);
+}
+
+//hWebSearchCombo（Rebar）プロシージャ
+LRESULT CALLBACK WebSearchProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern WNDPROC OldWebSearchProc;
+	switch(message){
+		case WM_LBUTTONDOWN:
+			RECT rect;
+			GetClientRect(hwnd,&rect);
+			SetWindowPos(hwnd,NULL,0,0,rect.right,120,SWP_NOMOVE);
+			break;
+	}
+	return CallWindowProc(OldWebSearchProc,hwnd,message,wParam,lParam);
+}
+
+LRESULT CALLBACK WebSearchEditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern WNDPROC OldWebSearchEditProc;
+	switch(message){
+		case WM_CHAR:
+			if(LOWORD(wParam)==VK_RETURN){
+				char *buffer,*temporary;
+				buffer=(char *)HeapAlloc(hHeap,0,MAX_PATH*3+1024);
+				temporary=(char *)HeapAlloc(hHeap,0,MAX_PATH*3+1024);
+
+				GetWindowText(hwnd,temporary,MAX_PATH);
+
+				int i=0;
+				while(temporary[i]==' ') i++;
+
+				char temp2[MAX_PATH];
+				strncpy(temp2,temporary+i,MAX_PATH);
+
+				i=lstrlen(temp2);
+				while(i>0){
+					if(temp2[i-1]==' ') i--;
+					else break;
+				}
+				temp2[i]=0;
+
+				//EUCに変換
+				nkf.pSetNkfOption("-wx");
+				nkf.pNkfConvert(buffer,temp2);
+
+				//URLエンコード
+				URLEncode(buffer);
+
+
+				//埋め込み型で表示
+				lstrcpy(temporary,"http://www.activebasic.com/application_search.php?query=");
+				lstrcat(temporary,buffer);
+				lstrcat(temporary,"&type=web&utf_sw=1");
+
+				pobj_SideWeb->GoPage(temporary);
+
+
+				AddFindData(GetParent(hwnd),pobj_nv->WebStr,temp2);
+
+				HeapDefaultFree(buffer);
+				HeapDefaultFree(temporary);
+			}
+			break;
+	}
+	return CallWindowProc(OldWebSearchEditProc,hwnd,message,wParam,lParam);
+}
+
+
+
+/*----- 以下はRebarの初期生成 -----*/
+
+//ドキュメント選択コンボボックスをレバーに追加
+HWND AddDocCombo(HWND hRebar,int num,char *lpszText){
+	extern HINSTANCE hInst;
+	extern HWND hDocCombo,hClient;
+	extern WNDPROC OldDocComboProc;
+	extern HFONT hStatusFont;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2;
+	HWND hTempWnd;
+	char buffer[MAX_PATH];
+
+	//コンボボックスを生成
+	hDocCombo=CreateWindow("COMBOBOX",NULL,
+		WS_CHILD|WS_VSCROLL|WS_VISIBLE|CBS_DROPDOWNLIST|CBS_DROPDOWN|CBS_HASSTRINGS|CBS_SORT,
+		0,0,0,120,hRebar,NULL,hInst,NULL);
+
+	//サブクラス化
+	OldDocComboProc=(WNDPROC)GetWindowLong(hDocCombo,GWL_WNDPROC);
+	SetWindowLong(hDocCombo,GWL_WNDPROC,(long)DocComboProc);
+
+	//フォントを設定
+	SendMessage(hDocCombo,WM_SETFONT,(unsigned int)hStatusFont,0);
+
+	hTempWnd=GetWindow(hClient,GW_CHILD);
+	if(IsWindow(hTempWnd)){
+		for(i=0,i2=0;i<MAX_WNDNUM;i++){
+			if(MdiInfo[i].hwnd){
+				GetWindowText(MdiInfo[i].hwnd,buffer,MAX_PATH);
+				if(MdiInfo[i].hwnd==hTempWnd) i2=SendMessage(hDocCombo,CB_ADDSTRING,0,(long)buffer);
+				else SendMessage(hDocCombo,CB_ADDSTRING,0,(long)buffer);
+			}
+		}
+		SendMessage(hDocCombo,CB_SETCURSEL,i2,0);
+	}
+
+	lstrcpy(lpszText,"File:");
+	return hDocCombo;
+}
+
+//ファイル管理ツールバーをレバーに追加
+HWND AddStandardToolbar(HWND hRebar,int num,char *lpszText){
+	extern HWND hStandardToolbarPager;
+
+	//ページャーウィンドウを生成
+	hStandardToolbarPager=CreateWindow(WC_PAGESCROLLER,NULL,
+		WS_CHILD|WS_VISIBLE|PGS_HORZ,
+		0,0,0,0,
+		hRebar,NULL,hInst,NULL);
+
+
+	//LuxToolbarオブジェクトを生成
+	if(pobj_StandardToolbar) pobj_StandardToolbar->Release();
+	pobj_StandardToolbar=LuxToolbar_CreateInstance();
+	pobj_StandardToolbar->Create(hStandardToolbarPager);
+
+
+#define ADD_TOOLBAR_BUTTON(id,iconID,lpszToolTip) pobj_StandardToolbar->Add(id,(HICON)LoadImage(hIconResInst,MAKEINTRESOURCE(iconID),IMAGE_ICON,16,16,0),lpszToolTip)
+#define ADD_TOOLBAR_SEPARATOR pobj_StandardToolbar->Add(0,0,0)
+	//ボタン類を追加
+	ADD_TOOLBAR_BUTTON(IDM_NEW,IDI_NEW,"新規作成(Ctrl+N)");
+	ADD_TOOLBAR_SEPARATOR;
+	ADD_TOOLBAR_BUTTON(IDM_OPEN,IDI_OPEN,"開く(Ctrl+O)");
+	ADD_TOOLBAR_BUTTON(IDM_SAVE,IDI_SAVE,"保存(Ctrl+S)");
+	ADD_TOOLBAR_BUTTON(IDM_ALLSAVE,IDI_ALLSAVE,"すべて保存");
+	ADD_TOOLBAR_SEPARATOR;
+	ADD_TOOLBAR_BUTTON(IDM_CUT,IDI_CUT,"切り取り(Ctrl+X)");
+	ADD_TOOLBAR_BUTTON(IDM_COPY,IDI_COPY,"コピー(Ctrl+C)");
+	ADD_TOOLBAR_BUTTON(IDM_PASTE,IDI_PASTE,"貼り付け(Ctrl+V)");
+	ADD_TOOLBAR_SEPARATOR;
+	ADD_TOOLBAR_BUTTON(IDM_UNDO,IDI_UNDO,"元に戻す(Ctrl+Z)");
+	ADD_TOOLBAR_BUTTON(IDM_REDO,IDI_REDO,"やり直し(Ctrl+Y)");
+	ADD_TOOLBAR_SEPARATOR;
+	ADD_TOOLBAR_BUTTON(IDM_FIND,IDI_FIND,"検索(Ctrl+F)");
+#undef ADD_TOOLBAR_SEPARATOR
+#undef ADD_TOOLBAR_BUTTON
+
+
+	//ページャー設定
+	Pager_SetChild(hStandardToolbarPager,pobj_StandardToolbar->GetHandle());
+
+
+	//サブクラス化
+	extern WNDPROC OldStandardToolbarProc;
+	OldStandardToolbarProc=(WNDPROC)GetWindowLong(pobj_StandardToolbar->GetHandle(),GWL_WNDPROC);
+	SetWindowLong(pobj_StandardToolbar->GetHandle(),GWL_WNDPROC,(long)StandardToolbarProc);
+
+	lpszText[0]=0;
+	return hStandardToolbarPager;
+}
+
+//デバッガツールバーをレバーに追加
+HWND AddDebuggerToolbar(HWND hRebar,int num,char *lpszText){
+#ifndef THETEXT
+
+	extern HWND hDebuggerToolbarPager;
+
+	hDebuggerToolbarPager=CreateWindow(WC_PAGESCROLLER,NULL,
+		WS_CHILD|WS_VISIBLE|PGS_HORZ,
+		0,0,0,0,
+		hRebar,NULL,hInst,NULL);
+
+	//LuxToolbarオブジェクトを生成
+	if(pobj_DebuggerToolbar) pobj_DebuggerToolbar->Release();
+	pobj_DebuggerToolbar=LuxToolbar_CreateInstance();
+	pobj_DebuggerToolbar->Create(hDebuggerToolbarPager);
+
+#define ADD_TOOLBAR_BUTTON(id,iconID,lpszToolTip) pobj_DebuggerToolbar->Add(id,(HICON)LoadImage(hIconResInst,MAKEINTRESOURCE(iconID),IMAGE_ICON,16,16,0),lpszToolTip)
+#define ADD_TOOLBAR_SEPARATOR pobj_DebuggerToolbar->Add(0,0,0)
+	//ボタン類を追加
+	ADD_TOOLBAR_BUTTON(IDM_DEBUGCOMPILE,IDI_DEBUGCOMPILE,"デバッグ コンパイル");
+	ADD_TOOLBAR_SEPARATOR;
+	ADD_TOOLBAR_BUTTON(IDM_DEBUG,IDI_DEBUGRUN,"デバッグ実行(F8)");
+	ADD_TOOLBAR_BUTTON(IDM_DEBUG_PAUSE,IDI_DEBUGPAUSE,"デバッグを一時停止");
+	ADD_TOOLBAR_BUTTON(IDM_DEBUG_STOP,IDI_DEBUGSTOP,"デバッグを中断");
+	ADD_TOOLBAR_SEPARATOR;
+	ADD_TOOLBAR_BUTTON(IDM_STEP_IN,IDI_STEPIN,"ステップ イン(F10)");
+	ADD_TOOLBAR_BUTTON(IDM_STEP_OVER,IDI_STEPOVER,"ステップ オーバー(F11)");
+	ADD_TOOLBAR_BUTTON(IDM_STEP_CURSOR,IDI_STEPTOCURSOR,"カーソル行まで実行(Ctrl+F11)");
+	ADD_TOOLBAR_SEPARATOR;
+	ADD_TOOLBAR_BUTTON(IDM_BREAKPOINT,IDI_BREAKPOINT,"ブレークポイントの設置/解除(F9)");
+#undef ADD_TOOLBAR_SEPARATOR
+#undef ADD_TOOLBAR_BUTTON
+
+	//ページャー設定
+	Pager_SetChild(hDebuggerToolbarPager,pobj_DebuggerToolbar->GetHandle());
+
+	//サブクラス化
+	extern WNDPROC OldStandardToolbarProc;
+	OldStandardToolbarProc=(WNDPROC)GetWindowLong(pobj_DebuggerToolbar->GetHandle(),GWL_WNDPROC);
+	SetWindowLong(pobj_DebuggerToolbar->GetHandle(),GWL_WNDPROC,(long)StandardToolbarProc);
+
+	lpszText[0]=0;
+	return hDebuggerToolbarPager;
+#else //THETEXT
+	return 0;
+#endif //THETEXT
+}
+
+//リリースツールバーをレバーに追加
+HWND AddReleaseToolbar(HWND hRebar,int num,char *lpszText){
+#ifndef THETEXT
+
+	extern HWND hReleaseToolbarPager;
+
+	hReleaseToolbarPager=CreateWindow(WC_PAGESCROLLER,NULL,
+		WS_CHILD|WS_VISIBLE|PGS_HORZ,
+		0,0,0,0,
+		hRebar,NULL,hInst,NULL);
+
+	//LuxToolbarオブジェクトを生成
+	if(pobj_ReleaseToolbar) pobj_ReleaseToolbar->Release();
+	pobj_ReleaseToolbar=LuxToolbar_CreateInstance();
+	pobj_ReleaseToolbar->Create(hReleaseToolbarPager);
+
+#define ADD_TOOLBAR_BUTTON(id,iconID,lpszToolTip) pobj_ReleaseToolbar->Add(id,(HICON)LoadImage(hIconResInst,MAKEINTRESOURCE(iconID),IMAGE_ICON,16,16,0),lpszToolTip)
+#define ADD_TOOLBAR_SEPARATOR pobj_ReleaseToolbar->Add(0,0,0)
+	//ボタン類を追加
+	ADD_TOOLBAR_BUTTON(IDM_RELEASECOMPILE,IDI_RELEASECOMPILE,"リリース コンパイル(F6)");
+	ADD_TOOLBAR_BUTTON(IDM_RELEASERUN,IDI_RELEASERUN,"実行");
+#undef ADD_TOOLBAR_SEPARATOR
+#undef ADD_TOOLBAR_BUTTON
+
+	//ページャー設定
+	Pager_SetChild(hReleaseToolbarPager,pobj_ReleaseToolbar->GetHandle());
+
+	//サブクラス化
+	extern WNDPROC OldStandardToolbarProc;
+	OldStandardToolbarProc=(WNDPROC)GetWindowLong(pobj_ReleaseToolbar->GetHandle(),GWL_WNDPROC);
+	SetWindowLong(pobj_ReleaseToolbar->GetHandle(),GWL_WNDPROC,(long)StandardToolbarProc);
+
+	lpszText[0]=0;
+	return hReleaseToolbarPager;
+#else //THETEXT
+	return 0;
+#endif //THETEXT
+}
+
+//コンパイラ選択コンボボックスをレバーに追加
+HWND AddBand_SelectCompiler(HWND hRebar,int num,char *lpszText){
+
+	//コンボボックスを生成
+	extern HINSTANCE hInst;
+	extern HWND hSelectCompilerCombo;
+	hSelectCompilerCombo=CreateWindow("COMBOBOX",NULL,
+		WS_CHILD|WS_VSCROLL|WS_VISIBLE|CBS_DROPDOWNLIST|CBS_DROPDOWN|CBS_HASSTRINGS|CBS_SORT,
+		0,0,0,120,hRebar,NULL,hInst,NULL);
+
+	//サブクラス化
+	extern WNDPROC OldSelectCompilerComboProc;
+	OldSelectCompilerComboProc=(WNDPROC)GetWindowLong(hSelectCompilerCombo,GWL_WNDPROC);
+	SetWindowLong(hSelectCompilerCombo,GWL_WNDPROC,(long)SelectCompilerComboProc);
+
+	//フォントを設定
+	extern HFONT hStatusFont;
+	SendMessage(hSelectCompilerCombo,WM_SETFONT,(WPARAM)hStatusFont,0);
+
+	//コンボボックスに文字列を挿入
+	SendMessage(hSelectCompilerCombo,CB_ADDSTRING,0,(long)"Win32");
+	if(IsWow64()) SendMessage(hSelectCompilerCombo,CB_ADDSTRING,0,(long)"Win64");
+
+	//Win32を選択
+	SendMessage(hSelectCompilerCombo,CB_SETCURSEL,0,0);
+
+	lpszText[0]=0;
+	return hSelectCompilerCombo;
+}
+
+HWND AddBand_WebSearch(HWND hRebar,int num,char *lpszText){
+	//コンボボックスを生成
+	extern HINSTANCE hInst;
+	extern HWND hWebSearchCombo;
+	hWebSearchCombo=CreateWindow("COMBOBOX",NULL,
+		WS_CHILD|WS_VSCROLL|WS_VISIBLE|CBS_DROPDOWN|CBS_HASSTRINGS|CBS_AUTOHSCROLL,
+		0,0,0,120,hRebar,NULL,hInst,NULL);
+
+	//サブクラス化
+	extern WNDPROC OldWebSearchProc;
+	OldWebSearchProc=(WNDPROC)GetWindowLong(hWebSearchCombo,GWL_WNDPROC);
+	SetWindowLong(hWebSearchCombo,GWL_WNDPROC,(long)WebSearchProc);
+	extern WNDPROC OldWebSearchEditProc;
+	OldWebSearchEditProc=(WNDPROC)GetWindowLong(GetWindow(hWebSearchCombo,GW_CHILD),GWL_WNDPROC);
+	SetWindowLong(GetWindow(hWebSearchCombo,GW_CHILD),GWL_WNDPROC,(long)WebSearchEditProc);
+
+	//フォントを設定
+	extern HFONT hStatusFont;
+	SendMessage(hWebSearchCombo,WM_SETFONT,(WPARAM)hStatusFont,0);
+
+	lstrcpy(lpszText,"WebSearch(F5):");
+
+
+
+	//Web検索文字列コンボボックスを初期化
+	int i;
+	SendMessage(hWebSearchCombo,CB_RESETCONTENT,0,0);
+	for(i=0;i<MAX_FINDLIST;i++){
+		if(pobj_nv->WebStr[i][0]=='\0') break;
+		SendMessage(hWebSearchCombo,CB_ADDSTRING,0,(long)pobj_nv->WebStr[i]);
+	}
+	SendMessage(hWebSearchCombo,CB_LIMITTEXT,8192,0);
+
+	return hWebSearchCombo;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/ClassTree.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/ClassTree.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/ClassTree.cpp	(revision 178)
@@ -0,0 +1,619 @@
+#include "Common.h"
+
+#if defined(JPN)
+//日本語
+#include "pj_msg_jpn.h"
+#else
+//英語
+#include "pj_msg_eng.h"
+#endif
+
+
+CClassTreeView *pobj_ClassTreeView;
+
+BOOL bSearchingClasses,bRetrySearchingClasses;
+
+
+int CClassTreeView::hash_default(LONG_PTR lpdata){
+	return lpdata%MAX_HASH;
+}
+void CClassTreeView::AddValidItem(HTREEITEM hItem,int iFileNum){
+	//ハッシュ値を取得
+	int key;
+	key=hash_default((LONG_PTR)hItem);
+
+	//格納位置を取得
+	TREEHASH *pth;
+	pth=&tree_data[key];
+	while(pth->hItem){
+		if(pth->hItem==hItem){
+			//既に存在するときは抜け出す
+			return;
+		}
+		if(pth->pNextData==0){
+			pth->pNextData=(TREEHASH *)HeapAlloc(hHeap,0,sizeof(TREEHASH));
+			pth=pth->pNextData;
+			break;
+		}
+		pth=pth->pNextData;
+	}
+
+	pth->hItem=hItem;
+	pth->iFileNum=iFileNum;
+	pth->pNextData=0;
+}
+
+BOOL CClassTreeView::delete_check(HTREEITEM hItem){
+	//ハッシュ値を取得
+	int key;
+	key=hash_default((LONG_PTR)hItem);
+
+	TREEHASH *pth;
+	pth=&tree_data[key];
+	while(pth->hItem){
+		if(pth->hItem==hItem) return 1;
+
+		if(pth->pNextData==0) break;
+		pth=pth->pNextData;
+	}
+	return 0;
+}
+
+void CClassTreeView::DeleteInvalidItems(HTREEITEM hItem){
+	HTREEITEM hChildItem;
+	while(hItem){
+		if(!delete_check(hItem)){
+			HTREEITEM hTemp;
+			hTemp=hItem;
+
+			hItem=TreeView_GetNextSibling(hTreeWnd,hItem);
+
+			TreeView_DeleteItem(hTreeWnd,hTemp);
+			continue;
+		}
+
+		hChildItem=TreeView_GetChild(hTreeWnd,hItem);
+		if(hChildItem){
+			DeleteInvalidItems(hChildItem);
+		}
+
+		hItem=TreeView_GetNextSibling(hTreeWnd,hItem);
+	}
+}
+
+void CClassTreeView::DeleteTreeHash(TREEHASH *pth){
+	if(pth->hItem && (iNowFile==-1 || iNowFile==pth->iFileNum)){
+		if(pth->pNextData){
+			DeleteTreeHash(pth->pNextData);
+			HeapDefaultFree(pth->pNextData);
+			pth->pNextData=0;
+		}
+		pth->hItem=0;
+	}
+}
+
+
+HTREEITEM CClassTreeView::insert(HTREEITEM hParentItem,int flag,char *lpszName,int iFileNum){
+	char temporary[255];
+
+	TVITEM tvItem;
+	tvItem.pszText=temporary;
+	tvItem.cchTextMax=255;
+	HTREEITEM hNextItem;
+	hNextItem=TreeView_GetChild(hTreeWnd,hParentItem);
+	while(hNextItem){
+		tvItem.mask=TVIF_HANDLE|TVIF_TEXT;
+		tvItem.hItem=hNextItem;
+		TreeView_GetItem(hTreeWnd,&tvItem);
+		if(lstrcmp(lpszName,tvItem.pszText)==0){
+			//既に挿入済みの場合
+			AddValidItem(hNextItem,iFileNum);
+			return hNextItem;
+		}
+
+		hNextItem=TreeView_GetNextSibling(hTreeWnd,hNextItem);
+	}
+
+
+	TV_INSERTSTRUCT tv;
+	tv.hInsertAfter=TVI_SORT;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIS_EXPANDED ;
+	tv.hParent=hParentItem;
+	tv.item.pszText=lpszName;
+
+	if(flag==CTV_ROOT){
+		tv.item.iImage=3;
+		tv.item.iSelectedImage=3;
+	}
+	if(flag==CTV_FOLDER){
+		tv.item.iImage=0;
+		tv.item.iSelectedImage=0;
+	}
+	else if(flag==CTV_GLOBAL_PROC){
+		tv.item.iImage=5;
+		tv.item.iSelectedImage=5;
+	}
+	else if(flag==CTV_CLASS){
+		tv.item.iImage=2;
+		tv.item.iSelectedImage=2;
+	}
+	else if(flag==CTV_PUBLIC_MEMBER){
+		tv.item.iImage=4;
+		tv.item.iSelectedImage=4;
+	}
+	else if(flag==CTV_PUBLIC_METHOD){
+		tv.item.iImage=5;
+		tv.item.iSelectedImage=5;
+	}
+	else if(flag==CTV_PRIVATE_MEMBER){
+		tv.item.iImage=6;
+		tv.item.iSelectedImage=6;
+	}
+	else if(flag==CTV_PRIVATE_METHOD){
+		tv.item.iImage=7;
+		tv.item.iSelectedImage=7;
+	}
+
+	hNextItem=TreeView_InsertItem(hTreeWnd,&tv);
+	AddValidItem(hNextItem,iFileNum);
+	return hNextItem;
+}
+
+
+
+CClassTreeView::CClassTreeView(){
+	memset(this,0,sizeof(CClassTreeView));
+}
+CClassTreeView::~CClassTreeView(){
+	while(bSearchingClasses) Sleep(10);
+
+	iNowFile=-1;
+
+	int i;
+	for(i=0;i<MAX_HASH;i++){
+		DeleteTreeHash(&tree_data[i]);
+	}
+
+	if(pobj_ClassTreeView->pProcInfo){
+		//プロシージャ情報のメモリを解放
+		for(i=0;i<pobj_ClassTreeView->NumberOfProcedures;i++){
+			HeapDefaultFree(pobj_ClassTreeView->pProcInfo[i].name);
+		}
+		HeapDefaultFree(pobj_ClassTreeView->pProcInfo);
+		pobj_ClassTreeView->pProcInfo=0;
+	}
+}
+void CClassTreeView::init(HWND hwnd,int iFileNum){
+	hTreeWnd=hwnd;
+
+	iNowFile=iFileNum;
+
+	int i;
+	for(i=0;i<MAX_HASH;i++){
+		DeleteTreeHash(&tree_data[i]);
+	}
+}
+
+void CClassTreeView::InsertRootFolder(void){
+	extern PROJECTINFO ProjectInfo;
+	char temporary[VN_SIZE];
+	sprintf(temporary,"%s クラス",ProjectInfo.name);
+	hRootFolder=insert(
+		TVI_ROOT,
+		CTV_ROOT,
+		temporary,-1);
+}
+void CClassTreeView::InsertGlobalProcedureFolder(void){
+	hGlobalProcedureFolder=insert(
+		hRootFolder,
+		CTV_FOLDER,
+		"グローバル関数",-1);
+}
+
+HTREEITEM CClassTreeView::InsertGlobalProcedure(int flag,char *lpszName,int iFileNum){
+	return pobj_ClassTreeView->insert(
+		hGlobalProcedureFolder,
+		CTV_GLOBAL_PROC,
+		lpszName,
+		iFileNum);
+}
+
+HTREEITEM CClassTreeView::insert_code_item(HTREEITEM hParentItem,int flag,char *lpszName,int iFileNum,char *pBuf,int p){
+	int i4;
+	i4=NumberOfProcedures;
+	pProcInfo=(PROCINFO *)HeapReAlloc(hHeap,0,pProcInfo,sizeof(PROCINFO)*(i4+1));
+	pProcInfo[i4].name=(char *)HeapAlloc(hHeap,0,lstrlen(lpszName)+1);
+	lstrcpy(pProcInfo[i4].name,lpszName);
+	pProcInfo[i4].FileNum=iFileNum;
+
+	//コード位置
+	pProcInfo[i4].code_pos=p;
+
+	//ツリーアイテムを挿入
+	HTREEITEM hTempItem;
+	hTempItem=insert(
+		hParentItem,
+		flag,
+		lpszName,
+		iFileNum);
+
+	pProcInfo[i4].hTreeItem=hTempItem;
+
+	NumberOfProcedures++;
+
+	return hTempItem;
+}
+
+void CClassTreeView::InsertClassFolder(char *lpszName,int iFileNum,char *pBuf,int p){
+	hNowClassFolder=insert_code_item(hRootFolder,CTV_CLASS,lpszName,iFileNum,pBuf,p);
+}
+void CClassTreeView::InsertClassMember(int flag,char *lpszName,int iFileNum,char *pBuf,int p){
+	insert_code_item(hNowClassFolder,flag,lpszName,iFileNum,pBuf,p);
+}
+
+void CClassTreeView::finish(){
+	DeleteInvalidItems(TreeView_GetRoot(hTreeWnd));
+}
+
+
+void AnalysisClass(char *pBuf,int *p,int iFileNum){
+	int i2;
+	i2=*p;
+
+
+	CClassInfo *pobj_ClassInfo;
+	pobj_ClassInfo=new CClassInfo();
+
+	pobj_ClassInfo->Analyze(pBuf,p);
+
+
+	//クラスフォルダを挿入
+	pobj_ClassTreeView->InsertClassFolder(
+		pobj_ClassInfo->ClassName,
+		iFileNum,
+		pBuf,
+		i2);
+
+
+
+	///////////////////////////////
+	// メンバ及びメソッドを挿入
+	///////////////////////////////
+
+	int i;
+	for(i=0;i<pobj_ClassInfo->MemberNum;i++){
+		int flag;
+		if(pobj_ClassInfo->pMemberInfo[i].dwProc==0){
+			//メンバ変数
+			if(pobj_ClassInfo->pMemberInfo[i].dwAccess==ACCESS_PUBLIC){
+				//公開
+				flag=CTV_PUBLIC_MEMBER;
+			}
+			else{
+				//非公開
+				flag=CTV_PRIVATE_MEMBER;
+			}
+		}
+		else{
+			//メソッド
+			if(pobj_ClassInfo->pMemberInfo[i].dwAccess==ACCESS_PUBLIC){
+				//公開
+				flag=CTV_PUBLIC_METHOD;
+			}
+			else{
+				//非公開
+				flag=CTV_PRIVATE_METHOD;
+			}
+		}
+		pobj_ClassTreeView->InsertClassMember(flag,pobj_ClassInfo->pMemberInfo[i].pName,iFileNum,pBuf,pobj_ClassInfo->pMemberInfo[i].code_pos);
+	}
+
+
+	delete pobj_ClassInfo;
+	pobj_ClassInfo=0;
+}
+
+
+void SetClassTreeFromOneFile_Buf( char *pBuf, int iFileNum ){
+	int i2,i3,i4;
+	char temporary[GENERAL_SIZE];
+
+	for(i2=0;;i2++){
+		if(pBuf[i2]=='\0') break;
+		while(pBuf[i2]=='\r'&&pBuf[i2+1]=='\n'&&pBuf[i2+2]=='\r'&&pBuf[i2+3]=='\n') i2+=2;
+		if(i2==0||(pBuf[i2]=='\r'&&pBuf[i2+1]=='\n')){
+			if(pBuf[i2]=='\r'&&pBuf[i2+1]=='\n') i2+=2;
+			while(pBuf[i2]>='0'&&pBuf[i2]<='9') i2++;
+			while(pBuf[i2]==' '||pBuf[i2]=='\t') i2++;
+
+			i4=i2;
+			for(i3=0;;i2++,i3++){
+				if(!IsVariableChar(pBuf[i2])){
+					temporary[i3]=0;
+					break;
+				}
+				temporary[i3]=pBuf[i2];
+			}
+			if(pBuf[i2]=='\0') break;
+
+			if(lstrcmpi(temporary,"Class")==0||
+				lstrcmpi(temporary,"Type")==0||
+				lstrcmpi(temporary,"Interface")==0){
+
+				/////////////////////////////
+				// クラスの解析
+				/////////////////////////////
+				AnalysisClass(pBuf,&i4,iFileNum);
+
+				i2=i4-1;
+				continue;
+			}
+
+			int sw;
+			if(lstrcmpi(temporary,"Sub")==0) sw=1;
+			else if(lstrcmpi(temporary,"Function")==0) sw=2;
+			else sw=0;
+
+			if(sw){
+				//Sub/Function
+				while(pBuf[i2]==' '||pBuf[i2]=='\t') i2++;
+				for(i3=0;;i2++,i3++){
+					if(!IsVariableChar(pBuf[i2])){
+						temporary[i3]=0;
+						break;
+					}
+					temporary[i3]=pBuf[i2];
+				}
+
+				if(lstrcmpi(temporary,"Export")==0){
+					//Export修飾子はとばす
+					while(pBuf[i2]==' '||pBuf[i2]=='\t') i2++;
+
+					for(i3=0;;i2++,i3++){
+						if(!IsVariableChar(pBuf[i2])){
+							temporary[i3]=0;
+							break;
+						}
+						temporary[i3]=pBuf[i2];
+					}
+				}
+
+				i4=pobj_ClassTreeView->NumberOfProcedures;
+				pobj_ClassTreeView->pProcInfo=(PROCINFO *)HeapReAlloc(hHeap,0,pobj_ClassTreeView->pProcInfo,sizeof(PROCINFO)*(i4+1));
+				pobj_ClassTreeView->pProcInfo[i4].name=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+				lstrcpy(pobj_ClassTreeView->pProcInfo[i4].name,temporary);
+				pobj_ClassTreeView->pProcInfo[i4].FileNum=iFileNum;
+
+				//定義行の選択範囲
+				pobj_ClassTreeView->pProcInfo[i4].code_pos=i2;
+
+				//パラメータ部
+				while(pBuf[i2]==' '||pBuf[i2]=='\t') i2++;
+				if(pBuf[i2]=='('){
+					int IsStr,PareNum;
+					for(i2++,i3=0,IsStr=0,PareNum=0;;i2++,i3++){
+						if(pBuf[i2]=='\"') IsStr^=1;
+						if(pBuf[i2]=='('&&IsStr==0) PareNum++;
+						if(pBuf[i2]==')'&&IsStr==0){
+							PareNum--;
+							if(PareNum<0){
+								temporary[i3]=0;
+								break;
+							}
+						}
+						if(pBuf[i2]=='\0') break;
+						temporary[i3]=pBuf[i2];
+					}
+					//temporaryはパラメータの内容が格納されるが、不要
+				}
+
+				for(;;i2++){
+					if(IsCommandDelimitation(pBuf,i2)){
+						break;
+					}
+					if((pBuf[i2]=='a'||pBuf[i2]=='A')&&(pBuf[i2+1]=='s'||pBuf[i2+1]=='S')&&(pBuf[i2+2]==' '||pBuf[i2+2]=='\t')){
+						i2+=3;
+						while(pBuf[i2]==' '||pBuf[i2]=='\t') i2++;
+						for(i3=0;;i2++,i3++){
+							if(!IsVariableChar(pBuf[i2])){
+								temporary[i3]=0;
+								break;
+							}
+							temporary[i3]=pBuf[i2];
+						}
+						//temporaryには型情報が格納されるが、不要
+						break;
+					}
+				}
+
+				//ツリーアイテムを挿入
+				HTREEITEM hTempItem;
+				hTempItem=pobj_ClassTreeView->InsertGlobalProcedure(
+					CTV_GLOBAL_PROC,
+					pobj_ClassTreeView->pProcInfo[i4].name,
+					iFileNum);
+				pobj_ClassTreeView->pProcInfo[i4].hTreeItem=hTempItem;
+
+				pobj_ClassTreeView->NumberOfProcedures++;
+
+				i2--;
+			}
+		}
+	}
+}
+void SetClassTreeFromOneFile(char *lpszFilePath,int iFileNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int WndNum;
+	HWND hChild=GetWindow(hClient,GW_CHILD);
+	while(hChild){
+		WndNum=GetWndNum(hChild);
+		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+			if(lstrcmpi(MdiInfo[WndNum].path,lpszFilePath)==0) break;
+		}
+		hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+	}
+
+	char *pBuf;
+	if(hChild){
+		//すでに指定されたファイルが開かれている場合
+		pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+	}
+	else{
+		//開かれていない場合
+		pBuf=ReadBuffer(lpszFilePath);
+		if(!pBuf) pBuf=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+	}
+
+	SetClassTreeFromOneFile_Buf( pBuf, iFileNum );
+
+	if(!hChild) HeapDefaultFree(pBuf);
+}
+
+void SetProcedureTreeData(void *temp_iFileNum){
+	int i;
+	char temporary[MAX_PATH];
+	BOOL bExpand;
+	TVITEM tvItem;
+	SCROLLINFO si;
+
+	int iFileNum;
+	iFileNum=(int)temp_iFileNum;
+
+	if(bSearchingClasses){
+		bRetrySearchingClasses=1;
+		_endthread();
+		return;
+	}
+	bSearchingClasses=1;
+
+	if(pobj_ClassTreeView->pProcInfo){
+wait_repeat:
+		Sleep(700);
+		if(bRetrySearchingClasses){
+			bRetrySearchingClasses=0;
+			goto wait_repeat;
+		}
+
+		PROCINFO *pNewProcInfo;
+		pNewProcInfo=(PROCINFO *)HeapAlloc(hHeap,0,pobj_ClassTreeView->NumberOfProcedures*sizeof(PROCINFO));
+		int NewProcNum;
+		NewProcNum=0;
+
+		//プロシージャ情報のメモリを解放
+		for(i=0;i<pobj_ClassTreeView->NumberOfProcedures;i++){
+			if(iFileNum==-1 || iFileNum==pobj_ClassTreeView->pProcInfo[i].FileNum){
+				HeapDefaultFree(pobj_ClassTreeView->pProcInfo[i].name);
+			}
+			else{
+				pNewProcInfo[NewProcNum]=pobj_ClassTreeView->pProcInfo[i];
+				NewProcNum++;
+			}
+		}
+		HeapDefaultFree(pobj_ClassTreeView->pProcInfo);
+
+		pobj_ClassTreeView->pProcInfo=pNewProcInfo;
+		pobj_ClassTreeView->NumberOfProcedures=NewProcNum;
+	}
+	else{
+		pobj_ClassTreeView->pProcInfo=(PROCINFO *)HeapAlloc(hHeap,0,1);
+		pobj_ClassTreeView->NumberOfProcedures=0;
+	}
+
+	extern HWND hProcedureTreeView;
+	tvItem.hItem=TreeView_GetRoot(hProcedureTreeView);
+	if(tvItem.hItem){
+		TreeView_GetItem(hProcedureTreeView,&tvItem);
+		if(tvItem.state&TVIS_EXPANDED){
+			bExpand=1;
+
+			si.cbSize=sizeof(SCROLLINFO);
+			si.fMask=SIF_POS;
+			GetScrollInfo(hProcedureTreeView,SB_VERT,&si);
+		}
+		else bExpand=0;
+	}
+	else bExpand=1;
+
+
+	pobj_ClassTreeView->init(hProcedureTreeView,iFileNum);
+
+	//ルートフォルダ
+	pobj_ClassTreeView->InsertRootFolder();
+
+	//グローバル関数フォルダ
+	pobj_ClassTreeView->InsertGlobalProcedureFolder();
+
+
+	//描画をロック
+	LockWindowUpdate(hProcedureTreeView);
+
+	extern PROJECTINFO ProjectInfo;
+	if(ProjectInfo.name[0]){
+		// プロジェクトが開かれているとき
+		if(iFileNum==-1){
+			//プロジェクトのすべてのファイルを解析
+			for(i=0;i<ProjectInfo.pobj_DBFileInfo->iNum;i++){
+				ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
+
+				SetClassTreeFromOneFile(temporary,i);
+			}
+
+			//不要になったアイテムを除去
+			//pobj_ClassTreeView->finish();
+		}
+		else{
+			/////////////////////////////////
+			// 編集中のファイルのみを解析
+			/////////////////////////////////
+
+			ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[iFileNum]->GetFullPath(temporary);
+
+			SetClassTreeFromOneFile(temporary,iFileNum);
+		}
+	}
+	else{
+		// 編集中の単体ファイルを解析
+
+		HWND hChild=GetWindow(hClient,GW_CHILD);
+		int WndNum=GetWndNum(hChild);
+		char *pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+		SetClassTreeFromOneFile_Buf( pBuf, -1 );
+
+	}
+
+	//不要になったアイテムを除去
+	pobj_ClassTreeView->finish();
+
+	//描画ロックを解除
+	LockWindowUpdate(0);
+
+
+	if(bExpand){
+		TreeView_Expand(hProcedureTreeView,pobj_ClassTreeView->hRootFolder,TVE_EXPAND);
+
+		SetScrollInfo(hProcedureTreeView,SB_VERT,&si,1);
+	}
+
+
+	bSearchingClasses=0;
+	if(bRetrySearchingClasses){
+		bRetrySearchingClasses=0;
+		ResetClassTree(iFileNum);
+	}
+
+	if(pobj_ClassTreeView->bCloseSwitch){
+		//コード解析中に終了ボタンが押されたとき
+		PostMessage(hOwner,WM_CLOSE,0,0);
+	}
+	if(pobj_ClassTreeView->bShowSwitch){
+		//コード解析中にクラスビューがダブルクリックされたとき
+		extern HWND hProjectViewTab;
+		PostMessage(hProjectViewTab,WM_COMMAND,IDM_PROCEDURETREE_SHOW,0);
+		pobj_ClassTreeView->bShowSwitch=0;
+	}
+
+	_endthread();
+}
+void ResetClassTree(int iFileNum){
+	_beginthread(SetProcedureTreeData,0,(void *)iFileNum);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/CodeFormatter.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/CodeFormatter.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/CodeFormatter.cpp	(revision 178)
@@ -0,0 +1,249 @@
+#include "common.h"
+
+// インデント関連
+
+int IsIndentAdditionCommand_FromBuffer(char *buffer);
+int IsIndentDecreaseCommand_FromBuffer(char *buffer);
+
+char *CodeFormatter(char *lpszReadBuffer){
+	int WndNum;
+	WndNum=GetNowWndNum();
+
+	if(MdiInfo[WndNum].DocType!=WNDTYPE_BASIC){
+		goto NonFormater;
+	}
+
+	char *lpszTempReadBuffer;
+	lpszTempReadBuffer=(char *)HeapAlloc(hHeap,0,lstrlen(lpszReadBuffer)+1);
+	lstrcpy(lpszTempReadBuffer,lpszReadBuffer);
+
+	//CRLFをLFに変換
+	ChangeReturnCode(lpszTempReadBuffer);
+
+	DeleteComment(lpszTempReadBuffer);
+
+	//カッコの相互関係をチェック
+	if(!CheckParenthesis(lpszTempReadBuffer)){
+		HeapDefaultFree(lpszTempReadBuffer);
+		goto NonFormater;
+	}
+
+
+
+	////////////////////////////////////
+	// インデントの初期TAB文字数を取得
+	////////////////////////////////////
+
+	char *pBuf;
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+	//カーソルバッファ位置を取得
+	int i,i2;
+	i=GetBufferIndexFromCaretPos(pBuf,
+		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+	int StartX=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x;
+
+	//現在の行のインデントをコピー（iFirstIndent_Speciallyにタブ数を格納）
+	int iFirstIndent_Specially=0;
+	for(i2=i;i2>0;i2--){
+		if(pBuf[i2-1]=='\r'&&pBuf[i2]=='\n'){
+
+			i=i2-1;
+
+			i2++;
+
+			int x=0;
+			while(pBuf[i2]=='\t'&&x<StartX){
+				i2++;
+				x++;
+				iFirstIndent_Specially++;
+			}
+
+			break;
+		}
+	}
+
+	//前の行のインデントをコピー（iIndentにタブ数を格納）
+	for(;i>0;i--){
+		if(
+			pBuf[i-1]=='\r'&&pBuf[i]=='\n'&&
+			(!(pBuf[i+1]=='\r'&&pBuf[i+2]=='\n'))
+			){
+			i++;
+			break;
+		}
+	}
+
+	int iIndent;
+	for(iIndent=0;;iIndent++){
+		if(pBuf[i+iIndent]!='\t') break;
+	}
+
+	if(MdiInfo[WndNum].DocType==WNDTYPE_BASIC){
+		//インデント追加のコマンドかどうかを判断
+		if(IsIndentAdditionCommand_FromBuffer(pBuf+i+iIndent)) iIndent++;
+	}
+
+
+
+	//////////////////////////////
+	// 各行のTAB文字数を計算
+	//////////////////////////////
+
+	int *pTabs,LineCount=0;
+	pTabs=(int *)HeapAlloc(hHeap,0,(lstrlen(lpszTempReadBuffer)+1)*sizeof(int));
+
+	char *pTemp;
+	pTemp=(char *)HeapAlloc(hHeap,0,lstrlen(lpszTempReadBuffer)+1);
+
+	i=0;
+	BOOL bInterface=0;
+	while(1){
+		while(lpszTempReadBuffer[i]=='\t'||lpszTempReadBuffer[i]==' ') i++;
+
+		int PareNum,BracketNum;
+		PareNum=0,BracketNum=0;
+
+		pTabs[LineCount]=0;
+
+		int MultiLine=0;
+		for(i2=0;;i++,i2++){
+
+			if(lpszTempReadBuffer[i-1]=='('||lpszTempReadBuffer[i-1]=='[') PareNum++;
+			else if(lpszTempReadBuffer[i-1]==')'||lpszTempReadBuffer[i-1]==']') PareNum--;
+
+			if(lpszTempReadBuffer[i]=='\n'||lpszTempReadBuffer[i]=='\0'){
+				if((lpszTempReadBuffer[i-1]=='('||lpszTempReadBuffer[i-1]==',')&&lpszTempReadBuffer[i]){
+					//パラメータ改行
+
+					i++;
+					MultiLine++;
+
+					pTabs[LineCount+MultiLine]=PareNum;
+
+					while(lpszTempReadBuffer[i]=='\n'){
+						i++;
+						MultiLine++;
+
+						pTabs[LineCount+MultiLine]=PareNum;
+					}
+					continue;
+				}
+				if(lpszTempReadBuffer[i-1]=='_'&&lpszTempReadBuffer[i]){
+					//任意改行
+					i++;
+					i2--;
+
+					MultiLine++;
+
+					pTabs[LineCount+MultiLine]=1;
+					continue;
+				}
+
+				pTemp[i2]=0;
+				break;
+			}
+			pTemp[i2]=lpszTempReadBuffer[i];
+		}
+
+
+		//インデント減少コマンドかどうかを判定
+		int f;
+		if(f=IsIndentDecreaseCommand_FromBuffer(pTemp)){
+			if(iIndent>0) iIndent--;
+			if(f==2){
+				if(iIndent>0) iIndent--;
+			}
+
+			if(f==3) bInterface=0;
+		}
+
+		if(iFirstIndent_Specially!=-1){
+			if(iIndent-iFirstIndent_Specially<0) iFirstIndent_Specially=iIndent;
+
+			pTabs[LineCount]+=iIndent-iFirstIndent_Specially;
+
+			iFirstIndent_Specially=-1;
+		}
+		else pTabs[LineCount]+=iIndent;
+		LineCount++;
+
+		while(MultiLine){
+			pTabs[LineCount]+=iIndent;
+			LineCount++;
+
+			MultiLine--;
+		}
+
+
+
+		//インデント増加コマンドかどうかを判定
+		if((f=IsIndentAdditionCommand_FromBuffer(pTemp))&&bInterface==0){
+			iIndent++;
+			if(f==2) iIndent++;
+
+			if(f==3) bInterface=1;
+		}
+
+
+		if(lpszTempReadBuffer[i]=='\0') break;
+		i++;
+	}
+
+
+
+	//////////////////////////
+	// インデント整形
+	//////////////////////////
+
+	char *lpszNewBuffer,temp2[1024];
+	lpszNewBuffer=(char *)HeapAlloc(hHeap,0,lstrlen(lpszReadBuffer)+8192);
+	lpszNewBuffer[0]=0;
+
+	i=0;
+	bInterface=0;
+	LineCount=0;
+	while(1){
+		while(lpszReadBuffer[i]=='\t'||lpszReadBuffer[i]==' ') i++;
+
+		for(i2=0;;i++,i2++){
+
+			if(IS_RETURN(lpszReadBuffer,i)||lpszReadBuffer[i]=='\0'){
+				pTemp[i2]=0;
+				break;
+			}
+			pTemp[i2]=lpszReadBuffer[i];
+		}
+
+
+		memset(temp2,'\t',pTabs[LineCount]);
+		temp2[pTabs[LineCount]]=0;
+		LineCount++;
+
+		lstrcat(lpszNewBuffer,temp2);
+		lstrcat(lpszNewBuffer,pTemp);
+
+
+
+		if(lpszReadBuffer[i]=='\0') break;
+		i+=2;
+
+		lstrcat(lpszNewBuffer,"\r\n");
+	}
+
+	HeapDefaultFree(pTemp);
+	HeapDefaultFree(lpszTempReadBuffer);
+
+	HeapDefaultFree(pTabs);
+
+	return lpszNewBuffer;
+
+
+
+NonFormater:
+	//インデント整形は行わない
+	lpszNewBuffer=(char *)HeapAlloc(hHeap,0,lstrlen(lpszReadBuffer)+1);
+	lstrcpy(lpszNewBuffer,lpszReadBuffer);
+	return lpszNewBuffer;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/Common.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Common.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Common.h	(revision 178)
@@ -0,0 +1,1255 @@
+#define STRICT
+#define OEMRESOURCE
+#define _CRT_SECURE_NO_DEPRECATE	//セキュリティ警告を出さない
+#define _CRT_NONSTDC_NO_DEPRECATE
+#include <windows.h>
+#include <stdio.h>
+#include <string.h>
+#include <commctrl.h>
+#include "../htmlhelp.h"
+#include <shlobj.h>
+#include <zmouse.h>
+#include <math.h>
+#include <limits.h>
+#include <process.h>
+#include <wininet.h>
+
+#include <vector>
+#include <string>
+#include <fstream>
+
+using namespace std;
+
+#include "nkf_class.h"
+#include "WebSearch.h"
+#include "ruler.h"
+#include "TabCtrl.h"
+#include "ExtensionLink.h"
+#include "HtmlAnalysis.h"
+#include "FileTree.h"
+#include "menu.h"
+#include "LuxCtrl.h"
+#include "MdiTextEdit.h"
+#include "BREGEXP.H"
+#include "../BasicCompiler32/CommandValue.h"
+#include "../BasicCompiler_Common/BasicFixed.h"
+
+
+typedef struct _charrange { 
+    LONG cpMin;
+    LONG cpMax;
+} CHARRANGE;
+
+
+#include "Attach.h"
+#include "Debugger.h"
+
+
+#pragma comment(lib, "wininet.lib")
+
+
+
+#ifdef THETEXT
+
+////////////////////////////
+// TheTextのバージョン情報
+////////////////////////////
+#define APPLICATION_NAME "TheText"
+#define VERSION_APPLI_NAME APPLICATION_NAME
+#define VERSION_STRING "1.02"
+
+#else
+
+/////////////////////////////////////////////////
+// ActiveBasic/ProjectEditorのバージョン情報
+/////////////////////////////////////////////////
+#define APPLICATION_NAME "ActiveBasic 5.0"
+#define VERSION_APPLI_NAME APPLICATION_NAME
+#define VERSION_STRING "5.00.00 CP4(rev.265)"
+
+#endif
+
+
+
+#define WIN32_COMPILER_NAME "BasicCompiler32.exe"
+#define WIN64_COMPILER_NAME "BasicCompiler64.exe"
+
+
+#ifndef IMAGE_FILE_MACHINE_AMD64
+#define IMAGE_FILE_MACHINE_AMD64             0x8664  // AMD64 (K8)
+#endif
+
+
+#if defined(JPN)
+
+#ifdef THETEXT
+//TheText日本語
+#include "../res_TheText/resource.h"
+#include "common_msg_jpn.h"
+#else
+//日本語
+#include "../res/resource.h"
+#include "common_msg_jpn.h"
+#endif
+
+#else
+//英語
+#include "../res_e/resource.h"
+#include "common_msg_eng.h"
+#endif
+
+//アイコンリソース
+#include "../icon_res/resource.h"
+
+
+
+
+#define GENERAL_SIZE	8192
+#define VN_SIZE			512
+#define MAX_ARRAYDIM	16
+
+#define MAX_WNDNUM 255
+
+
+#ifdef _AMD64_
+#else
+typedef long LONG_PTR;
+typedef DWORD ULONG_PTR;
+#endif
+
+//ファイルタイプ
+#define FT_BASICPROGRAM	1
+#define FT_SUBPROGRAM	2
+#define FT_TEXT			3
+#define FT_PROJECT		4
+#define FT_ICON			5
+#define FT_HTML			6
+#define FT_OTHER		0
+
+#define BMPNUM_STANDARDTOOLBAR	10		//hDefaultToolbarのビットマップ数
+#define SEPNUM_STANDARDTOOLBAR	4		//hDefaultToolbarのセパレータ数
+#define BMPNUM_DEBUGGERTOOLBAR		8		//hDebuggerToolbarのビットマップ数
+#define SEPNUM_DEBUGGERTOOLBAR		2		//hDebuggerToolbarのセパレータ数
+#define BMPNUM_RADTOOLBAR		18		//コントロール挿入用ツールバーのビットマップ数（区切り用BMPを最後の1つに用意する）
+#define SEPNUM_RADTOOLBAR		3		//コントロール挿入用ツールバーのセパレータ数
+
+//MDIクライアントウィンドウ下のドキュメントウィンドウタイプ
+#define WNDTYPE_BASIC		1
+#define WNDTYPE_TEXT		2
+#define	WNDTYPE_RAD			3
+#define WNDTYPE_MENU		4
+#define WNDTYPE_ICONEDIT	5
+#define WNDTYPE_HTML		6
+
+#define IS_DOCUMENT_TEXT(a) (a==WNDTYPE_BASIC||a==WNDTYPE_TEXT||a==WNDTYPE_HTML)
+
+#define IS_RETURN(buffer,p) (buffer[p]=='\r'&&buffer[p+1]=='\n')
+#define IS_BLANK(c) (c==' '||c=='\t')
+
+//Rebarコントロールの個数（レバー追加）
+#define MAX_REBARBANDS			5
+
+//RebarコントロールのID（レバー追加）
+#define ID_DOCCOMBO				1
+#define ID_STANDARDTOOLBAR		2
+#define ID_RELEASETOOLBAR		3
+#define ID_DEBUGGERTOOLBAR		4
+#define ID_SELECTCOMPILERCOMBO	5
+#define ID_WEB_SEARCH			6
+
+//検索コンボボックスの最大リスト数
+#define MAX_FINDLIST	20
+
+#define ID_FIRSTCHILD 100
+
+
+//タブカラー
+#define TABCOLOR_GRAY		RGB(230,230,230)	//灰色
+#define TABCOLOR_WHITE		RGB(255,255,255)	//白
+#define TABCOLOR_RED		RGB(255,200,200)	//赤
+#define TABCOLOR_GREEN		RGB(200,255,200)	//緑
+#define TABCOLOR_BLUE		RGB(200,220,255)	//青
+#define TABCOLOR_YELLOW		RGB(255,255,180)	//黄色
+
+
+//////////////////////////////////////////
+// BasicCompiler、ProjectEditor共通の定数
+//////////////////////////////////////////
+
+//サイズ変更枠の太さ
+#define LEVER_THICK 5
+
+#define WM_SHOWERROR			WM_USER+70	//エラー表示メッセージ
+
+#define WM_SETCOMPILEVIEW		WM_USER+71	//コンパイラウィンドウが表示されたとき
+#define WM_DESTROYCOMPILEVIEW	WM_USER+72	//コンパイラウィンドウが破棄されたとき
+
+#define WM_SETDEBUGGERBASE		WM_USER+73	//デバッガベースウィンドウが表示されたとき
+#define WM_DESTROYDEBUGGERBASE	WM_USER+74	//デバッガベースウィンドウが破棄されたとき
+
+#define WM_SETDEBUGGERVIEW		WM_USER+75	//デバッガウィンドウが表示されたとき
+#define WM_DESTROYDEBUGGERVIEW	WM_USER+76	//デバッガウィンドウが表示されたとき
+
+///////////////////////////////////////////
+
+
+#define WM_RESETCARETPOS		WM_USER+80	//オートスクロールスレッドからのキャレット設定
+
+#define WM_SEARCH_TAB_CREATE	WM_USER+90	//Web検索のタブアイテムの生成メッセージ
+#define WM_SEARCH_TAB_CLOSE		WM_USER+91	//Web検索のタブアイテムの破棄メッセージ
+
+//SideWeb
+#define WM_BROWS_CREATE  WM_USER+100
+#define WM_BROWS_DESTROY WM_USER+101
+#define WM_BROWS_GO      WM_USER+102
+#define WM_BROWS_NAVI    WM_USER+103
+
+
+
+#define MAX_HASH 32768
+
+
+//////////////////////////////////
+// メインウィンドウのタイマーID
+
+#define ID_TIMER_BACKUP	10
+#define ID_DEBUGSAFTY	20
+
+// ここまで
+//////////////////////////////////
+
+
+
+extern HANDLE hHeap;
+extern HINSTANCE hInst,hResInst,hIconResInst;
+extern HWND hOwner;
+extern HWND hClient;
+extern int ScreenX,ScreenY;
+extern char pj_editor_Dir[MAX_PATH];
+
+
+//アルファブレンド用のAPI
+#define WS_EX_LAYERED 0x00080000
+#define LWA_ALPHA 0x00000002
+typedef BOOL (WINAPI *FWINLAYER)(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags );
+
+
+
+//新規プロジェクトのベース
+#define BASE_VOID	0
+#define BASE_PROMPT 1
+#define BASE_NORMAL 2
+
+struct POINTANDSIZE{
+	POINT pos;
+	SIZE size;
+};
+
+
+
+//////////////////////////////////////////
+// リソース ヘッダ（アイコン、カーソル用）
+typedef struct{
+	WORD idReserved;
+	WORD idType;
+	WORD idCount;
+}ICONDIR,CURSORDIR;
+
+////////////////////////////
+//.icoファイルのヘッダ情報
+struct ICONDIRENTRY{
+	BYTE bWidth;
+	BYTE bHeight;
+	BYTE bColorCount;
+	BYTE bReserved;
+	WORD wPlanes;
+	WORD wBitCount;
+	DWORD dwBytesInRes;
+	DWORD dwImageOffset;
+};
+
+
+/////////////////////
+//MDIウィンドウ情報
+
+#define MAX_UNDONUM 300//512未完成
+#define MAX_ICONEDIT_UNDONUM 32
+
+#define TEXTEDIT_UNDO_KEY		1
+#define TEXTEDIT_UNDO_PASTE		2
+#define TEXTEDIT_UNDO_SELKEY	3
+struct TEXTEDIT_UNDOSTATE{
+	int NowPos;
+	int Command[MAX_UNDONUM];
+	char *KeyStr[MAX_UNDONUM];
+	char *DelStr[MAX_UNDONUM];
+	CHARRANGE Range[MAX_UNDONUM];
+	CHARRANGE DelRange[MAX_UNDONUM];
+};
+
+struct RAD_UNDOSTATE_NAME{
+	char *name;
+	char *HandleName;
+	char *CallBackName;
+};
+#define RAD_UNDO_INSERTWND	1
+#define RAD_UNDO_DELETEWND	2
+#define RAD_UNDO_INSERTITEM	3
+#define RAD_UNDO_DELETEITEM	4
+#define RAD_UNDO_NAME		5
+#define RAD_UNDO_CAPTION	6
+#define RAD_UNDO_FONT		7
+#define RAD_UNDO_BGCOLOR	8
+#define RAD_UNDO_WINDOWMENU	9
+#define RAD_UNDO_ICONRES	10
+#define RAD_UNDO_STYLE		11
+#define RAD_UNDO_EXSTYLE	12
+#define RAD_UNDO_POSITION	13
+#define RAD_UNDO_IMAGESTATE	14
+#define RAD_UNDO_TYPE		15
+struct RAD_UNDOSTATE{
+	int NowPos;
+	int Command[MAX_UNDONUM];
+	int SelectItemNum[MAX_UNDONUM];
+	DWORD lpdwData[MAX_UNDONUM];
+};
+
+#define MAX_RAD_SELITEM	255
+struct MDIRADINFO{
+	//Radツール用
+
+	HWND hTools;
+
+	HWND hProperty;
+	HWND hProp_Dlg;
+
+	HWND hSupport;
+
+	HWND hRad;
+
+	HBITMAP hBitmap;
+	HBITMAP hOldBitmap;
+	HDC hMemDC;
+	int SelectingItem[MAX_RAD_SELITEM];
+	int ButtonSelect;
+
+	//ウィンドウクライアント領域
+	POINT ClientPos;
+	SIZE ClientSize;
+
+	//変更情報
+	RAD_UNDOSTATE undo;
+};
+
+struct MDIMENUINFO{
+	HWND hList;
+	HWND hMenuEdit;
+	HWND hEdit_Dlg;
+};
+
+#define ICONTYPE_16_16	0
+#define ICONTYPE_16_256	1
+#define ICONTYPE_32_16	2
+#define ICONTYPE_32_256	3
+struct ICONEDIT_UNDOSTATE{
+	int NowPos;
+	BYTE *lpData[MAX_ICONEDIT_UNDONUM];
+};
+struct MDIICONEDITINFO{
+	HWND hMain;
+	HWND hToolDlg;
+	HWND hButtonsDlg;
+	HWND hColorDlg;
+
+	HDC memdc;
+	HBITMAP hMemBmp;
+
+	HBITMAP hSelectingBmp;
+	int SelectLevel;
+	RECT DraggingRect;
+
+	int num;
+	int SelectIconNum;
+	union{
+		BYTE *pIconImage[8];	//アイコンのイメージデータ配列（マップ配列、カラー配列、マスク配列）
+		BITMAPINFOHEADER *pBmpHdr[8];
+	};
+	DWORD dwBytesInRes[8];
+
+	DWORD NowTool;
+	COLORREF MainColor;
+	COLORREF SubColor;
+
+	ICONEDIT_UNDOSTATE undo[8];
+	BOOL bModify;
+};
+
+struct MDIINFO{
+	HWND hwnd;
+	int DocType;
+	char *title;
+	char *path;
+
+	union{
+		MDIRADINFO *MdiRadInfo;
+		MDIMENUINFO *MdiMenuInfo;
+		MDIICONEDITINFO *MdiIconEditInfo;
+		CMdiTextEdit *pMdiTextEdit;
+	};
+
+	char *IndentStr;
+};
+extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+//RADツールのマウスドラッグ
+#define FRAME_CHANGEPOS_START	1 //----- ここから -----
+#define FRAME_UPPER_LEFT	1
+#define FRAME_UPPER_RIGHT	2
+#define FRAME_LOWER_LEFT	3
+#define FRAME_LOWER_RIGHT	4
+#define FRAME_LEFT			5
+#define FRAME_RIGHT			6
+#define FRAME_UPPER			7
+#define FRAME_LOWER			8
+#define FRAME_INSIDE		9
+#define FRAME_CHANGEPOS_END		9 //----- ここまで -----
+#define ITEM_MAKING			10
+#define SELECTING_FRAME		11
+
+//アイテムの大きさの限界値
+#define MIN_ITEM_X	12
+#define MIN_ITEM_Y	9
+
+//選択アイテム
+#define SELECT_WINDOW	-1
+#define NON_TOOL		-1
+
+struct RADINFO{
+	int NowDragging;
+	POINT DragStartPos;
+	RECT DragStartRect[MAX_RAD_SELITEM];
+	RECT DraggingRect[MAX_RAD_SELITEM];
+	RECT OldDraggingRect[MAX_RAD_SELITEM];
+};
+
+
+//////////////////
+//リソース情報
+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;
+};
+
+
+////////////////////
+//プロジェクト情報
+
+#define PROJECT_VERSION	10
+
+class CFileInfo{
+public:
+	char *m_path;
+	HTREEITEM m_hTreeItem;
+	CFileInfo(char *path,HTREEITEM hTreeItem);
+	~CFileInfo();
+
+	void GetFullPath(char *buffer);
+};
+class CDBFileInfo{
+public:
+	int iNum;
+	CFileInfo **ppobj_FileInfo;
+
+	CDBFileInfo();
+	~CDBFileInfo();
+
+	void add(char *path,HTREEITEM hTreeItem);
+	void del(HTREEITEM hTreeItem);
+	char *GetPath(HTREEITEM hTreeItem);
+	BOOL IsMainFile(HTREEITEM hTreeItem);
+
+	void SetTreeItem(int index,HTREEITEM hTreeItem);
+	void ResetTree(void);
+
+	BOOL dupli_check(char *path);
+};
+struct FILEINFO{
+	char *pPath;
+	HTREEITEM hTreeItem;
+};
+
+struct PROCINFO{
+	char *name;
+	int FileNum;
+	HTREEITEM hTreeItem;
+
+	int code_pos;
+};
+struct INCPROCINFO{
+	char *name;
+	char *Parms;
+	char *type;
+};
+
+//ダイアログアイテムの種類
+#define CT_BUTTON		1
+#define CT_CHECKBOX		2
+#define CT_COMBOBOX		3
+#define CT_EDIT			4
+#define CT_GROUPBOX		5
+#define CT_HSCROLLBAR	6
+#define CT_IMAGEBOX		7
+#define CT_LISTBOX		8
+#define CT_LISTVIEW		9
+#define CT_RADIOBUTTON	10
+#define CT_STATIC		11
+#define CT_TREEVIEW		12
+#define CT_VSCROLLBAR	13
+#define CT_UPDOWN		14
+#define CT_PROGRESSBAR	15
+#define CT_TRACKBAR		16
+#define CT_MENU			99
+
+//イベント タイプ
+#define EVENTTYPE_DEFAULT	0
+#define EVENTTYPE_MENU		1
+#define EVENTTYPE_MMSYS		2
+
+//ウィンドウ タイプ
+#define WNDTYPE_DEFAULT		0
+#define WNDTYPE_MODALDLG	1
+#define WNDTYPE_MODELESSDLG	3
+
+//イメージタイプ
+#define IMGTYPE_FILE	0
+#define IMGTYPE_RES		1
+
+struct IMAGECTRLINFO{
+	int type;
+	char *path;
+};
+struct CHILDINFO{
+	char *IdName;
+	POINT pos;
+	SIZE size;
+	char *caption;
+	DWORD style;
+	DWORD ExStyle;
+	int Control;
+
+	IMAGECTRLINFO ImageCtrlInfo;
+};
+struct WINDOW_INFO{
+	//ウィンドウデータ
+	char *name;
+	char *HandleName;
+	POINT pos;
+	SIZE size;
+	char *caption;
+	DWORD style;
+	DWORD ExStyle;
+	char *MenuID;
+	int id;
+	int bgColor;
+	LOGFONT LogFont;
+	char *IconResName;
+	char *ClassName;
+	char *CallBackName;
+	long type;
+	char *filepath;
+
+	//子ウィンドウ管理
+	int NumberOfChildWindows;
+	CHILDINFO *pChildInfo;
+
+	//ツリー項目
+	HTREEITEM hTreeItem;
+};
+struct NEWPROJECTINFO{
+	char name[MAX_PATH];
+	DWORD dwTypeID;
+	_int8 ShowHelloWorld;
+	DWORD dwOption;
+};
+struct MENU_INFO{
+	char *IdName;
+	char *caption;
+	UINT type;
+	UINT state;
+
+	int NumberOfMenu;
+	MENU_INFO *pMenuInfo;
+
+	HTREEITEM hTreeItem;
+};
+#define MT_EXE	0	//EXEモジュールタイプ
+#define MT_DLL	1	//DLLモジュールタイプ
+#define PJ_OP_SOURCE_MASK	0x00FFFFFF
+#define PJ_OP_MMSYSTEM		0x00000001
+#define PJ_OP_COMMCTRL		0x00000002
+#define PJ_OP_RICHEDIT		0x00000004
+#define PJ_OP_WINSOCK		0x00000008
+#define PJ_OP_STRICT		0x00010000	// #strictディレクティブは今は使われていない
+#define PJ_OP_RC_MANIFEST	0x00020000
+#define PJ_OP_UNICODE		0x00040000
+struct PROJECTINFO{
+	DWORD dwModuleType;
+
+	char name[MAX_PATH];
+	char dir[MAX_PATH];
+
+	DWORD dwVersion;
+
+	CDBFileInfo *pobj_DBFileInfo;
+
+	char ResourceFileName[MAX_PATH];
+
+	int NumberOfMenu;
+	MENU_INFO *pMenuInfo;
+	HTREEITEM hMenuTreeItem;
+
+	int NumberOfWindows;
+	WINDOW_INFO *pWindowInfo;
+	HTREEITEM hWindowTreeItem;
+
+	RESOURCEINFO res;
+
+	DWORD dwOption;
+	char lpszOutput_Release[MAX_PATH];
+	char lpszOutput_Debug[MAX_PATH];
+
+	//マニフェスト
+	char szManifestPath[MAX_PATH];
+
+	//デバッグ情報
+	char szCmdLine[8192];
+	char szExePath[MAX_PATH];
+
+	//ブレークポイント情報
+	CDBBreakPoint *pobj_DBBreakPoint;
+
+	_int8 ModifyOfMaterial;
+	_int8 ModifuOfResource;
+	_int8 modify;
+};
+extern PROJECTINFO ProjectInfo;
+
+
+struct SAVEREBAR{
+	int RebarID;
+	int RebarLength;
+	int IsBandBreak;
+};
+
+struct ITEMEVENTINFO{
+	char *IdName;
+	char **pEventNames;
+	int ClassID;
+	int EventNum;
+};
+
+#define PARAMETER_HINT_MAX_SIZE 8192
+struct METHODCHECKINFO{
+	HWND hWnd;
+	LOGFONT LogFont;
+	HFONT hFont;
+	HFONT hBoldFont;
+	char BeforeMethodName[VN_SIZE];
+	char msg[PARAMETER_HINT_MAX_SIZE];
+	int ParmNum;
+	int HeadPos;
+};
+
+
+/////////////////////
+// コード補完機能
+/////////////////////
+
+#define ACCESS_NON					0
+#define ACCESS_PRIVATE				1
+#define ACCESS_PUBLIC				2
+#define ACCESS_PROTECTED			3
+#define ACCESS_PAIRCOMMAND			4
+#define ACCESS_HTML_GENERAL_PARAM	5
+#define ACCESS_HTML_PARAM			6
+struct MEMBERINFO{
+	//クラス名
+	char *pName;
+	DWORD dwProc;
+	DWORD dwAccess;
+
+	int code_pos;
+};
+struct COMPLEMENT_WINDOW_INFO{
+	HWND hWnd;
+	HWND hList;
+
+	int iPos;
+	int iLength;
+
+	MEMBERINFO *pMemberInfo;
+	int MemberNum;
+
+	//ペアステートメントのインデント格納用
+	char szIndent[255];
+};
+
+
+
+class CSettingFile{
+	BOOL GetDataLine(const char *name,char *parms);
+protected:
+	char *buffer;
+
+	BOOL GetWholeValue(const char *name,int *pi32data);
+	bool GetBoolean( const char *name,bool &b );
+	BOOL Get3WholeValue(char *name,int *pd1,int *pd2,int *pd3);
+	BOOL GetRGBValue(char *name,COLORREF *prgb);
+	BOOL GetStringValue(char *name,char *str);
+	BOOL GetRectValue(char *name,RECT *prc);
+	BOOL GetLogFont(char *name,LOGFONT *plf);
+	BOOL GetRebarBand(SAVEREBAR *psr,int num);
+
+	void SetWholeValue( const char *name,long i32data);
+	void SetBoolean( const char *name,bool b);
+	void Set3WholeValue(char *name,long d1,long d2,long d3);
+	void SetRGBValue(char *name,COLORREF rgb);
+	void SetStringValue(char *name,char *str);
+	void SetRectValue(char *name,RECT *prc);
+	void SetLogFont(char *name,LOGFONT *plf);
+	void SetRebarBand(SAVEREBAR *psr,int num);
+};
+#include "DesignTheme.h"
+
+
+
+//ProjectEditor.cpp
+void HeapDefaultFree(LPVOID lpMem);
+void ToBigChar(char str[]);
+int GetWndNum(HWND hChild);
+int GetNowWndNum(void);
+int GetFileNum(int WndNum);
+void SendTextEditResizeEvent(HWND hwnd);
+void RedrawAllWindow(void);
+int DocumentModifyCheck(HWND hChild);
+void SetStatusText(char *MenuText);
+void ResetState_UndoMenu(void);
+void ResetState_EditMenu(void);
+void ResetState_DocMenu(void);
+void DuplicateTitleCheck(char *lpszTitle);
+HWND NewTextEditWindow(char *filepath,_int8 DocumentType,COLORREF TabColor=TABCOLOR_GRAY);
+void CloseDocWindow(int WndNum);
+void ResizeTextEditWnd(HWND hwnd,int cx,int cy);
+void ResizeOwnerWnd(void);
+#define FLAG_DBLCLK		1
+#define FLAG_BEAMCURSOR	2
+int RegWndClass(WNDPROC WndProc,char *lpClassName,HBRUSH hBackBrush,DWORD dwFlag);
+
+//Backup.cpp
+void CreateBackupDir(void);
+void backup(void *dummy);
+BOOL restore(void);
+
+//DialogBoxes.cpp
+void SetPosCenter(HWND hParent,HWND hwnd);
+void SetPosCenter(HWND hwnd);
+BOOL SetFontDialog(HWND hwnd,LOGFONT *lf,BOOL bFixedPitchOnly,int *lpiPointSize=0);
+void DlgNewProjectWizard(HWND hwnd);
+BOOL CALLBACK DlgNewFile(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+void DlgProjectOptionSetting(HWND hwnd);
+void DlgOptionSetting(HWND hwnd);
+BOOL CALLBACK DialogAbout(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//FileOperation.cpp
+void MakeUserSettingDir(void);
+char *ReadBuffer(char *path);
+char *ReadBuffer_NonErrMsg(char *path);
+_int8 WriteBuffer(char *path,char *buffer,int length, bool isEnableError = true);
+_int8 WriteBuffer_NonErrMsg(char *path,char *buffer,int length);
+void GetRelationalPath(char *path,char *dir);
+void GetFullPath(char *path,char *dir);
+void RemoveDirectoryStrong(const char *dirPath);
+BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,_int8 IsOpen);
+BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle);
+int GetFileExtension(char *path);
+HWND OpenFileWithExtension(char *OpenFileName);
+BOOL SaveDocument(HWND hChild,char *SaveFileName);
+BOOL ShortPathToLongPath(char ShortPath[MAX_PATH],char *LongPath);
+bool IsExistFile( const char *FilePath );
+bool IsExistDirectory( const char *DirPath );
+
+//rebar.cpp
+#define MAX_BAND 255
+typedef HWND (*AddBandProc)(HWND hRebar,int num,char *lpszText);
+class CDBRebarBand{
+	int BandId[MAX_BAND];
+	AddBandProc pAddProc[MAX_BAND];
+	int iMaxBandNum;
+public:
+	HWND hRebar;
+	CDBRebarBand();
+	~CDBRebarBand();
+	void add(int band_id,AddBandProc add_proc);
+	HWND call_add(int band_id,int num,char *lpszText);
+};
+class CMainRebar{
+	CDBRebarBand *pobj_DBRebarBand;
+
+	void SetupRebar(HWND hwnd);
+public:
+	HWND hParent;
+	HWND hRebar;
+
+	CMainRebar(HWND hwnd_parent);
+	~CMainRebar();
+
+	void ResetInitRebar();
+	void ResetRebar();
+	void SaveRebarState(void);
+	void ChangeRebarBand(int BandID);
+	void menu_popup(HWND hwnd,int PosX,int PosY);
+};
+extern CMainRebar *pobj_Rebar;
+void ResetRebarData(void);
+LRESULT CALLBACK DefaultToolbarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+LRESULT CALLBACK DocComboProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+LRESULT CALLBACK DebuggerToolbarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//SubOperation.cpp
+void ScreenToClient(HWND hwnd,RECT *pRect);
+void ClientToScreen(HWND hwnd,RECT *pRect);
+BOOL IsWow64(void);
+void URLEncode(LPSTR pszSrc);
+void Digit(int num,char *buffer);
+void RectNaturalFormat(RECT *ReadRect,RECT *CopyRect);
+void RectNaturalFormat(int *x1,int *y1,int *x2,int *y2);
+void KillSpaces(char *str1,char *str2);
+void RemoveStringQuotes(char *str);
+void SlideString(char *str,int slide);
+void SlideBuffer(char *buffer,int length,int slide);
+BOOL IsVariableTopChar(char c);
+BOOL IsVariableChar(char c);
+BOOL IsCommandBackDelimitation(char *buffer,int pos);
+BOOL IsCommandDelimitation(char *buffer,int p);
+char *ComparisonString( char *str1, char *str2, bool isBigSmall, bool isWordUnit );
+int GetOneParameter(char *Parameter,int pos,char *retAns);
+int GetStringInPare(char *buffer,char *ReadBuffer);
+int GetStringInBracket(char *buffer,char *ReadBuffer);
+void JumpBlank(char *pBuf,int *piPos);
+BOOL CheckParenthesis(char *buffer);
+DWORD GetValue(char *value);
+BOOL IsManagementCommand(int ComNum);
+int IsBasicReservedWord(char *str);
+HBITMAP CreateGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2);
+HBITMAP CreateVertGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2);
+HBITMAP CreateHorzGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2);
+HICON CreateGrayIcon(HICON hBaseIcon);
+void GetSize(SIZE *pSize,RECT *pRect);
+BOOL HitTest(RECT *pRect,POINT *pPos);
+BOOL Rectangle(HDC hdc,RECT *pRect);
+void ComboBox_SetSelText(HWND hCombo,char *lpszText);
+void SetCursorByState(int state);
+void SetTextEditColorDesign(TEXTEDIT_COLOR_INFO *pColorInfo,CTheme *pobj_Theme,BOOL bRedraw);
+BOOL SetupProjectEditor(void);
+void EndProjectEditor(void);
+void SetupWindow(HWND hwnd);
+BOOL SetRunning(HWND hChild);
+BOOL IsNeedCompile(char *FileName,BOOL bDebug);
+string GetLastErrorString();
+
+//DocumentAdvice.cpp
+void MenuAdvice(WPARAM msg);
+void ShowToolTipText(LPTOOLTIPTEXT TipText);
+char *IncludeFiles(char *buffer);
+void AddParameterHints_ToProject(char *path);
+
+
+
+/////////////////////
+// テキスト エディタ
+/////////////////////
+
+#define CONTROL_TAB_SPACE_DEFAULT		10	//エディタ画面左端のコントロールタブ（通常）
+
+//DrawBuffer.cpp
+void TextEdit_DrawBuffer(HDC hdc,int WndNum);
+
+//TextEditor.cpp
+int GetControlTabSpace(int WndNum,int *piCount=0);
+void ResetTextEditFont(HWND hwnd);
+void SetTextEditWordColor(int WndNum);
+BOOL IsHiragana(char *pBuf);
+BOOL IsAlphabet(char c);
+BOOL IsReturnCode(char *pBuf);
+void ResetScrollbar(int WndNum,int max_x,int max_y);
+#define WORDCARET_BEFORE 1
+#define WORDCARET_AFTER  2
+void TextEdit_GetWordCaret(HWND hwnd,int WndNum,POINT *pPos,int *piStart,int *piEnd,BOOL bBeforeAfterFlag);
+void CancelBeforeAutoIndent(int WndNum);
+LRESULT CALLBACK TextEditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//Caret.cpp
+BOOL IsRightTurn(char *pBuf,int i,int now_x);
+int GetBufferIndexFromCaretPos(char *pBuf,int now_x,int now_y);
+void GetCaretPosFromBufferIndex(char *pBuf,int index,POINT *pCaretPos);
+void TextEdit_GetSel(int WndNum,CHARRANGE *pCharRange);
+void TextEdit_GetSelText(int WndNum,CHARRANGE *pCharRange,char *buffer);
+void GetScrollBaseCaretPos(int WndNum,int *pNaturalBaseX,int *pNaturalBaseY);
+void GetNaturalBaseCaretPos(int WndNum,int *pScrollBaseX,int *pScrollBaseY);
+void TextEdit_SetSel(int WndNum,int StartIndex,int EndIndex,BOOL bShowCenter=0);
+void TextEdit_SelectOneLine(int WndNum,int code_pos,BOOL bShowCenter=0);
+void ResetCaretPos(int WndNum,BOOL bInputAndReset=0);
+BOOL TextEdit_ScrollCaret(int WndNum,BOOL bScrollOneStep_x,BOOL bShowCenter=0);
+void CaretPos_LooseToNatural(int WndNum,int loose_x,int loose_y,POINT *pCaretPos);
+void GetNaturalCaretPos_Click(int WndNum,int mouse_x,int mouse_y,POINT *pCaretPos);
+void GetNaturalCaretPos_Left(int WndNum);
+void GetNaturalCaretPos_Right(int WndNum,POINT *pCaretPos);
+void GetNaturalCaretPos_Up(int WndNum,POINT *pCaretPos);
+void GetNaturalCaretPos_Down(int WndNum,POINT *pCaretPos);
+void GetNaturalCaretPos_PageUp(int WndNum,POINT *pCaretPos);
+void GetNaturalCaretPos_PageDown(int WndNum,POINT *pCaretPos);
+
+//Replace.cpp
+void TextEdit_Replace(int WndNum,char *str,BOOL bRedraw);
+void TextEdit_ReplaceUpdateUndoData(int WndNum,char *str,BOOL bPaste,BOOL bRedraw);
+void TextEdit_Convert(int id);
+
+//TextEditor_UndoRedo.cpp
+void TextEdit_UndoCommand(int WndNum);
+void TextEdit_RedoCommand(int WndNum);
+void TextEdit_NoticeChanging(int WndNum,int Command,char *KeyStr,char *DelStr,CHARRANGE *Range,CHARRANGE *DelRange);
+void TextEdit_DeleteUndoData(TEXTEDIT_UNDOSTATE *pUndoState,int pos);
+
+//Search.cpp
+void AddFindData(HWND hwnd,char ppData[MAX_FINDLIST][MAX_PATH],char *str);
+BOOL CALLBACK DlgFind(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK DlgPermutation(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//analysis.cpp
+BOOL GetVarFormatString(char *buffer,char *array,char *array2,char *NestMember,int *pRefType);
+BOOL CheckReferType(char *ClassName,BOOL bArray,char *VarArray,int VarRefType);
+void GetOriginalClassName(char *ClassName);
+int GetClassPos(char *pBuf,char *ClassName,DWORD *pdwClassType);
+BOOL GetClassNameFromClassMember(char *pBuf,int iPos,char *VarName,char *ClassName,BOOL *pbArray);
+void GetCodeAreaType(char *pBuf,int iPos,int *piProcPos,char *NowClass);
+BOOL GetVariableClassName(char *pEditBuf,int iPos,char *VarName,char *ClassName,BOOL *pbArray);
+
+//EndPairCommandComplement.cpp
+BOOL GetEndPairCommandInfo(char *buffer,int p);
+BOOL IsNeedNewIndentCommand(char *name);
+void GetWithObjectVariable(char *buffer,int p,char *pObjectVar);
+
+//Complement.cpp
+void DeleteComplementInfo(void);
+BOOL GetComplementInfo(char *variable,char *pEditBuf,int iPos);
+void CodeComplement(int WndNum,int iPos);
+LRESULT CALLBACK ComplementWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//ParameterHint.cpp
+char *GetUserSourceCode(void);
+void ChangeReturnCode(char *buffer);
+void DeleteComment(char *buffer);
+LRESULT CALLBACK MethodCheckWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+void ShowParameterHint(int WndNum);
+
+//CodeFormatter.cpp
+char *CodeFormatter(char *lpszReadBuffer);
+
+#ifdef THETEXT
+//StringCount.cpp
+BOOL CALLBACK DlgStringCount(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+#endif
+
+//Print.cpp
+class CPage{
+public:
+	PAGESETUPDLG psd;
+	CPage();
+	~CPage();
+
+	BOOL SetupDlg(void);
+};
+extern CPage obj_Page;
+LRESULT CALLBACK PreviewWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+void Preview(void);
+void Printout(void);
+
+//History.cpp
+#define IS_FILEHISTORY_COMMAND(a) (100<=a&&a<=199)
+class CHistory{
+	int iNum;
+	int iMaxHistoryNum;
+
+	int m_BaseID;
+public:
+	char *lpszPath[255];
+
+	CHistory(int BaseID);
+	~CHistory();
+
+	void load(char *path);
+	void save(char *path);
+
+	void add(char *path);
+	void insert(char *path);
+
+	void ResetFileMenu(CSubMenuEx *pobj_SubMenu,BOOL bOwnerDraw);
+};
+
+
+
+
+//////////////////////
+/* プロジェクト解析 */
+
+//CClassInfo.cpp
+class CClassInfo{
+public:
+	char ClassName[VN_SIZE];
+	MEMBERINFO *pMemberInfo;
+	int MemberNum;
+	CClassInfo();
+	~CClassInfo();
+	int Analyze(char *pBuf,int *p);
+};
+
+//ClassTree.cpp
+struct TREEHASH{
+	HTREEITEM hItem;
+	int iFileNum;
+	TREEHASH *pNextData;
+};
+#define CTV_ROOT			1	//ルート
+#define CTV_FOLDER			2	//フォルダ
+#define CTV_GLOBAL_PROC		3	//プロシージャ
+#define CTV_CLASS			4	//クラス
+#define CTV_PUBLIC_MEMBER	5	//公開cメンバ変数
+#define CTV_PUBLIC_METHOD	6	//公開メソッド
+#define CTV_PRIVATE_MEMBER	7	//非公開メンバ変数
+#define CTV_PRIVATE_METHOD	8	//非公開メソッド
+class CClassTreeView{
+	HWND hTreeWnd;
+	int iNowFile;
+	TREEHASH tree_data[MAX_HASH];
+
+	HTREEITEM hGlobalProcedureFolder;
+	HTREEITEM hNowClassFolder;
+
+	int hash_default(LONG_PTR lpdata);
+
+	void AddValidItem(HTREEITEM hItem,int iFileNum);
+	BOOL delete_check(HTREEITEM hItem);
+	void DeleteInvalidItems(HTREEITEM hItem);
+	void DeleteTreeHash(TREEHASH *pth);
+
+	HTREEITEM insert(HTREEITEM hParentItem,int flag,char *lpszName,int iFileNum);
+
+public:
+	HTREEITEM hRootFolder;
+
+	int NumberOfProcedures;
+	PROCINFO *pProcInfo;
+
+	BOOL bCloseSwitch;
+	BOOL bShowSwitch;
+
+	CClassTreeView();
+	~CClassTreeView();
+	void init(HWND hwnd,int iFileNum);
+
+	void InsertRootFolder(void);
+	void InsertGlobalProcedureFolder(void);
+	HTREEITEM InsertGlobalProcedure(int flag,char *lpszName,int iFileNum);
+	HTREEITEM insert_code_item(HTREEITEM hParentItem,int flag,char *lpszName,int iFileNum,char *pBuf,int p);
+	void InsertClassFolder(char *lpszName,int iFileNum,char *pBuf,int p);
+	void InsertClassMember(int flag,char *lpszName,int iFileNum,char *pBuf,int p);
+	void finish();
+};
+extern CClassTreeView *pobj_ClassTreeView;
+void ResetClassTree(int iFileNum);
+
+//ProjectControl.cpp
+void ResizeProjectView_ToolWindow(void);
+LRESULT CALLBACK ProjectView_ToolWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+void ShowFileView();
+void ShowClassView();
+void ShowMaterialView();
+LRESULT CALLBACK ProjectViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+void Project_File_Insert(char *path);
+void Project_File_Delete(HTREEITEM hTreeItem);
+void MakeNewProject(void);
+void OpenProject(char *path);
+BOOL ProjectModifyCheck(BOOL bRun);
+_int8 CloseProject(void);
+void MakeWorkFile(void);
+void SaveProject(void);
+BOOL SetProjectToRun(void);
+BOOL IsNeedCompileForProject(BOOL bDebug);
+
+//WindowControl.cpp
+int GetWndInfoNum(char *name);
+HGLOBAL Rad_GetChildInfoClipboardData(int WndNum,int WndInfoNum);
+void Rad_PasteChildInfoClipboardData(int WndNum,HGLOBAL hGlobal);
+char *PermutationWndPgmTemplate(char *pBuf,char *pPjName, char *pWndName, char *pHandleName, char *pProcName);
+void GetItemClassName(char *buffer,int Control);
+void SaveWindowProgram();
+void SaveWindowFile(char *path,WINDOW_INFO *WindowInfo,int NumberOfWindowInfo);
+_int8 OpenWindowFile(char *path);
+void GetDefaultWindowFont(LOGFONT *LogFont);
+void Project_Window_Insert(void);
+void Project_Window_Delete(int WndInfoNum);
+
+//Resource.cpp
+void GetResourceData(void);
+void Project_CursorResInsert(void);
+void Project_Cursor_Delete(int CursorInfoNum);
+void Project_Cursor_RenameID(int CursorInfoNum);
+void Project_BitmapResInsert(void);
+void Project_Bitmap_Delete(int IconInfoNum);
+void Project_Bitmap_RenameID(int BitmapInfoNum);
+void Project_IconResInsert(void);
+void Project_Icon_Delete(int IconInfoNum);
+void Project_Icon_RenameID(int IconInfoNum);
+BOOL CALLBACK DlgProject_ResourceID_Input(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+
+
+///////////////////
+/* RADウィンドウ */
+
+//RadProc.cpp
+void NewRadWindow(int WndInfoNum);
+int InsertDlgItem(int WndNum,int WndInfoNum,int ItemNum,POINT *pPos,SIZE *pSize,char *IdName,char *caption,DWORD style_or_WndNum,DWORD ExStyle,int Control,int ImageType,char *ImagePath,DWORD dwInsertType);
+void DeleteDlgItem(int WndNum,int WndInfoNum,int ItemNum,BOOL bNoticeChanging);
+void CursorPos_GlobalToLocal(HWND hwnd,long *x,long *y);
+void DrawSelectingRect(HWND hwnd,int WndNum,int WndInfoNum,int ButtonSelect);
+void ChangePropertyWindow(int WndNum,int WndInfoNum);
+void ResetScrollbarOfRadEditor(int WndNum,int weight,int height);
+LRESULT CALLBACK RadWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+void ResizeToRadToolWindows(int WndNum,int weight,int height);
+LRESULT CALLBACK MDIClientWindow_Rad(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//DrawWindow.cpp
+void DrawRadWindow(int WndNum,WINDOW_INFO *pWindowInfo);
+
+//Rad_UndoRedo.cpp
+void Rad_UndoCommand(int WndNum);
+void Rad_RedoCommand(int WndNum);
+void Rad_DeleteUndoData(int WndNum,int pos);
+void Rad_NoticeChanging(int WndNum,int Command,int SelectItemNum,DWORD dwData);
+
+//RadToolsAndPropertyProc.cpp
+LRESULT CALLBACK RadToolsWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_WindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK DlgRadProperty_Item_RenameCaption(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_ButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_CheckBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_ComboBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_EditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_GroupBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_ImageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_ListBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_ListViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_ProgressBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_RadioButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_ScrollBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_StaticProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_TrackBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_TreeViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK RadProperty_UpDownProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+LRESULT CALLBACK RadPropertyWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//MessageCallOperation.cpp
+char **GetProcedureNamesOfMessageCall(int WndInfoNum,ITEMEVENTINFO **ppItemEventInfo,int *num,BOOL *pbAlways);
+void SelectProcedureOfMessageCall(int WndInfoNum,char *ProcedureName,char *Parameter);
+BOOL CALLBACK DlgEventCode(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//RadSupport.cpp
+LRESULT CALLBACK TestWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+void SetSupportDlgData(int WndNum,int WndInfoNum);
+BOOL CALLBACK DlgRadSupport(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+
+
+////////////////////
+/* MENUウィンドウ */
+
+//MenuProc.cpp
+int GetMenuInfoNum(char *name);
+void HeapMenuDataFree(MENU_INFO *pMenuInfo,int ItemNum,int *NumberOfFreedItem);
+BOOL CALLBACK DlgProject_MenuID_Input(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+void Project_Menu_Insert(void);
+void Project_Menu_Delete(int MenuInfoNum);
+void NewMenuWindow(MENU_INFO *pMenuInfo);
+BOOL CALLBACK MenuEditDlg(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+LRESULT CALLBACK MenuEditWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+LRESULT CALLBACK MDIClientWindow_Menu(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+
+
+//////////////////////////////////
+/* アイコン エディタ ウィンドウ */
+
+//IconEditor.cpp
+void AddIconType(int WndNum,int IconType);
+void DeleteIconType(int WndNum);
+void NewIconEditWindow(char *filepath);
+void SaveIconFile(char *filepath,HWND hwnd);
+LRESULT CALLBACK MDIClientWindow_IconEdit(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//IconEditor_Main.cpp
+HGLOBAL IconEdit_GetChildInfoClipboardData(int WndNum);
+void IconEdit_PasteChildInfoClipboardData(int WndNum,HBITMAP hBmp);
+void IconEdit_PasteImage(int WndNum);
+void DrawIconToMemBmp(int WndNum,RECT *pRect);
+void IconEdit_EraseRect(int WndNum,RECT *pRect);
+LRESULT CALLBACK IconEditWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//IconEditor_Tool.cpp
+BOOL CALLBACK DlgIconButtons(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+BOOL CALLBACK DlgIconToolProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//IconEditor_Color.cpp
+BOOL CALLBACK DlgIconColorProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+//IconEditor_UndoRedo.cpp
+void IconEdit_UndoCommand(int WndNum);
+void IconEdit_RedoCommand(int WndNum);
+void IconEdit_NoticeChanging(int WndNum);
+
+
+
+
+
+#include "NonVolatile.h"
+
+
+
+
+#ifdef _DEBUG
+/*Debug*/
+
+#define HeapAlloc CheckHeapAlloc
+#define HeapReAlloc CheckHeapReAlloc
+LPVOID CheckHeapAlloc(HANDLE hHeap,DWORD dwFlags,DWORD dwBytes);
+LPVOID CheckHeapReAlloc(HANDLE hHeap,DWORD dwFlags,LPVOID lpMem,DWORD dwBytes);
+
+#define DeleteObject CheckDeleteObject
+BOOL CheckDeleteObject(HGDIOBJ hObject);
+
+#endif
Index: tag/abdev(2007.06.20)/ProjectEditor/Complement.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Complement.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Complement.cpp	(revision 178)
@@ -0,0 +1,785 @@
+#include "common.h"
+
+///////////////////////////
+// コード補完機能
+///////////////////////////
+
+BOOL GetComplementClass(char *pBuf,char *ClassName,char *nest,BOOL bInherits){
+	extern HANDLE hHeap;
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+	extern char *pHeaderBuf;
+	extern char *pUserSource;
+	int i,i2;
+	char temporary[8192];
+	DWORD dwClassType;
+	BOOL bRet;
+
+
+	/////////////////////////////////////////
+	// ソースコードからクラス定義位置を取得
+	/////////////////////////////////////////
+	i=GetClassPos(pBuf,ClassName,&dwClassType);
+	if(pBuf[i]=='\0') return 0;
+
+
+	if(nest[0]){
+		////////////////////
+		// 入れ子構造の場合
+		////////////////////
+
+		//クラス、配列の構成要素を解析する
+		char VarName[VN_SIZE];		//変数名
+		char array[VN_SIZE];		//第1次配列
+		char lpPtrOffset[VN_SIZE];	//第2次配列
+		char NestMember[VN_SIZE];	//入れ子メンバ
+		int RefType;				//"."参照のときは0、"->"参照のときは1
+		lstrcpy(VarName,nest);
+		if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,&RefType)) return 0;
+
+		//メンバ変数の型であるクラスの名前を取得
+		char ClassName[VN_SIZE];
+		BOOL bArray;
+		if(!GetClassNameFromClassMember(pBuf,i,VarName,ClassName,&bArray)) return 0;
+
+		//TypeDef宣言を考慮してオリジナルなクラス名を取得
+		GetOriginalClassName(ClassName);
+
+		if(!CheckReferType(ClassName,bArray,array,RefType)) return 0;
+
+		//ユーザーのソースコードをサーチ
+		bRet=GetComplementClass(pUserSource,ClassName,NestMember,0);
+		if(!bRet){
+			//失敗したときはbasic.sbpをサーチ
+			bRet=GetComplementClass(pHeaderBuf,ClassName,NestMember,0);
+		}
+		return bRet;
+	}
+
+
+	////////////////////////
+	// メンバ情報を取得
+	////////////////////////
+	DWORD dwAccess;
+	DWORD dwProc;
+
+	//アクセス制限の初期値をセット
+	if(dwClassType==ESC_CLASS) dwAccess=ACCESS_PRIVATE;
+	else dwAccess=ACCESS_PUBLIC;
+
+	if(memicmp(pBuf+i,"Inherits",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')){
+		i+=9;
+		while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+		//継承を行う場合
+		for(i2=0;;i++,i2++){
+			if(!IsVariableChar(pBuf[i])){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=pBuf[i];
+		}
+
+		//ユーザーのソースコードをサーチ
+		bRet=GetComplementClass(pUserSource,temporary,"",1);
+		if(!bRet){
+			//失敗したときはbasic.sbpをサーチ
+			bRet=GetComplementClass(pHeaderBuf,temporary,"",1);
+		}
+
+		for(;;i++){
+			if(pBuf[i]=='\0') break;
+			i2=IsCommandDelimitation(pBuf,i);
+			if(i2){
+				i+=i2;
+				break;
+			}
+		}
+		JumpBlank(pBuf,&i);
+	}
+
+	//メンバ変数、関数を取得
+	while(1){
+		if(pBuf[i]=='\0') break;
+		if(memicmp(pBuf+i,"End",3)==0){
+			/*	End Class
+				End Type
+				の検出 */
+			i2=i+3;
+			while(pBuf[i2]==' '||pBuf[i2]=='\t') i2++;
+
+			if(memicmp(pBuf+i2,"Class",5)==0&&(!IsVariableChar(pBuf[i2+5]))||
+				memicmp(pBuf+i2,"Interface",9)==0&&(!IsVariableChar(pBuf[i2+9]))||
+				memicmp(pBuf+i2,"Type",4)==0&&(!IsVariableChar(pBuf[i2+4]))) break;
+		}
+
+		if(memicmp(pBuf+i,"Abstract",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Virtual",7)==0&&(pBuf[i+7]==' '||pBuf[i+7]=='\t')||
+			memicmp(pBuf+i,"Override",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')){
+			//メンバ関数のとき
+			if(pBuf[i]=='a'||pBuf[i]=='A'){
+				i+=9;
+				dwProc=ESC_ABSTRACT;
+
+				while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+				if(memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')) i+=9;
+				else if(memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')) i+=4;
+			}
+			else if(pBuf[i]=='v'||pBuf[i]=='V'){
+				i+=8;
+				dwProc=ESC_VIRTUAL;
+
+				while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+				if(memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')) i+=9;
+				else if(memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')) i+=4;
+			}
+			else if(pBuf[i]=='o'||pBuf[i]=='O'){
+				i+=9;
+				dwProc=ESC_OVERRIDE;
+
+				while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+				if(memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')) i+=9;
+				else if(memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')) i+=4;
+			}
+			else if(pBuf[i]=='f'||pBuf[i]=='F'){
+				i+=9;
+				dwProc=ESC_FUNCTION;
+			}
+			else if(pBuf[i]=='s'||pBuf[i]=='S'){
+				i+=4;
+				dwProc=ESC_SUB;
+			}
+
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		}
+		else{
+			//メンバ変数のとき
+			dwProc=0;
+		}
+
+		//変数名または関数名を取得
+		if(pBuf[i]=='~'){
+			temporary[0]='~';
+			i2=1;
+			i++;
+		}
+		else i2=0;
+		for(;;i++,i2++){
+			if(!IsVariableChar(pBuf[i])){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=pBuf[i];
+		}
+
+		if(bInherits){
+			//継承元の場合はコンストラクタ、デストラクタを除去
+			if(temporary[0]=='~') goto next;
+			if(lstrcmp(temporary,ClassName)==0) goto next;
+		}
+
+		//次の行をサーチ
+		for(;;i++){
+			if(pBuf[i]=='\0') break;
+			if(pBuf[i]=='\''||(pBuf[i]=='/'&&pBuf[i+1]=='*')){
+				//コメント中
+				JumpBlank(pBuf,&i);
+				break;
+			}
+			i2=IsCommandDelimitation(pBuf,i);
+			if(i2){
+				i+=i2;
+				break;
+			}
+		}
+		JumpBlank(pBuf,&i);
+
+		//重複チェック（オーバーライド関数の除去）
+		for(i2=0;i2<ComplementWndInfo.MemberNum;i2++){
+			if(lstrcmp(ComplementWndInfo.pMemberInfo[i2].pName,temporary)==0) goto next;
+		}
+
+		//アクセスを変更
+		if(lstrcmpi(temporary,"Private")==0){
+			dwAccess=ACCESS_PRIVATE;
+			continue;
+		}
+		if(lstrcmpi(temporary,"Public")==0){
+			dwAccess=ACCESS_PUBLIC;
+			continue;
+		}
+		if(lstrcmpi(temporary,"Protected")==0){
+			dwAccess=ACCESS_PROTECTED;
+			continue;
+		}
+
+		ComplementWndInfo.pMemberInfo=
+			(MEMBERINFO *)HeapReAlloc(hHeap,
+				0,
+				ComplementWndInfo.pMemberInfo,
+				(ComplementWndInfo.MemberNum+1)*sizeof(MEMBERINFO));
+
+		//メンバ名
+		ComplementWndInfo.pMemberInfo[ComplementWndInfo.MemberNum].pName=
+			(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+		lstrcpy(ComplementWndInfo.pMemberInfo[ComplementWndInfo.MemberNum].pName,
+			temporary);
+
+		//メンバの種類（変数、Virtual、Sub、Function）
+		ComplementWndInfo.pMemberInfo[ComplementWndInfo.MemberNum].dwProc=dwProc;
+
+		//アクセシビリティ
+		ComplementWndInfo.pMemberInfo[ComplementWndInfo.MemberNum].dwAccess=dwAccess;
+
+		ComplementWndInfo.MemberNum++;
+next:
+		if(dwProc){
+			//Abstract定義以外はEnd Sub、End Functionをサーチする
+			if(dwProc==ESC_ABSTRACT) continue;
+			if(dwClassType==ESC_INTERFACE) continue;
+
+			while(1){
+				if(pBuf[i]=='\0'){
+					i2=0;
+					break;
+				}
+
+				if(memicmp(pBuf+i,"End",3)==0){
+					/*	End Sub
+						End Function
+						の検出 */
+					i+=3;
+					while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+					if(memicmp(pBuf+i,"Sub",3)==0&&(!IsVariableChar(pBuf[i+3]))||
+						memicmp(pBuf+i,"Function",8)==0&&(!IsVariableChar(pBuf[i+8]))){
+						i2=1;
+						break;
+					}
+
+					if(memicmp(pBuf+i,"Class",5)==0&&(!IsVariableChar(pBuf[i+5]))||
+						memicmp(pBuf+i,"Interface",9)==0&&(!IsVariableChar(pBuf[i+9]))||
+						memicmp(pBuf+i,"Type",4)==0&&(!IsVariableChar(pBuf[i+4]))){
+						i2=0;
+						break;
+					}
+				}
+
+				//次の行をサーチ
+				for(;;i++){
+					if(pBuf[i]=='\0') break;
+					i2=IsCommandDelimitation(pBuf,i);
+					if(i2){
+						i+=i2;
+						break;
+					}
+				}
+				JumpBlank(pBuf,&i);
+			}
+
+			if(i2==0){
+				//コード解析が不正に終了
+				return 1;
+			}
+
+			//次の行をサーチ
+			for(;;i++){
+				if(pBuf[i]=='\0') break;
+				i2=IsCommandDelimitation(pBuf,i);
+				if(i2){
+					i+=i2;
+					break;
+				}
+			}
+			JumpBlank(pBuf,&i);
+		}
+	}
+
+	return 1;
+}
+
+void DeleteComplementInfo(void){
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+	int i;
+
+	for(i=0;i<ComplementWndInfo.MemberNum;i++)
+		HeapDefaultFree(ComplementWndInfo.pMemberInfo[i].pName);
+
+	HeapDefaultFree(ComplementWndInfo.pMemberInfo);
+}
+BOOL GetComplementInfo(char *variable,char *pEditBuf,int iPos){
+	extern HANDLE hHeap;
+
+	//ユーザーが作成したソースコードを取得
+	extern char *pUserSource;
+	pUserSource=GetUserSourceCode();
+
+	//クラス、配列の構成要素を解析する
+	char VarName[VN_SIZE];		//変数名
+	char array[VN_SIZE];		//第1次配列
+	char lpPtrOffset[VN_SIZE];	//第2次配列
+	char NestMember[VN_SIZE];	//入れ子メンバ
+	int RefType;				//"."参照のときは0、"->"参照のときは1
+	lstrcpy(VarName,variable);
+	if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,&RefType)){
+		HeapDefaultFree(pUserSource);
+		pUserSource=0;
+		return 0;
+	}
+
+
+	////////////////////////////////
+	// オブジェクトのクラス名を取得
+	////////////////////////////////
+	char ClassName[VN_SIZE];
+	BOOL bArray;
+	if(!GetVariableClassName(pEditBuf,iPos,VarName,ClassName,&bArray)){
+		HeapDefaultFree(pUserSource);
+		pUserSource=0;
+		return 0;
+	}
+
+	//TypeDef宣言を考慮してオリジナルなクラス名を取得
+	GetOriginalClassName(ClassName);
+
+	if(!CheckReferType(ClassName,bArray,array,RefType)){
+		HeapDefaultFree(pUserSource);
+		pUserSource=0;
+		return 0;
+	}
+
+
+	////////////////////
+	// クラス情報を取得
+	////////////////////
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+
+	ComplementWndInfo.pMemberInfo=(MEMBERINFO *)HeapAlloc(hHeap,0,1);
+	ComplementWndInfo.MemberNum=0;
+
+	//ユーザーのソースコードをサーチ
+	BOOL bRet;
+	bRet=GetComplementClass(pUserSource,ClassName,NestMember,0);
+	if(!bRet){
+		//失敗したときはbasic.sbpをサーチ
+		extern char *pHeaderBuf;
+		bRet=GetComplementClass(pHeaderBuf,ClassName,NestMember,0);
+	}
+
+	HeapDefaultFree(pUserSource);
+	pUserSource=0;
+
+	if(!bRet||ComplementWndInfo.MemberNum==0){
+		//見つからなかったとき
+		DeleteComplementInfo();
+		return 0;
+	}
+
+	return 1;
+}
+void CodeComplement(int WndNum,int iPos){
+	int i,i2;
+
+	//エディタ画面左端のコントロールタブ
+	int iControlTabSpace;
+	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern int font_width,font_height;
+	POINT pos;
+	pos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+	GetScrollBaseCaretPos(WndNum,(int *)&pos.x,(int *)&pos.y);
+
+	pos.x=(pos.x-1)*font_width    +iControlTabSpace;
+	pos.y=(pos.y+1)*font_height;
+
+	ClientToScreen(MdiInfo[WndNum].pMdiTextEdit->hEdit,&pos);
+
+	extern HINSTANCE hInst;
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+	ComplementWndInfo.hWnd=CreateWindowEx(WS_EX_DLGMODALFRAME,
+		"ComplementWindow",NULL,
+		WS_POPUP|WS_CLIPCHILDREN,
+		pos.x,pos.y,100,100,
+		hOwner,NULL,hInst,0);
+
+	///////////////////////////
+	// リストビューの初期化
+	///////////////////////////
+	extern METHODCHECKINFO MethodCheckInfo;
+	int height,max_width,listitem_height;
+	max_width=0;
+
+	// リストアイテムを追加
+	LV_ITEM lvItem;
+	lvItem.mask = LVIF_TEXT|LVIF_IMAGE;
+	for(i=0;i<ComplementWndInfo.MemberNum;i++){
+		lvItem.pszText=ComplementWndInfo.pMemberInfo[i].pName;
+		lvItem.iItem=0;
+		lvItem.iSubItem=0;
+
+		if(ComplementWndInfo.pMemberInfo[i].dwAccess==ACCESS_PAIRCOMMAND){
+			//ペアステートメント補完リストアイテム
+			lvItem.iImage=4;
+		}
+		else if(ComplementWndInfo.pMemberInfo[i].dwAccess==ACCESS_HTML_GENERAL_PARAM){
+			//HTMLタグのパラメータ
+			lvItem.iImage=5;
+		}
+		else if(ComplementWndInfo.pMemberInfo[i].dwAccess==ACCESS_HTML_PARAM){
+			//HTMLタグのパラメータ
+			lvItem.iImage=6;
+		}
+		else if(ComplementWndInfo.pMemberInfo[i].dwProc==0){
+			//メンバ変数
+			if(ComplementWndInfo.pMemberInfo[i].dwAccess!=ACCESS_PUBLIC)
+				lvItem.iImage=0;
+			else
+				lvItem.iImage=1;
+		}
+		else{
+			//メンバ関数
+			if(ComplementWndInfo.pMemberInfo[i].dwAccess!=ACCESS_PUBLIC)
+				lvItem.iImage=2;
+			else
+				lvItem.iImage=3;
+		}
+		ListView_InsertItem(ComplementWndInfo.hList,&lvItem);
+
+		i2=ListView_GetStringWidth(ComplementWndInfo.hList,
+			ComplementWndInfo.pMemberInfo[i].pName);
+
+		if(max_width<i2) max_width=i2;
+	}
+
+	RECT rc;
+	ListView_GetItemRect(ComplementWndInfo.hList,0,&rc,LVIR_BOUNDS);
+	listitem_height=rc.bottom-rc.top;
+	height=listitem_height*ComplementWndInfo.MemberNum;
+
+	//ウィンドウサイズとクライアント領域サイズの差を計算
+	RECT rc_Window,rc_Client;
+	SIZE size;
+	int dx,dy;
+	GetWindowRect(ComplementWndInfo.hWnd, &rc_Window);
+	GetClientRect(ComplementWndInfo.hWnd, &rc_Client);
+	dx = (rc_Window.right - rc_Window.left) - (rc_Client.right - rc_Client.left);
+	dy = (rc_Window.bottom - rc_Window.top) - (rc_Client.bottom - rc_Client.top);
+
+#define MAX_COMPLEMENT_LISTNUM 15
+	size.cx=max_width+dx+30;	//※30はアイコンの幅を含む余白
+	size.cy=height+dy;
+	if(size.cy>listitem_height*MAX_COMPLEMENT_LISTNUM+dy){
+		size.cy=listitem_height*MAX_COMPLEMENT_LISTNUM+dy;
+
+		//垂直スクロールバーの幅を考慮する
+		size.cx+=GetSystemMetrics(SM_CXVSCROLL);
+	}
+	else{
+		//スクロールバーを使用しないようにする
+		i=GetWindowLong(ComplementWndInfo.hList,GWL_STYLE);
+		i|=LVS_NOSCROLL;
+		i&=~(WS_VSCROLL|WS_HSCROLL);
+		SetWindowLong(ComplementWndInfo.hList,GWL_STYLE,i);
+	}
+
+	if(pos.x+size.cx>ScreenX){
+		pos.x=ScreenX-size.cx;
+	}
+	if(pos.y+size.cy>ScreenY-30){
+		pos.y-=size.cy+font_height;
+	}
+
+	//サイズ変更
+	MoveWindow(ComplementWndInfo.hWnd,
+		pos.x,pos.y,
+		size.cx,size.cy,0);
+
+	//チラツキを抑えながら、補完リストを表示する
+	ShowWindow(ComplementWndInfo.hWnd,SW_SHOWNOACTIVATE);
+
+	ComplementWndInfo.iPos=iPos;
+}
+
+
+
+////////////////////////////////
+// コード補完ウィンドウ
+////////////////////////////////
+
+void DrawComplementListView(HWND hListView,HDC hdc){
+	//コード補完リストビューの独自描画
+	int i;
+	RECT rc;
+	char temporary[1024];
+
+	RECT rcClient;
+	GetClientRect(hListView,&rcClient);
+
+	HFONT hFont;
+	hFont=(HFONT)SendMessage(hListView,WM_GETFONT,0,0);
+
+	HFONT hOldFont;
+	hOldFont=(HFONT)SelectObject(hdc,hFont);
+
+	SetBkMode(hdc,OPAQUE);
+
+	for(i=0;i<ListView_GetItemCount(hListView);i++){
+		LVITEM lvItem;
+		lvItem.mask = LVIF_TEXT|LVIF_IMAGE|LVIF_STATE;
+		lvItem.iItem=i;
+		lvItem.iSubItem=0;
+		lvItem.pszText=temporary;
+		lvItem.cchTextMax=1024;
+		lvItem.stateMask=LVIS_SELECTED;
+		ListView_GetItem(hListView,&lvItem);
+
+		COLORREF colorBack;
+		if(lvItem.state&LVIS_SELECTED){
+			//選択中
+			colorBack=RGB(50,80,255);
+		}
+		else{
+			//選択されていない
+			colorBack=ListView_GetBkColor(hListView);
+		}
+
+
+		/////////////////////
+		// アイコンを描画
+		/////////////////////
+		ListView_GetItemRect(hListView,i,&rc,LVIR_ICON);
+
+		HIMAGELIST hImageList;
+		hImageList=ListView_GetImageList(hListView,LVSIL_SMALL);
+
+		ImageList_Draw(hImageList,lvItem.iImage,hdc,rc.left,rc.top,ILD_NORMAL);
+
+
+		/////////////////////
+		// 文字列を描画
+		/////////////////////
+
+		//背景色で下地を準備
+		ListView_GetItemRect(hListView,i,&rc,LVIR_ICON);
+		rc.left=rc.right;
+		rc.right=rcClient.right;
+		if(lvItem.state&LVIS_SELECTED){
+			//選択されている
+
+			//グラデーションビットマップを生成
+			SIZE size;
+			GetSize(&size,&rc);
+			HBITMAP hBackBmp;
+			hBackBmp=CreateGradationBitmap(&size,RGB(130,150,210),RGB(50,80,190));
+
+			HDC memdc;
+			memdc=CreateCompatibleDC(hdc);
+			SelectObject(memdc,hBackBmp);
+
+			BitBlt(hdc,rc.left,rc.top,size.cx,size.cy,memdc,0,0,SRCCOPY);
+
+			DeleteDC(memdc);
+			DeleteObject(hBackBmp);
+
+			SetTextColor(hdc,RGB(255,255,255));
+			SetBkMode(hdc,TRANSPARENT);
+		}
+		else{
+			//選択されていない
+			HBRUSH hBrush;
+			hBrush=CreateSolidBrush(colorBack);
+			FillRect(hdc,&rc,hBrush);
+			DeleteObject(hBrush);
+
+			SetTextColor(hdc,RGB(0,0,0));
+			SetBkMode(hdc,OPAQUE);
+			SetBkColor(hdc,colorBack);
+		}
+
+		ListView_GetItemRect(hListView,i,&rc,LVIR_LABEL);
+		rc.left+=5;
+		DrawText(hdc,lvItem.pszText,lstrlen(lvItem.pszText),&rc,DT_LEFT|DT_SINGLELINE|DT_VCENTER);
+	}
+
+	SelectObject(hdc,hOldFont);
+}
+
+WNDPROC OldComplementListViewProc;
+
+LRESULT CALLBACK ComplementListViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+	int i,WndNum;
+	char temporary[VN_SIZE],temp2[VN_SIZE];
+
+	switch(message){
+		case WM_SETFOCUS:
+		case WM_RBUTTONDOWN:
+		case WM_RBUTTONDBLCLK:
+			//フォーカスをエディタに戻す
+			WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+			SetFocus(MdiInfo[WndNum].pMdiTextEdit->hEdit);
+			return 0;
+		case WM_KEYDOWN:
+			if(LOWORD(wParam)==VK_RETURN) goto DblClk;
+			else if(LOWORD(wParam)==VK_ESCAPE){
+				DestroyWindow(ComplementWndInfo.hWnd);
+				ComplementWndInfo.hWnd=0;
+			}
+			break;
+		case WM_LBUTTONDOWN:
+			//フォーカスをエディタに戻す
+			WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+			SetFocus(MdiInfo[WndNum].pMdiTextEdit->hEdit);
+
+			LVHITTESTINFO lvHitTest;
+			lvHitTest.pt.x=0;
+			lvHitTest.pt.y=HIWORD(lParam);
+			ListView_HitTest(hwnd,&lvHitTest);
+
+			//アイテムを選択
+			ListView_SetItemState(hwnd,lvHitTest.iItem,LVIS_SELECTED|LVIS_FOCUSED,LVIS_SELECTED|LVIS_FOCUSED);
+			return 0;
+		case WM_LBUTTONDBLCLK:
+DblClk:
+
+			//選択されたアイテムを取得
+			for(i=0;i<ComplementWndInfo.MemberNum;i++){
+				if(ListView_GetItemState(ComplementWndInfo.hList,i,LVIS_SELECTED)) break;
+			}
+			if(i!=ComplementWndInfo.MemberNum){
+				ListView_GetItemText(hwnd,i,0,temporary,VN_SIZE);
+
+				WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+				if(ComplementWndInfo.pMemberInfo[0].dwAccess==ACCESS_PAIRCOMMAND){
+					//ペアステートメント補完
+
+					for(i=ComplementWndInfo.iPos-1;;i--){
+						if(MdiInfo[WndNum].pMdiTextEdit->buffer[i]!='\t'){
+							i++;
+							break;
+						}
+					}
+
+					GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,
+						i,
+						&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+
+					//インデント
+					lstrcpy(temp2,ComplementWndInfo.szIndent);
+					if(IsNeedNewIndentCommand(temporary)) lstrcat(temp2,"\t");
+
+					lstrcat(temp2,temporary);
+
+					//リプレース前に補完機能を破棄する
+					DestroyWindow(ComplementWndInfo.hWnd);
+					ComplementWndInfo.hWnd=0;
+
+					TextEdit_ReplaceUpdateUndoData(WndNum,temp2,0,1);
+				}
+				else{
+					//クラスメンバ補完
+
+					GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,
+						ComplementWndInfo.iPos,
+						&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+
+					//リプレース前に補完機能を破棄する
+					DestroyWindow(ComplementWndInfo.hWnd);
+					ComplementWndInfo.hWnd=0;
+
+					TextEdit_ReplaceUpdateUndoData(WndNum,temporary,0,1);
+				}
+			}
+
+			return 0;
+
+		case WM_PAINT:
+			HDC hdc;
+			PAINTSTRUCT ps;
+			hdc=BeginPaint(hwnd,&ps);
+			DrawComplementListView(hwnd,hdc);
+			EndPaint(hwnd,&ps);
+			return 0;
+	}
+	return CallWindowProc(OldComplementListViewProc,hwnd,message,wParam,lParam);
+}
+
+LRESULT CALLBACK ComplementWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+	static HWND hListView;
+	static HIMAGELIST hImageList;
+
+	switch(message){
+		case WM_CREATE:
+
+			////////////////////////
+			// リストビューを作成
+			////////////////////////
+
+			hListView=CreateWindow(WC_LISTVIEW,0,
+				WS_CHILD|WS_VISIBLE|WS_VSCROLL|     LVS_SMALLICON|LVS_SINGLESEL|LVS_SORTASCENDING|LVS_SHOWSELALWAYS,
+				0,0,0,0,
+				hwnd,NULL,hInst,0);
+			OldComplementListViewProc=(WNDPROC)GetWindowLongPtr(hListView,GWLP_WNDPROC);
+			SetWindowLong(hListView,GWLP_WNDPROC,(long)ComplementListViewProc);
+
+			//フォントをセット
+			extern METHODCHECKINFO MethodCheckInfo;
+			SendMessage(hListView,WM_SETFONT,(long)MethodCheckInfo.hFont,0);
+
+			ComplementWndInfo.hList=hListView;
+
+			//背景色をセット
+			COLORREF rgb;
+			if(ComplementWndInfo.pMemberInfo[0].dwAccess==ACCESS_PAIRCOMMAND){
+				//ペアステートメント補完
+				rgb=RGB(245,245,255);
+			}
+			else{
+				//クラスメンバ補完
+				rgb=RGB(255,245,240);
+			}
+			ListView_SetBkColor(hListView,rgb);
+			ListView_SetTextBkColor(hListView,rgb);
+
+
+			////////////////////////
+			// イメージリストを作成
+			////////////////////////
+
+			hImageList=ImageList_Create(16, 16, ILC_COLOR24, 7, 0);
+			ListView_SetImageList(hListView, hImageList, LVSIL_SMALL);
+			ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_MEMBER_PRIVATE_VARIABLE)));
+			ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_MEMBER_PUBLIC_VARIABLE)));
+			ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_MEMBER_PRIVATE_FUNCTION)));
+			ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_MEMBER_PUBLIC_FUNCTION)));
+			ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_PAIRSTATEMENT)));
+			ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_HTML_GENERAL_PARAMETER)));
+			ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_HTML_PARAMETER)));
+
+			return 0;
+		case WM_SIZE:
+			MoveWindow(hListView,0,0,LOWORD(lParam),HIWORD(lParam),0);
+			return 0;
+		case WM_DESTROY:
+			DeleteComplementInfo();
+			ImageList_Destroy(hImageList);
+			return 0;
+
+		case WM_NOTIFY:
+			NMLISTVIEW *nmListView;
+			nmListView=(NMLISTVIEW *)lParam;
+			if(nmListView->hdr.hwndFrom==hListView){
+				if(nmListView->hdr.code==LVN_ITEMCHANGED){
+					InvalidateRect(hListView,NULL,0);
+					return 1;
+				}
+			}
+			break;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/Debugger.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Debugger.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Debugger.cpp	(revision 178)
@@ -0,0 +1,518 @@
+#include "common.h"
+
+CDebugger *pobj_Debugger;
+
+#define WM_DEBUG_CONTINUE	WM_USER+200
+#define WM_STEP_IN			WM_USER+201
+#define WM_STEP_OVER		WM_USER+202
+#define WM_STEP_CURSOR		WM_USER+203
+#define WM_DEBUG_STOP		WM_USER+204
+#define WM_DEBUG_PAUSE		WM_USER+205
+
+CDebugger::CDebugger(){
+	hwnd=0;
+	bDebugging=0;
+}
+CDebugger::~CDebugger(){
+}
+
+BOOL CDebugger::IsDebugging(void){
+	return bDebugging;
+}
+BOOL CDebugger::IsDebuggerView(void){
+	if(hwnd) return 1;
+	return 0;
+}
+
+void CDebugger::resize(int x,int y,int cx,int cy){
+	MoveWindow(hwnd,x,y,cx,cy,1);
+}
+
+void CDebugger::ResetCommandEnabled(void){
+	if(bDebugging==0){
+		BOOL bEnableDocument=0, bBreakPoint=0;
+
+		HWND hChild;
+		hChild=GetWindow(hClient,GW_CHILD);
+
+		if(ProjectInfo.name[0]){
+			//有効（プロジェクトを開いているとき）
+			bEnableDocument=1;
+		}
+		else{
+			if(IsWindow(hChild)){
+				if(MdiInfo[GetWndNum(hChild)].DocType==WNDTYPE_BASIC){
+					//有効（Basicプログラムファイルを開いているとき）
+					bEnableDocument=1;
+				}
+			}
+		}
+
+		if(IsWindow(hChild)){
+			if(MdiInfo[GetWndNum(hChild)].DocType==WNDTYPE_BASIC){
+				//ブレークポイント有効（Basicプログラムファイルを開いているとき）
+				bBreakPoint=1;
+			}
+		}
+
+		int MenuMsg;
+		if(bEnableDocument) MenuMsg=MF_BYCOMMAND|MF_ENABLED;
+		else MenuMsg=MF_BYCOMMAND|MF_GRAYED;
+
+		//リリースコンパイル
+		pobj_MainMenu->EnableItem(IDM_RELEASECOMPILE,MenuMsg);
+		pobj_ReleaseToolbar->EnableItem(IDM_RELEASECOMPILE,bEnableDocument);
+
+		//リリース実行
+		pobj_MainMenu->EnableItem(IDM_RELEASERUN,MenuMsg);
+		pobj_ReleaseToolbar->EnableItem(IDM_RELEASERUN,bEnableDocument);
+
+		//デバッグコンパイル
+		pobj_MainMenu->EnableItem(IDM_DEBUGCOMPILE,MenuMsg);
+		pobj_DebuggerToolbar->EnableItem(IDM_DEBUGCOMPILE,bEnableDocument);
+
+		//デバッグ実行
+		pobj_MainMenu->EnableItem(IDM_DEBUG,MenuMsg);
+		pobj_DebuggerToolbar->EnableItem(IDM_DEBUG,bEnableDocument);
+
+		if(bEnableDocument==0){
+			//ステップ実行
+			pobj_MainMenu->EnableItem(IDM_STEP_IN,MenuMsg);
+			pobj_MainMenu->EnableItem(IDM_STEP_OVER,MenuMsg);
+			pobj_MainMenu->EnableItem(IDM_STEP_CURSOR,MenuMsg);
+			pobj_DebuggerToolbar->EnableItem(IDM_STEP_IN,bEnableDocument);
+			pobj_DebuggerToolbar->EnableItem(IDM_STEP_OVER,bEnableDocument);
+			pobj_DebuggerToolbar->EnableItem(IDM_STEP_CURSOR,bEnableDocument);
+
+			//デバッグの一時停止
+			pobj_MainMenu->EnableItem(IDM_DEBUG_PAUSE,MenuMsg);
+			pobj_DebuggerToolbar->EnableItem(IDM_DEBUG_PAUSE,bEnableDocument);
+
+			//デバッグの中断
+			pobj_MainMenu->EnableItem(IDM_DEBUG_STOP,MenuMsg);
+			pobj_DebuggerToolbar->EnableItem(IDM_DEBUG_STOP,bEnableDocument);
+		}
+
+		if(bBreakPoint) MenuMsg=MF_BYCOMMAND|MF_ENABLED;
+		else MenuMsg=MF_BYCOMMAND|MF_GRAYED;
+
+		//ブレークポイント
+		pobj_MainMenu->EnableItem(IDM_BREAKPOINT,MenuMsg);
+		pobj_DebuggerToolbar->EnableItem(IDM_BREAKPOINT,bBreakPoint);
+
+
+
+
+		//プラットフォームセレクト
+		extern HWND hSelectCompilerCombo;
+		EnableWindow(hSelectCompilerCombo,bEnableDocument);
+	}
+}
+
+void CDebugger::SaftyCheck(void){
+	extern HWND hCompileView;
+	if(!IsWindow(hCompileView)){
+		SendMessage(hOwner,WM_DESTROYDEBUGGERVIEW,0,0);
+		SendMessage(hOwner,WM_DESTROYDEBUGGERBASE,0,0);
+		SendMessage(hOwner,WM_DESTROYCOMPILEVIEW,0,0);
+	}
+}
+
+
+
+/////////////////////////////////////////
+// デバッグ開始
+/////////////////////////////////////////
+void CDebugger::begin(void){
+	bDebugging=1;
+
+	if(pobj_MainMenu){
+		//リリースコンパイルを無効化
+		pobj_MainMenu->EnableItem(IDM_RELEASECOMPILE,MF_BYCOMMAND|MF_GRAYED);
+		pobj_DebuggerToolbar->EnableItem(IDM_RELEASECOMPILE,0);
+
+		//デバッグコンパイルを無効化
+		pobj_MainMenu->EnableItem(IDM_DEBUGCOMPILE,MF_BYCOMMAND|MF_GRAYED);
+		pobj_DebuggerToolbar->EnableItem(IDM_DEBUGCOMPILE,0);
+
+		//デバッグ実行を無効化
+		pobj_MainMenu->EnableItem(IDM_DEBUG,MF_BYCOMMAND|MF_GRAYED);
+		pobj_DebuggerToolbar->EnableItem(IDM_DEBUG,0);
+
+		//ステップ実行を無効化
+		pobj_MainMenu->EnableItem(IDM_STEP_IN,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_STEP_OVER,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_STEP_CURSOR,MF_BYCOMMAND|MF_GRAYED);
+		pobj_DebuggerToolbar->EnableItem(IDM_STEP_IN,0);
+		pobj_DebuggerToolbar->EnableItem(IDM_STEP_OVER,0);
+		pobj_DebuggerToolbar->EnableItem(IDM_STEP_CURSOR,0);
+
+		//デバッグの一時停止を有効化
+		pobj_MainMenu->EnableItem(IDM_DEBUG_PAUSE,MF_BYCOMMAND|MF_ENABLED);
+		pobj_DebuggerToolbar->EnableItem(IDM_DEBUG_PAUSE,1);
+
+		//デバッグの中断を有効化
+		pobj_MainMenu->EnableItem(IDM_DEBUG_STOP,MF_BYCOMMAND|MF_ENABLED);
+		pobj_DebuggerToolbar->EnableItem(IDM_DEBUG_STOP,1);
+	}
+}
+
+
+/////////////////////////////////////////
+// デバッグ終了
+/////////////////////////////////////////
+void CDebugger::end(void){
+	bDebugging=0;
+
+	if(pobj_MainMenu){
+		//リリースコンパイルを有効化
+		pobj_MainMenu->EnableItem(IDM_RELEASECOMPILE,MF_BYCOMMAND|MF_ENABLED);
+		pobj_DebuggerToolbar->EnableItem(IDM_RELEASECOMPILE,1);
+
+		//デバッグコンパイルを有効化
+		pobj_MainMenu->EnableItem(IDM_DEBUGCOMPILE,MF_BYCOMMAND|MF_ENABLED);
+		pobj_DebuggerToolbar->EnableItem(IDM_DEBUGCOMPILE,1);
+
+		//デバッグ実行を有効化
+		pobj_MainMenu->EnableItem(IDM_DEBUG,MF_BYCOMMAND|MF_ENABLED);
+		pobj_DebuggerToolbar->EnableItem(IDM_DEBUG,1);
+
+		//ステップ実行を無効化
+		pobj_MainMenu->EnableItem(IDM_STEP_IN,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_STEP_OVER,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_STEP_CURSOR,MF_BYCOMMAND|MF_GRAYED);
+		pobj_DebuggerToolbar->EnableItem(IDM_STEP_IN,0);
+		pobj_DebuggerToolbar->EnableItem(IDM_STEP_OVER,0);
+		pobj_DebuggerToolbar->EnableItem(IDM_STEP_CURSOR,0);
+
+		//デバッグの一時停止を無効化
+		pobj_MainMenu->EnableItem(IDM_DEBUG_PAUSE,MF_BYCOMMAND|MF_GRAYED);
+		pobj_DebuggerToolbar->EnableItem(IDM_DEBUG_PAUSE,0);
+
+		//デバッグの中断を無効化
+		pobj_MainMenu->EnableItem(IDM_DEBUG_STOP,MF_BYCOMMAND|MF_GRAYED);
+		pobj_DebuggerToolbar->EnableItem(IDM_DEBUG_STOP,0);
+	}
+}
+
+
+/////////////////////////////////////////
+// 一時停止（ウォッチウィンドウが立ち上がる）
+/////////////////////////////////////////
+void CDebugger::watch_start(HWND hDebuggerView){
+	hwnd=hDebuggerView;
+
+	if(pobj_MainMenu){
+		//継続を有効化
+		pobj_MainMenu->EnableItem(IDM_DEBUG,MF_BYCOMMAND|MF_ENABLED);
+		pobj_DebuggerToolbar->EnableItem(IDM_DEBUG,1);
+
+		//ステップ実行を有効化
+		pobj_MainMenu->EnableItem(IDM_STEP_IN,MF_BYCOMMAND|MF_ENABLED);
+		pobj_MainMenu->EnableItem(IDM_STEP_OVER,MF_BYCOMMAND|MF_ENABLED);
+		pobj_MainMenu->EnableItem(IDM_STEP_CURSOR,MF_BYCOMMAND|MF_ENABLED);
+		pobj_DebuggerToolbar->EnableItem(IDM_STEP_IN,1);
+		pobj_DebuggerToolbar->EnableItem(IDM_STEP_OVER,1);
+		pobj_DebuggerToolbar->EnableItem(IDM_STEP_CURSOR,1);
+
+		//デバッグの一時停止を無効化
+		pobj_MainMenu->EnableItem(IDM_DEBUG_PAUSE,MF_BYCOMMAND|MF_GRAYED);
+		pobj_DebuggerToolbar->EnableItem(IDM_DEBUG_PAUSE,0);
+	}
+}
+
+
+/////////////////////////////////////////
+// デバッグを再開
+/////////////////////////////////////////
+void CDebugger::watch_quit(void){
+	hwnd=0;
+
+	begin();
+}
+
+
+void CDebugger::DebugContinue(void){
+	if(hwnd) SendMessage(hwnd,WM_DEBUG_CONTINUE,0,0);
+}
+void CDebugger::StepIn(void){
+	if(hwnd) SendMessage(hwnd,WM_STEP_IN,0,0);
+}
+void CDebugger::StepOver(void){
+	if(hwnd) SendMessage(hwnd,WM_STEP_OVER,0,0);
+}
+void CDebugger::StepToCursor(void){
+	if(hwnd){
+		int WndNum;
+		WndNum=GetNowWndNum();
+		if(WndNum==-1) return;
+
+		char temporary[MAX_PATH];
+		sprintf(temporary,"\"%s\",%d",MdiInfo[WndNum].path,MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+
+		char temp2[MAX_PATH];
+		GetTempPath(MAX_PATH,temp2);
+		if(temp2[lstrlen(temp2)-1]!='\\') lstrcat(temp2,"\\");
+		lstrcat(temp2,"ab_breakpoint.tmp");
+
+		WriteBuffer(temp2,temporary,lstrlen(temporary));
+
+		SendMessage(hwnd,WM_STEP_CURSOR,0,0);
+	}
+}
+void CDebugger::DebugStop(void){
+	extern HWND hCompileView;
+	SendMessage(hCompileView,WM_DEBUG_STOP,0,0);
+}
+void CDebugger::DebugPause(void){
+	extern HWND hCompileView;
+	SendMessage(hCompileView,WM_DEBUG_PAUSE,0,0);
+}
+
+
+
+
+
+
+//////////////////////////
+// ブレークポイント
+//////////////////////////
+
+CFileBreakPoint::CFileBreakPoint(char *lpszFileName,int iLineNum){
+	this->lpszFileName=(char *)HeapAlloc(hHeap,0,lstrlen(lpszFileName)+1);
+	lstrcpy(this->lpszFileName,lpszFileName);
+
+	piLine=(int *)HeapAlloc(hHeap,0,sizeof(int));
+	piLine[0]=iLineNum;
+	num=1;
+}
+CFileBreakPoint::~CFileBreakPoint(){
+	HeapDefaultFree(lpszFileName);
+	HeapDefaultFree(piLine);
+}
+void CFileBreakPoint::add(int iLineNum){
+	piLine=(int *)HeapReAlloc(hHeap,0,piLine,(num+1)*sizeof(int));
+
+	int i;
+	for(i=0;i<num;i++){
+		if(piLine[i]>iLineNum){
+			for(int i2=num;i2>i;i2--){
+				piLine[i2]=piLine[i2-1];
+			}
+			break;
+		}
+	}
+
+	piLine[i]=iLineNum;
+	num++;
+}
+void CFileBreakPoint::remove(int iLineNum){
+	int i;
+	for(i=0;i<num;i++){
+		if(iLineNum==piLine[i]) break;
+	}
+	if(i==num) return;
+
+	num--;
+	for(;i<num;i++){
+		piLine[i]=piLine[i+1];
+	}
+}
+BOOL CFileBreakPoint::check(int iLineNum){
+	int i;
+	for(i=0;i<num;i++){
+		if(iLineNum==piLine[i]) return 1;
+	}
+	return 0;
+}
+
+void CFileBreakPoint::replace(LPSTR lpszBuffer,CHARRANGE *pDelRange,CHARRANGE *pRange,LPSTR lpszNewStr){
+	int i;
+
+	//削除される行範囲を取得
+	int DelStartLine=0;
+	for(i=0;i<pDelRange->cpMin;i++){
+		if(IsReturnCode(lpszBuffer+i)){
+			DelStartLine++;
+		}
+	}
+
+	int DelEndLine=DelStartLine;
+	for(;i<pDelRange->cpMax;i++){
+		if(IsReturnCode(lpszBuffer+i)){
+			DelEndLine++;
+		}
+	}
+
+	//ブレークポイントを消去
+	for(i=0;i<num;i++){
+		if(DelStartLine<piLine[i]&&piLine[i]<DelEndLine){
+			remove(piLine[i]);
+		}
+	}
+
+
+	//新しく挿入される文字列の行数を計算する
+	int NewLineNum=0;
+	for(i=0;lpszNewStr[i];i++){
+		if(IsReturnCode(lpszNewStr+i)){
+			NewLineNum++;
+		}
+	}
+
+
+	//オフセットを計算
+	int offset=DelStartLine-DelEndLine+NewLineNum;
+
+
+	//挿入行以降の行にて、オフセットを反映される
+	for(i=0;i<num;i++){
+		if(DelStartLine<=piLine[i]){
+			piLine[i]+=offset;
+		}
+	}
+}
+
+
+
+CDBBreakPoint::CDBBreakPoint(){
+	ppItem=(CFileBreakPoint **)HeapAlloc(hHeap,0,1);
+	num=0;
+}
+CDBBreakPoint::~CDBBreakPoint(){
+	int i;
+	for(i=0;i<num;i++){
+		delete ppItem[i];
+	}
+	HeapDefaultFree(ppItem);
+}
+void CDBBreakPoint::insert(char *lpszFileName,int iLineNum){
+	int i;
+	for(i=0;i<num;i++){
+		if(lstrcmpi(ppItem[i]->lpszFileName,lpszFileName)==0){
+			ppItem[i]->add(iLineNum);
+			return;
+		}
+	}
+
+	if(i==num){
+		ppItem=(CFileBreakPoint **)HeapReAlloc(hHeap,0,ppItem,(num+1)*sizeof(CFileBreakPoint *));
+		ppItem[num]=new CFileBreakPoint(lpszFileName,iLineNum);
+		num++;
+	}
+}
+void CDBBreakPoint::remove(char *lpszFileName,int iLineNum){
+	int i;
+	for(i=0;i<num;i++){
+		if(lstrcmpi(lpszFileName,ppItem[i]->lpszFileName)==0){
+			ppItem[i]->remove(iLineNum);
+			break;
+		}
+	}
+	if(i==num) return;
+
+	if(ppItem[i]->num==0){
+		delete ppItem[i];
+
+		num--;
+		for(;i<num;i++){
+			ppItem[i]=ppItem[i+1];
+		}
+	}
+}
+
+void CDBBreakPoint::Event_BreakPoint(void){
+	int WndNum;
+	WndNum=GetNowWndNum();
+	if(WndNum==-1) return;
+
+	if(!IsExistFile(MdiInfo[WndNum].path)) return;
+
+	int i,i2,sw=0;
+	for(i=0;i<num;i++){
+		if(lstrcmpi(MdiInfo[WndNum].path,ppItem[i]->lpszFileName)==0){
+			for(i2=0;i2<ppItem[i]->num;i2++){
+				if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==ppItem[i]->piLine[i2]){
+					sw=1;
+					break;
+				}
+			}
+			break;
+		}
+	}
+
+	if(sw==0){
+		//ブレークポイントを追加
+		insert(MdiInfo[WndNum].path,MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+	}
+	else{
+		//ブレークポイントを削除
+		remove(MdiInfo[WndNum].path,MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+	}
+
+	if(pobj_Debugger->IsDebugging()){
+		SaveToTempFile();
+
+		//デバッガにブレークポイント更新のメッセージを送る
+		//未完成
+	}
+
+	//エディタを再描画
+	InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->hEdit,NULL,0);
+}
+void CDBBreakPoint::SaveToTempFile(void){
+	char *buffer;
+	int length=0;
+	buffer=(char *)HeapAlloc(hHeap,0,65535);
+	buffer[0]=0;
+	int i,i2;
+	for(i=0;i<num;i++){
+		sprintf(buffer+length,"\"%s\"",ppItem[i]->lpszFileName);
+		length+=lstrlen(buffer+length);
+
+		for(i2=0;i2<ppItem[i]->num;i2++){
+			sprintf(buffer+length,",%d",ppItem[i]->piLine[i2]);
+			length+=lstrlen(buffer+length);
+		}
+
+		lstrcpy(buffer+length,"\n");
+		length+=lstrlen(buffer+length);
+	}
+
+	HANDLE hFile;
+	char temporary[MAX_PATH];
+	GetTempPath(MAX_PATH,temporary);
+	if(temporary[lstrlen(temporary)-1]!='\\') lstrcat(temporary,"\\");
+	lstrcat(temporary,"ab_breakpoint.tmp");
+
+	//未完成
+	sprintf(temporary,"%sab_breakpoint.tmp",pj_editor_Dir);
+
+	hFile=CreateFile(temporary,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_TEMPORARY,NULL);
+	DWORD dwAccBytes;
+	WriteFile(hFile,buffer,lstrlen(buffer),&dwAccBytes,NULL);
+	CloseHandle(hFile);
+
+	HeapDefaultFree(buffer);
+}
+
+
+CFileBreakPoint *CDBBreakPoint::EnumLines(char *lpszFilePath){
+	int i;
+	for(i=0;i<num;i++){
+		if(lstrcmpi(lpszFilePath,ppItem[i]->lpszFileName)==0){
+			return ppItem[i];
+		}
+	}
+	return 0;
+}
+
+void CDBBreakPoint::replace(LPSTR lpszFilePath,LPSTR lpszBuffer,CHARRANGE *pDelRange,CHARRANGE *pRange,LPSTR lpszNewStr){
+	int i;
+	for(i=0;i<num;i++){
+		if(lstrcmpi(ppItem[i]->lpszFileName,lpszFilePath)==0){
+			ppItem[i]->replace(lpszBuffer,pDelRange,pRange,lpszNewStr);
+			return;
+		}
+	}
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/Debugger.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Debugger.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Debugger.h	(revision 178)
@@ -0,0 +1,83 @@
+
+class CDebugger{
+	BOOL bDebugging;
+public:
+	HWND hwnd;
+
+	CDebugger::CDebugger();
+	CDebugger::~CDebugger();
+
+	BOOL IsDebugging(void);
+	BOOL IsDebuggerView(void);
+
+	void resize(int x,int y,int cx,int cy);
+
+	void ResetCommandEnabled(void);
+
+	void SaftyCheck(void);
+
+	void begin(void);
+	void end(void);
+	void watch_start(HWND hDebuggerView);
+	void watch_quit(void);
+
+
+	/////////////////////////////////
+	// イベントによるアプリ間通信
+	/////////////////////////////////
+
+	void DebugContinue(void);
+	void StepIn(void);
+	void StepOver(void);
+	void StepToCursor(void);
+
+	void DebugStop(void);
+	void DebugPause(void);
+};
+
+extern CDebugger *pobj_Debugger;
+
+
+
+
+
+/////////////////////////////////
+// ブレークポイント
+/////////////////////////////////
+
+class CFileBreakPoint{
+public:
+	char *lpszFileName;
+
+	int *piLine;
+	int num;
+
+	CFileBreakPoint(char *lpszFileName,int iLineNum);
+	~CFileBreakPoint();
+
+	void add(int iLineNum);
+	void remove(int iLineNum);
+
+	BOOL check(int iLineNum);
+
+	void replace(LPSTR lpszBuffer,CHARRANGE *pDelRange,CHARRANGE *pRange,LPSTR lpszNewStr);
+};
+
+class CDBBreakPoint{
+	CFileBreakPoint **ppItem;
+	int num;
+
+public:
+	CDBBreakPoint();
+	~CDBBreakPoint();
+
+	void insert(char *lpszFileName,int iLineNum);
+	void remove(char *lpszFileName,int iLineNum);
+
+	void Event_BreakPoint(void);
+	void SaveToTempFile(void);
+
+	CFileBreakPoint *EnumLines(char *lpszFilePath);
+
+	void replace(LPSTR lpszFilePath,LPSTR lpszBuffer,CHARRANGE *pDelRange,CHARRANGE *pRange,LPSTR lpszNewStr);
+};
Index: tag/abdev(2007.06.20)/ProjectEditor/DesignTheme.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/DesignTheme.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/DesignTheme.cpp	(revision 178)
@@ -0,0 +1,191 @@
+#include "common.h"
+
+
+CDBTheme *pobj_DBTheme;
+
+
+CTheme::CTheme(char *path,char *name){
+	bActive=0;
+	lstrcpy(m_name,name);
+	if(path==0) return;
+
+	buffer=ReadBuffer(path);
+
+
+	//通常の文字色
+	GetRGBValue("rgbDefault",&TextColorInfo.rgbDefault);
+
+	//コメント文字色
+	GetRGBValue("rgbComment",&TextColorInfo.rgbComment);
+
+	//特殊ステートメント
+	GetRGBValue("rgbStatement",&TextColorInfo.rgbStatement);
+
+	//文字列色
+	GetRGBValue("rgbString",&TextColorInfo.rgbString);
+
+	//背景色（カーソル行）
+	GetRGBValue("rgbCursorBack",&TextColorInfo.rgbCursorBack);
+
+	//背景色（一般）
+	GetRGBValue("rgbBackground",&TextColorInfo.rgbBackground);
+
+	//背景画像
+	if(!GetStringValue("BackgroundImagePath",szBackgroundImagePath)) szBackgroundImagePath[0]=0;
+
+	HeapDefaultFree(buffer);
+}
+CTheme::CTheme(){
+	CTheme(0,THEMENAME_USER);
+}
+CTheme::~CTheme(){
+}
+
+void CTheme::save(){
+	buffer=(char *)HeapAlloc(hHeap,0,65536);
+	buffer[0]=0;
+
+
+	//通常の文字色
+	SetRGBValue("rgbDefault",TextColorInfo.rgbDefault);
+
+	//コメント文字色
+	SetRGBValue("rgbComment",TextColorInfo.rgbComment);
+
+	//特殊ステートメント
+	SetRGBValue("rgbStatement",TextColorInfo.rgbStatement);
+
+	//文字列色
+	SetRGBValue("rgbString",TextColorInfo.rgbString);
+
+	//背景色（カーソル行）
+	SetRGBValue("rgbCursorBack",TextColorInfo.rgbCursorBack);
+
+	//背景色（一般）
+	SetRGBValue("rgbBackground",TextColorInfo.rgbBackground);
+
+	//背景画像
+	SetStringValue("BackgroundImagePath",szBackgroundImagePath);
+
+	char path[MAX_PATH];
+	sprintf(path,"%sTheme\\%s",pj_editor_Dir,m_name);
+	if(!IsExistFile(path)){
+		CreateDirectory(path,NULL);
+	}
+
+	sprintf(path,"%sTheme\\%s\\design.ini",pj_editor_Dir,m_name);
+	WriteBuffer(path,buffer,lstrlen(buffer));
+
+	HeapDefaultFree(buffer);
+}
+
+
+CDBTheme::CDBTheme(){
+	hBackBmp=0;
+
+	iNum=0;
+	ppobj_Theme=(CTheme **)HeapAlloc(hHeap,0,1);
+
+	char temporary[MAX_PATH];
+	sprintf(temporary,"%sTheme\\*",pj_editor_Dir);
+
+	HANDLE hFind;
+	WIN32_FIND_DATA wfd;
+	hFind=FindFirstFile(temporary,&wfd);
+	if(hFind!=INVALID_HANDLE_VALUE){
+		do{
+			if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY){
+				if(!(lstrcmp(wfd.cFileName,".")==0||lstrcmp(wfd.cFileName,"..")==0)){
+					//ディレクトリのとき
+					sprintf(temporary,"%sTheme\\%s\\design.ini",pj_editor_Dir,wfd.cFileName);
+					if(IsExistFile(temporary)){
+						add(temporary,wfd.cFileName);
+					}
+				}
+			}
+			else{
+				//ファイルのとき
+				//無視
+			}
+		}while(FindNextFile(hFind,&wfd));
+	}
+}
+CDBTheme::~CDBTheme(){
+	int i;
+	for(i=0;i<iNum;i++){
+		delete ppobj_Theme[i];
+	}
+	HeapDefaultFree(ppobj_Theme);
+
+	unlock();
+}
+
+CTheme *CDBTheme::dupli_check(char *name){
+	//重複チェック
+	int i;
+	for(i=0;i<iNum;i++){
+		if(lstrcmpi(ppobj_Theme[i]->m_name,name)==0){
+			return ppobj_Theme[i];
+		}
+	}
+	return 0;
+}
+
+CTheme *CDBTheme::add(char *path,char *name){
+	ppobj_Theme=(CTheme **)HeapReAlloc(hHeap,0,ppobj_Theme,(iNum+1)*sizeof(CTheme *));
+	ppobj_Theme[iNum]=new CTheme(path,name);
+	iNum++;
+
+	return ppobj_Theme[iNum-1];
+}
+void CDBTheme::ResetTheme_ToComboBox(HWND hCombo){
+	int i;
+	for(i=0;i<iNum;i++){
+		SendMessage(hCombo,CB_ADDSTRING,0,(LPARAM)ppobj_Theme[i]->m_name);
+	}
+
+	//選択する
+	for(i=0;i<iNum;i++){
+		if(lstrcmp(ppobj_Theme[i]->m_name,pobj_nv->szActiveTheme)==0){
+			i=SendMessage(hCombo,CB_FINDSTRINGEXACT,0,(LPARAM)ppobj_Theme[i]->m_name);
+			SendMessage(hCombo,CB_SETCURSEL,i,0);
+			break;
+		}
+	}
+}
+CTheme *CDBTheme::GetActiveTheme(){
+	int i;
+	for(i=0;i<iNum;i++){
+		if(lstrcmp(ppobj_Theme[i]->m_name,pobj_nv->szActiveTheme)==0){
+			return ppobj_Theme[i];
+		}
+	}
+	return 0;
+}
+
+void CDBTheme::lock(void){
+	CTheme *pobj_Theme;
+	pobj_Theme=GetActiveTheme();
+
+	if(pobj_Theme->szBackgroundImagePath[0]=='\0'){
+		hBackBmp=0;
+		return;
+	}
+
+	char szThemeDir[MAX_PATH];
+	sprintf(szThemeDir,"%sTheme\\%s\\",pj_editor_Dir,pobj_Theme->m_name);
+
+	char temporary[MAX_PATH];
+	lstrcpy(temporary,pobj_Theme->szBackgroundImagePath);
+	GetFullPath(temporary,szThemeDir);
+
+	hBackBmp=(HBITMAP)LoadImage(0,temporary,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE);
+
+	BITMAP Bitmap;
+	GetObject(hBackBmp,sizeof(BITMAP),&Bitmap);
+	sizeBackBmp.cx=Bitmap.bmWidth;
+	sizeBackBmp.cy=Bitmap.bmHeight;
+}
+void CDBTheme::unlock(void){
+	if(hBackBmp) DeleteObject(hBackBmp);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/DesignTheme.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/DesignTheme.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/DesignTheme.h	(revision 178)
@@ -0,0 +1,53 @@
+
+
+#define THEMENAME_CLASSIC	"Classic"
+#define THEMENAME_USER		"User Setting"
+
+
+struct TEXTEDIT_COLOR_INFO{
+	COLORREF rgbDefault;		//通常の文字
+	COLORREF rgbComment;		//コメント
+	COLORREF rgbStatement;		//特殊ステートメント
+	COLORREF rgbString;			//文字列
+	COLORREF rgbCursorBack;		//背景色（カーソル行）
+	COLORREF rgbBackground;		//背景色（一般）
+};
+extern TEXTEDIT_COLOR_INFO tci;
+
+
+class CTheme:public CSettingFile{
+public:
+	BOOL bActive;
+	char m_name[MAX_PATH];
+	TEXTEDIT_COLOR_INFO TextColorInfo;
+	char szBackgroundImagePath[MAX_PATH];
+
+	CTheme(char *path,char *name);
+	CTheme();
+	~CTheme();
+
+	void save(void);
+};
+
+class CDBTheme{
+public:
+	int iNum;
+	CTheme **ppobj_Theme;
+
+	CDBTheme();
+	~CDBTheme();
+	CTheme *dupli_check(char *name);
+
+	CTheme *add(char *path,char *name);
+
+	void ResetTheme_ToComboBox(HWND hCombo);
+
+	CTheme *GetActiveTheme();
+
+	HBITMAP hBackBmp;
+	SIZE sizeBackBmp;
+	void lock(void);
+	void unlock(void);
+};
+
+extern CDBTheme *pobj_DBTheme;
Index: tag/abdev(2007.06.20)/ProjectEditor/DialogBoxes.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/DialogBoxes.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/DialogBoxes.cpp	(revision 178)
@@ -0,0 +1,2209 @@
+#include "Common.h"
+
+//タブ用
+BOOL SetSwitch[32];
+
+
+void SetPosCenter(HWND hParent,HWND hwnd){
+	RECT owrect,rect;
+	int x,y;
+
+	if(IsWindow(hParent)) GetWindowRect(hParent,&owrect);
+	else{
+		owrect.left=0;
+		owrect.top=0;
+		owrect.right=ScreenX;
+		owrect.bottom=ScreenY;
+	}
+	GetWindowRect(hwnd,&rect);
+	x=((owrect.right-owrect.left)-(rect.right-rect.left))/2+owrect.left;
+	y=((owrect.bottom-owrect.top)-(rect.bottom-rect.top))/2+owrect.top;
+	SetWindowPos(hwnd,0,x,y,0,0,SWP_NOSIZE);
+}
+void SetPosCenter(HWND hwnd){
+	SetPosCenter(hOwner,hwnd);
+}
+BOOL SetFontDialog(HWND hwnd,LOGFONT *lf,BOOL bFixedPitchOnly,int *lpiPointSize){
+	CHOOSEFONT cf;
+	LOGFONT lfDummy;
+
+	lfDummy=*lf;
+	memset(&cf,0,sizeof(CHOOSEFONT));
+	cf.lStructSize=sizeof(CHOOSEFONT);
+	cf.hwndOwner=hwnd;
+	cf.lpLogFont=&lfDummy;
+	cf.Flags=CF_SCREENFONTS|CF_INITTOLOGFONTSTRUCT;
+	if(bFixedPitchOnly) cf.Flags|=CF_FIXEDPITCHONLY|CF_NOVERTFONTS;
+	cf.nFontType=SCREEN_FONTTYPE;
+	lstrcpy((char *)cf.lpTemplateName,"Font select");
+
+	if(!ChooseFont(&cf)) return 0;
+
+	memcpy(lf,&lfDummy,sizeof(LOGFONT));
+
+	if(lpiPointSize) *lpiPointSize=cf.iPointSize;
+
+	return 1;
+}
+
+
+
+//////////////////////////////////
+// プロジェクト新規作成ウィザード
+//////////////////////////////////
+
+//プロジェクト作成項目
+#if defined(JPN)
+//日本語
+#define TEXT_BASE_NORMAL	"ノーマル ウィンドウをベースに、GUIアプリケーションを作成します。"
+#define TEXT_BASE_PROMPT	"プロンプト ウィンドウをベースに、N88BASIC互換プログラムを作成します。"
+#define TEXT_BASE_DOSPROMPT	"コンソール アプリケーションを作成します。Windows上で稼動するDOSプロンプトでの入出力が可能になります。"
+#define TEXT_NOBASE			"空のプロジェクトを作成します。"
+#define TEXT_DIRECTX		"DirectXに対応したアプリケーションを作成します。2Dまたは3Dの描画を高速に行うことができ、ゲームアプリケーションなどの開発に最適です。"
+#define TEXT_DLL			"ダイナミック リンク ライブラリ(DLL)を作成します。"
+#else
+//英語
+#define TEXT_BASE_NORMAL	"You can make a GUI application of a normal window base."
+#define TEXT_BASE_PROMPT	"You can make a N88 compatible program of a prompt window base."
+#define TEXT_BASE_DOSPROMPT	"You can make a console application."
+#define TEXT_NOBASE			"Empty project is created."
+#define TEXT_DIRECTX		"You can make a DirectX application. It can draw 2D or 3D graphics at high speed and it is useful to a game programing."
+#define TEXT_DLL			"You can make a DLL(Dynamic Link Library)."
+#endif
+
+void GetCheckTextBuffer(char *buffer){
+	extern NEWPROJECTINFO NewProjectInfo;
+	int i;
+
+#if defined(JPN)
+	//日本語
+	lstrcpy(buffer,"作成するプロジェクトの内容を確認して \"完了\" ボタンを押して下さい。\r\n\r\n");
+	i=lstrlen(buffer);
+	sprintf(buffer+i,"プロジェクト名: \"%s\"\r\n",NewProjectInfo.name);
+	i+=lstrlen(buffer+i);
+	sprintf(buffer+i,"ワーク ディレクトリ: \"%s\\%s\"\r\n\r\n",pobj_nv->ProjectSaveDir,NewProjectInfo.name);
+	i+=lstrlen(buffer+i);
+
+	if(NewProjectInfo.dwTypeID==IDC_EXE_WINDOWBASE){
+		lstrcpy(buffer+i,"ノーマル ウィンドウを持つEXE形式の実行ファイルを作成します。\r\n\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"--- 以下のファイルが生成されます ---\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.pj … プロジェクト ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.idx … インデックス ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.ab … メイン ソースコード ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wnd … ウィンドウ デザイン保存用\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wrk … 作業状況の管理用\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"MainWnd.ab … メイン ウィンドウのイベント プロシージャ用\r\n",NewProjectInfo.name);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_PROMPTBASE){
+		lstrcpy(buffer+i,"プロンプト ウィンドウを持つEXE形式の実行ファイルを作成します。\r\n\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"--- 以下のファイルが生成されます ---\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.pj … プロジェクト ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.idx … インデックス ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.ab … メイン ソースコード ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wrk … 作業状況の管理用\r\n",NewProjectInfo.name);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_DOSPROMPTBASE){
+		lstrcpy(buffer+i,"EXE形式のコンソール アプリケーションを作成します。\r\n\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"--- 以下のファイルが生成されます ---\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.pj … プロジェクト ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.idx … インデックス ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.ab … メイン ソースコード ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wrk … 作業状況の管理用\r\n",NewProjectInfo.name);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_NOBASE){
+		lstrcpy(buffer+i,"EXE形式の実行ファイルを作成します。\r\n\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"--- 以下のファイルが生成されます ---\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.pj … プロジェクト ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.idx … インデックス ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.ab … メイン ソースコード ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wrk … 作業状況の管理用\r\n",NewProjectInfo.name);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_DIRECTX){
+		lstrcpy(buffer+i,"EXE形式の実行ファイルを作成します。同時に、DirectXの操作に必要なソースコードを生成します。\r\n\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"--- 以下のファイルが生成されます ---\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.pj … プロジェクト ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.idx … インデックス ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.ab … メイン ソースコード ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"dx_graphics.sbp … DirectGraphicsサポート用ソースコード ファイル\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"dx_input.sbp … DirectInputサポート用ソースコード ファイル\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"dx_music.sbp … DirectMusicサポート用ソースコード ファイル\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wrk … 作業状況の管理用\r\n",NewProjectInfo.name);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_DLL){
+		lstrcpy(buffer+i,"ダイナミック リンク ライブラリ(DLL)を作成します。\r\n\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"--- 以下のファイルが生成されます ---\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.pj … プロジェクト ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.idx … インデックス ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.ab … メイン ソースコード ファイル\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wrk … 作業状況の管理用\r\n",NewProjectInfo.name);
+	}
+#else
+	//英語
+	lstrcpy(buffer,"Please check following points and click the \"Finish\" button.\r\n\r\n");
+	i=lstrlen(buffer);
+	sprintf(buffer+i,"Project Name: \"%s\"\r\n",NewProjectInfo.name);
+	i+=lstrlen(buffer+i);
+	sprintf(buffer+i,"Work Directory: \"%s\\%s\"\r\n\r\n",pobj_nv->ProjectSaveDir,NewProjectInfo.name);
+	i+=lstrlen(buffer+i);
+
+	if(NewProjectInfo.dwTypeID==IDC_EXE_WINDOWBASE){
+		sprintf(buffer+i,"%s\r\n\r\n",TEXT_BASE_NORMAL);
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"--- Creation Files ---\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.pj … Project file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.idx … Index file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.ab … Main Source Code file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wnd … Data of Window Design\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wrk … Data of Work State\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"MainWnd.ab … Data of Event Procedures of the Main Window\r\n",NewProjectInfo.name);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_PROMPTBASE){
+		sprintf(buffer+i,"%s\r\n\r\n",TEXT_BASE_PROMPT);
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"--- Creation Files ---\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.pj … Creation Files\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.idx … Index file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.ab … Main Source Code file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wrk … Data of Work State\r\n",NewProjectInfo.name);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_DOSPROMPTBASE){
+		sprintf(buffer+i,"%s\r\n\r\n",TEXT_BASE_DOSPROMPT);
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"--- Creation Files ---\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.pj … Creation Files\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.idx … Index file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.ab … Main Source Code file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wrk … Data of Work State\r\n",NewProjectInfo.name);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_NOBASE){
+		sprintf(buffer+i,"%s\r\n\r\n",TEXT_NOBASE);
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"--- Creation Files ---\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.pj … Creation Files\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.idx … Index file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.ab … Main Source Code file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wrk … Data of Work State\r\n",NewProjectInfo.name);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_DIRECTX){
+		sprintf(buffer+i,"%s\r\n\r\n",TEXT_DIRECTX);
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"--- Creation Files ---\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.pj … Creation Files\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.idx … Index file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.ab … Main Source Code file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"dx_graphics.sbp … DirectGraphics is supported at this source file\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"dx_input.sbp … DirectInput is supported at this source file\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"dx_music.sbp … DirectMusic is supported at this source file\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wrk … Data of Work State\r\n",NewProjectInfo.name);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_DLL){
+		sprintf(buffer+i,"%s\r\n\r\n",TEXT_DLL);
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"--- Creation Files ---\r\n");
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.pj … Creation Files\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.idx … Index file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.ab … Main Source Code file\r\n",NewProjectInfo.name);
+		i+=lstrlen(buffer+i);
+		sprintf(buffer+i,"%s.wrk … Data of Work State\r\n",NewProjectInfo.name);
+	}
+#endif
+}
+BOOL CALLBACK DlgNewProject_Page3(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	char buffer[GENERAL_SIZE];
+	LPPSHNOTIFY lpPshNotify;
+	switch(message){
+		case WM_NOTIFY:
+			lpPshNotify=(LPPSHNOTIFY)lParam;
+			switch(lpPshNotify->hdr.code){
+				case PSN_SETACTIVE:
+					PropSheet_SetWizButtons(GetParent(hwnd),PSWIZB_FINISH|PSWIZB_BACK);
+
+					GetCheckTextBuffer(buffer);
+
+					SetDlgItemText(hwnd,IDC_PROJECTINFO,buffer);
+					SetTimer(hwnd,1,10,0);
+					return 1;
+				case PSN_WIZFINISH:
+					MakeNewProject();
+					return 1;
+			}
+			break;
+		case WM_TIMER:
+			KillTimer(hwnd,1);
+			SendDlgItemMessage(hwnd,IDC_PROJECTINFO,EM_SETSEL,0,0);
+			return 1;
+	}
+	return 0;
+}
+BOOL CALLBACK DlgNewProject_Page2(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern NEWPROJECTINFO NewProjectInfo;
+	LPPSHNOTIFY lpPshNotify;
+	switch(message){
+		case WM_INITDIALOG:
+
+			break;
+		case WM_NOTIFY:
+			lpPshNotify=(LPPSHNOTIFY)lParam;
+			switch(lpPshNotify->hdr.code){
+				case PSN_SETACTIVE:
+					//DirectXアプリのときはMMSYSをチェック
+					if(NewProjectInfo.dwTypeID==IDC_EXE_DIRECTX){
+						SendDlgItemMessage(hwnd,IDC_API_MMSYS,BM_SETCHECK,BST_CHECKED,0);
+						EnableWindow(GetDlgItem(hwnd,IDC_API_MMSYS),0);
+					}
+					else{
+						EnableWindow(GetDlgItem(hwnd,IDC_API_MMSYS),1);
+					}
+
+					PropSheet_SetWizButtons(GetParent(hwnd),PSWIZB_NEXT|PSWIZB_BACK);
+					return 1;
+				case PSN_WIZNEXT:
+					NewProjectInfo.dwOption=PJ_OP_RC_MANIFEST;
+					if(SendDlgItemMessage(hwnd,IDC_UNICODE,BM_GETCHECK,0,0))
+						NewProjectInfo.dwOption|=PJ_OP_UNICODE;
+					if(SendDlgItemMessage(hwnd,IDC_API_COMMCTRL,BM_GETCHECK,0,0))
+						NewProjectInfo.dwOption|=PJ_OP_COMMCTRL;
+					if(SendDlgItemMessage(hwnd,IDC_API_MMSYS,BM_GETCHECK,0,0))
+						NewProjectInfo.dwOption|=PJ_OP_MMSYSTEM;
+					if(SendDlgItemMessage(hwnd,IDC_API_RICHEDIT,BM_GETCHECK,0,0))
+						NewProjectInfo.dwOption|=PJ_OP_RICHEDIT;
+					if(SendDlgItemMessage(hwnd,IDC_API_WINSOCK,BM_GETCHECK,0,0))
+						NewProjectInfo.dwOption|=PJ_OP_WINSOCK;
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+void AppImage_ShowOrHide(HWND hDlg,int id){
+	int nCmd;
+
+	if(id==IDC_EXE_WINDOWBASE) nCmd=SW_SHOW;
+	else nCmd=SW_HIDE;
+	ShowWindow(GetDlgItem(hDlg,IDC_IMAGE_WINDOW),nCmd);
+
+	if(id==IDC_EXE_PROMPTBASE) nCmd=SW_SHOW;
+	else nCmd=SW_HIDE;
+	ShowWindow(GetDlgItem(hDlg,IDC_IMAGE_PROMPT),nCmd);
+
+	if(id==IDC_EXE_DOSPROMPTBASE) nCmd=SW_SHOW;
+	else nCmd=SW_HIDE;
+	ShowWindow(GetDlgItem(hDlg,IDC_IMAGE_DOSPROMPT),nCmd);
+
+	if(id==IDC_EXE_NOBASE) nCmd=SW_SHOW;
+	else nCmd=SW_HIDE;
+	ShowWindow(GetDlgItem(hDlg,IDC_IMAGE_NON),nCmd);
+
+	if(id==IDC_EXE_DIRECTX) nCmd=SW_SHOW;
+	else nCmd=SW_HIDE;
+	ShowWindow(GetDlgItem(hDlg,IDC_IMAGE_DIRECTX),nCmd);
+}
+BOOL CALLBACK DlgNewProject_Page1(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern NEWPROJECTINFO NewProjectInfo;
+	int i;
+	char temporary[MAX_PATH];
+	LPPSHNOTIFY lpPshNotify;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(GetParent(hwnd));
+
+			SetDlgItemText(hwnd,IDC_DIRPATH,pobj_nv->ProjectSaveDir);
+			SendDlgItemMessage(hwnd,IDC_EXE_WINDOWBASE,BM_SETCHECK,BST_CHECKED,0);
+			SetDlgItemText(hwnd,IDC_HELPTEXT_OFBASE,TEXT_BASE_NORMAL);
+			break;
+		case WM_COMMAND:
+			if(HIWORD(wParam)==EN_CHANGE){
+				if(GetWindowTextLength(GetDlgItem(hwnd,IDC_PROJECTNAME))==0||
+					GetWindowTextLength(GetDlgItem(hwnd,IDC_DIRPATH))==0){
+					PropSheet_SetWizButtons(GetParent(hwnd),0);
+				}
+				else PropSheet_SetWizButtons(GetParent(hwnd),PSWIZB_NEXT);
+			}
+			switch(LOWORD(wParam)){
+				case IDC_PATHBROWSE:
+					//"ディレクトリを選択して下さい"
+					if(!GetFolder(hwnd,temporary,STRING_DIRECTORY_SELECT)) return 1;
+					SetDlgItemText(hwnd,IDC_DIRPATH,temporary);
+					return 1;
+				case IDC_EXE_WINDOWBASE:
+					AppImage_ShowOrHide(hwnd,LOWORD(wParam));
+
+					SetDlgItemText(hwnd,IDC_HELPTEXT_OFBASE,TEXT_BASE_NORMAL);
+					EnableWindow(GetDlgItem(hwnd,IDC_SHOWHELLOWORLD),1);
+					return 1;
+				case IDC_EXE_PROMPTBASE:
+					AppImage_ShowOrHide(hwnd,LOWORD(wParam));
+
+					SetDlgItemText(hwnd,IDC_HELPTEXT_OFBASE,TEXT_BASE_PROMPT);
+					EnableWindow(GetDlgItem(hwnd,IDC_SHOWHELLOWORLD),1);
+					return 1;
+				case IDC_EXE_DOSPROMPTBASE:
+					AppImage_ShowOrHide(hwnd,LOWORD(wParam));
+
+					SetDlgItemText(hwnd,IDC_HELPTEXT_OFBASE,TEXT_BASE_DOSPROMPT);
+					EnableWindow(GetDlgItem(hwnd,IDC_SHOWHELLOWORLD),1);
+					return 1;
+				case IDC_EXE_NOBASE:
+					AppImage_ShowOrHide(hwnd,LOWORD(wParam));
+
+					SetDlgItemText(hwnd,IDC_HELPTEXT_OFBASE,TEXT_NOBASE);
+					EnableWindow(GetDlgItem(hwnd,IDC_SHOWHELLOWORLD),0);
+					return 1;
+				case IDC_EXE_DIRECTX:
+					AppImage_ShowOrHide(hwnd,LOWORD(wParam));
+
+					SetDlgItemText(hwnd,IDC_HELPTEXT_OFBASE,TEXT_DIRECTX);
+					EnableWindow(GetDlgItem(hwnd,IDC_SHOWHELLOWORLD),0);
+					return 1;
+				case IDC_DLL:
+					AppImage_ShowOrHide(hwnd,LOWORD(wParam));
+
+					SetDlgItemText(hwnd,IDC_HELPTEXT_OFBASE,TEXT_DLL);
+					EnableWindow(GetDlgItem(hwnd,IDC_SHOWHELLOWORLD),0);
+					return 1;
+			}
+			break;
+		case WM_NOTIFY:
+			lpPshNotify=(LPPSHNOTIFY)lParam;
+			switch(lpPshNotify->hdr.code){
+				case PSN_SETACTIVE:
+					SendMessage(hwnd,WM_COMMAND,MAKELONG(0,EN_CHANGE),0);
+					return 1;
+				case PSN_WIZNEXT:
+					GetDlgItemText(hwnd,IDC_PROJECTNAME,NewProjectInfo.name,MAX_PATH);
+					if(!IsVariableTopChar(NewProjectInfo.name[0])){
+						//"プロジェクト名の先頭文字はアルファベット（A～Z、a～z）またはアンダーバー（_）でなければなりません。"
+						MessageBox(hwnd,STRING_ERROR_PROJECTTOPCHAR,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+						SetWindowLong(hwnd,DWL_MSGRESULT,-1);
+						return 1;
+					}
+					for(i=1;;i++){
+						if(NewProjectInfo.name[i]=='\0') break;
+						if(!IsVariableChar(NewProjectInfo.name[i])){
+							//"プロジェクト名に不正な文字コードが含まれています。"
+							MessageBox(hwnd,STRING_ERROR_PROJECTNAME,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+							SetWindowLong(hwnd,DWL_MSGRESULT,-1);
+							return 1;
+						}
+					}
+					GetDlgItemText(hwnd,IDC_DIRPATH,pobj_nv->ProjectSaveDir,MAX_PATH);
+
+					//ベース選択
+					if(SendDlgItemMessage(hwnd,IDC_EXE_WINDOWBASE,BM_GETCHECK,0,0))
+						NewProjectInfo.dwTypeID=IDC_EXE_WINDOWBASE;
+					else if(SendDlgItemMessage(hwnd,IDC_EXE_PROMPTBASE,BM_GETCHECK,0,0))
+						NewProjectInfo.dwTypeID=IDC_EXE_PROMPTBASE;
+					else if(SendDlgItemMessage(hwnd,IDC_EXE_DOSPROMPTBASE,BM_GETCHECK,0,0))
+						NewProjectInfo.dwTypeID=IDC_EXE_DOSPROMPTBASE;
+					else if(SendDlgItemMessage(hwnd,IDC_EXE_NOBASE,BM_GETCHECK,0,0))
+						NewProjectInfo.dwTypeID=IDC_EXE_NOBASE;
+					else if(SendDlgItemMessage(hwnd,IDC_EXE_DIRECTX,BM_GETCHECK,0,0))
+						NewProjectInfo.dwTypeID=IDC_EXE_DIRECTX;
+					else if(SendDlgItemMessage(hwnd,IDC_DLL,BM_GETCHECK,0,0))
+						NewProjectInfo.dwTypeID=IDC_DLL;
+
+					//"Hello World!"を表示するか
+					if(SendDlgItemMessage(hwnd,IDC_SHOWHELLOWORLD,BM_GETCHECK,0,0)) NewProjectInfo.ShowHelloWorld=1;
+					else NewProjectInfo.ShowHelloWorld=0;
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+void DlgNewProjectWizard(HWND hwnd){
+#define MAX_NEWPROJECTPAGE 3
+	PROPSHEETHEADER psh;
+	PROPSHEETPAGE psp;
+	HPROPSHEETPAGE hpsp[MAX_NEWPROJECTPAGE];
+	int i;
+
+	psp.dwSize=sizeof(PROPSHEETPAGE);
+	psp.hInstance=hResInst;
+	psp.dwFlags=PSP_DEFAULT;
+
+	//各ページのセッティング
+	i=0;
+	psp.pszTemplate=MAKEINTRESOURCE(IDD_NEWPROJECT_PAGE1);
+	psp.pfnDlgProc=DlgNewProject_Page1;
+	hpsp[i]=CreatePropertySheetPage(&psp);
+	i++;
+	psp.pszTemplate=MAKEINTRESOURCE(IDD_NEWPROJECT_PAGE2);
+	psp.pfnDlgProc=DlgNewProject_Page2;
+	hpsp[i]=CreatePropertySheetPage(&psp);
+	i++;
+	psp.pszTemplate=MAKEINTRESOURCE(IDD_NEWPROJECT_PAGE3);
+	psp.pfnDlgProc=DlgNewProject_Page3;
+	hpsp[i]=CreatePropertySheetPage(&psp);
+
+	memset(&psh,0,sizeof(PROPSHEETHEADER));
+	psh.dwSize=sizeof(PROPSHEETHEADER);
+	psh.dwFlags=PSH_WIZARD;
+	psh.phpage=hpsp;
+	psh.hwndParent=hwnd;
+	psh.nPages=MAX_NEWPROJECTPAGE;
+	PropertySheet(&psh);
+}
+
+#define CATEGORY_TEXT_BASIC	"Basic"
+#define CATEGORY_TEXT_TEXT	"テキスト"
+#define CATEGORY_TEXT_OTHER "その他"
+
+#define CATEGORY_BASIC	1
+#define CATEGORY_TEXT	2
+#define CATEGORY_OTHER	3
+void ResetNewFileTypeListView(HWND hListView,int fCategory){
+	ListView_DeleteAllItems(hListView);
+
+	LV_ITEM lvItem;
+	lvItem.mask = LVIF_TEXT|LVIF_IMAGE|LVIF_PARAM;
+	lvItem.iItem=0;
+	lvItem.iSubItem=0;
+
+	if(fCategory==CATEGORY_BASIC){
+		lvItem.pszText="Basic ソース ファイル";
+		lvItem.iImage=0;
+		lvItem.lParam=FT_BASICPROGRAM;
+		ListView_InsertItem(hListView,&lvItem);
+		lvItem.iItem++;
+
+		lvItem.pszText="プロジェクト";
+		lvItem.iImage=2;
+		lvItem.lParam=FT_PROJECT;
+		ListView_InsertItem(hListView,&lvItem);
+	}
+	else if(fCategory==CATEGORY_TEXT){
+		lvItem.pszText="テキスト ファイル";
+		lvItem.iImage=3;
+		lvItem.lParam=FT_TEXT;
+		ListView_InsertItem(hListView,&lvItem);
+		lvItem.iItem++;
+
+		lvItem.pszText="HTML ファイル";
+		lvItem.iImage=4;
+		lvItem.lParam=FT_HTML;
+		ListView_InsertItem(hListView,&lvItem);
+	}
+	else if(fCategory==CATEGORY_OTHER){
+		lvItem.pszText="アイコン ファイル";
+		lvItem.iImage=5;
+		lvItem.lParam=FT_ICON;
+		ListView_InsertItem(hListView,&lvItem);
+	}
+
+	ListView_SetItemState(hListView,0,LVIS_SELECTED|LVIS_FOCUSED,LVIS_SELECTED|LVIS_FOCUSED);
+}
+
+#ifndef THETEXT
+BOOL CALLBACK DlgNewFile(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern PROJECTINFO ProjectInfo;
+	extern char NewFileName[MAX_PATH];
+
+	static HIMAGELIST hImageList;
+	static HWND hTree;
+	static HWND hListView;
+	int i;
+	LVITEM lvItem;
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+
+
+			///////////////////////////////////
+			// カテゴリツリービューを初期化
+			///////////////////////////////////
+			HTREEITEM hBasicTreeItem;
+
+			hTree=GetDlgItem(hwnd,IDC_CATEGORY_TREE);
+
+			TV_INSERTSTRUCT tv;
+			tv.hInsertAfter=TVI_LAST;
+			tv.item.mask=TVIF_TEXT;
+			tv.hParent=TVI_ROOT;
+
+			tv.item.pszText=CATEGORY_TEXT_BASIC;
+			hBasicTreeItem=TreeView_InsertItem(hTree,&tv);
+			tv.item.pszText=CATEGORY_TEXT_TEXT;
+			TreeView_InsertItem(hTree,&tv);
+			tv.item.pszText=CATEGORY_TEXT_OTHER;
+			TreeView_InsertItem(hTree,&tv);
+
+			TreeView_SelectItem(hTree,hBasicTreeItem);
+
+
+
+			/////////////////////////////////////////
+			// ファイルタイプ リストビューを初期化
+			/////////////////////////////////////////
+
+			hListView=GetDlgItem(hwnd,IDC_FILETYPELIST);
+
+			hImageList=ImageList_Create(32, 32, ILC_COLOR24|ILC_MASK, 6, 0);
+			ListView_SetImageList(hListView, hImageList, LVSIL_NORMAL);
+			ImageList_AddIcon(hImageList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_FILE_BAS)));
+			ImageList_AddIcon(hImageList, LoadIcon(hInst, MAKEINTRESOURCE(IDI_FILE_SBP)));
+			ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_NEWFILE_PJ)));
+			ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_NEWFILE_TEXT)));
+			ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_NEWFILE_HTML)));
+			ImageList_AddIcon(hImageList, LoadIcon(hResInst, MAKEINTRESOURCE(IDI_NEWFILE_ICON)));
+
+
+			ResetNewFileTypeListView(hListView,CATEGORY_BASIC);
+
+
+			SetFocus(GetDlgItem(hwnd,IDC_FILETYPELIST));
+
+			if(ProjectInfo.name[0]){
+				SendDlgItemMessage(hwnd,IDC_ADDTOPROJECT,BM_SETCHECK,BST_CHECKED,0);
+			}
+
+			SendMessage(hwnd,WM_COMMAND,IDC_ADDTOPROJECT,0);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					for(i=0;i<ListView_GetItemCount(hListView);i++){
+						if(ListView_GetItemState(hListView,i,LVIS_SELECTED)){
+							lvItem.mask=LVIF_PARAM;
+							lvItem.iItem=i;
+							lvItem.iSubItem=0;
+							ListView_GetItem(hListView,&lvItem);
+							break;
+						}
+					}
+					if(i==ListView_GetItemCount(hListView)) return 1;
+
+					//ファイルタイプ
+					i=lvItem.lParam;
+
+					//プロジェクトへ追加するかどうか
+					if(IsWindowEnabled(GetDlgItem(hwnd,IDC_ADDTOPROJECT))){
+						if(SendDlgItemMessage(hwnd,IDC_ADDTOPROJECT,BM_GETCHECK,0,0)){
+							i|=0x00008000;
+							GetDlgItemText(hwnd,IDC_FILENAME,NewFileName,MAX_PATH);
+
+							if(NewFileName[0]=='\0'){
+								MessageBox(hwnd,"ファイル名を入力してください。",APPLICATION_NAME,MB_OK);
+								return 1;
+							}
+						}
+					}
+
+					EndDialog(hwnd,i);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,-1);
+					return 1;
+				case IDC_ADDTOPROJECT:
+					if(IsWindowEnabled(GetDlgItem(hwnd,IDC_ADDTOPROJECT))&&
+						SendDlgItemMessage(hwnd,IDC_ADDTOPROJECT,BM_GETCHECK,0,0)){
+						EnableWindow(GetDlgItem(hwnd,IDC_FILENAME),1);
+						EnableWindow(GetDlgItem(hwnd,IDC_STATIC_FILENAME),1);
+					}
+					else{
+						EnableWindow(GetDlgItem(hwnd,IDC_FILENAME),0);
+						EnableWindow(GetDlgItem(hwnd,IDC_STATIC_FILENAME),0);
+					}
+					return 1;
+			}
+			break;
+
+		case WM_NOTIFY:
+			NMHDR *hdr;
+			hdr=(NMHDR *)lParam;
+			if(hdr->hwndFrom==hTree&&hdr->code==TVN_SELCHANGED){
+				NMTREEVIEW *lpnmTree;
+				lpnmTree=(NMTREEVIEW *)lParam;
+
+				char temporary[255];
+				TVITEM tvItem;
+				tvItem.mask=TVIF_TEXT|TVIF_HANDLE;
+				tvItem.hItem=lpnmTree->itemNew.hItem;
+				tvItem.pszText=temporary;
+				tvItem.cchTextMax=255;
+				TreeView_GetItem(hTree,&tvItem);
+
+				if(lstrcmpi(tvItem.pszText,CATEGORY_TEXT_BASIC)==0)
+					ResetNewFileTypeListView(hListView,CATEGORY_BASIC);
+				else if(lstrcmpi(tvItem.pszText,CATEGORY_TEXT_TEXT)==0)
+					ResetNewFileTypeListView(hListView,CATEGORY_TEXT);
+				else if(lstrcmpi(tvItem.pszText,CATEGORY_TEXT_OTHER)==0)
+					ResetNewFileTypeListView(hListView,CATEGORY_OTHER);
+			}
+			if(hdr->hwndFrom==hListView){
+				if(hdr->code==LVN_ITEMCHANGED){
+					for(i=0;i<ListView_GetItemCount(hListView);i++){
+						if(ListView_GetItemState(hListView,i,LVIS_SELECTED)){
+							lvItem.mask=LVIF_PARAM;
+							lvItem.iItem=i;
+							lvItem.iSubItem=0;
+							ListView_GetItem(hListView,&lvItem);
+							break;
+						}
+					}
+					if(i!=ListView_GetItemCount(hListView)&&ProjectInfo.name[0]&&(
+						lvItem.lParam==FT_BASICPROGRAM||
+						lvItem.lParam==FT_SUBPROGRAM
+						)){
+						EnableWindow(GetDlgItem(hwnd,IDC_ADDTOPROJECT),1);
+					}
+					else EnableWindow(GetDlgItem(hwnd,IDC_ADDTOPROJECT),0);
+
+					SendMessage(hwnd,WM_COMMAND,IDC_ADDTOPROJECT,0);
+				}
+				else if(hdr->code==NM_DBLCLK){
+					SendMessage(hwnd,WM_COMMAND,IDOK,0);
+				}
+			}
+			return 0;
+
+		case WM_DESTROY:
+			ImageList_Destroy(hImageList);
+			return 0;
+	}
+	return 0;
+}
+#endif
+
+
+//プロジェクトオプション項目
+#define MAX_PJSETDLG 4
+DWORD temp_dwPjOption;
+char temp_lpszOutputRelease[MAX_PATH];
+char temp_lpszOutputDebug[MAX_PATH];
+char temp_szManifestPath[MAX_PATH];
+char temp_szDebugCmdLine[8192];
+char temp_szDebugExePath[MAX_PATH];
+
+void SaveSetting_DlgPjOption(void){
+	extern PROJECTINFO  ProjectInfo;
+	if(SetSwitch[0]){
+		//出力ファイル
+		lstrcpy(ProjectInfo.lpszOutput_Release,temp_lpszOutputRelease);
+		lstrcpy(ProjectInfo.lpszOutput_Debug,temp_lpszOutputDebug);
+
+		//コメントの有無
+		ProjectInfo.dwOption=temp_dwPjOption;
+	}
+	if(SetSwitch[1]){
+		//Win32API
+		ProjectInfo.dwOption=temp_dwPjOption;
+	}
+	if(SetSwitch[2]){
+		//マニフェスト
+
+		//パス
+		lstrcpy(ProjectInfo.szManifestPath,temp_szManifestPath);
+
+		ProjectInfo.dwOption=temp_dwPjOption;
+
+		ProjectInfo.ModifuOfResource=1;
+	}
+	if(SetSwitch[3]){
+		//デバッグ
+
+		//コマンドライン
+		lstrcpy(ProjectInfo.szCmdLine,temp_szDebugCmdLine);
+
+		//デバッグセッション用の実行可能ファイル
+		lstrcpy(ProjectInfo.szExePath,temp_szDebugExePath);
+	}
+
+	ProjectInfo.modify=1;
+}
+BOOL CALLBACK DlgProjectOption_Whole(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern PROJECTINFO ProjectInfo;
+	NMHDR *nmhdr;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(GetParent(hwnd));
+
+			SetSwitch[0]=1;
+
+			//出力ファイル
+			SetDlgItemText(hwnd,IDC_EDIT_RELEASE,ProjectInfo.lpszOutput_Release);
+			SetDlgItemText(hwnd,IDC_EDIT_DEBUG,ProjectInfo.lpszOutput_Debug);
+
+			//Unicode
+			if(temp_dwPjOption&PJ_OP_UNICODE)
+				SendDlgItemMessage(hwnd,IDC_UNICODE,BM_SETCHECK,BST_CHECKED,0);
+
+			break;
+		case WM_NOTIFY:
+			nmhdr=(NMHDR *)lParam;
+			if(nmhdr->code==PSN_APPLY||nmhdr->code==PSN_KILLACTIVE){
+				GetDlgItemText(hwnd,IDC_EDIT_RELEASE,temp_lpszOutputRelease,MAX_PATH);
+				GetDlgItemText(hwnd,IDC_EDIT_DEBUG,temp_lpszOutputDebug,MAX_PATH);
+
+				//Unicode
+				if(SendDlgItemMessage(hwnd,IDC_UNICODE,BM_GETCHECK,0,0))
+					temp_dwPjOption|=PJ_OP_UNICODE;
+				else temp_dwPjOption&=~PJ_OP_UNICODE;
+
+				if(nmhdr->code==PSN_APPLY) SaveSetting_DlgPjOption();
+			}
+			return 1;
+	}
+	return 0;
+}
+BOOL CALLBACK DlgProjectOption_Win32API(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern PROJECTINFO ProjectInfo;
+	NMHDR *nmhdr;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetSwitch[1]=1;
+
+			if(temp_dwPjOption&PJ_OP_MMSYSTEM)
+				SendDlgItemMessage(hwnd,IDC_API_MMSYS,BM_SETCHECK,BST_CHECKED,0);
+			if(temp_dwPjOption&PJ_OP_COMMCTRL)
+				SendDlgItemMessage(hwnd,IDC_API_COMMCTRL,BM_SETCHECK,BST_CHECKED,0);
+			if(temp_dwPjOption&PJ_OP_RICHEDIT)
+				SendDlgItemMessage(hwnd,IDC_API_RICHEDIT,BM_SETCHECK,BST_CHECKED,0);
+			if(temp_dwPjOption&PJ_OP_WINSOCK)
+				SendDlgItemMessage(hwnd,IDC_API_WINSOCK,BM_SETCHECK,BST_CHECKED,0);
+			break;
+		case WM_NOTIFY:
+			nmhdr=(NMHDR *)lParam;
+			if(nmhdr->code==PSN_APPLY||nmhdr->code==PSN_KILLACTIVE){
+				if(SendDlgItemMessage(hwnd,IDC_API_MMSYS,BM_GETCHECK,0,0))
+					temp_dwPjOption|=PJ_OP_MMSYSTEM;
+				else temp_dwPjOption&=~PJ_OP_MMSYSTEM;
+				if(SendDlgItemMessage(hwnd,IDC_API_COMMCTRL,BM_GETCHECK,0,0))
+					temp_dwPjOption|=PJ_OP_COMMCTRL;
+				else temp_dwPjOption&=~PJ_OP_COMMCTRL;
+				if(SendDlgItemMessage(hwnd,IDC_API_RICHEDIT,BM_GETCHECK,0,0))
+					temp_dwPjOption|=PJ_OP_RICHEDIT;
+				else temp_dwPjOption&=~PJ_OP_RICHEDIT;
+				if(SendDlgItemMessage(hwnd,IDC_API_WINSOCK,BM_GETCHECK,0,0))
+					temp_dwPjOption|=PJ_OP_WINSOCK;
+				else temp_dwPjOption&=~PJ_OP_WINSOCK;
+
+				if(nmhdr->code==PSN_APPLY) SaveSetting_DlgPjOption();
+			}
+			return 1;
+	}
+	return 0;
+}
+BOOL CALLBACK DlgProjectOption_Manifest(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	switch(message){
+		case WM_INITDIALOG:
+			SetSwitch[2]=1;
+
+			//パス
+			SetDlgItemText(hwnd,IDC_PATH,ProjectInfo.szManifestPath);
+
+			//マニフェストをリソースに埋め込む
+			if(temp_dwPjOption&PJ_OP_RC_MANIFEST)
+				SendDlgItemMessage(hwnd,IDC_RC_MANIFEST,BM_SETCHECK,BST_CHECKED,0);
+
+			SendMessage(hwnd,WM_COMMAND,IDC_RC_MANIFEST,0);
+
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_RC_MANIFEST:
+					if(SendDlgItemMessage(hwnd,IDC_RC_MANIFEST,BM_GETCHECK,0,0)){
+						EnableWindow(GetDlgItem(hwnd,IDC_STATIC_PATH),1);
+						EnableWindow(GetDlgItem(hwnd,IDC_PATH),1);
+					}
+					else{
+						EnableWindow(GetDlgItem(hwnd,IDC_STATIC_PATH),0);
+						EnableWindow(GetDlgItem(hwnd,IDC_PATH),0);
+					}
+					return 1;
+			}
+			break;
+		case WM_NOTIFY:
+			NMHDR *nmhdr;
+			nmhdr=(NMHDR *)lParam;
+			if(nmhdr->code==PSN_APPLY||nmhdr->code==PSN_KILLACTIVE){
+
+				//パス
+				GetDlgItemText(hwnd,IDC_PATH,temp_szManifestPath,MAX_PATH);
+
+				//マニフェストをリソースに埋め込む
+				if(SendDlgItemMessage(hwnd,IDC_RC_MANIFEST,BM_GETCHECK,0,0))
+					temp_dwPjOption|=PJ_OP_RC_MANIFEST;
+				else temp_dwPjOption&=~PJ_OP_RC_MANIFEST;
+
+				if(nmhdr->code==PSN_APPLY) SaveSetting_DlgPjOption();
+			}
+			return 1;
+	}
+	return 0;
+}
+BOOL CALLBACK DlgProjectOption_Debug(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern PROJECTINFO ProjectInfo;
+	NMHDR *nmhdr;
+	char temporary[MAX_PATH];
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetSwitch[3]=1;
+
+			if(ProjectInfo.dwModuleType!=MT_DLL){
+				EnableWindow(GetDlgItem(hwnd,IDC_EXE_PATH),0);
+				EnableWindow(GetDlgItem(hwnd,IDC_DIR),0);
+			}
+
+			SetDlgItemText(hwnd,IDC_CMD_LINE,ProjectInfo.szCmdLine);
+			SetDlgItemText(hwnd,IDC_EXE_PATH,ProjectInfo.szExePath);
+
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_DIR:
+					extern LPSTR ExeFileFilter;
+					if(!GetFilePathDialog(hwnd,temporary,ExeFileFilter,"DLLデバッグ用の実行可能ファイルを指定してください",1)) break;
+
+					SetDlgItemText(hwnd,IDC_EXE_PATH,temporary);
+					return 1;
+			}
+			break;
+		case WM_NOTIFY:
+			nmhdr=(NMHDR *)lParam;
+			if(nmhdr->code==PSN_APPLY||nmhdr->code==PSN_KILLACTIVE){
+				GetDlgItemText(hwnd,IDC_CMD_LINE,temp_szDebugCmdLine,8192);
+				GetDlgItemText(hwnd,IDC_EXE_PATH,temp_szDebugExePath,MAX_PATH);
+
+				if(nmhdr->code==PSN_APPLY) SaveSetting_DlgPjOption();
+			}
+			return 1;
+	}
+	return 0;
+}
+void DlgProjectOptionSetting(HWND hwnd){
+	PROPSHEETHEADER psh;
+	PROPSHEETPAGE psp[MAX_PJSETDLG];
+	HPROPSHEETPAGE hpsp[MAX_PJSETDLG];
+	int i;
+	memset(&SetSwitch,0,MAX_PJSETDLG);
+
+	//各ページのセッティング
+	i=0;
+	psp[i].dwSize=sizeof(PROPSHEETPAGE);
+	psp[i].dwFlags=PSP_DEFAULT;
+	psp[i].hInstance=hResInst;
+	psp[i].pszTemplate=MAKEINTRESOURCE(IDD_PJ_OPTION1);
+	psp[i].pfnDlgProc=DlgProjectOption_Whole;
+	hpsp[i]=CreatePropertySheetPage(&psp[i]);
+	i++;
+	psp[i].dwSize=sizeof(PROPSHEETPAGE);
+	psp[i].dwFlags=PSP_DEFAULT;
+	psp[i].hInstance=hResInst;
+	psp[i].pszTemplate=MAKEINTRESOURCE(IDD_PJ_OPTION2);
+	psp[i].pfnDlgProc=DlgProjectOption_Win32API;
+	hpsp[i]=CreatePropertySheetPage(&psp[i]);
+	i++;
+	psp[i].dwSize=sizeof(PROPSHEETPAGE);
+	psp[i].dwFlags=PSP_DEFAULT;
+	psp[i].hInstance=hResInst;
+	psp[i].pszTemplate=MAKEINTRESOURCE(IDD_PJ_OPTION3);
+	psp[i].pfnDlgProc=DlgProjectOption_Manifest;
+	hpsp[i]=CreatePropertySheetPage(&psp[i]);
+	i++;
+	psp[i].dwSize=sizeof(PROPSHEETPAGE);
+	psp[i].dwFlags=PSP_DEFAULT;
+	psp[i].hInstance=hResInst;
+	psp[i].pszTemplate=MAKEINTRESOURCE(IDD_PJ_OPTION4);
+	psp[i].pfnDlgProc=DlgProjectOption_Debug;
+	hpsp[i]=CreatePropertySheetPage(&psp[i]);
+
+	extern PROJECTINFO ProjectInfo;
+	temp_dwPjOption=ProjectInfo.dwOption;
+
+	memset(&psh,0,sizeof(PROPSHEETHEADER));
+	psh.dwSize=sizeof(PROPSHEETHEADER);
+	psh.dwFlags=PSH_PROPSHEETPAGE|PSH_NOAPPLYNOW;
+	psh.phpage=hpsp;
+	psh.hwndParent=hwnd;
+	psh.pszCaption=STRING_PROJECTOPTION;	//"プロジェクト オプション"
+	psh.nPages=MAX_PJSETDLG;
+	psh.nStartPage=0;
+	psh.ppsp=psp;
+	PropertySheet(&psh);
+}
+
+
+/////////////////////
+// オプション項目
+/////////////////////
+
+BOOL bOptionWhole;
+BOOL bOptionEditor;
+BOOL bOptionColor;
+BOOL bOptionToolbar;
+BOOL bOptionRad;
+BOOL bOptionWeb;
+BOOL temp_bSaveCheckProject;
+BOOL temp_bLineAdjust;
+BOOL temp_bSaveTabToHead;
+LOGFONT temp_lf,temp_HintFont;
+int temp_TabSize;
+BOOL temp_bEditor_LineNumber;
+BOOL temp_bEditor_Ruler;
+BOOL temp_bEditor_CaretLine_BackGround;
+int temp_iMaxOneLineTextLength;
+BOOL temp_bAutoIndent;
+BOOL temp_bPasteIndent;
+DWORD temp_dwParameterHint;
+BOOL temp_bShowComplementWnd;
+int temp_BackNum_PairStatementComplement;
+BOOL temp_bSaveFindStr;
+
+CTheme obj_temp_Theme;
+
+BOOL temp_bCtrlKeyHyperLink;
+BOOL temp_bSaveWebFindStr;
+CDBDomain *pobj_temp_DBDomain;
+
+void SaveSetting(void){
+	int i;
+	if(bOptionWhole){
+		//実行時の、プロジェクトの保存確認の有無
+		pobj_nv->bSaveCheckProject=temp_bSaveCheckProject;
+
+		//ドキュメントを保存したときにタブを先頭に再配置するかどうか
+		pobj_nv->bSaveTabToHead=temp_bSaveTabToHead;
+	}
+	if(bOptionEditor){
+		//フォント
+		pobj_nv->lf=temp_lf;
+
+		//タブサイズ
+		pobj_nv->TabSize=temp_TabSize;
+
+		//エディタの行番号を表示するかどうか
+		pobj_nv->bEditor_LineNumber=temp_bEditor_LineNumber;
+
+		//エディタのルーラーを表示するかどうか
+		pobj_nv->bEditor_Ruler=temp_bEditor_Ruler;
+
+		//カーソル行を強調表示するかどうか
+		pobj_nv->bEditor_CaretLine_BackGround=temp_bEditor_CaretLine_BackGround;
+
+		//自動折り返し時の一行あたりの文字数
+		pobj_nv->iMaxOneLineTextLength=temp_iMaxOneLineTextLength;
+
+		//コード補完機能
+		pobj_nv->bShowComplementWnd=temp_bShowComplementWnd;
+
+		pobj_nv->BackNum_PairStatementComplement=temp_BackNum_PairStatementComplement;
+
+		//パラメータ ヒント
+		pobj_nv->dwParameterHint=temp_dwParameterHint;
+
+		//パラメータ ヒント フォント
+		extern METHODCHECKINFO MethodCheckInfo;
+		MethodCheckInfo.LogFont=temp_HintFont;
+		DeleteObject(MethodCheckInfo.hFont);
+		DeleteObject(MethodCheckInfo.hBoldFont);
+
+		MethodCheckInfo.hFont=CreateFontIndirect(&MethodCheckInfo.LogFont);
+		i=MethodCheckInfo.LogFont.lfWeight;
+		MethodCheckInfo.LogFont.lfWeight=FW_BOLD;
+		MethodCheckInfo.hBoldFont=CreateFontIndirect(&MethodCheckInfo.LogFont);
+		MethodCheckInfo.LogFont.lfWeight=i;
+
+		//自動インデント
+		pobj_nv->bAutoIndent=temp_bAutoIndent;
+
+		//貼り付け時のインデント調整
+		pobj_nv->bPasteIndent=temp_bPasteIndent;
+
+		//検索・置換文字列を保存するかどうか
+		pobj_nv->bSaveFindStr=temp_bSaveFindStr;
+
+		RedrawAllWindow();		//すべてのウィンドウを再描画
+	}
+	if(bOptionColor){
+		//カラーデザインを更新
+		CTheme *pobj_Theme;
+		pobj_Theme=pobj_DBTheme->dupli_check(obj_temp_Theme.m_name);
+		*pobj_Theme=obj_temp_Theme;
+		if(lstrcmp(pobj_Theme->m_name,THEMENAME_USER)==0){
+			//ユーザー設定の場合は自動的にファイルに保存する
+			pobj_Theme->save();
+		}
+
+		//再描画
+		SetTextEditColorDesign(&tci,pobj_Theme,1);
+	}
+	if(bOptionRad){
+		//ライン アジャスタ
+		pobj_nv->bLineAdjust=temp_bLineAdjust;
+	}
+	if(bOptionWeb){
+		pobj_nv->bCtrlKeyHyperLink=temp_bCtrlKeyHyperLink;
+
+		pobj_nv->bSaveWebFindStr=temp_bSaveWebFindStr;
+
+		//Web検索
+		pobj_nv->pobj_DBDomain->copy_get(pobj_temp_DBDomain);
+
+		//SideWebウィンドウを再表示
+		delete pobj_SideWeb;
+		pobj_SideWeb=new CSideWeb(hOwner);
+		ResizeOwnerWnd();
+	}
+	return;
+}
+BOOL CALLBACK Dlg_Option_Whole(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	NMHDR *nmhdr;
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(GetParent(hwnd));
+
+			bOptionWhole=1;
+
+			//実行時の、プロジェクトの保存確認の有無
+			if(pobj_nv->bSaveCheckProject) SendDlgItemMessage(hwnd,IDC_SAVECHECK,BM_SETCHECK,BST_CHECKED,0);
+
+			//ドキュメントを保存したときにタブを先頭に再配置するかどうか
+			if(pobj_nv->bSaveTabToHead) SendDlgItemMessage(hwnd,IDC_SAVE_TAB_TO_HEAD,BM_SETCHECK,BST_CHECKED,0);
+
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_LINKFILE:
+					ExtensionLink(hwnd);
+					return 1;
+			}
+			break;
+		case WM_NOTIFY:
+			nmhdr=(NMHDR *)lParam;
+			if(nmhdr->code==PSN_APPLY||nmhdr->code==PSN_KILLACTIVE){
+				//実行時の、プロジェクトの保存確認の有無
+				if(SendDlgItemMessage(hwnd,IDC_SAVECHECK,BM_GETCHECK,0,0)) temp_bSaveCheckProject=1;
+				else temp_bSaveCheckProject=0;
+
+				//ドキュメントを保存したときにタブを先頭に再配置するかどうか
+				if(SendDlgItemMessage(hwnd,IDC_SAVE_TAB_TO_HEAD,BM_GETCHECK,0,0)) temp_bSaveTabToHead=1;
+				else temp_bSaveTabToHead=0;
+
+				if(nmhdr->code==PSN_APPLY) SaveSetting();
+			}
+			return 1;
+		case WM_HELP:
+			HELPINFO *lpHelpInfo;
+			lpHelpInfo = (HELPINFO *)lParam;
+
+			HH_POPUP hp;
+			memset(&hp, 0, sizeof(HH_POPUP));
+			hp.cbStruct = sizeof(HH_POPUP);
+			hp.pt.x = lpHelpInfo->MousePos.x;
+			hp.pt.y = lpHelpInfo->MousePos.y+10;
+			hp.clrForeground = RGB(0, 0, 0);
+			hp.clrBackground = -1;
+			hp.rcMargins.left = -1;
+			hp.rcMargins.right = -1;
+			hp.rcMargins.top = -1;
+			hp.rcMargins.bottom = -1;
+			hp.idString = 0;
+			hp.pszFont="MS Sans Serif,10";
+
+			switch(lpHelpInfo->iCtrlId){
+				case IDC_SAVECHECK:
+#if defined(JPN)
+					//日本語
+					hp.pszText="このチェックボックスをオンにすると、プロジェクトが未保存の状態であるとき、コンパイル時に保存確認のダイアログボックスが表示されるようになります。\nチェックをオフにすると、プロジェクトはコンパイル時に自動的に保存されます（デフォルトはオフです）。";
+#else
+					//英語
+					hp.pszText="When the compiling button is clicked, if this check is on, the DialogBox to save modification is displayed.\nIf this check is off, the project is saved automatically(Default).";
+#endif
+					break;
+				case IDC_LINKFILE:
+#if defined(JPN)
+					//日本語
+					hp.pszText="ファイルの関連付けを行います。";
+#else
+					//英語
+					hp.pszText="Relate the files.";
+#endif
+					break;
+				default:
+					hp.pszText="";
+					break;
+			}
+			HtmlHelp(hwnd, 0, HH_DISPLAY_TEXT_POPUP, (DWORD)&hp);
+			return 1;
+	}
+	return 0;
+}
+BOOL CALLBACK Dlg_Option_Editor(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern METHODCHECKINFO MethodCheckInfo;
+	char str[255];
+	NMHDR *nmhdr;
+	switch(message){
+		case WM_INITDIALOG:
+			bOptionEditor=1;
+
+			//フォント
+			sprintf(str,"%s",pobj_nv->lf.lfFaceName);
+			SetDlgItemText(hwnd,IDC_SETFONT,str);
+			temp_lf=pobj_nv->lf;
+
+			//タブサイズ
+			sprintf(str,"%d",pobj_nv->TabSize);
+			SetDlgItemText(hwnd,IDC_TABSIZE,str);
+
+			//エディタの行番号を表示するかどうか
+			if(pobj_nv->bEditor_LineNumber) SendDlgItemMessage(hwnd,IDC_LINENUMBER,BM_SETCHECK,BST_CHECKED,0);
+
+			//エディタのルーラーを表示するかどうか
+			if(pobj_nv->bEditor_Ruler) SendDlgItemMessage(hwnd,IDC_RULER,BM_SETCHECK,BST_CHECKED,0);
+
+			//カーソル行を強調表示するかどうか
+			if(pobj_nv->bEditor_CaretLine_BackGround) SendDlgItemMessage(hwnd,IDC_CARETLINE_BACKGROUND,BM_SETCHECK,BST_CHECKED,0);
+
+#ifdef THETEXT
+			//自動折り返し時の一行あたりの文字数
+			sprintf(str,"%d",pobj_nv->iMaxOneLineTextLength);
+			SetDlgItemText(hwnd,IDC_MAX_ONELINE_TEXT_LENGTH,str);
+#endif
+
+			//自動インデント
+			if(pobj_nv->bAutoIndent) SendDlgItemMessage(hwnd,IDC_ISAUTOINDENT,BM_SETCHECK,BST_CHECKED,0);
+
+			//貼り付け時のインデント調整
+			if(pobj_nv->bPasteIndent) SendDlgItemMessage(hwnd,IDC_PASTEINDENT,BM_SETCHECK,BST_CHECKED,0);
+
+			//コード補完
+			if(pobj_nv->bShowComplementWnd)
+				SendDlgItemMessage(hwnd,IDC_COMPLEMENT,BM_SETCHECK,BST_CHECKED,0);
+
+			//ペアステートメント補完
+			SendDlgItemMessage(hwnd,IDC_BACKNUM,EM_SETLIMITTEXT,4,0);
+			if(pobj_nv->BackNum_PairStatementComplement){
+				SendDlgItemMessage(hwnd,IDC_PAIRSTATEMENT,BM_SETCHECK,BST_CHECKED,0);
+				sprintf(str,"%d",pobj_nv->BackNum_PairStatementComplement);
+				SetDlgItemText(hwnd,IDC_BACKNUM,str);
+			}
+
+			SendMessage(hwnd,WM_COMMAND,IDC_COMPLEMENT,0);
+
+			//パラメータ ヒント
+			if(pobj_nv->dwParameterHint){
+				SendDlgItemMessage(hwnd,IDC_PARAMHINT,BM_SETCHECK,BST_CHECKED,0);
+				if(pobj_nv->dwParameterHint==1)
+					SendDlgItemMessage(hwnd,IDC_POPUP,BM_SETCHECK,BST_CHECKED,0);
+				else
+					SendDlgItemMessage(hwnd,IDC_STATUSBAR,BM_SETCHECK,BST_CHECKED,0);
+				SendMessage(hwnd,WM_COMMAND,IDC_PARAMHINT,0);
+			}
+			else SendDlgItemMessage(hwnd,IDC_POPUP,BM_SETCHECK,BST_CHECKED,0);
+
+			//パラメータ ヒント フォント
+			sprintf(str,"%s",MethodCheckInfo.LogFont.lfFaceName);
+			SetDlgItemText(hwnd,IDC_HINTFONT,str);
+			temp_HintFont=MethodCheckInfo.LogFont;
+
+			//検索・置換文字列を保存するかどうか
+			if(pobj_nv->bSaveFindStr) SendDlgItemMessage(hwnd,IDC_SAVE_FINDSTR,BM_SETCHECK,BST_CHECKED,0);
+
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_SETFONT:
+					if(!SetFontDialog(hwnd,&temp_lf,1)) return 1;
+					sprintf(str,"%s",temp_lf.lfFaceName);
+					SetDlgItemText(hwnd,IDC_SETFONT,str);
+					return 1;
+				case IDC_HINTFONT:
+					if(!SetFontDialog(hwnd,&temp_HintFont,0)) return 1;
+					sprintf(str,"%s",temp_HintFont.lfFaceName);
+					SetDlgItemText(hwnd,IDC_HINTFONT,str);
+					return 1;
+
+				case IDC_ISAUTOINDENT:
+				case IDC_COMPLEMENT:
+					if(SendDlgItemMessage(hwnd,IDC_ISAUTOINDENT,BM_GETCHECK,0,0)&&
+						SendDlgItemMessage(hwnd,IDC_COMPLEMENT,BM_GETCHECK,0,0)){
+						EnableWindow(GetDlgItem(hwnd,IDC_PAIRSTATEMENT),1);
+						SendMessage(hwnd,WM_COMMAND,IDC_PAIRSTATEMENT,0);
+					}
+					else{
+						EnableWindow(GetDlgItem(hwnd,IDC_PAIRSTATEMENT),0);
+						EnableWindow(GetDlgItem(hwnd,IDC_BACKNUM),0);
+						EnableWindow(GetDlgItem(hwnd,IDC_STATIC_PAIRSTATEMENT),0);
+					}
+					return 1;
+
+				case IDC_PAIRSTATEMENT:
+					if(SendDlgItemMessage(hwnd,IDC_PAIRSTATEMENT,BM_GETCHECK,0,0)){
+						EnableWindow(GetDlgItem(hwnd,IDC_BACKNUM),1);
+						EnableWindow(GetDlgItem(hwnd,IDC_STATIC_PAIRSTATEMENT),1);
+
+						if(GetWindowTextLength(GetDlgItem(hwnd,IDC_BACKNUM))==0)
+							SetDlgItemText(hwnd,IDC_BACKNUM,"100");
+					}
+					else{
+						EnableWindow(GetDlgItem(hwnd,IDC_BACKNUM),0);
+						EnableWindow(GetDlgItem(hwnd,IDC_STATIC_PAIRSTATEMENT),0);
+					}
+					return 1;
+
+				case IDC_PARAMHINT:
+					if(SendDlgItemMessage(hwnd,IDC_PARAMHINT,BM_GETCHECK,0,0)){
+						EnableWindow(GetDlgItem(hwnd,IDC_POPUP),1);
+						EnableWindow(GetDlgItem(hwnd,IDC_STATUSBAR),1);
+						if(SendDlgItemMessage(hwnd,IDC_POPUP,BM_GETCHECK,0,0)){
+							EnableWindow(GetDlgItem(hwnd,IDC_STATIC_HINTFONT),1);
+							EnableWindow(GetDlgItem(hwnd,IDC_HINTFONT),1);
+						}
+					}
+					else{
+						EnableWindow(GetDlgItem(hwnd,IDC_POPUP),0);
+						EnableWindow(GetDlgItem(hwnd,IDC_STATUSBAR),0);
+						EnableWindow(GetDlgItem(hwnd,IDC_STATIC_HINTFONT),0);
+						EnableWindow(GetDlgItem(hwnd,IDC_HINTFONT),0);
+					}
+					return 1;
+				case IDC_POPUP:
+					EnableWindow(GetDlgItem(hwnd,IDC_STATIC_HINTFONT),1);
+					EnableWindow(GetDlgItem(hwnd,IDC_HINTFONT),1);
+					return 1;
+				case IDC_STATUSBAR:
+					EnableWindow(GetDlgItem(hwnd,IDC_STATIC_HINTFONT),0);
+					EnableWindow(GetDlgItem(hwnd,IDC_HINTFONT),0);
+					return 1;
+			}
+			break;
+		case WM_NOTIFY:
+			nmhdr=(NMHDR *)lParam;
+			if(nmhdr->code==PSN_APPLY||nmhdr->code==PSN_KILLACTIVE){
+				GetDlgItemText(hwnd,IDC_TABSIZE,str,255);
+				sscanf(str,"%d",&temp_TabSize);
+
+				//エディタの行番号を表示するかどうか
+				if(SendDlgItemMessage(hwnd,IDC_LINENUMBER,BM_GETCHECK,0,0)) temp_bEditor_LineNumber=1;
+				else temp_bEditor_LineNumber=0;
+
+				//エディタのルーラーを表示するかどうか
+				if(SendDlgItemMessage(hwnd,IDC_RULER,BM_GETCHECK,0,0)) temp_bEditor_Ruler=1;
+				else temp_bEditor_Ruler=0;
+
+				//カーソル行を強調表示するかどうか
+				if(SendDlgItemMessage(hwnd,IDC_CARETLINE_BACKGROUND,BM_GETCHECK,0,0)) temp_bEditor_CaretLine_BackGround=1;
+				else temp_bEditor_CaretLine_BackGround=0;
+
+#ifdef THETEXT
+				//自動折り返し時の一行あたりの文字数
+				GetDlgItemText(hwnd,IDC_MAX_ONELINE_TEXT_LENGTH,str,255);
+				sscanf(str,"%d",&temp_iMaxOneLineTextLength);
+				if(temp_iMaxOneLineTextLength<=0){
+					temp_iMaxOneLineTextLength=75;
+				}
+#endif
+
+				//自動インデント
+				if(SendDlgItemMessage(hwnd,IDC_ISAUTOINDENT,BM_GETCHECK,0,0)) temp_bAutoIndent=1;
+				else temp_bAutoIndent=0;
+
+				//貼り付け時のインデント調整
+				if(SendDlgItemMessage(hwnd,IDC_PASTEINDENT,BM_GETCHECK,0,0)) temp_bPasteIndent=1;
+				else temp_bPasteIndent=0;
+
+				//コード補完機能
+				if(SendDlgItemMessage(hwnd,IDC_COMPLEMENT,BM_GETCHECK,0,0))
+					temp_bShowComplementWnd=1;
+				else temp_bShowComplementWnd=0;
+
+				//ペアステートメント補完
+				if(IsWindowEnabled(GetDlgItem(hwnd,IDC_PAIRSTATEMENT))){
+					if(SendDlgItemMessage(hwnd,IDC_PAIRSTATEMENT,BM_GETCHECK,0,0)){
+						GetDlgItemText(hwnd,IDC_BACKNUM,str,255);
+						sscanf(str,"%d",&temp_BackNum_PairStatementComplement);
+					}
+					else temp_BackNum_PairStatementComplement=0;
+				}
+				else temp_BackNum_PairStatementComplement=0;
+
+				//パラメータヒント
+				if(SendDlgItemMessage(hwnd,IDC_PARAMHINT,BM_GETCHECK,0,0)){
+					if(SendDlgItemMessage(hwnd,IDC_POPUP,BM_GETCHECK,0,0)) temp_dwParameterHint=1;
+					else temp_dwParameterHint=2;
+				}
+				else temp_dwParameterHint=0;
+
+				if(SendDlgItemMessage(hwnd,IDC_SAVE_FINDSTR,BM_GETCHECK,0,0))
+					temp_bSaveFindStr=1;
+				else temp_bSaveFindStr=0;
+
+				if(nmhdr->code==PSN_APPLY) SaveSetting();
+			}
+			return 1;
+
+		case WM_HELP:
+			HELPINFO *lpHelpInfo;
+			lpHelpInfo = (HELPINFO *)lParam;
+
+			HH_POPUP hp;
+			memset(&hp, 0, sizeof(HH_POPUP));
+			hp.cbStruct = sizeof(HH_POPUP);
+			hp.pt.x = lpHelpInfo->MousePos.x;
+			hp.pt.y = lpHelpInfo->MousePos.y+10;
+			hp.clrForeground = RGB(0, 0, 0);
+			hp.clrBackground = -1;
+			hp.rcMargins.left = -1;
+			hp.rcMargins.right = -1;
+			hp.rcMargins.top = -1;
+			hp.rcMargins.bottom = -1;
+			hp.idString = 0;
+			hp.pszFont="MS Sans Serif,10";
+
+			switch(lpHelpInfo->iCtrlId){
+				case IDC_STATIC_SETFONT:
+				case IDC_SETFONT:
+#if defined(JPN)
+					//日本語
+					hp.pszText="エディタで使用するフォントを選択することができます。";
+#else
+					//英語
+					hp.pszText="Choose the font displayed on the editor";
+#endif
+					break;
+				case IDC_STATIC_TABSIZE:
+				case IDC_TABSIZE:
+#if defined(JPN)
+					//日本語
+					hp.pszText="タブサイズを指定します。デフォルト値は4です。";
+#else
+					//英語
+					hp.pszText="Set the tab size. Value of default is 4.";
+#endif
+					break;
+				case IDC_ISAUTOINDENT:
+#if defined(JPN)
+					//日本語
+					hp.pszText="このチェックをオンにすると、必要に応じて、自動的にインデント用のタブ文字が挿入されます。";
+#else
+					//英語
+					hp.pszText="If this check is on, the indent tabs will be inserted automatically.";
+#endif
+					break;
+				case IDC_COMPLEMENT:
+#if defined(JPN)
+					//日本語
+					hp.pszText="このチェックをオンにすると、クラスまたは構造体のメンバを入力するときに、予想されるキーワードがリスト表示されます。";
+#else
+					//英語
+					hp.pszText="If this check is on, the member expected is displayed in a list when inputting the member of the class object.";
+#endif
+					break;
+				case IDC_PARAMHINT:
+#if defined(JPN)
+					//日本語
+					hp.pszText="このチェックをオンにすると、関数またはステートメントを入力するときに、該当するパラメータのヒント文字列が表示されます。文字列の表示方法はポップアップまたはステータスバーのいずれかを選択することができます。";
+#else
+					//英語
+					hp.pszText="If this check is on, parameter hint is displayed when inputting a function or a statement.";
+#endif
+					break;
+				case IDC_POPUP:
+#if defined(JPN)
+					//日本語
+					hp.pszText="パラメータヒントをポップアップ表示するときは、ここをチェックします。";
+#else
+					//英語
+					hp.pszText="If this check is on, parameter hint is displayed on a popup window.";
+#endif
+					break;
+				case IDC_STATUSBAR:
+#if defined(JPN)
+					//日本語
+					hp.pszText="パラメータヒントをステータスバーに表示するときは、ここをチェックします。";
+#else
+					//英語
+					hp.pszText="If this check is on, parameter hint is displayed in a status bar.";
+#endif
+					break;
+				case IDC_STATIC_HINTFONT:
+				case IDC_HINTFONT:
+#if defined(JPN)
+					//日本語
+					hp.pszText="ポップアップ表示されるパラメータヒントのフォントを指定します。";
+#else
+					//英語
+					hp.pszText="Choose the font displayed on the popup hint.";
+#endif
+					break;
+				default:
+					hp.pszText="";
+					break;
+			}
+			HtmlHelp(hwnd, 0, HH_DISPLAY_TEXT_POPUP, (DWORD)&hp);
+			return 1;
+	}
+	return 0;
+}
+COLORREF GetColorFromSelection(int iPos,TEXTEDIT_COLOR_INFO *ptci){
+	if(iPos==0) return ptci->rgbComment;
+	else if(iPos==1) return ptci->rgbString;
+	else if(iPos==2) return ptci->rgbDefault;
+	else if(iPos==3) return ptci->rgbStatement;
+	else if(iPos==4) return ptci->rgbCursorBack;
+	else if(iPos==5) return ptci->rgbBackground;
+	return 0;
+}
+void SetColorFromSelection(int iPos,COLORREF rgb,TEXTEDIT_COLOR_INFO *ptci){
+	if(iPos==0) ptci->rgbComment=rgb;
+	else if(iPos==1) ptci->rgbString=rgb;
+	else if(iPos==2) ptci->rgbDefault=rgb;
+	else if(iPos==3) ptci->rgbStatement=rgb;
+	else if(iPos==4) ptci->rgbCursorBack=rgb;
+	else if(iPos==5) ptci->rgbBackground=rgb;
+}
+#ifdef THETEXT
+char szNewThemeName[MAX_PATH];
+BOOL bThemeOverwirte;
+BOOL CALLBACK DlgOptionThemeSave(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+
+			SendMessage(hwnd,WM_COMMAND,IDC_NAME,0);
+			SetFocus(GetDlgItem(hwnd,IDC_NAME));
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					GetDlgItemText(hwnd,IDC_NAME,szNewThemeName,MAX_PATH);
+
+					if(SendDlgItemMessage(hwnd,IDC_OVERWRITE,BM_GETCHECK,0,0))
+						bThemeOverwirte=1;
+					else bThemeOverwirte=0;
+
+					if(pobj_DBTheme->dupli_check(szNewThemeName)){
+						if(!bThemeOverwirte){
+							char temporary[MAX_PATH];
+							sprintf(temporary,"テーマ \"%s\" は既に存在します。「上書きを許可する」をチェックした後、保存してください。",szNewThemeName);
+							MessageBox(hwnd,temporary,APPLICATION_NAME,MB_OK);
+							return 1;
+						}
+					}
+
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+				case IDC_NAME:
+					if(GetWindowTextLength(GetDlgItem(hwnd,IDC_NAME)))
+						EnableWindow(GetDlgItem(hwnd,IDOK),1);
+					else EnableWindow(GetDlgItem(hwnd,IDOK),0);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+#endif
+BOOL CALLBACK Dlg_Option_Color(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	int iPos;
+	CTheme *pobj_Theme;
+	char temporary[MAX_PATH];
+	switch(message){
+		case WM_INITDIALOG:
+			bOptionColor=1;
+
+			//一時保存値を初期化
+			pobj_Theme=pobj_DBTheme->GetActiveTheme();
+			obj_temp_Theme=*pobj_Theme;
+
+			//指定する部分
+			SendDlgItemMessage(hwnd,IDC_TARGET,CB_ADDSTRING,0,(LPARAM)"コメント");
+			SendDlgItemMessage(hwnd,IDC_TARGET,CB_ADDSTRING,0,(LPARAM)"ダブルクォート内の文字列");
+			SendDlgItemMessage(hwnd,IDC_TARGET,CB_ADDSTRING,0,(LPARAM)"通常の文字");
+			SendDlgItemMessage(hwnd,IDC_TARGET,CB_ADDSTRING,0,(LPARAM)"特殊ステートメント");
+			SendDlgItemMessage(hwnd,IDC_TARGET,CB_ADDSTRING,0,(LPARAM)"背景色（カーソル行）");
+			SendDlgItemMessage(hwnd,IDC_TARGET,CB_ADDSTRING,0,(LPARAM)"背景色（一般）");
+			SendDlgItemMessage(hwnd,IDC_TARGET,CB_SETCURSEL,0,0);
+
+
+			//テーマ名をコンボボックスにセット
+			pobj_DBTheme->ResetTheme_ToComboBox(GetDlgItem(hwnd,IDC_THEME));
+
+
+			SendMessage(hwnd,WM_COMMAND,MAKELONG(IDC_THEME,CBN_SELCHANGE),0);
+			break;
+
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+#ifdef THETEXT
+				case IDC_SAVE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_OPTION_THEME_SAVE),hwnd,DlgOptionThemeSave)) return 1;
+
+					pobj_Theme=pobj_DBTheme->dupli_check(szNewThemeName);
+					if(pobj_Theme){
+					}
+					else{
+						//新規に追加
+						pobj_Theme=pobj_DBTheme->add(0,szNewThemeName);
+					}
+					*pobj_Theme=obj_temp_Theme;
+					lstrcpy(pobj_Theme->m_name,szNewThemeName);
+
+					//ファイルに保存
+					pobj_Theme->save();
+
+					//テーマ コンボボックスのカーソル位置をセット
+					ComboBox_SetSelText(GetDlgItem(hwnd,IDC_THEME),szNewThemeName);
+
+					return 1;
+#endif //THETEXT
+				case IDC_THEME:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						if(!SendDlgItemMessage(hwnd,IDC_THEME,CB_GETLBTEXT,
+							SendDlgItemMessage(hwnd,IDC_THEME,CB_GETCURSEL,0,0),
+							(LPARAM)temporary)) return 1;
+
+						pobj_Theme=pobj_DBTheme->dupli_check(temporary);
+						obj_temp_Theme=*pobj_Theme;
+
+						InvalidateRect(GetDlgItem(hwnd,IDC_SAMPLE),NULL,0);
+						InvalidateRect(GetDlgItem(hwnd,IDC_COLOR_BUTTON),NULL,0);
+					}
+					return 1;
+				case IDC_TARGET:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						InvalidateRect(GetDlgItem(hwnd,IDC_COLOR_BUTTON),NULL,0);
+					}
+					return 1;
+				case IDC_COLOR_BUTTON:
+					iPos=SendDlgItemMessage(hwnd,IDC_TARGET,CB_GETCURSEL,0,0);
+
+					CHOOSECOLOR cc;
+					static COLORREF CustColors[16];
+					cc.lStructSize=sizeof(CHOOSECOLOR);
+					cc.hwndOwner=hwnd;
+					cc.rgbResult=GetColorFromSelection(iPos,&obj_temp_Theme.TextColorInfo);
+					cc.lpCustColors=CustColors;
+					cc.Flags=CC_FULLOPEN | CC_RGBINIT;
+					if(!ChooseColor(&cc)) return 1;
+
+					SetColorFromSelection(iPos,cc.rgbResult,&obj_temp_Theme.TextColorInfo);
+
+					InvalidateRect(GetDlgItem(hwnd,IDC_COLOR_BUTTON),NULL,0);
+					InvalidateRect(GetDlgItem(hwnd,IDC_SAMPLE),NULL,0);
+
+					lstrcpy(obj_temp_Theme.m_name,THEMENAME_USER);
+
+					//ユーザー設定を選択
+					ComboBox_SetSelText(GetDlgItem(hwnd,IDC_THEME),THEMENAME_USER);
+					return 1;
+			}
+			break;
+
+		case WM_NOTIFY:
+			NMHDR *nmhdr;
+			nmhdr=(NMHDR *)lParam;
+
+			if(nmhdr->code==PSN_APPLY) SaveSetting();
+			return 1;
+
+		case WM_DRAWITEM:
+			LPDRAWITEMSTRUCT pds;
+			pds=(LPDRAWITEMSTRUCT)lParam;
+
+			HBRUSH hBrush,hOldBrush;
+
+			if(wParam==IDC_COLOR_BUTTON){
+				iPos=SendDlgItemMessage(hwnd,IDC_TARGET,CB_GETCURSEL,0,0);
+
+				//////////////
+				// 色を描画
+				//////////////
+
+				//ペンとブラシを生成
+				HPEN hPen,hOldPen;
+				hPen=(HPEN)GetStockObject(WHITE_PEN);
+				if(IsWindowEnabled(GetDlgItem(hwnd,IDC_COLOR_BUTTON)))
+					hBrush=CreateSolidBrush(GetColorFromSelection(iPos,&obj_temp_Theme.TextColorInfo));
+				else
+					hBrush=CreateSolidBrush(GetSysColor(COLOR_3DFACE));
+
+				//塗りつぶす
+				hOldPen=(HPEN)SelectObject(pds->hDC,hPen);
+				hOldBrush=(HBRUSH)SelectObject(pds->hDC,hBrush);
+				Rectangle(pds->hDC,0,0,pds->rcItem.right,pds->rcItem.bottom);
+				SelectObject(pds->hDC,hOldPen);
+				SelectObject(pds->hDC,hOldBrush);
+
+				//ブラシを破棄
+				DeleteObject(hBrush);
+			}
+			else if(wParam==IDC_SAMPLE){
+				TEXTEDIT_COLOR_INFO ColorInfo;
+				ColorInfo=obj_temp_Theme.TextColorInfo;
+
+				//背景色で塗りつぶす
+				hBrush=CreateSolidBrush(ColorInfo.rgbBackground);
+				hOldBrush=(HBRUSH)SelectObject(pds->hDC,hBrush);
+				PatBlt(pds->hDC,0,0,pds->rcItem.right,pds->rcItem.bottom,PATCOPY);
+				SelectObject(pds->hDC,hOldBrush);
+				DeleteObject(hBrush);
+
+				//フォントを選択
+				extern HFONT hFont_TextEdit;
+				HFONT hOldFont;
+				hOldFont=(HFONT)SelectObject(pds->hDC,hFont_TextEdit);
+
+				///////////////////
+				// サンプルを描画
+				///////////////////
+
+				extern int font_width,font_height;
+				int x=0,y=0;
+
+#ifdef THETEXT
+#define SAMPLESTR_STATEMENT "div"
+#define SAMPLESTR_COMMENT "<!-- この行にカーソルがあります -->"
+#define SAMPLESTR_DEFAULT "<    style=               >Hello World!</   >"
+#define SAMPLESTR_STRING "\"color:#123456\""
+
+				y+=font_height;
+
+				//"<    style=               >Hello World!</   >"
+				SetTextColor(pds->hDC,ColorInfo.rgbDefault);
+				SetBkColor(pds->hDC,ColorInfo.rgbBackground);
+				TextOut(pds->hDC,x,y,SAMPLESTR_DEFAULT,lstrlen(SAMPLESTR_DEFAULT));
+
+				//div
+				x=font_width*1;
+				SetTextColor(pds->hDC,ColorInfo.rgbStatement);
+				TextOut(pds->hDC,x,y,SAMPLESTR_STATEMENT,lstrlen(SAMPLESTR_STATEMENT));
+				x=font_width*41;
+				TextOut(pds->hDC,x,y,SAMPLESTR_STATEMENT,lstrlen(SAMPLESTR_STATEMENT));
+
+				//"color:#123456"
+				x=font_width*11;
+				SetTextColor(pds->hDC,ColorInfo.rgbString);
+				TextOut(pds->hDC,x,y,SAMPLESTR_STRING,lstrlen(SAMPLESTR_STRING));
+
+				x=0;
+				y+=font_height*2;
+
+				//"'この行にカーソルがあります
+				hBrush=CreateSolidBrush(ColorInfo.rgbCursorBack);
+				hOldBrush=(HBRUSH)SelectObject(pds->hDC,hBrush);
+				PatBlt(pds->hDC,x,y,pds->rcItem.right,font_height,PATCOPY);
+				SelectObject(pds->hDC,hOldBrush);
+				DeleteObject(hBrush);
+
+				SetTextColor(pds->hDC,ColorInfo.rgbComment);
+				SetBkColor(pds->hDC,ColorInfo.rgbCursorBack);
+				TextOut(pds->hDC,x,y,SAMPLESTR_COMMENT,lstrlen(SAMPLESTR_COMMENT));
+#else
+#define SAMPLESTR_STATEMENT "#console"
+#define SAMPLESTR_COMMENT "'この行にカーソルがあります"
+#define SAMPLESTR_DEFAULT "Print "
+#define SAMPLESTR_STRING "\"Hello World!\""
+
+				//"#console"
+				SetTextColor(pds->hDC,ColorInfo.rgbStatement);
+				SetBkColor(pds->hDC,ColorInfo.rgbBackground);
+				TextOut(pds->hDC,0,0,SAMPLESTR_STATEMENT,lstrlen(SAMPLESTR_STATEMENT));
+				y+=font_height*2;
+
+				//"'この行にカーソルがあります
+				hBrush=CreateSolidBrush(ColorInfo.rgbCursorBack);
+				hOldBrush=(HBRUSH)SelectObject(pds->hDC,hBrush);
+				PatBlt(pds->hDC,x,y,pds->rcItem.right,font_height,PATCOPY);
+				SelectObject(pds->hDC,hOldBrush);
+				DeleteObject(hBrush);
+
+				SetTextColor(pds->hDC,ColorInfo.rgbComment);
+				SetBkColor(pds->hDC,ColorInfo.rgbCursorBack);
+				TextOut(pds->hDC,x,y,SAMPLESTR_COMMENT,lstrlen(SAMPLESTR_COMMENT));
+				y+=font_height*2;
+
+				//Print
+				SetTextColor(pds->hDC,ColorInfo.rgbDefault);
+				SetBkColor(pds->hDC,ColorInfo.rgbBackground);
+				TextOut(pds->hDC,x,y,SAMPLESTR_DEFAULT,lstrlen(SAMPLESTR_DEFAULT));
+				x+=lstrlen(SAMPLESTR_DEFAULT)*font_width;
+
+				//"Hello World!"
+				SetTextColor(pds->hDC,ColorInfo.rgbString);
+				TextOut(pds->hDC,x,y,SAMPLESTR_STRING,lstrlen(SAMPLESTR_STRING));
+#endif
+
+				SelectObject(pds->hDC,hOldFont);
+			}
+			return 0;
+
+		case WM_HELP:
+			HELPINFO *lpHelpInfo;
+			lpHelpInfo = (HELPINFO *)lParam;
+
+			HH_POPUP hp;
+			memset(&hp, 0, sizeof(HH_POPUP));
+			hp.cbStruct = sizeof(HH_POPUP);
+			hp.pt.x = lpHelpInfo->MousePos.x;
+			hp.pt.y = lpHelpInfo->MousePos.y+10;
+			hp.clrForeground = RGB(0, 0, 0);
+			hp.clrBackground = -1;
+			hp.rcMargins.left = -1;
+			hp.rcMargins.right = -1;
+			hp.rcMargins.top = -1;
+			hp.rcMargins.bottom = -1;
+			hp.idString = 0;
+			hp.pszFont="MS Sans Serif,10";
+
+			switch(lpHelpInfo->iCtrlId){
+				case IDC_TARGET:
+					hp.pszText="どの部分の色を設定するかを選択します。";
+					break;
+				default:
+					hp.pszText="";
+					break;
+			}
+			HtmlHelp(hwnd, 0, HH_DISPLAY_TEXT_POPUP, (DWORD)&hp);
+			return 1;
+	}
+	return 0;
+}
+BOOL CALLBACK Dlg_Option_Toolbar(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	switch(message){
+		case WM_INITDIALOG:
+			bOptionToolbar=1;
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_RESETTOOLBAR:
+					//"ツールバーの配置をすべて初期状態に戻します。\nよろしいですか？"
+					if(IDCANCEL==MessageBox(hwnd,STRING_TOOLBAR_RESET,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
+
+					//レバーコントロールを再生成
+					pobj_Rebar->ResetInitRebar();
+
+					//メニュー状態を設定
+					ResetState_DocMenu();
+					return 1;
+			}
+			break;
+
+		case WM_HELP:
+			HELPINFO *lpHelpInfo;
+			lpHelpInfo = (HELPINFO *)lParam;
+
+			HH_POPUP hp;
+			memset(&hp, 0, sizeof(HH_POPUP));
+			hp.cbStruct = sizeof(HH_POPUP);
+			hp.pt.x = lpHelpInfo->MousePos.x;
+			hp.pt.y = lpHelpInfo->MousePos.y+10;
+			hp.clrForeground = RGB(0, 0, 0);
+			hp.clrBackground = -1;
+			hp.rcMargins.left = -1;
+			hp.rcMargins.right = -1;
+			hp.rcMargins.top = -1;
+			hp.rcMargins.bottom = -1;
+			hp.idString = 0;
+			hp.pszFont="MS Sans Serif,10";
+
+			switch(lpHelpInfo->iCtrlId){
+				case IDC_RESETTOOLBAR:
+#if defined(JPN)
+					//日本語
+					hp.pszText="ツールバーの配置を初期状態に戻します。";
+#else
+					//英語
+					hp.pszText="Reset the state of the toolbar.";
+#endif
+					break;
+				default:
+					hp.pszText="";
+					break;
+			}
+			HtmlHelp(hwnd, 0, HH_DISPLAY_TEXT_POPUP, (DWORD)&hp);
+			return 1;
+	}
+	return 0;
+}
+BOOL CALLBACK Dlg_Option_Rad(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	NMHDR *nmhdr;
+	switch(message){
+		case WM_INITDIALOG:
+
+			bOptionRad=1;
+
+			//ライン アジャスタ
+			if(pobj_nv->bLineAdjust) SendDlgItemMessage(hwnd,IDC_LINEADJUST,BM_SETCHECK,BST_CHECKED,0);
+
+			break;
+		case WM_NOTIFY:
+			nmhdr=(NMHDR *)lParam;
+			if(nmhdr->code==PSN_APPLY||nmhdr->code==PSN_KILLACTIVE){
+				if(SendDlgItemMessage(hwnd,IDC_LINEADJUST,BM_GETCHECK,0,0)) temp_bLineAdjust=1;
+				else temp_bLineAdjust=0;
+
+				if(nmhdr->code==PSN_APPLY) SaveSetting();
+			}
+			return 1;
+
+		case WM_HELP:
+			HELPINFO *lpHelpInfo;
+			lpHelpInfo = (HELPINFO *)lParam;
+
+			HH_POPUP hp;
+			memset(&hp, 0, sizeof(HH_POPUP));
+			hp.cbStruct = sizeof(HH_POPUP);
+			hp.pt.x = lpHelpInfo->MousePos.x;
+			hp.pt.y = lpHelpInfo->MousePos.y+10;
+			hp.clrForeground = RGB(0, 0, 0);
+			hp.clrBackground = -1;
+			hp.rcMargins.left = -1;
+			hp.rcMargins.right = -1;
+			hp.rcMargins.top = -1;
+			hp.rcMargins.bottom = -1;
+			hp.idString = 0;
+			hp.pszFont="MS Sans Serif,10";
+
+			switch(lpHelpInfo->iCtrlId){
+				case IDC_LINEADJUST:
+#if defined(JPN)
+					//日本語
+					hp.pszText="このチェックボックスをオンにすると、ラインアジャスタ機能が有効になります。ラインアジャスタ機能をオンにすると、マウスを使ってコントロールの移動を行う際に他のコントロール同士との位置合わせが容易に行えるようになります。";
+#else
+					//英語
+					hp.pszText="If this check is on, line adjuster becomes effective.";
+#endif
+					break;
+				default:
+					hp.pszText="";
+					break;
+			}
+			HtmlHelp(hwnd, 0, HH_DISPLAY_TEXT_POPUP, (DWORD)&hp);
+			return 1;
+	}
+	return 0;
+}
+char szDomainAdd_Name[255];
+char szDomainAdd_Domain[255];
+BOOL CALLBACK Dlg_Option_Web_Domain_Add(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+			SetFocus(GetDlgItem(hwnd,IDC_NAME));
+
+			if(lParam!=-1){
+				SetWindowText(hwnd,"Web検索用ドメインを編集");
+				SetDlgItemText(hwnd,IDC_NAME,szDomainAdd_Name);
+				SetDlgItemText(hwnd,IDC_DOMAIN,szDomainAdd_Domain);
+			}
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					GetDlgItemText(hwnd,IDC_NAME,szDomainAdd_Name,255);
+					GetDlgItemText(hwnd,IDC_DOMAIN,szDomainAdd_Domain,255);
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			return 0;
+	}
+	return 0;
+}
+BOOL CALLBACK Dlg_Option_Web(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	HWND hListView;
+	NMHDR *nmhdr;
+	int i;
+	char temporary[255];
+	switch(message){
+		case WM_INITDIALOG:
+
+			bOptionWeb=1;
+
+
+			//Ctrlキーによるハイパーリンク
+			if(pobj_nv->bCtrlKeyHyperLink) SendDlgItemMessage(hwnd,IDC_CTRLKEY_HYPERLINK,BM_SETCHECK,BST_CHECKED,0);
+
+			//Web検索文字列を保存するかどうか
+			if(pobj_nv->bSaveWebFindStr) SendDlgItemMessage(hwnd,IDC_SAVE_WEBFINDSTR,BM_SETCHECK,BST_CHECKED,0);
+
+
+			//拡張スタイル
+			DWORD dwStyle;
+			hListView=GetDlgItem(hwnd,IDC_DOMAIN_LIST);
+			dwStyle=ListView_GetExtendedListViewStyle(hListView);
+			dwStyle|=LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES;
+			ListView_SetExtendedListViewStyle(hListView,dwStyle);
+
+			LV_COLUMN ListView_Column;
+			ListView_Column.mask=LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
+			ListView_Column.fmt=LVCFMT_LEFT;
+
+			ListView_Column.cx=80;
+			ListView_Column.pszText="表示名";
+			ListView_Column.iSubItem=0;
+			ListView_InsertColumn(hListView,ListView_Column.iSubItem,&ListView_Column);
+
+			ListView_Column.cx=200;
+			ListView_Column.pszText="ドメイン";
+			ListView_Column.iSubItem++;
+			ListView_InsertColumn(hListView,ListView_Column.iSubItem,&ListView_Column);
+
+			//一時オブジェクトにコピー
+			pobj_temp_DBDomain->copy_get(pobj_nv->pobj_DBDomain);
+
+			//ドメインリストにデータをセット
+			pobj_temp_DBDomain->SetListView(hListView);
+
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_ADD:
+					if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_OPTION_WEB_DOMAIN_ADD),hwnd,Dlg_Option_Web_Domain_Add,-1)) return 1;
+
+					pobj_temp_DBDomain->add(szDomainAdd_Name,szDomainAdd_Domain);
+					return 1;
+				case IDC_DELETE:
+					hListView=GetDlgItem(hwnd,IDC_DOMAIN_LIST);
+					for(i=0;i<ListView_GetItemCount(hListView);i++){
+						if(ListView_GetItemState(hListView,i,LVIS_SELECTED)){
+							ListView_GetItemText(hListView,i,0,temporary,255);
+							pobj_temp_DBDomain->del(temporary);
+							break;
+						}
+					}
+					return 1;
+				case IDC_EDIT:
+					hListView=GetDlgItem(hwnd,IDC_DOMAIN_LIST);
+					for(i=0;i<ListView_GetItemCount(hListView);i++){
+						if(ListView_GetItemState(hListView,i,LVIS_SELECTED)){
+							ListView_GetItemText(hListView,i,0,temporary,255);
+
+							ListView_GetItemText(hListView,i,0,szDomainAdd_Name,255);
+							ListView_GetItemText(hListView,i,1,szDomainAdd_Domain,255);
+							lstrcpy(temporary,szDomainAdd_Name);
+							if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_OPTION_WEB_DOMAIN_ADD),hwnd,Dlg_Option_Web_Domain_Add,i)) return 1;
+
+							pobj_temp_DBDomain->change(temporary,szDomainAdd_Name,szDomainAdd_Domain);
+						}
+					}
+					return 1;
+			}
+			return 0;
+		case WM_NOTIFY:
+			nmhdr=(NMHDR *)lParam;
+			if(nmhdr->code==PSN_APPLY||nmhdr->code==PSN_KILLACTIVE){
+
+				//Ctrlキーによるハイパーリンク
+				if(SendDlgItemMessage(hwnd,IDC_CTRLKEY_HYPERLINK,BM_GETCHECK,0,0)) temp_bCtrlKeyHyperLink=1;
+				else temp_bCtrlKeyHyperLink=0;
+
+				//Web検索文字列を保存するかどうか
+				if(SendDlgItemMessage(hwnd,IDC_SAVE_WEBFINDSTR,BM_GETCHECK,0,0)) temp_bSaveWebFindStr=1;
+				else temp_bSaveWebFindStr=0;
+
+				if(nmhdr->code==PSN_APPLY) SaveSetting();
+			}
+			if(nmhdr->idFrom==IDC_DOMAIN_LIST){
+				if(nmhdr->code==NM_DBLCLK){
+					LPNMLISTVIEW lpnmListView;
+					lpnmListView=(LPNMLISTVIEW)lParam;
+
+					char szBeforeName[255];
+					ListView_GetItemText(nmhdr->hwndFrom,lpnmListView->iItem,0,szDomainAdd_Name,255);
+					ListView_GetItemText(nmhdr->hwndFrom,lpnmListView->iItem,1,szDomainAdd_Domain,255);
+					lstrcpy(szBeforeName,szDomainAdd_Name);
+					if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_OPTION_WEB_DOMAIN_ADD),hwnd,Dlg_Option_Web_Domain_Add,lpnmListView->iItem)) return 1;
+
+					pobj_temp_DBDomain->change(szBeforeName,szDomainAdd_Name,szDomainAdd_Domain);
+				}
+			}
+			return 1;
+	}
+	return 0;
+}
+void DlgOptionSetting(HWND hwnd){
+	PROPSHEETHEADER psh;
+#define MAX_SETDLG 32
+	PROPSHEETPAGE psp[MAX_SETDLG];
+	HPROPSHEETPAGE hpsp[MAX_SETDLG];
+	int i;
+
+	bOptionWhole=0;
+	bOptionEditor=0;
+	bOptionColor=0;
+	bOptionToolbar=0;
+	bOptionRad=0;
+	bOptionWeb=0;
+
+	i=0;
+
+	//各ページのセッティング
+	psp[i].dwSize=sizeof(PROPSHEETPAGE);
+	psp[i].dwFlags=PSP_DEFAULT;
+	psp[i].hInstance=hResInst;
+	psp[i].pszTemplate=MAKEINTRESOURCE(IDD_OPTION_WHOLE);
+	psp[i].pfnDlgProc=Dlg_Option_Whole;
+	hpsp[i]=CreatePropertySheetPage(&psp[i]);
+	i++;
+	psp[i].dwSize=sizeof(PROPSHEETPAGE);
+	psp[i].dwFlags=PSP_DEFAULT;
+	psp[i].hInstance=hResInst;
+	psp[i].pszTemplate=MAKEINTRESOURCE(IDD_OPTION_EDITOR);
+	psp[i].pfnDlgProc=Dlg_Option_Editor;
+	hpsp[i]=CreatePropertySheetPage(&psp[i]);
+	i++;
+	psp[i].dwSize=sizeof(PROPSHEETPAGE);
+	psp[i].dwFlags=PSP_DEFAULT;
+	psp[i].hInstance=hResInst;
+	psp[i].pszTemplate=MAKEINTRESOURCE(IDD_OPTION_COLOR);
+	psp[i].pfnDlgProc=Dlg_Option_Color;
+	hpsp[i]=CreatePropertySheetPage(&psp[i]);
+	i++;
+	psp[i].dwSize=sizeof(PROPSHEETPAGE);
+	psp[i].dwFlags=PSP_DEFAULT;
+	psp[i].hInstance=hResInst;
+	psp[i].pszTemplate=MAKEINTRESOURCE(IDD_OPTION_TOOLBAR);
+	psp[i].pfnDlgProc=Dlg_Option_Toolbar;
+	hpsp[i]=CreatePropertySheetPage(&psp[i]);
+
+#ifndef THETEXT
+	//RADツールに関するオプションはProjectEditorのみ表示
+	i++;
+	psp[i].dwSize=sizeof(PROPSHEETPAGE);
+	psp[i].dwFlags=PSP_DEFAULT;
+	psp[i].hInstance=hResInst;
+	psp[i].pszTemplate=MAKEINTRESOURCE(IDD_OPTION_RAD);
+	psp[i].pfnDlgProc=Dlg_Option_Rad;
+	hpsp[i]=CreatePropertySheetPage(&psp[i]);
+#endif
+
+	i++;
+	psp[i].dwSize=sizeof(PROPSHEETPAGE);
+	psp[i].dwFlags=PSP_DEFAULT;
+	psp[i].hInstance=hResInst;
+	psp[i].pszTemplate=MAKEINTRESOURCE(IDD_OPTION_WEB);
+	psp[i].pfnDlgProc=Dlg_Option_Web;
+	hpsp[i]=CreatePropertySheetPage(&psp[i]);
+
+	i++;
+
+
+
+	///////////////////////////
+	// 一時オブジェクトを生成
+	///////////////////////////
+
+	pobj_temp_DBDomain=new CDBDomain();
+
+
+
+	memset(&psh,0,sizeof(PROPSHEETHEADER));
+	psh.dwSize=sizeof(PROPSHEETHEADER);
+	psh.dwFlags=PSH_PROPSHEETPAGE|PSH_NOAPPLYNOW;
+	psh.phpage=hpsp;
+	psh.hwndParent=hwnd;
+	psh.pszCaption=STRING_OPTION;	//"オプション"
+	psh.nPages=i;
+	psh.nStartPage=0;
+	psh.ppsp=psp;
+	PropertySheet(&psh);
+
+
+
+	///////////////////////////
+	// 一時オブジェクトを破棄
+	///////////////////////////
+
+	delete pobj_temp_DBDomain;
+}
+BOOL CALLBACK DialogAbout(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	if(message==WM_INITDIALOG){
+		SetPosCenter(hwnd);
+
+		SetDlgItemText(hwnd,IDC_STATIC_NAME,VERSION_APPLI_NAME);
+
+		char temporary[1024];
+		sprintf(temporary,"Version %s",VERSION_STRING);
+		SetDlgItemText(hwnd,IDC_STATIC_VERSION,temporary);
+
+
+#ifndef THETEXT
+		//ライブラリ開発チーム
+		LoadString(hResInst,IDS_DEV_GROUP,temporary,1024);
+		SetDlgItemText(hwnd,IDC_DEV_GROUP,temporary);
+#endif
+	}
+	if(message==WM_COMMAND){
+		switch(LOWORD(wParam)){
+			case IDCANCEL:
+				EndDialog(hwnd,NULL);
+				return 1;
+		}
+	}
+	return 0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/DocumentAdvice.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/DocumentAdvice.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/DocumentAdvice.cpp	(revision 178)
@@ -0,0 +1,274 @@
+#include "Common.h"
+
+void MenuAdvice(WPARAM msg){
+	/////////////////////////////////////////////////////
+	// コマンド解説（ステータスバーに表示されるテキスト）
+	/////////////////////////////////////////////////////
+	extern char CmdMsg[255];
+
+#if defined(JPN)
+	//日本語
+	if(LOWORD(msg)==IDM_NEW) SetStatusText("新規にプロジェクトまたはドキュメントを作成します");
+	else if(LOWORD(msg)==IDM_OPEN) SetStatusText("既存のドキュメントを開きます");
+	else if(LOWORD(msg)==IDM_CLOSE) SetStatusText("作業中のファイルを閉じます");
+	else if(LOWORD(msg)==IDM_SAVE) SetStatusText("作業中のファイルを保存します");
+	else if(LOWORD(msg)==IDM_NEWSAVE) SetStatusText("作業中のファイルを新しい名前を付けて保存します");
+	else if(LOWORD(msg)==IDM_ALLSAVE) SetStatusText("開いているファイルをすべて保存します");
+	else if(LOWORD(msg)==IDM_PROJECT_OPEN) SetStatusText("既存のプロジェクトを開きます");
+	else if(LOWORD(msg)==IDM_PROJECT_SAVE) SetStatusText("作業中のプロジェクトを保存します");
+	else if(LOWORD(msg)==IDM_PROJECT_CLOSE) SetStatusText("作業中のプロジェクトを閉じます");
+	else if(LOWORD(msg)==IDM_EXIT) SetStatusText("アプリケーションの終了と内容の保存確認をします");
+	else if(LOWORD(msg)==IDM_UNDO) SetStatusText("直前の操作を元にもどします");
+	else if(LOWORD(msg)==IDM_REDO) SetStatusText("前の未完了操作を繰り返します");
+	else if(LOWORD(msg)==IDM_CUT) SetStatusText("選択範囲を切り取り、クリップボードへコピーします");
+	else if(LOWORD(msg)==IDM_COPY) SetStatusText("選択範囲をクリップボードへコピーします");
+	else if(LOWORD(msg)==IDM_PASTE) SetStatusText("挿入位置にクリップボードの内容を挿入します");
+	else if(LOWORD(msg)==IDM_DELETE) SetStatusText("選択範囲を削除します");
+	else if(LOWORD(msg)==IDM_ALLSELECT) SetStatusText("ファイル全体を選択します");
+	else if(LOWORD(msg)==IDM_FIND) SetStatusText("作業中のドキュメント内を検索します");
+	else if(LOWORD(msg)==IDM_PERMUTATION) SetStatusText("指定した文字列を他の文字列で置換します");
+
+#ifdef THETEXT
+	else if(LOWORD(msg)==IDM_STRING_COUNT) SetStatusText("作業中ドキュメントの文字数をカウントします");
+#endif
+
+	else if(LOWORD(msg)==IDM_PROJECTVIEW) SetStatusText("プロジェクトビューの表示/非表示を切り替えます");
+	else if(LOWORD(msg)==IDM_PROJECT_OPTION) SetStatusText("プロジェクトオプションの設定を行います");
+	else if(LOWORD(msg)==IDM_TOPMOST) SetStatusText("エディタの最前面表示ON/OFFを切り替えます");
+	else if(LOWORD(msg)==IDM_SET) SetStatusText("エディタオプションの設定を行います");
+	else if(LOWORD(msg)==IDM_DEBUG) SetStatusText("プログラムをデバッグ用にコンパイルし、デバッグ実行します");
+	else if(LOWORD(msg)==IDM_DEBUGCOMPILE) SetStatusText("プログラムをデバッグ用にコンパイルします");
+	else if(LOWORD(msg)==IDM_RELEASECOMPILE) SetStatusText("プログラムをリリース用にコンパイルします");
+	else if(LOWORD(msg)==IDM_TOPIC) SetStatusText("ヘルプファイルを開きます");
+	else if(LOWORD(msg)==IDM_ABOUT) SetStatusText("ActiveBasicのバージョン情報を表示します");
+	else SetStatusText(CmdMsg);
+#else
+	//英語
+	if(LOWORD(msg)==IDM_NEW) SetStatusText("Create a new document");
+	else if(LOWORD(msg)==IDM_OPEN) SetStatusText("Open an existing document");
+	else if(LOWORD(msg)==IDM_CLOSE) SetStatusText("Close the active document");
+	else if(LOWORD(msg)==IDM_SAVE) SetStatusText("Save the active document");
+	else if(LOWORD(msg)==IDM_NEWSAVE) SetStatusText("Save the active document with a new name");
+	else if(LOWORD(msg)==IDM_ALLSAVE) SetStatusText("Save all the modified documents");
+	else if(LOWORD(msg)==IDM_PROJECT_OPEN) SetStatusText("Open an existing project");
+	else if(LOWORD(msg)==IDM_PROJECT_SAVE) SetStatusText("Save the active project");
+	else if(LOWORD(msg)==IDM_PROJECT_CLOSE) SetStatusText("Close the active project");
+	else if(LOWORD(msg)==IDM_EXIT) SetStatusText("Quit the application, prompts you to save modified documents");
+	else if(LOWORD(msg)==IDM_UNDO) SetStatusText("Undo the last action");
+	else if(LOWORD(msg)==IDM_REDO) SetStatusText("Redo the previously undone action");
+	else if(LOWORD(msg)==IDM_CUT) SetStatusText("Cut the selection and puts it on the Clipboard");
+	else if(LOWORD(msg)==IDM_COPY) SetStatusText("Copy the selection and puts it on the Clipboard");
+	else if(LOWORD(msg)==IDM_PASTE) SetStatusText("Insert Clipboard contents");
+	else if(LOWORD(msg)==IDM_DELETE) SetStatusText("Erase the selection");
+	else if(LOWORD(msg)==IDM_ALLSELECT) SetStatusText("Select the entire document");
+	else if(LOWORD(msg)==IDM_FIND) SetStatusText("Search for text in the active document");
+	else if(LOWORD(msg)==IDM_PERMUTATION) SetStatusText("Replace occurrences of search string");
+	else if(LOWORD(msg)==IDM_PROJECTVIEW) SetStatusText("Show or hide ProjectView");
+	else if(LOWORD(msg)==IDM_PROJECT_OPTION) SetStatusText("Set project options");
+	else if(LOWORD(msg)==IDM_TOPMOST) SetStatusText("Mark ProjectEditor stay on top of the other applications");
+	else if(LOWORD(msg)==IDM_SET) SetStatusText("Set editor options");
+	else if(LOWORD(msg)==IDM_DEBUG) SetStatusText("Debug the program");
+	else if(LOWORD(msg)==IDM_DEBUGCOMPILE) SetStatusText("Compile the program for debugging");
+	else if(LOWORD(msg)==IDM_RELEASECOMPILE) SetStatusText("Compile the program for release");
+	else if(LOWORD(msg)==IDM_TOPIC) SetStatusText("Open the Help topics");
+	else if(LOWORD(msg)==IDM_ABOUT) SetStatusText("Display information about ActiveBasic");
+	else SetStatusText(CmdMsg);
+#endif
+}
+
+void ShowToolTipText(LPTOOLTIPTEXT TipText){
+	////////////////////////////////////////////////////////////////////////////
+	// ツールチップ（ツールバーにポイントしたときにポップアップされるテキスト）
+	////////////////////////////////////////////////////////////////////////////
+
+#if defined(JPN)
+	//日本語
+	if(TipText->hdr.idFrom==IDM_NEW) TipText->lpszText="新規作成 (Ctrl+N)";
+	else if(TipText->hdr.idFrom==IDM_OPEN) TipText->lpszText="開く (Ctrl+O)";
+	else if(TipText->hdr.idFrom==IDM_SAVE) TipText->lpszText="保存 (Ctrl+S)";
+	else if(TipText->hdr.idFrom==IDM_ALLSAVE) TipText->lpszText="すべて保存";
+	else if(TipText->hdr.idFrom==IDM_CUT) TipText->lpszText="切り取り (Ctrl+X)";
+	else if(TipText->hdr.idFrom==IDM_COPY) TipText->lpszText="コピー (Ctrl+C)";
+	else if(TipText->hdr.idFrom==IDM_PASTE) TipText->lpszText="貼り付け (Ctrl+V)";
+	else if(TipText->hdr.idFrom==IDM_UNDO) TipText->lpszText="元に戻す (Ctrl+Z)";
+	else if(TipText->hdr.idFrom==IDM_REDO) TipText->lpszText="やり直し (Ctrl+Y)";
+	else if(TipText->hdr.idFrom==IDM_FIND) TipText->lpszText="検索 (Ctrl+F)";
+	else if(TipText->hdr.idFrom==IDM_DEBUG) TipText->lpszText="デバッグ実行 (F2)";
+	else if(TipText->hdr.idFrom==IDM_DEBUGCOMPILE) TipText->lpszText="デバッグ コンパイル (F4)";
+	else if(TipText->hdr.idFrom==IDM_RELEASECOMPILE) TipText->lpszText="リリース コンパイル (F7)";
+#else
+	//英語
+	if(TipText->hdr.idFrom==IDM_NEW) TipText->lpszText="New Document (Ctrl+N)";
+	else if(TipText->hdr.idFrom==IDM_OPEN) TipText->lpszText="Open Document (Ctrl+O)";
+	else if(TipText->hdr.idFrom==IDM_SAVE) TipText->lpszText="Save Document (Ctrl+S)";
+	else if(TipText->hdr.idFrom==IDM_ALLSAVE) TipText->lpszText="Save All Document";
+	else if(TipText->hdr.idFrom==IDM_CUT) TipText->lpszText="Cut (Ctrl+X)";
+	else if(TipText->hdr.idFrom==IDM_COPY) TipText->lpszText="Copy (Ctrl+C)";
+	else if(TipText->hdr.idFrom==IDM_PASTE) TipText->lpszText="Paste (Ctrl+V)";
+	else if(TipText->hdr.idFrom==IDM_UNDO) TipText->lpszText="Undo (Ctrl+Z)";
+	else if(TipText->hdr.idFrom==IDM_REDO) TipText->lpszText="Redo (Ctrl+Y)";
+	else if(TipText->hdr.idFrom==IDM_FIND) TipText->lpszText="Find (Ctrl+F)";
+	else if(TipText->hdr.idFrom==IDM_DEBUG) TipText->lpszText="Run for Debugging (F2)";
+	else if(TipText->hdr.idFrom==IDM_DEBUGCOMPILE) TipText->lpszText="Compile for Debugging (F4)";
+	else if(TipText->hdr.idFrom==IDM_RELEASECOMPILE) TipText->lpszText="Compile for Release (F7)";
+#endif
+	MenuAdvice(TipText->hdr.idFrom);
+}
+
+char *reflexive_Include(char *buffer,char ***pppFilePath,int *pFileNum,char *pDefaultDir){
+	extern HANDLE hHeap;
+	int i,i2,i3,i4,sw1,sw2,FileSize;
+	char temporary[MAX_PATH],temp2[MAX_PATH+255],*temp3;
+	DWORD AccBytes;
+
+	//重複チェック用
+	char **ppFilePath;
+	int FileNum;
+	ppFilePath=*pppFilePath;
+	FileNum=*pFileNum;
+
+	for(i=0;;i++){
+		if( ( memcmp(buffer+i,"#include",8)==0 || memcmp(buffer+i,"#require",8)==0 )&&(!IsVariableChar(buffer[i+8]))){
+			i2=i+8;
+			while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+			sw1=0;
+			if(buffer[i2]=='\"') i2++;
+			else if(buffer[i2]=='<'){
+				i2++;
+				sw1=1;
+			}
+			for(i3=0;;i2++,i3++){
+				if((buffer[i2]=='\"'&&sw1==0)||(buffer[i2]=='>'&&sw1==1)||(buffer[i2]=='\r'&&buffer[i2+1]=='\n')||buffer[i2]=='\0'){
+					temporary[i3]=0;
+					break;
+				}
+				temporary[i3]=buffer[i2];
+			}
+			while((!(buffer[i2]=='\r'&&buffer[i2+1]=='\n'))&&buffer[i2]!='\0') i2++;
+
+			if(sw1){
+				sprintf(temp2,"%sInclude\\%s",pj_editor_Dir,temporary);
+				lstrcpy(temporary,temp2);
+			}
+			else{
+				GetFullPath(temporary,pDefaultDir);
+			}
+
+
+			//////////////////
+			// 重複チェック
+			//////////////////
+			for(i3=0,sw2=0;i3<FileNum;i3++){
+				if(lstrcmpi(ppFilePath[i3],temporary)==0){
+					//重複したとき
+					sw2=1;
+					break;
+				}
+			}
+			if(sw2){
+				//重複したときは無視する
+				i=i2;
+				continue;
+			}
+			ppFilePath=(char **)HeapReAlloc(hHeap,0,ppFilePath,(FileNum+1)*sizeof(char *));
+			ppFilePath[FileNum]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+			lstrcpy(ppFilePath[FileNum],temporary);
+			FileNum++;
+
+#define MEM_SPACE 1024 //強制終了を防ぐためのゆとりスペース
+			extern MDIINFO MdiInfo[MAX_WNDNUM];
+			for(i3=0;i3<MAX_WNDNUM;i3++){
+				if(MdiInfo[i3].hwnd){
+					if(lstrcmpi(temporary,MdiInfo[i3].path)==0) break;
+				}
+			}
+			if(i3==MAX_WNDNUM){
+				//ファイルから開く
+				HANDLE fh;
+				fh=CreateFile(temporary,GENERIC_READ,0,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+				if(fh==INVALID_HANDLE_VALUE){
+					goto finish;
+				}
+
+				FileSize=GetFileSize(fh,NULL);
+
+				temp3=(char *)HeapAlloc(hHeap,0,FileSize+MEM_SPACE);
+				ReadFile(fh,temp3,FileSize,&AccBytes,NULL);
+				temp3[FileSize]=0;
+
+				CloseHandle(fh);
+			}
+			else{
+				//エディタから読み取る
+				FileSize=lstrlen(MdiInfo[i3].pMdiTextEdit->buffer);
+
+				temp3=(char *)HeapAlloc(hHeap,0,FileSize+MEM_SPACE);
+				memcpy(temp3,MdiInfo[i3].pMdiTextEdit->buffer,FileSize);
+				temp3[FileSize]=0;
+			}
+
+			//新しい参照ディレクトリを取得
+			char DefaultDir[MAX_PATH+1024];
+			_splitpath(temporary,DefaultDir,temp2,0,0);
+			lstrcat(DefaultDir,temp2);
+
+			//インクルードの再帰呼び出し
+			temp3=reflexive_Include(temp3,&ppFilePath,&FileNum,DefaultDir);
+			FileSize=lstrlen(temp3);
+
+			i4=lstrlen(buffer)+FileSize-(i2-i);
+			if(FileSize>(i2-i)) buffer=(char *)HeapReAlloc(hHeap,0,buffer,i4+1+MEM_SPACE);
+			SlideString(buffer+i2,FileSize-(i2-i));
+
+			memcpy(buffer+i,temp3,FileSize);
+
+			HeapDefaultFree(temp3);
+
+			i--;
+			continue;
+		}
+
+		for(;;i++){
+			if(buffer[i]=='\0') break;
+			if(buffer[i]=='\r'&&buffer[i+1]=='\n'){
+				i++;
+				break;
+			}
+		}
+		if(buffer[i]=='\0') break;
+	}
+
+finish:
+
+	//重複チェック用
+	*pppFilePath=ppFilePath;
+	*pFileNum=FileNum;
+
+	return buffer;
+}
+
+char *IncludeFiles(char *buffer){
+	extern HANDLE hHeap;
+	int i;
+
+	//参照ディレクトリ
+	char *pDefaultDir;
+	extern PROJECTINFO ProjectInfo;
+	if(ProjectInfo.name[0])
+		pDefaultDir=ProjectInfo.dir;
+	else pDefaultDir=pj_editor_Dir;
+
+	//重複チェック用
+	char **ppFilePath;
+	int FileNum;
+	ppFilePath=(char **)HeapAlloc(hHeap,0,1);
+	FileNum=0;
+
+	buffer=reflexive_Include(buffer,&ppFilePath,&FileNum,pDefaultDir);
+
+	for(i=0;i<FileNum;i++){
+		HeapDefaultFree(ppFilePath[i]);
+	}
+	HeapDefaultFree(ppFilePath);
+	return buffer;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/DrawBuffer.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/DrawBuffer.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/DrawBuffer.cpp	(revision 178)
@@ -0,0 +1,613 @@
+#include "Common.h"
+
+extern HFONT hFont_TextEdit;
+extern int font_width,font_height;
+
+class CDrawReserve{
+	int x,y;
+	COLORREF NowColor,NowBackColor;
+	int bNowUnder;
+	char *lpszBuffer;
+	int length;
+	int m_WndNum;
+	HDC hdc;
+	HBITMAP hMemBmp,hOldBitmap;
+	HFONT hOldFont;
+	SIZE ClientSize;
+	int iControlTabSpace;
+	int iOnePage_CharHeight;
+	int iLineNumberTextCount;
+	int iMax_OneLine_TextLength;
+public:
+	HDC memdc;
+	CDrawReserve(int WndNum,HDC _hDC,int cx,int cy,int ctrl_tab_space,int nMaxOnePageChar,int linenum_textcount){
+		m_WndNum=WndNum;
+		x=-1;
+		y=-1;
+		bNowUnder=0;
+		hdc=_hDC;
+		ClientSize.cx=cx;
+		ClientSize.cy=cy;
+		iControlTabSpace=ctrl_tab_space;
+		iOnePage_CharHeight=nMaxOnePageChar;
+		iMax_OneLine_TextLength=cx/font_width+1;
+		iLineNumberTextCount=linenum_textcount;
+		memdc=CreateCompatibleDC(hdc);
+		hMemBmp=CreateCompatibleBitmap(hdc,cx,cy);
+		hOldBitmap=(HBITMAP)SelectObject(memdc,hMemBmp);
+
+		//背景色でメモリ画面を初期化
+		HBRUSH hBrush,hOldBrush;
+		hBrush=CreateSolidBrush(tci.rgbBackground);
+		hOldBrush=(HBRUSH)SelectObject(memdc,hBrush);
+		PatBlt(memdc,0,0,cx,cy,PATCOPY);
+		DeleteObject(hBrush);
+
+		//背景ビットマップ
+#ifdef THETEXT
+		if(pobj_DBTheme->hBackBmp){
+			HDC memdc2;
+			memdc2=CreateCompatibleDC(memdc);
+			SelectObject(memdc2,pobj_DBTheme->hBackBmp);
+			BitBlt(memdc,
+				cx-(pobj_DBTheme->sizeBackBmp.cx),
+				cy-(pobj_DBTheme->sizeBackBmp.cy),
+				pobj_DBTheme->sizeBackBmp.cx,pobj_DBTheme->sizeBackBmp.cy,
+				memdc2,0,0,SRCCOPY);
+			DeleteDC(memdc2);
+		}
+#endif
+
+		//フォントを設定
+		extern HFONT hFont_TextEdit;
+		hOldFont=(HFONT)SelectObject(memdc,hFont_TextEdit);
+
+		lpszBuffer=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+		length=0;
+	}
+	~CDrawReserve(){
+		SelectObject(memdc,hOldBitmap);
+		DeleteObject(hMemBmp);
+
+		SelectObject(memdc,hOldFont);
+
+		DeleteDC(memdc);
+
+		HeapDefaultFree(lpszBuffer);
+	}
+
+	void draw(){
+		if(length==0) return;
+		SetTextColor(memdc,NowColor);
+		if(NowBackColor==tci.rgbBackground){
+			SetBkMode(memdc,TRANSPARENT);
+		}
+		else{
+			SetBkMode(memdc,OPAQUE);
+			SetBkColor(memdc,NowBackColor);
+		}
+
+		HFONT hBeforeFont;
+		if(bNowUnder){
+			//下線付きフォントに設定
+			extern HFONT hFont_HyperLink_TextEdit;
+			hBeforeFont=(HFONT)SelectObject(memdc,hFont_HyperLink_TextEdit);
+		}
+
+		int offset=0;
+		if(x<0){
+			offset=-x;
+
+			//左端の全角文字の文字化けを避けるために10バイトの余裕を作る
+			offset-=10;
+			if(offset<0) offset=0;
+
+			length-=offset;
+			if(length<0) return;
+		}
+
+		if(length>iMax_OneLine_TextLength+10){
+			length=iMax_OneLine_TextLength+10;
+		}
+
+		int i;
+		int *lpDxWidths;
+		lpDxWidths=(int *)malloc((length+1)*sizeof(int));
+		for(i=0;i<length+1;i++){
+			lpDxWidths[i]=font_width;
+		}
+		ExtTextOut(memdc,
+			(x+offset)*(font_width)     +iControlTabSpace,
+			y*font_height,
+			0,NULL,
+			lpszBuffer+offset,length,
+			lpDxWidths);
+
+		if(bNowUnder){
+			SelectObject(memdc,hBeforeFont);
+		}
+
+		free(lpDxWidths);
+	}
+
+	void DrawReserve(int nXStart,int nYStart,COLORREF NextColor,COLORREF NextBackColor,BOOL bUnder,LPSTR lpString,int cbString){
+		if(nYStart!=y || NextColor!=NowColor || NextBackColor!=NowBackColor || bUnder!=bNowUnder){
+			//描画
+			draw();
+
+			x=nXStart;
+			y=nYStart;
+			NowColor=NextColor;
+			NowBackColor=NextBackColor;
+			bNowUnder=bUnder;
+
+			lpszBuffer[0]=0;
+			length=0;
+		}
+
+		//予約
+		lpszBuffer=(char *)HeapReAlloc(hHeap,0,lpszBuffer,length+cbString+1);
+		memcpy(lpszBuffer+length,lpString,cbString);
+		length+=cbString;
+		lpszBuffer[length]=0;
+	}
+
+	void finish(int BaseY){
+		draw();
+
+		HBRUSH hBrush,hOldBrush;
+		if(pobj_nv->bEditor_LineNumber){
+			hBrush=CreateSolidBrush(RGB(220,220,220));
+			hOldBrush=(HBRUSH)SelectObject(memdc,hBrush);
+
+
+			/////////////////////////////////////////////////////
+			// エディタ画面左端のコントロールタブの行番号を描画
+			/////////////////////////////////////////////////////
+
+			//灰色で塗りつぶす
+			PatBlt(memdc,
+				0,
+				0,
+				iControlTabSpace,
+				ClientSize.cy,
+				PATCOPY);
+
+			extern HFONT hFont_LineNumber;
+			int LineNumberFontHeight;
+
+			HFONT hOldFont;
+			hOldFont=(HFONT)SelectObject(memdc,hFont_LineNumber);
+			SetTextColor(memdc,RGB(60,60,60));
+			SetBkColor(memdc,RGB(220,220,220));
+
+			SIZE size;
+			GetTextExtentPoint32(memdc,"A",1,&size);
+			LineNumberFontHeight=size.cy;
+
+
+			//ブレークポイントの描画を準備
+			CFileBreakPoint *pobj_FileBreakPoint=0;
+			if(ProjectInfo.name[0]){
+				pobj_FileBreakPoint=
+					ProjectInfo.pobj_DBBreakPoint->EnumLines(MdiInfo[m_WndNum].path);
+			}
+			else{
+				extern CDBBreakPoint *pobj_DBBreakPoint;
+				pobj_FileBreakPoint=pobj_DBBreakPoint->EnumLines(MdiInfo[m_WndNum].path);
+			}
+
+
+			int i,i2;
+			char temporary[255],temp2[255];
+			if(y<iOnePage_CharHeight) i2=y;
+			else i2=iOnePage_CharHeight;
+			for(i=0;i<=i2;i++){
+
+				BOOL bBreakPoint;
+				bBreakPoint=0;
+				if(pobj_FileBreakPoint){
+					if(pobj_FileBreakPoint->check(i-BaseY)){
+						bBreakPoint=1;
+					}
+				}
+
+				if(bBreakPoint){
+					DrawIconEx(memdc,3,i*font_height+(font_height-16)/2,
+						(HICON)LoadImage(hIconResInst,MAKEINTRESOURCE(IDI_BREAKPOINT_FLAG),IMAGE_ICON,16,16,LR_SHARED),
+						16,16,0,NULL,DI_NORMAL);
+				}
+				else{
+					sprintf(temp2,"%%%dd:",iLineNumberTextCount);
+					sprintf(temporary,temp2,(i-BaseY)+1);
+
+					TextOut(memdc,
+						3,
+						i*font_height+(font_height-LineNumberFontHeight)/2,
+						temporary,
+						lstrlen(temporary));
+				}
+			}
+
+			SelectObject(memdc,hOldFont);
+
+
+			//ブラシを破棄
+			SelectObject(memdc,hOldBrush);
+			DeleteObject(hBrush);
+		}
+		else{
+			////////////////////////////////////////////
+			// エディタ画面左端のコントロールタブを描画
+			// ※行番号は非表示
+			////////////////////////////////////////////
+
+			hBrush=CreateSolidBrush(RGB(220,220,220));
+			hOldBrush=(HBRUSH)SelectObject(memdc,hBrush);
+
+			PatBlt(memdc,
+				0,
+				0,
+				iControlTabSpace,
+				ClientSize.cy,
+				PATCOPY);
+
+			SelectObject(memdc,hOldBrush);
+			DeleteObject(hBrush);
+		}
+
+
+		//メモリDCの内容を画面に描画
+		BitBlt(hdc,0,0,ClientSize.cx,ClientSize.cy,memdc,0,0,SRCCOPY);
+	}
+};
+
+void TextEdit_DrawBuffer(HDC hdc,int WndNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2;
+	int x,y;
+	int BaseX,BaseY,CharX;
+	char *pBuf,temporary[255];
+	HWND hEdit;
+
+
+	//背景モード、カラーの設定
+	COLORREF DefaultBackColor,CaretBackColor;
+	DefaultBackColor=tci.rgbBackground;
+
+	RECT ClientRect;
+	hEdit=GetWindow(MdiInfo[WndNum].hwnd,GW_CHILD);
+	GetClientRect(hEdit,&ClientRect);
+
+	//エディタ画面左端のコントロールタブ
+	int iControlTabSpace;
+	int iLineNumberTextCount;
+	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+	iLineNumberTextCount=MdiInfo[WndNum].pMdiTextEdit->iLineNumberTextCount;
+
+	//一ページ中に表示できる行数を取得
+	int OnePage_CharHeight;
+	OnePage_CharHeight=(ClientRect.bottom/font_height)+1;
+
+	//描画用クラス
+	CDrawReserve obj_dr(
+		WndNum,
+		hdc,
+		ClientRect.right-ClientRect.left,ClientRect.bottom-ClientRect.top,
+		iControlTabSpace,
+		OnePage_CharHeight,
+		iLineNumberTextCount);
+
+
+	//テキストバッファをコード内で参照しやすいようにポインタ変数を利用する
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+	//選択範囲を取得
+	CHARRANGE CharRange;
+	TextEdit_GetSel(WndNum,&CharRange);
+
+	//ベース描画ポジションを取得(文字単位)
+	BaseX=0;
+	BaseY=0;
+	GetScrollBaseCaretPos(WndNum,&BaseX,&BaseY);
+
+	if(pobj_nv->bEditor_CaretLine_BackGround){
+		//カーソル行の色を変える
+		CaretBackColor=tci.rgbCursorBack;
+	}
+	else{
+		//カーソル行の色を変えない
+		CaretBackColor=tci.rgbBackground;
+	}
+	HBRUSH hCaretBackBrush;
+	hCaretBackBrush=CreateSolidBrush(CaretBackColor);
+
+	BOOL IsStr=0;
+	DWORD dwComment=0;
+	BOOL bMultiLineComment;
+	COLORREF NextColor,NextBackColor;
+	int MaxX=0;
+	x=BaseX;
+	y=BaseY;
+	CharX=0;	//左端から何文字目かを示す
+	int bHyperLinkUnderBar=0;	//ハイパーリンク用下線の表示スイッチ
+	for(i=0;;i++){
+		if(pBuf[i]=='\0'){
+			if(0<=y&&y<=OnePage_CharHeight){
+				if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==y-BaseY){
+					////////////////////////////////////
+					// カーソル行では余白を塗りつぶす
+					////////////////////////////////////
+
+					HBRUSH hTempBrush;
+					hTempBrush=(HBRUSH)SelectObject(obj_dr.memdc,hCaretBackBrush);
+
+					//終端コードよりも右側はブラシで塗りつぶす
+					PatBlt(obj_dr.memdc,
+						x*font_width     +iControlTabSpace,
+						y*font_height,
+						ClientRect.right-(x*font_width     +iControlTabSpace),
+						font_height,
+						PATCOPY);
+
+					//カーソル行
+					SelectObject(obj_dr.memdc,hTempBrush);
+				}
+
+				//行番号が末端行にも表示されるようにするために描画予約を行う
+				obj_dr.DrawReserve(
+					x,
+					y,
+					NULL,
+					NULL,
+					bHyperLinkUnderBar,
+					"",0);
+			}
+
+			if(MaxX<CharX) MaxX=CharX;
+
+			break;
+		}
+
+		if(IsRightTurn(pBuf,i,x)){
+			/////////////////
+			// 自動折り返し
+			/////////////////
+
+			if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==y-BaseY){
+				///////////////////////////////////////////////////////////
+				//改行コードよりも右側は白いブラシで塗りつぶす（カーソル行用）
+				///////////////////////////////////////////////////////////
+
+				HBRUSH hTempBrush;
+
+				//カーソル行
+				hTempBrush=(HBRUSH)SelectObject(obj_dr.memdc,hCaretBackBrush);
+
+				PatBlt(obj_dr.memdc,
+					x*font_width     +iControlTabSpace,
+					y*font_height,
+					ClientRect.right-(x*font_width     +iControlTabSpace),
+					font_height,
+					PATCOPY);
+
+				//カーソル行
+				SelectObject(obj_dr.memdc,hTempBrush);
+			}
+
+			y++;
+
+			x=BaseX;
+			CharX=0;
+			i--;
+			continue;
+		}
+
+		if(MdiInfo[WndNum].DocType==WNDTYPE_BASIC){
+
+			if(pBuf[i]=='\"'&&dwComment==0) IsStr^=1;
+
+			//複数行に渡るコメントを考慮
+			if(pBuf[i]=='/'&&pBuf[i+1]=='*'&&IsStr==0&&dwComment==0){
+				dwComment=12;
+				bMultiLineComment=1;
+			}
+			if(pBuf[i]=='*'&&pBuf[i+1]=='/'&&
+				dwComment==10&&bMultiLineComment){
+				dwComment=3;
+			}
+
+			//単行コメント
+			if(pBuf[i]=='\''&&dwComment==0&&IsStr==0){
+				dwComment=10;
+				bMultiLineComment=0;
+			}
+
+			if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+				//単行コメント中での改行は、コメントを解除
+				if(dwComment&&bMultiLineComment==0){
+					IsStr=0;
+					dwComment=0;
+				}
+			}
+			if(dwComment!=0&&dwComment!=10) dwComment--;
+		}
+		if(MdiInfo[WndNum].DocType==WNDTYPE_HTML){
+			//複数行に渡るコメントを考慮
+			if(pBuf[i]=='<'&&pBuf[i+1]=='!'&&pBuf[i+2]=='-'&&pBuf[i+3]=='-'&&IsStr==0&&dwComment==0){
+				dwComment=10;
+			}
+			if(pBuf[i]=='-'&&pBuf[i+1]=='-'&&pBuf[i+2]=='>'&&
+				dwComment){
+				dwComment=4;
+			}
+			if(dwComment!=0&&dwComment!=10) dwComment--;
+		}
+
+		//ハイパーリンク用下線
+		if(MdiInfo[WndNum].pMdiTextEdit->iUnderStart<=i&&i<MdiInfo[WndNum].pMdiTextEdit->iUnderEnd)
+			bHyperLinkUnderBar=1;
+		else bHyperLinkUnderBar=0;
+
+		if(0<=y&&y<=OnePage_CharHeight){
+			//////////////////////////////////
+			// 表示中ページでは文字単位で描画
+			//////////////////////////////////
+			//※i2に描画する文字数を格納する
+
+			NextBackColor=DefaultBackColor;
+			if(dwComment){
+				//複数行に渡るコメント
+				NextColor=tci.rgbComment;
+			}
+			else{
+				//通常カラー
+				NextColor=MdiInfo[WndNum].pMdiTextEdit->pColorRef[i];
+			}
+
+			if(CharRange.cpMin<=i&&i<CharRange.cpMax){
+				//選択されているバッファは反転表示する
+				NextColor=NextColor^0x00FFFFFF;
+				NextBackColor=NextBackColor^0x00FFFFFF;
+			}
+			else{
+				if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==y-BaseY){
+					//カーソル行
+					NextBackColor=CaretBackColor;
+				}
+			}
+
+			if(IsDBCSLeadByte(pBuf[i])){
+				//マルチバイト文字
+				i2=2;
+				obj_dr.DrawReserve(
+					x,
+					y,
+					NextColor,
+					NextBackColor,
+					bHyperLinkUnderBar,
+					pBuf+i,i2);
+
+				i++;
+			}
+			else if(pBuf[i]=='\t'){
+				//タブ文字
+				int tab;
+				tab=pobj_nv->TabSize;
+
+				if((x-BaseX)%tab==0) i2=tab;
+				else i2=tab-(x-BaseX)%tab;
+				memset(temporary,' ',i2);
+				temporary[i2]=0;
+
+				obj_dr.DrawReserve(
+					x,
+					y,
+					NextColor,
+					NextBackColor,
+					bHyperLinkUnderBar,
+					temporary,i2);
+			}
+			else if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+				//改行文字は1スペースだけ空白を描画しておく（反転表示をするため）
+				i2=1;
+				temporary[0]=' ';
+				temporary[1]=0;
+				obj_dr.DrawReserve(
+					x,
+					y,
+					NextColor,
+					NextBackColor,
+					bHyperLinkUnderBar,
+					temporary,i2);
+
+
+				if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==y-BaseY){
+					///////////////////////////////////////////////////////////
+					//改行コードよりも右側は白いブラシで塗りつぶす（カーソル行用）
+					///////////////////////////////////////////////////////////
+
+					HBRUSH hTempBrush;
+
+					//カーソル行
+					hTempBrush=(HBRUSH)SelectObject(obj_dr.memdc,hCaretBackBrush);
+
+					PatBlt(obj_dr.memdc,
+						(x+i2)*font_width     +iControlTabSpace,
+						y*font_height,
+						ClientRect.right-((x+i2)*font_width     +iControlTabSpace),
+						font_height,
+						PATCOPY);
+
+					//カーソル行
+					SelectObject(obj_dr.memdc,hTempBrush);
+				}
+			}
+			else{
+				//通常のキャラ文字
+				i2=1;
+				obj_dr.DrawReserve(
+					x,
+					y,
+					NextColor,
+					NextBackColor,
+					bHyperLinkUnderBar,
+					pBuf+i,i2);
+			}
+		}
+		else{
+			////////////////////////////////////////
+			// 非表示ページでは文字数の計算だけ行う
+			////////////////////////////////////////
+			//※i2に描画する文字数を格納する
+
+			if(IsDBCSLeadByte(pBuf[i])){
+				//マルチバイト文字
+				i2=2;
+				i++;
+			}
+			else if(pBuf[i]=='\t'){
+				//タブ文字
+				int tab;
+				tab=pobj_nv->TabSize;
+
+				if((x-BaseX)%tab==0) i2=tab;
+				else i2=tab-(x-BaseX)%tab;
+			}
+			else{
+				//通常のキャラ文字（改行文字を含む）
+				i2=1;
+			}
+		}
+
+		if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+			y++;
+
+			if(MaxX<CharX) MaxX=CharX;
+
+			x=BaseX;
+			CharX=0;
+
+			i++;
+		}
+		else{
+			x+=i2;
+			CharX+=i2;
+		}
+	}
+
+	obj_dr.finish(BaseY);
+
+	DeleteObject(hCaretBackBrush);
+
+
+	//////////////////////////////////
+	// スクロールバーの範囲をセット
+	//////////////////////////////////
+
+	if(pobj_nv->bRightTurn){
+		MaxX=0;
+	}
+
+	ResetScrollbar(WndNum,MaxX,(-BaseY)+y);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/DrawWindow.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/DrawWindow.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/DrawWindow.cpp	(revision 178)
@@ -0,0 +1,1767 @@
+#include "Common.h"
+
+void DrawLineInClient(int WndNum,long StartX,long StartY,long EndX,long EndY){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	MoveToEx(MdiInfo[WndNum].MdiRadInfo->hMemDC,
+		StartX+MdiInfo[WndNum].MdiRadInfo->ClientPos.x,
+		StartY+MdiInfo[WndNum].MdiRadInfo->ClientPos.y,
+		NULL);
+	LineTo(MdiInfo[WndNum].MdiRadInfo->hMemDC,
+		EndX+MdiInfo[WndNum].MdiRadInfo->ClientPos.x,
+		EndY+MdiInfo[WndNum].MdiRadInfo->ClientPos.y);
+}
+void DrawRectangleInClient(int WndNum,long left,long top,long right,long bottom,COLORREF RGB_Pen,COLORREF RGB_Brush,BOOL bBrushing){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HPEN hPen,hOldPen;
+	HBRUSH hBrush,hOldBrush;
+
+	hPen=CreatePen(PS_SOLID,0,RGB_Pen);
+	if(bBrushing) hBrush=CreateSolidBrush(RGB_Brush);
+	else hBrush=(HBRUSH)GetStockObject(NULL_BRUSH);
+	hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+	hOldBrush=(HBRUSH)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hBrush);
+
+	Rectangle(MdiInfo[WndNum].MdiRadInfo->hMemDC,
+		left+MdiInfo[WndNum].MdiRadInfo->ClientPos.x,
+		top+MdiInfo[WndNum].MdiRadInfo->ClientPos.y,
+		right+MdiInfo[WndNum].MdiRadInfo->ClientPos.x,
+		bottom+MdiInfo[WndNum].MdiRadInfo->ClientPos.y);
+
+	SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+	SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldBrush);
+	DeleteObject(hPen);
+	if(bBrushing) DeleteObject(hBrush);
+}
+void DrawButtonEdge(int WndNum,POINT *pPos,SIZE *pSize){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HPEN hPen,hOldPen;
+
+	//光源方向の縁
+	hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+	hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+	DrawLineInClient(WndNum,
+		pPos->x, pPos->y,
+		pPos->x+pSize->cx-1, pPos->y);
+	DrawLineInClient(WndNum,
+		pPos->x, pPos->y,
+		pPos->x, pPos->y+pSize->cy-1);
+	SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+	DeleteObject(hPen);
+
+	//影側の縁
+	hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DDKSHADOW));
+	hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+	DrawLineInClient(WndNum,
+		pPos->x, pPos->y+pSize->cy-1,
+		pPos->x+pSize->cx, pPos->y+pSize->cy-1);
+	DrawLineInClient(WndNum,
+		pPos->x+pSize->cx-1, pPos->y,
+		pPos->x+pSize->cx-1, pPos->y+pSize->cy-1);
+	SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+	DeleteObject(hPen);
+
+	hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DSHADOW));
+	hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+	DrawLineInClient(WndNum,
+		pPos->x+1, pPos->y+pSize->cy-2,
+		pPos->x+pSize->cx-1, pPos->y+pSize->cy-2);
+	DrawLineInClient(WndNum,
+		pPos->x+pSize->cx-2, pPos->y+1,
+		pPos->x+pSize->cx-2, pPos->y+pSize->cy-2);
+	SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+	DeleteObject(hPen);
+
+	//内部
+	DrawRectangleInClient(WndNum,
+		pPos->x+1,pPos->y+1,
+		pPos->x+pSize->cx-2,pPos->y+pSize->cy-2,
+		GetSysColor(COLOR_3DFACE),GetSysColor(COLOR_3DFACE),1);
+
+	pPos->x+=3;
+	pPos->y+=2;
+	pSize->cx-=5;
+	pSize->cy-=4;
+}
+void DrawItemEdgeByExStyle(int WndNum,int ExStyle,POINT *pPos,SIZE *pSize){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HPEN hPen,hOldPen;
+	RECT rect;
+
+	if(ExStyle&WS_EX_DLGMODALFRAME){
+		///////////////////////////
+		//モーダル フレーム境界線
+
+		rect.left=pPos->x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+		rect.top=pPos->y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+		rect.right=pPos->x+pSize->cx+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+		rect.bottom=pPos->y+pSize->cy+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+		DrawEdge(MdiInfo[WndNum].MdiRadInfo->hMemDC,&rect,EDGE_RAISED,BF_RECT);
+		pPos->x+=2;
+		pPos->y+=2;
+		pSize->cx-=4;
+		pSize->cy-=4;
+
+		//細枠
+		DrawRectangleInClient(WndNum,
+			pPos->x,pPos->y,
+			pPos->x+pSize->cx,pPos->y+pSize->cy,
+			GetSysColor(COLOR_ACTIVEBORDER),0,0);
+
+		pPos->x+=1;
+		pPos->y+=1;
+		pSize->cx-=2;
+		pSize->cy-=2;
+	}
+	else if(ExStyle&WS_EX_STATICEDGE){
+		//////////////////////
+		//スタティック境界線
+
+		//影側の色
+		hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DSHADOW));
+		hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+		DrawLineInClient(WndNum,
+			pPos->x,
+			pPos->y,
+			pPos->x,
+			pPos->y+pSize->cy-1);
+		DrawLineInClient(WndNum,
+			pPos->x,
+			pPos->y,
+			pPos->x+pSize->cx-1,
+			pPos->y);
+		SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+		DeleteObject(hPen);
+
+		//光源方向の縁
+		hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+		hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+		DrawLineInClient(WndNum,
+			pPos->x,
+			pPos->y+pSize->cy-1,
+			pPos->x+pSize->cx-1,
+			pPos->y+pSize->cy-1);
+		DrawLineInClient(WndNum,
+			pPos->x+pSize->cx-1,
+			pPos->y,
+			pPos->x+pSize->cx-1,
+			pPos->y+pSize->cy);
+		SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+		DeleteObject(hPen);
+
+		pPos->x+=1;
+		pPos->y+=1;
+		pSize->cx-=2;
+		pSize->cy-=2;
+	}
+	if(ExStyle&WS_EX_CLIENTEDGE){
+		//////////////////////
+		//クライアント境界線
+
+		rect.left=pPos->x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+		rect.top=pPos->y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+		rect.right=pPos->x+pSize->cx+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+		rect.bottom=pPos->y+pSize->cy+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+		DrawEdge(MdiInfo[WndNum].MdiRadInfo->hMemDC,&rect,EDGE_SUNKEN,BF_RECT);
+		pPos->x+=2;
+		pPos->y+=2;
+		pSize->cx-=4;
+		pSize->cy-=4;
+	}
+}
+void DrawScrollBar(int WndNum,DWORD style,BOOL bSwitch,POINT *pPos,SIZE *pSize){
+	extern PROJECTINFO ProjectInfo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2;
+	HPEN hPen,hOldPen;
+	COLORREF rgb;
+	POINT pos;
+	SIZE size;
+
+	if(bSwitch==0){
+		//水平スクロールバー
+
+		//左ボタン
+		if(pSize->cx>16*2){
+			pos=*pPos;
+			size.cx=16;
+			size.cy=pSize->cy;
+		}
+		else{
+			pos=*pPos;
+			size.cx=pSize->cx/2;
+			size.cy=pSize->cy;
+		}
+		DrawItemEdgeByExStyle(WndNum,WS_EX_DLGMODALFRAME,&pos,&size);
+
+		//内部
+		DrawRectangleInClient(WndNum,
+			pos.x,pos.y,
+			pos.x+size.cx,pos.y+size.cy,
+			GetSysColor(COLOR_3DFACE),GetSysColor(COLOR_3DFACE),1);
+
+		if(style&WS_DISABLED){
+			hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+			hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+			pos.x++;
+			pos.y++;
+			i2=pos.y+(size.cy/2);
+			for(i=0;i<4;i++,i2--){
+				DrawLineInClient(WndNum,i+pos.x+2,i2,i+pos.x+2,i2+(i*2)+1);
+			}
+			SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+			DeleteObject(hPen);
+			rgb=GetSysColor(COLOR_GRAYTEXT);
+			pos.x--;
+			pos.y--;
+		}
+		else rgb=GetSysColor(COLOR_BTNTEXT);
+		hPen=CreatePen(PS_SOLID,0,rgb);
+		hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+		i2=pos.y+(size.cy/2);
+		for(i=0;i<4;i++,i2--){
+			DrawLineInClient(WndNum,i+pos.x+2,i2,i+pos.x+2,i2+(i*2)+1);
+		}
+		SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+		DeleteObject(hPen);
+
+		//右ボタン
+		if(pSize->cx>16*2){
+			pos.x=pPos->x+pSize->cx-16;
+			pos.y=pPos->y;
+			size.cx=16;
+			size.cy=pSize->cy;
+		}
+		else{
+			pos.x=pPos->x+pSize->cx/2+pSize->cx%2;
+			pos.y=pPos->y;
+			size.cx=pSize->cx/2;
+			size.cy=pSize->cy;
+		}
+		DrawItemEdgeByExStyle(WndNum,WS_EX_DLGMODALFRAME,&pos,&size);
+
+		//内部
+		DrawRectangleInClient(WndNum,
+			pos.x,pos.y,
+			pos.x+size.cx,pos.y+size.cy,
+			GetSysColor(COLOR_3DFACE),GetSysColor(COLOR_3DFACE),1);
+
+		if(style&WS_DISABLED){
+			hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+			hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+			pos.x++;
+			pos.y++;
+			i2=pos.y+(size.cy/2);
+			for(i=3;i>=0;i--,i2--){
+				DrawLineInClient(WndNum,i+pos.x+3,i2,i+pos.x+3,i2+((3-i)*2)+1);
+			}
+			SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+			DeleteObject(hPen);
+			rgb=GetSysColor(COLOR_GRAYTEXT);
+			pos.x--;
+			pos.y--;
+		}
+		else rgb=GetSysColor(COLOR_BTNTEXT);
+		hPen=CreatePen(PS_SOLID,0,rgb);
+		hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+		i2=pos.y+(size.cy/2);
+		for(i=3;i>=0;i--,i2--){
+			DrawLineInClient(WndNum,i+pos.x+3,i2,i+pos.x+3,i2+((3-i)*2)+1);
+		}
+		SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+		DeleteObject(hPen);
+
+		if(pSize->cx>16*3){
+			if(!(style&WS_DISABLED)){
+				pos.x=pPos->x+16;
+				pos.y=pPos->y;
+				size.cx=16;
+				size.cy=pSize->cy;
+				DrawItemEdgeByExStyle(WndNum,WS_EX_DLGMODALFRAME,&pos,&size);
+
+				//内部
+				DrawRectangleInClient(WndNum,
+					pos.x,pos.y,
+					pos.x+size.cx,pos.y+size.cy,
+					GetSysColor(COLOR_3DFACE),GetSysColor(COLOR_3DFACE),1);
+
+				pos.x=pPos->x+16*2;
+				pos.y=pPos->y;
+				size.cx=pSize->cx-16*3;
+				size.cy=pSize->cy;
+			}
+			else{
+				pos.x=pPos->x+16;
+				pos.y=pPos->y;
+				size.cx=pSize->cx-16*2;
+				size.cy=pSize->cy;
+			}
+		}
+		else if(pSize->cx>16*2){
+			pos.x=pPos->x+16;
+			pos.y=pPos->y;
+			size.cx=pSize->cx-16*2;
+			size.cy=pSize->cy;
+		}
+		else{
+			pos.x=pPos->x+pSize->cx/2;
+			pos.y=pPos->y;
+			size.cx=pSize->cx%2;
+			size.cy=pSize->cy;
+		}
+	}
+	else{
+		//垂直スクロールバー
+
+		//上ボタン
+		if(pSize->cy>16*2){
+			pos=*pPos;
+			size.cy=16;
+			size.cx=pSize->cx;
+		}
+		else{
+			pos=*pPos;
+			size.cy=pSize->cy/2;
+			size.cx=pSize->cx;
+		}
+		DrawItemEdgeByExStyle(WndNum,WS_EX_DLGMODALFRAME,&pos,&size);
+
+		//内部
+		DrawRectangleInClient(WndNum,
+			pos.x,pos.y,
+			pos.x+size.cx,pos.y+size.cy,
+			GetSysColor(COLOR_3DFACE),GetSysColor(COLOR_3DFACE),1);
+
+		pos.y++;
+		if(style&WS_DISABLED){
+			hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+			hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+			pos.x++;
+			pos.y++;
+			i2=pos.x+(size.cx/2)-1;
+			for(i=0;i<4;i++,i2--){
+				DrawLineInClient(WndNum,i2,i+pos.y+2,i2+(i*2)+1,i+pos.y+2);
+			}
+			SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+			DeleteObject(hPen);
+			rgb=GetSysColor(COLOR_GRAYTEXT);
+			pos.x--;
+			pos.y--;
+		}
+		else rgb=GetSysColor(COLOR_BTNTEXT);
+		hPen=CreatePen(PS_SOLID,0,rgb);
+		hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+		i2=pos.x+(size.cx/2)-1;
+		for(i=0;i<4;i++,i2--){
+			DrawLineInClient(WndNum,i2,i+pos.y+2,i2+(i*2)+1,i+pos.y+2);
+		}
+		SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+		DeleteObject(hPen);
+
+		//下ボタン
+		if(pSize->cy>16*2){
+			pos.x=pPos->x;
+			pos.y=pPos->y+pSize->cy-16;
+			size.cx=pSize->cx;
+			size.cy=16;
+		}
+		else{
+			pos.x=pPos->x;
+			pos.y=pPos->y+pSize->cy/2+pSize->cy%2;
+			size.cx=pSize->cx;
+			size.cy=pSize->cy/2;
+		}
+		DrawItemEdgeByExStyle(WndNum,WS_EX_DLGMODALFRAME,&pos,&size);
+
+		//内部
+		DrawRectangleInClient(WndNum,
+			pos.x,pos.y,
+			pos.x+size.cx,pos.y+size.cy,
+			GetSysColor(COLOR_3DFACE),GetSysColor(COLOR_3DFACE),1);
+
+		pos.x--;
+		if(style&WS_DISABLED){
+			hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+			hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+			pos.x++;
+			pos.y++;
+			i2=pos.x+(size.cx/2);
+			for(i=3;i>=0;i--,i2--){
+				DrawLineInClient(WndNum,i2,i+pos.y+3,i2+((3-i)*2)+1,i+pos.y+3);
+			}
+			SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+			DeleteObject(hPen);
+			rgb=GetSysColor(COLOR_GRAYTEXT);
+			pos.x--;
+			pos.y--;
+		}
+		else rgb=GetSysColor(COLOR_BTNTEXT);
+		hPen=CreatePen(PS_SOLID,0,rgb);
+		hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+		i2=pos.x+(size.cx/2);
+		for(i=3;i>=0;i--,i2--){
+			DrawLineInClient(WndNum,i2,i+pos.y+3,i2+((3-i)*2)+1,i+pos.y+3);
+		}
+		SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+		DeleteObject(hPen);
+
+		if(pSize->cy>16*3){
+			if(!(style&WS_DISABLED)){
+				pos.x=pPos->x;
+				pos.y=pPos->y+16;
+				size.cx=pSize->cx;
+				size.cy=16;
+				DrawItemEdgeByExStyle(WndNum,WS_EX_DLGMODALFRAME,&pos,&size);
+
+				//内部
+				DrawRectangleInClient(WndNum,
+					pos.x,pos.y,
+					pos.x+size.cx,pos.y+size.cy,
+					GetSysColor(COLOR_3DFACE),GetSysColor(COLOR_3DFACE),1);
+
+				pos.x=pPos->x;
+				pos.y=pPos->y+16*2;
+				size.cx=pSize->cx;
+				size.cy=pSize->cy-16*3;
+			}
+			else{
+				pos.x=pPos->x;
+				pos.y=pPos->y+16;
+				size.cx=pSize->cx;
+				size.cy=pSize->cy-16*2;
+			}
+		}
+		else if(pSize->cy>16*2){
+			pos.x=pPos->x;
+			pos.y=pPos->y+16;
+			size.cx=pSize->cx;
+			size.cy=pSize->cy-16*2;
+		}
+		else{
+			pos.x=pPos->x;
+			pos.y=pPos->y+pSize->cy/2;
+			size.cx=pSize->cx;
+			size.cy=pSize->cy%2;
+		}
+	}
+
+	if(size.cx){
+		int x,y;
+		HBITMAP hBitmap;
+		BITMAPINFO BitmapInfo;
+		BYTE *pByte;
+
+		memset(&BitmapInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER));
+		BitmapInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
+		BitmapInfo.bmiHeader.biWidth=size.cx;
+		BitmapInfo.bmiHeader.biHeight=size.cy;
+		BitmapInfo.bmiHeader.biPlanes=1;
+		BitmapInfo.bmiHeader.biBitCount=24;
+
+		hBitmap=CreateDIBSection(MdiInfo[WndNum].MdiRadInfo->hMemDC,&BitmapInfo,DIB_RGB_COLORS,(void **)&pByte,0,0);
+		i=BitmapInfo.bmiHeader.biWidth*3;
+		if(i%sizeof(LONG)!=0) i+=sizeof(LONG)-(i%sizeof(LONG));
+		for(y=0;y<BitmapInfo.bmiHeader.biHeight;y++){
+			if(y%2==0) rgb=GetSysColor(COLOR_3DFACE);
+			else rgb=RGB(255,255,255);
+			for(x=0;x<BitmapInfo.bmiHeader.biWidth;x++){
+				i2=y*i+x*3;
+				pByte[i2+2]=LOBYTE(LOWORD(rgb));
+				pByte[i2+1]=HIBYTE(LOWORD(rgb));
+				pByte[i2]=LOBYTE(HIWORD(rgb));
+				if(rgb==RGB(255,255,255)) rgb=GetSysColor(COLOR_3DFACE);
+				else rgb=RGB(255,255,255);
+			}
+		}
+		SetDIBitsToDevice(MdiInfo[WndNum].MdiRadInfo->hMemDC,
+			pos.x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x,
+			pos.y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y,
+			BitmapInfo.bmiHeader.biWidth, BitmapInfo.bmiHeader.biHeight,
+			0,0,
+			0,BitmapInfo.bmiHeader.biHeight,
+			pByte,
+			&BitmapInfo,
+			DIB_RGB_COLORS);
+		DeleteObject(hBitmap);
+	}
+}
+void DrawUpDownControl(int WndNum,DWORD style,BOOL bSwitch,POINT *pPos,SIZE *pSize){
+	extern PROJECTINFO ProjectInfo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2;
+	HPEN hPen,hOldPen;
+	COLORREF rgb;
+	POINT pos;
+	SIZE size;
+
+	if(bSwitch==0){
+		//水平
+
+		//左ボタン
+		pos=*pPos;
+		size.cx=pSize->cx/2;
+		size.cy=pSize->cy;
+		DrawItemEdgeByExStyle(WndNum,WS_EX_DLGMODALFRAME,&pos,&size);
+
+		//内部
+		DrawRectangleInClient(WndNum,
+			pos.x,pos.y,
+			pos.x+size.cx,pos.y+size.cy,
+			GetSysColor(COLOR_3DFACE),GetSysColor(COLOR_3DFACE),1);
+
+		if(style&WS_DISABLED){
+			hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+			hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+			pos.x++;
+			pos.y++;
+			i2=pos.y+(size.cy/2);
+			for(i=0;i<4;i++,i2--){
+				DrawLineInClient(WndNum,i+pos.x+2,i2,i+pos.x+2,i2+(i*2)+1);
+			}
+			SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+			DeleteObject(hPen);
+			rgb=GetSysColor(COLOR_GRAYTEXT);
+			pos.x--;
+			pos.y--;
+		}
+		else rgb=GetSysColor(COLOR_BTNTEXT);
+		hPen=CreatePen(PS_SOLID,0,rgb);
+		hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+		i2=pos.y+(size.cy/2);
+		for(i=0;i<4;i++,i2--){
+			DrawLineInClient(WndNum,i+pos.x+2,i2,i+pos.x+2,i2+(i*2)+1);
+		}
+		SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+		DeleteObject(hPen);
+
+		//右ボタン
+		pos.x=pPos->x+pSize->cx/2+pSize->cx%2;
+		pos.y=pPos->y;
+		size.cx=pSize->cx/2;
+		size.cy=pSize->cy;
+		DrawItemEdgeByExStyle(WndNum,WS_EX_DLGMODALFRAME,&pos,&size);
+
+		//内部
+		DrawRectangleInClient(WndNum,
+			pos.x,pos.y,
+			pos.x+size.cx,pos.y+size.cy,
+			GetSysColor(COLOR_3DFACE),GetSysColor(COLOR_3DFACE),1);
+
+		if(style&WS_DISABLED){
+			hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+			hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+			pos.x++;
+			pos.y++;
+			i2=pos.y+(size.cy/2);
+			for(i=3;i>=0;i--,i2--){
+				DrawLineInClient(WndNum,i+pos.x+3,i2,i+pos.x+3,i2+((3-i)*2)+1);
+			}
+			SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+			DeleteObject(hPen);
+			rgb=GetSysColor(COLOR_GRAYTEXT);
+			pos.x--;
+			pos.y--;
+		}
+		else rgb=GetSysColor(COLOR_BTNTEXT);
+		hPen=CreatePen(PS_SOLID,0,rgb);
+		hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+		i2=pos.y+(size.cy/2);
+		for(i=3;i>=0;i--,i2--){
+			DrawLineInClient(WndNum,i+pos.x+3,i2,i+pos.x+3,i2+((3-i)*2)+1);
+		}
+		SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+		DeleteObject(hPen);
+	}
+	else{
+		//垂直
+
+		//上ボタン
+		pos=*pPos;
+		size.cy=pSize->cy/2;
+		size.cx=pSize->cx;
+		DrawItemEdgeByExStyle(WndNum,WS_EX_DLGMODALFRAME,&pos,&size);
+
+		//内部
+		DrawRectangleInClient(WndNum,
+			pos.x,pos.y,
+			pos.x+size.cx,pos.y+size.cy,
+			GetSysColor(COLOR_3DFACE),GetSysColor(COLOR_3DFACE),1);
+
+		pos.y++;
+		if(style&WS_DISABLED){
+			hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+			hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+			pos.x++;
+			pos.y++;
+			i2=pos.x+(size.cx/2)-1;
+			for(i=0;i<4;i++,i2--){
+				DrawLineInClient(WndNum,i2,i+pos.y+2,i2+(i*2)+1,i+pos.y+2);
+			}
+			SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+			DeleteObject(hPen);
+			rgb=GetSysColor(COLOR_GRAYTEXT);
+			pos.x--;
+			pos.y--;
+		}
+		else rgb=GetSysColor(COLOR_BTNTEXT);
+		hPen=CreatePen(PS_SOLID,0,rgb);
+		hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+		i2=pos.x+(size.cx/2)-1;
+		for(i=0;i<4;i++,i2--){
+			DrawLineInClient(WndNum,i2,i+pos.y+2,i2+(i*2)+1,i+pos.y+2);
+		}
+		SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+		DeleteObject(hPen);
+
+		//下ボタン
+		pos.x=pPos->x;
+		pos.y=pPos->y+pSize->cy/2+pSize->cy%2;
+		size.cx=pSize->cx;
+		size.cy=pSize->cy/2;
+		DrawItemEdgeByExStyle(WndNum,WS_EX_DLGMODALFRAME,&pos,&size);
+
+		//内部
+		DrawRectangleInClient(WndNum,
+			pos.x,pos.y,
+			pos.x+size.cx,pos.y+size.cy,
+			GetSysColor(COLOR_3DFACE),GetSysColor(COLOR_3DFACE),1);
+
+		pos.x--;
+		if(style&WS_DISABLED){
+			hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+			hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+			pos.x++;
+			pos.y++;
+			i2=pos.x+(size.cx/2);
+			for(i=3;i>=0;i--,i2--){
+				DrawLineInClient(WndNum,i2,i+pos.y+3,i2+((3-i)*2)+1,i+pos.y+3);
+			}
+			SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+			DeleteObject(hPen);
+			rgb=GetSysColor(COLOR_GRAYTEXT);
+			pos.x--;
+			pos.y--;
+		}
+		else rgb=GetSysColor(COLOR_BTNTEXT);
+		hPen=CreatePen(PS_SOLID,0,rgb);
+		hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hPen);
+		i2=pos.x+(size.cx/2);
+		for(i=3;i>=0;i--,i2--){
+			DrawLineInClient(WndNum,i2,i+pos.y+3,i2+((3-i)*2)+1,i+pos.y+3);
+		}
+		SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldPen);
+		DeleteObject(hPen);
+	}
+}
+void DrawWindowScrollBar(int WndNum,DWORD style,POINT *pPos,SIZE *pSize){
+	POINT pos;
+	SIZE size;
+	if(style&WS_HSCROLL){
+		pos.x=pPos->x;
+		pos.y=pPos->y+pSize->cy-GetSystemMetrics(SM_CYVSCROLL);
+		if(style&WS_VSCROLL) size.cx=pSize->cx-GetSystemMetrics(SM_CXVSCROLL);
+		else size.cx=pSize->cx;
+		size.cy=GetSystemMetrics(SM_CYVSCROLL);
+		DrawScrollBar(WndNum,style,0,&pos,&size);
+	}
+	if(style&WS_VSCROLL){
+		pos.x=pPos->x+pSize->cx-GetSystemMetrics(SM_CXHSCROLL);
+		pos.y=pPos->y;
+		size.cx=GetSystemMetrics(SM_CXHSCROLL);
+		if(style&WS_HSCROLL) size.cy=pSize->cy-GetSystemMetrics(SM_CYHSCROLL);
+		else size.cy=pSize->cy;
+		DrawScrollBar(WndNum,style,1,&pos,&size);
+	}
+}
+void DrawOEMImage(HDC hdc,POINT *pPos,SIZE *pSize,DWORD dwImage){
+	HBITMAP hBmp,hOldBmp;
+	HDC memdc;
+
+	//未完成（XPのみに対応？）
+
+	memdc=CreateCompatibleDC(hdc);
+	hBmp=LoadBitmap(NULL,(LPSTR)dwImage);
+	hOldBmp=(HBITMAP)SelectObject(memdc,hBmp);
+	BitBlt(hdc,pPos->x,pPos->y,pSize->cx,pSize->cy,memdc,0,0,SRCCOPY);
+	SelectObject(memdc,hOldBmp);
+	DeleteDC(memdc);
+	DeleteObject(hBmp);
+}
+void DesigningWindow(int WndNum,HDC hdc,POINT *pBasePos,WINDOW_INFO *pWindowInfo){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3,i4;
+	double red,green,blue,d_red,d_green,d_blue;
+	char temporary[MAX_PATH];
+	COLORREF rgb;
+	HPEN hPen,hOldPen;
+	HBRUSH hBrush,hOldBrush;
+	HFONT hFont,hOldFont;
+	HANDLE hImage;
+	RECT InsideRect,rect,rc2;
+	POINT pos,pos2;
+	SIZE size,size2;
+
+	HGLOBAL hResource;
+	BITMAPINFO *pBitmapInfo;
+	BYTE *pByte,*pByte2;
+
+
+	////////////////////////
+	//ウィンドウの縁を描画
+	InsideRect.left=pBasePos->x;
+	InsideRect.top=pBasePos->y;
+	InsideRect.right=InsideRect.left+pWindowInfo->size.cx;
+	InsideRect.bottom=InsideRect.top+pWindowInfo->size.cy;
+
+	if(pWindowInfo->style&(WS_BORDER|WS_THICKFRAME)){
+		DrawEdge(hdc,&InsideRect,EDGE_RAISED,BF_RECT);
+
+		InsideRect.left+=2;
+		InsideRect.top+=2;
+		InsideRect.right-=2;
+		InsideRect.bottom-=2;
+	}
+
+
+	////////////
+	//枠を描画
+	if(pWindowInfo->style&(WS_BORDER|WS_THICKFRAME)){
+		//細枠
+		hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_ACTIVEBORDER));
+		hBrush=CreateSolidBrush(GetSysColor(COLOR_3DFACE));
+		hOldPen=(HPEN)SelectObject(hdc,hPen);
+		hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+		Rectangle(hdc,InsideRect.left,InsideRect.top,InsideRect.right,InsideRect.bottom);
+
+		InsideRect.left+=1;
+		InsideRect.top+=1;
+		InsideRect.right-=1;
+		InsideRect.bottom-=1;
+
+		//サイズ変更枠
+		if(pWindowInfo->style&WS_THICKFRAME){
+			Rectangle(hdc,InsideRect.left,InsideRect.top,InsideRect.right,InsideRect.bottom);
+
+			InsideRect.left+=1;
+			InsideRect.top+=1;
+			InsideRect.right-=1;
+			InsideRect.bottom-=1;
+		}
+		SelectObject(hdc,hOldPen);
+		SelectObject(hdc,hOldBrush);
+		DeleteObject(hPen);
+		DeleteObject(hBrush);
+	}
+
+
+	//Draw...InClient関数のため
+	MdiInfo[WndNum].MdiRadInfo->ClientPos.x=0;
+	MdiInfo[WndNum].MdiRadInfo->ClientPos.y=0;
+
+	if(pWindowInfo->style&(WS_CAPTION&(~WS_BORDER))){
+		//////////////////////
+		//タイトルバーを描画
+
+		//背景を描画（グラデーション可）
+		i=GetSysColor(COLOR_ACTIVECAPTION);
+		OSVERSIONINFO OsVersionInfo;
+		OsVersionInfo.dwOSVersionInfoSize=sizeof(OSVERSIONINFO);
+		GetVersionEx(&OsVersionInfo);
+		if((OsVersionInfo.dwPlatformId==VER_PLATFORM_WIN32_NT&&OsVersionInfo.dwMajorVersion>=5)||
+			(OsVersionInfo.dwPlatformId==VER_PLATFORM_WIN32_WINDOWS&&LOWORD(OsVersionInfo.dwBuildNumber)>=1998)){
+#define COLOR_GRADIENTACTIVECAPTION 27
+			i2=GetSysColor(COLOR_GRADIENTACTIVECAPTION);
+		}
+		else i2=i;
+		if(pWindowInfo->ExStyle&WS_EX_TOOLWINDOW)
+			i3=GetSystemMetrics(SM_CYSMCAPTION);
+		else i3=GetSystemMetrics(SM_CYCAPTION);
+		d_red=((double)((i2&0xFF)-(i&0xFF)))/(double)(InsideRect.right-InsideRect.left);
+		d_green=((double)(((i2>>8)&0xFF))-((i>>8)&0xFF))/(double)(InsideRect.right-InsideRect.left);
+		d_blue=((double)(((i2>>16)&0xFF))-((i>>16)&0xFF))/(double)(InsideRect.right-InsideRect.left);
+
+		red=(double)(i&0xFF);
+		green=(double)((i>>8)&0xFF);
+		blue=(double)((i>>16)&0xFF);
+		for(i4=InsideRect.left;i4<InsideRect.right;i4++){
+			hPen=CreatePen(PS_SOLID,0,RGB((_int8)red,(_int8)green,(_int8)blue));
+			hOldPen=(HPEN)SelectObject(hdc,hPen);
+			MoveToEx(hdc,i4,InsideRect.top,NULL);
+			LineTo(hdc,i4,InsideRect.top+i3-1);
+			SelectObject(hdc,hOldPen);
+			DeleteObject(hPen);
+			red+=d_red;
+			green+=d_green;
+			blue+=d_blue;
+		}
+
+		//タイトルテキストの描画
+		LOGFONT LogFont;
+		SystemParametersInfo(SPI_GETICONTITLELOGFONT,sizeof(LOGFONT),&LogFont,0);
+		hFont=CreateFontIndirect(&LogFont);
+		hOldFont=(HFONT)SelectObject(hdc,hFont);
+		SetTextColor(hdc,GetSysColor(COLOR_CAPTIONTEXT));
+		rect.left=InsideRect.left+20;
+		rect.top=InsideRect.top;
+		rect.right=InsideRect.right;
+		rect.bottom=InsideRect.top+i3;
+		DrawText(hdc,pWindowInfo->caption,lstrlen(pWindowInfo->caption),&rect,DT_SINGLELINE|DT_VCENTER|DT_NOPREFIX);
+		SelectObject(hdc,hOldFont);
+		DeleteObject(hFont);
+
+		//ボタン
+		if(pWindowInfo->style&WS_SYSMENU){
+			//終了ボタン
+			size.cx=GetSystemMetrics(SM_CXSIZE)-2;
+			size.cy=GetSystemMetrics(SM_CYSIZE)-4;
+			pos.x=InsideRect.right-2-size.cx;
+			pos.y=InsideRect.top+2;
+			DrawButtonEdge(WndNum,&pos,&size);
+
+			hResource=LoadResource(hResInst,FindResource(hResInst,MAKEINTRESOURCE(IDB_TITLE_BUTTON_CLOSE),RT_BITMAP));
+			pBitmapInfo=(BITMAPINFO *)LockResource(hResource);
+			pByte=(BYTE *)pBitmapInfo+pBitmapInfo->bmiHeader.biSize;
+
+			i2=pBitmapInfo->bmiHeader.biWidth*3;
+			if(i2%sizeof(LONG)!=0) i2+=sizeof(LONG)-(i2%sizeof(LONG));
+			pByte2=(BYTE *)GlobalAlloc(GMEM_FIXED,pBitmapInfo->bmiHeader.biHeight*i2);
+			int x,y;
+			for(y=0;y<pBitmapInfo->bmiHeader.biHeight;y++){
+				if(y%2==0) rgb=GetSysColor(COLOR_3DFACE);
+				else rgb=RGB(255,255,255);
+				for(x=0;x<pBitmapInfo->bmiHeader.biWidth;x++){
+					i4=y*i2+x*3;
+					rgb=RGB(pByte[i4+2],pByte[i4+1],pByte[i4]);
+					if(rgb==RGB(0,0,0)){
+						rgb=GetSysColor(COLOR_BTNTEXT);
+						pByte2[i4+2]=LOBYTE(LOWORD(rgb));
+						pByte2[i4+1]=HIBYTE(LOWORD(rgb));
+						pByte2[i4]=LOBYTE(HIWORD(rgb));
+					}
+					else if(rgb==RGB(255,255,255)){
+						rgb=GetSysColor(COLOR_3DFACE);
+						pByte2[i4+2]=LOBYTE(LOWORD(rgb));
+						pByte2[i4+1]=HIBYTE(LOWORD(rgb));
+						pByte2[i4]=LOBYTE(HIWORD(rgb));
+					}
+				}
+			}
+			SetStretchBltMode(hdc,COLORONCOLOR);
+			StretchDIBits(hdc,
+				pos.x+(int)((double)size.cx*0.17), pos.y+(int)((double)size.cy*0.17),
+				(int)((double)size.cx*0.65)+1, (int)((double)size.cy*0.65)+1,
+				0,0,
+				pBitmapInfo->bmiHeader.biWidth,pBitmapInfo->bmiHeader.biHeight,
+				pByte2,
+				pBitmapInfo,
+				DIB_RGB_COLORS,SRCCOPY);
+			GlobalFree(pByte2);
+
+			if(pWindowInfo->style&WS_MAXIMIZEBOX||pWindowInfo->style&WS_MINIMIZEBOX){
+				//最大化ボタン
+				size.cx=GetSystemMetrics(SM_CXSIZE)-2;
+				size.cy=GetSystemMetrics(SM_CYSIZE)-4;
+				pos.x=InsideRect.right-size.cx*2-4;
+				pos.y=InsideRect.top+2;
+				DrawButtonEdge(WndNum,&pos,&size);
+				if(!(pWindowInfo->style&WS_MAXIMIZEBOX)){
+					pos.x++;
+					pos.y++;
+					hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+					hOldPen=(HPEN)SelectObject(hdc,hPen);
+					hOldBrush=(HBRUSH)SelectObject(hdc,GetStockObject(NULL_BRUSH));
+					Rectangle(hdc,pos.x,pos.y,pos.x+size.cx-2,pos.y+size.cy-1);
+					MoveToEx(hdc,pos.x,pos.y+1,NULL);
+					LineTo(hdc,pos.x+size.cx-2,pos.y+1);
+					SelectObject(hdc,hOldPen);
+					SelectObject(hdc,hOldBrush);
+					DeleteObject(hPen);
+					pos.x--;
+					pos.y--;
+					rgb=GetSysColor(COLOR_GRAYTEXT);
+				}
+				else rgb=GetSysColor(COLOR_BTNTEXT);
+				hPen=CreatePen(PS_SOLID,0,rgb);
+				hOldPen=(HPEN)SelectObject(hdc,hPen);
+				hOldBrush=(HBRUSH)SelectObject(hdc,GetStockObject(NULL_BRUSH));
+				Rectangle(hdc,pos.x,pos.y,pos.x+size.cx-2,pos.y+size.cy-1);
+				MoveToEx(hdc,pos.x,pos.y+1,NULL);
+				LineTo(hdc,pos.x+size.cx-2,pos.y+1);
+				SelectObject(hdc,hOldPen);
+				SelectObject(hdc,hOldBrush);
+				DeleteObject(hPen);
+
+				//最小化ボタン
+				size.cx=GetSystemMetrics(SM_CXSIZE)-2;
+				size.cy=GetSystemMetrics(SM_CYSIZE)-4;
+				pos.x=InsideRect.right-size.cx*3-4;
+				pos.y=InsideRect.top+2;
+				DrawButtonEdge(WndNum,&pos,&size);
+				if(!(pWindowInfo->style&WS_MINIMIZEBOX)){
+					pos.x++;
+					pos.y++;
+					hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+					hOldPen=(HPEN)SelectObject(hdc,hPen);
+					MoveToEx(hdc,pos.x+1,pos.y+size.cy-2,NULL);
+					LineTo(hdc,pos.x+size.cy-3,pos.y+size.cy-2);
+					MoveToEx(hdc,pos.x+1,pos.y+size.cy-3,NULL);
+					LineTo(hdc,pos.x+size.cy-3,pos.y+size.cy-3);
+					SelectObject(hdc,hOldPen);
+					DeleteObject(hPen);
+					pos.x--;
+					pos.y--;
+					rgb=GetSysColor(COLOR_GRAYTEXT);
+				}
+				else rgb=GetSysColor(COLOR_BTNTEXT);
+				hPen=CreatePen(PS_SOLID,0,rgb);
+				hOldPen=(HPEN)SelectObject(hdc,hPen);
+				MoveToEx(hdc,pos.x+1,pos.y+size.cy-2,NULL);
+				LineTo(hdc,pos.x+size.cy-3,pos.y+size.cy-2);
+				MoveToEx(hdc,pos.x+1,pos.y+size.cy-3,NULL);
+				LineTo(hdc,pos.x+size.cy-3,pos.y+size.cy-3);
+				SelectObject(hdc,hOldPen);
+				DeleteObject(hPen);
+			}
+		}
+
+		InsideRect.top+=i3;
+	}
+
+	if(pWindowInfo->MenuID){
+		//メニューラインを3DFACEで描画
+		rgb=GetSysColor(COLOR_3DFACE);
+		i=GetSystemMetrics(SM_CYMENU);
+		hPen=CreatePen(PS_SOLID,0,rgb);
+		hBrush=CreateSolidBrush(rgb);
+		hOldPen=(HPEN)SelectObject(hdc,hPen);
+		hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+		Rectangle(hdc,
+			InsideRect.left,InsideRect.top-1,InsideRect.right,InsideRect.top+i);
+		SelectObject(hdc,hOldPen);
+		SelectObject(hdc,hOldBrush);
+		DeleteObject(hPen);
+		DeleteObject(hBrush);
+
+		InsideRect.top+=i;
+	}
+
+	//クライアント左上ポジションを設定
+	MdiInfo[WndNum].MdiRadInfo->ClientPos.x=InsideRect.left;
+	MdiInfo[WndNum].MdiRadInfo->ClientPos.y=InsideRect.top;
+
+	//ExStyleによる縁を描画
+	pos.x=0;
+	pos.y=0;
+	size.cx=InsideRect.right-InsideRect.left;
+	size.cy=InsideRect.bottom-InsideRect.top;
+	DrawItemEdgeByExStyle(WndNum,pWindowInfo->ExStyle,&pos,&size);
+
+	//スクロールバーを描画
+	DrawWindowScrollBar(WndNum,pWindowInfo->style,&pos,&size);
+
+	//クライアント領域のサイズを設定
+	MdiInfo[WndNum].MdiRadInfo->ClientSize=size;
+
+
+	//////////////
+	//背景を描画
+	if(pWindowInfo->bgColor==COLOR_3DFACE){
+		//3DFACE
+		hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DFACE));
+		hBrush=CreateSolidBrush(GetSysColor(COLOR_3DFACE));
+		hOldPen=(HPEN)SelectObject(hdc,hPen);
+		hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+		Rectangle(hdc,InsideRect.left,InsideRect.top,InsideRect.right,InsideRect.bottom);
+		SelectObject(hdc,hOldPen);
+		SelectObject(hdc,hOldBrush);
+		DeleteObject(hPen);
+		DeleteObject(hBrush);
+	}
+	else if(pWindowInfo->bgColor<=0){
+		//色指定
+		hPen=CreatePen(PS_SOLID,0,-pWindowInfo->bgColor);
+		hBrush=CreateSolidBrush(-pWindowInfo->bgColor);
+		hOldPen=(HPEN)SelectObject(hdc,hPen);
+		hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+		Rectangle(hdc,InsideRect.left,InsideRect.top,InsideRect.right,InsideRect.bottom);
+		SelectObject(hdc,hOldPen);
+		SelectObject(hdc,hOldBrush);
+		DeleteObject(hPen);
+		DeleteObject(hBrush);
+	}
+	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);
+			GetFullPath(temporary,ProjectInfo.dir);
+			hImage=LoadImage(NULL,temporary,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE);
+
+			hBrush=CreatePatternBrush((HBITMAP)hImage);
+			hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+			SetBrushOrgEx(hdc,InsideRect.left,InsideRect.top,&pos);
+			PatBlt(hdc,
+				InsideRect.left, InsideRect.top,
+				InsideRect.right-InsideRect.left, InsideRect.bottom-InsideRect.top,PATCOPY);
+			SetBrushOrgEx(hdc,pos.x,pos.y,0);
+			SelectObject(hdc,hOldBrush);
+			DeleteObject(hBrush);
+			DeleteObject(hImage);
+		}
+	}
+
+
+	////////////////////////////////////////////
+	//子ウィンドウ（ダイアログアイテム）を描画
+	hFont=CreateFontIndirect(&pWindowInfo->LogFont);
+	for(i=0;i<pWindowInfo->NumberOfChildWindows;i++){
+		pos=pWindowInfo->pChildInfo[i].pos;
+		size=pWindowInfo->pChildInfo[i].size;
+
+		//ExStyleによる縁を描画
+		DrawItemEdgeByExStyle(WndNum,pWindowInfo->pChildInfo[i].ExStyle,&pos,&size);
+
+		if(pWindowInfo->pChildInfo[i].Control==CT_BUTTON){
+			////////////////////////
+			// Button コントロール
+
+			if((pWindowInfo->pChildInfo[i].style&0x0000000F)==BS_DEFPUSHBUTTON){
+				//標準のボタンの場合（黒枠描画）
+				DrawRectangleInClient(WndNum,
+					pos.x, pos.y,
+					pos.x+size.cx, pos.y+size.cy,
+					RGB(0,0,0),0,0);
+				pos.x++;
+				pos.y++;
+				size.cx-=2;
+				size.cy-=2;
+			}
+
+			//ボタンの縁を描画
+			DrawButtonEdge(WndNum,&pos,&size);
+
+			if(!(pWindowInfo->pChildInfo[i].style&(BS_ICON|BS_BITMAP))){
+				//キャプション テキスト
+
+				rect.left=pos.x+1+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+				rect.top=pos.y+1+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+				rect.right=pos.x+size.cx-2+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+				rect.bottom=pos.y+size.cy-2+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+
+				if(pWindowInfo->pChildInfo[i].style&BS_MULTILINE) i4=0;
+				else i4=DT_SINGLELINE;
+
+				//ビットを考慮してBS_CENTERを最初に比較する
+				if((pWindowInfo->pChildInfo[i].style&BS_CENTER)==BS_CENTER) i2=DT_CENTER;
+				else if(pWindowInfo->pChildInfo[i].style&BS_LEFT) i2=DT_LEFT;
+				else if(pWindowInfo->pChildInfo[i].style&BS_RIGHT) i2=DT_RIGHT;
+				else i2=DT_CENTER;
+
+				//ビットを考慮してBS_VCENTERを最初に比較する
+				if((pWindowInfo->pChildInfo[i].style&BS_VCENTER)==BS_VCENTER) i3=DT_VCENTER;
+				else if(pWindowInfo->pChildInfo[i].style&BS_TOP) i3=DT_TOP;
+				else if(pWindowInfo->pChildInfo[i].style&BS_BOTTOM) i3=DT_BOTTOM;
+				else i3=DT_VCENTER;
+
+				hOldFont=(HFONT)SelectObject(hdc,hFont);
+				if(pWindowInfo->pChildInfo[i].style&WS_DISABLED){
+					SetTextColor(hdc,RGB(255,255,255));
+					rc2.left=rect.left+1;
+					rc2.top=rect.top+1;
+					rc2.right=rect.right+1;
+					rc2.bottom=rect.bottom+1;
+					DrawText(hdc,pWindowInfo->pChildInfo[i].caption,-1,&rc2,i4|i2|i3);
+					SetTextColor(hdc,GetSysColor(COLOR_GRAYTEXT));
+				}
+				else SetTextColor(hdc,GetSysColor(COLOR_BTNTEXT));
+
+				DrawText(hdc,pWindowInfo->pChildInfo[i].caption,-1,&rect,i4|i2|i3);
+				SelectObject(hdc,hOldFont);
+			}
+		}
+		else if(pWindowInfo->pChildInfo[i].Control==CT_CHECKBOX){
+			//////////////////////////
+			// CheckBox コントロール
+
+			if(pWindowInfo->pChildInfo[i].style&BS_PUSHLIKE){
+				//ボタンの縁を描画
+				DrawButtonEdge(WndNum,&pos,&size);
+			}
+			else{
+				//チェックボックスを描画
+				size2.cx=13;
+				size2.cy=13;
+				if(pWindowInfo->pChildInfo[i].style&BS_LEFTTEXT)
+					pos2.x=pos.x+size.cx-size2.cx;
+				else pos2.x=pos.x;
+				if((pWindowInfo->pChildInfo[i].style&BS_VCENTER)==BS_VCENTER||
+					(pWindowInfo->pChildInfo[i].style&BS_VCENTER)==0)
+					pos2.y=pos.y+(size.cy/2)-(size2.cy/2);
+				else if(pWindowInfo->pChildInfo[i].style&BS_TOP)
+					pos2.y=pos.y+1;
+				else if(pWindowInfo->pChildInfo[i].style&BS_BOTTOM)
+					pos2.y=pos.y+size.cy-size2.cy-1;
+				DrawItemEdgeByExStyle(WndNum,WS_EX_CLIENTEDGE,&pos2,&size2);
+
+				if(pWindowInfo->pChildInfo[i].style&WS_DISABLED)
+					rgb=GetSysColor(COLOR_3DFACE);
+				else rgb=GetSysColor(COLOR_WINDOW);
+				DrawRectangleInClient(WndNum,pos2.x, pos2.y,
+					pos2.x+size2.cx, pos2.y+size2.cy,
+					rgb,rgb,1);
+				if(!(pWindowInfo->pChildInfo[i].style&BS_LEFTTEXT)) pos.x+=17;
+				else pos.x++;
+				size.cx-=17;
+			}
+
+			if(!(pWindowInfo->pChildInfo[i].style&(BS_ICON|BS_BITMAP))){
+				//キャプション テキスト
+				rect.left=pos.x+1+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+				rect.top=pos.y+1+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+				rect.right=pos.x+size.cx-2+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+				rect.bottom=pos.y+size.cy-2+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+
+				if(pWindowInfo->pChildInfo[i].style&BS_MULTILINE) i4=0;
+				else i4=DT_SINGLELINE;
+
+				//ビットを考慮してBS_CENTERを最初に比較する
+				if((pWindowInfo->pChildInfo[i].style&BS_CENTER)==BS_CENTER) i2=DT_CENTER;
+				else if(pWindowInfo->pChildInfo[i].style&BS_LEFT) i2=DT_LEFT;
+				else if(pWindowInfo->pChildInfo[i].style&BS_RIGHT) i2=DT_RIGHT;
+				else i2=DT_LEFT;
+
+				//ビットを考慮してBS_VCENTERを最初に比較する
+				if((pWindowInfo->pChildInfo[i].style&BS_VCENTER)==BS_VCENTER) i3=DT_VCENTER;
+				else if(pWindowInfo->pChildInfo[i].style&BS_TOP) i3=DT_TOP;
+				else if(pWindowInfo->pChildInfo[i].style&BS_BOTTOM) i3=DT_BOTTOM;
+				else i3=DT_VCENTER;
+
+				hOldFont=(HFONT)SelectObject(hdc,hFont);
+				if(pWindowInfo->pChildInfo[i].style&WS_DISABLED){
+					SetTextColor(hdc,RGB(255,255,255));
+					rc2.left=rect.left+1;
+					rc2.top=rect.top+1;
+					rc2.right=rect.right+1;
+					rc2.bottom=rect.bottom+1;
+					DrawText(hdc,pWindowInfo->pChildInfo[i].caption,-1,&rc2,i4|i2|i3);
+					SetTextColor(hdc,GetSysColor(COLOR_GRAYTEXT));
+				}
+				else SetTextColor(hdc,GetSysColor(COLOR_BTNTEXT));
+
+				DrawText(hdc,pWindowInfo->pChildInfo[i].caption,-1,&rect,i4|i2|i3);
+				SelectObject(hdc,hOldFont);
+			}
+		}
+		else if(pWindowInfo->pChildInfo[i].Control==CT_COMBOBOX){
+			//////////////////////////
+			// ComboBox コントロール
+
+			pos2=pos;
+			size2.cx=size.cx;
+			size2.cy=20;
+			DrawItemEdgeByExStyle(WndNum,WS_EX_CLIENTEDGE,&pos2,&size2);
+
+			//内部
+			if(pWindowInfo->pChildInfo[i].style&WS_DISABLED)
+				rgb=GetSysColor(COLOR_3DFACE);
+			else rgb=GetSysColor(COLOR_WINDOW);
+			DrawRectangleInClient(WndNum,
+				pos2.x,pos2.y,
+				pos2.x+size2.cx,pos2.y+size2.cy,
+				rgb,rgb,1);
+
+			if((pWindowInfo->pChildInfo[i].style&0x000F)==CBS_SIMPLE){
+				pos.y+=20;
+				size.cy-=20;
+				DrawItemEdgeByExStyle(WndNum,WS_EX_CLIENTEDGE,&pos,&size);
+
+				//内部
+				rgb=GetSysColor(COLOR_WINDOW);
+				DrawRectangleInClient(WndNum,
+					pos.x,pos.y,
+					pos.x+size.cx,pos.y+size.cy,
+					rgb,rgb,1);
+			}
+			else{
+				//下ボタン
+				pos2.x+=size2.cx-16;
+				size2.cx=16;
+				size2.cy=16;
+				DrawItemEdgeByExStyle(WndNum,WS_EX_DLGMODALFRAME,&pos2,&size2);
+
+				//内部
+				DrawRectangleInClient(WndNum,
+					pos2.x,pos2.y,
+					pos2.x+size2.cx,pos2.y+size2.cy,
+					GetSysColor(COLOR_3DFACE),GetSysColor(COLOR_3DFACE),1);
+
+				pos2.x--;
+				if(pWindowInfo->pChildInfo[i].style&WS_DISABLED){
+					hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DHIGHLIGHT));
+					hOldPen=(HPEN)SelectObject(hdc,hPen);
+					pos2.x++;
+					pos2.y++;
+					i3=pos2.x+(size2.cx/2);
+					for(i2=3;i2>=0;i2--,i3--){
+						DrawLineInClient(WndNum,i3,i2+pos2.y+3,i3+((3-i2)*2)+1,i2+pos2.y+3);
+					}
+					SelectObject(hdc,hOldPen);
+					DeleteObject(hPen);
+					rgb=GetSysColor(COLOR_GRAYTEXT);
+					pos2.x--;
+					pos2.y--;
+				}
+				else rgb=GetSysColor(COLOR_BTNTEXT);
+				hPen=CreatePen(PS_SOLID,0,rgb);
+				hOldPen=(HPEN)SelectObject(hdc,hPen);
+				i3=pos2.x+(size2.cx/2);
+				for(i2=3;i2>=0;i2--,i3--){
+					DrawLineInClient(WndNum,i3,i2+pos2.y+3,i3+((3-i2)*2)+1,i2+pos2.y+3);
+				}
+				SelectObject(hdc,hOldPen);
+				DeleteObject(hPen);
+			}
+		}
+		else if(pWindowInfo->pChildInfo[i].Control==CT_EDIT){
+			//////////////////////
+			// Edit コントロール
+
+			//内部
+			if(pWindowInfo->pChildInfo[i].style&WS_DISABLED||pWindowInfo->pChildInfo[i].style&ES_READONLY)
+				rgb=GetSysColor(COLOR_3DFACE);
+			else rgb=GetSysColor(COLOR_WINDOW);
+			DrawRectangleInClient(WndNum,
+				pos.x,pos.y,
+				pos.x+size.cx,pos.y+size.cy,
+				rgb,rgb,1);
+
+			//キャプション テキスト
+			rect.left=pos.x+1+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+			rect.top=pos.y+1+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+			rect.right=pos.x+size.cx-1+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+			rect.bottom=pos.y+size.cy-1+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+
+			if(pWindowInfo->pChildInfo[i].style&ES_MULTILINE) i4=0;
+			else i4=DT_SINGLELINE;
+
+			//ビットを考慮してES_LEFTを最後に検討する
+			if(pWindowInfo->pChildInfo[i].style&ES_CENTER) i2=DT_CENTER;
+			else if(pWindowInfo->pChildInfo[i].style&ES_RIGHT) i2=DT_RIGHT;
+			else i2=DT_LEFT;
+
+			//文字色を設定
+			if(pWindowInfo->pChildInfo[i].style&WS_DISABLED)
+				SetTextColor(hdc,GetSysColor(COLOR_GRAYTEXT));
+			else
+				SetTextColor(hdc,GetSysColor(COLOR_WINDOWTEXT));
+
+			hOldFont=(HFONT)SelectObject(hdc,hFont);
+			DrawText(hdc,pWindowInfo->pChildInfo[i].caption,-1,&rect,i4|i2);
+			SelectObject(hdc,hOldFont);
+		}
+
+		else if(pWindowInfo->pChildInfo[i].Control==CT_GROUPBOX){
+			///////////////////////////////////
+			// グループ ボックス コントロール
+
+			hOldFont=(HFONT)SelectObject(hdc,hFont);
+			GetTextExtentPoint32(hdc,pWindowInfo->pChildInfo[i].caption,lstrlen(pWindowInfo->pChildInfo[i].caption),&size2);
+
+			//枠を描画
+			rect.left=pos.x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+			rect.top=pos.y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y+(size2.cy/2);
+			rect.right=pos.x+size.cx+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+			rect.bottom=pos.y+size.cy+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+			DrawEdge(hdc,&rect,EDGE_ETCHED,BF_RECT);
+
+			//ビットを考慮してBS_CENTERを最初に検討する
+			if((pWindowInfo->pChildInfo[i].style&BS_CENTER)==BS_CENTER){
+				rect.left=pos.x+(size.cx/2)-(size2.cx/2)-3;
+				rect.right=rect.left+size2.cx+4;
+			}
+			else if(pWindowInfo->pChildInfo[i].style&BS_RIGHT){
+				rect.right=pos.x+size.cx-7;
+				rect.left=rect.right-size2.cx-4;
+			}
+			else{
+				rect.left=pos.x+7;
+				rect.right=rect.left+size2.cx+4;
+			}
+			rect.top=pos.y;
+			rect.bottom=pos.y+size2.cy;
+
+			if(pWindowInfo->bgColor==COLOR_3DFACE) rgb=GetSysColor(COLOR_3DFACE);
+			else rgb=-pWindowInfo->bgColor;
+			DrawRectangleInClient(WndNum,rect.left,rect.top,rect.right,rect.bottom,rgb,rgb,1);
+
+			if(!((pWindowInfo->pChildInfo[i].style&BS_ICON)||(pWindowInfo->pChildInfo[i].style&BS_BITMAP))){
+				rect.left+=MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+				rect.top+=MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+				rect.right+=MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+				rect.bottom+=MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+				rect.left+=2;
+				rect.right-=2;
+
+				//テキストを描画
+				if(pWindowInfo->pChildInfo[i].style&WS_DISABLED){
+					SetTextColor(hdc,RGB(255,255,255));
+					rc2.left=rect.left+1;
+					rc2.top=rect.top+1;
+					rc2.right=rect.right+1;
+					rc2.bottom=rect.bottom+1;
+					DrawText(hdc,pWindowInfo->pChildInfo[i].caption,-1,&rc2,DT_SINGLELINE);
+					SetTextColor(hdc,GetSysColor(COLOR_GRAYTEXT));
+				}
+				else
+					SetTextColor(hdc,GetSysColor(COLOR_BTNTEXT));
+
+				DrawText(hdc,pWindowInfo->pChildInfo[i].caption,-1,&rect,DT_SINGLELINE);
+			}
+			SelectObject(hdc,hOldFont);
+		}
+
+		else if(pWindowInfo->pChildInfo[i].Control==CT_HSCROLLBAR){
+			////////////////////////////////////
+			// 水平スクロールバー コントロール
+			DrawScrollBar(WndNum,pWindowInfo->pChildInfo[i].style,0,&pos,&size);
+		}
+
+		else if(pWindowInfo->pChildInfo[i].Control==CT_IMAGEBOX){
+			/////////////////////
+			// イメージ ボックス
+			HDC memdc;
+
+			if((pWindowInfo->pChildInfo[i].style&0x0000000F)==SS_BLACKFRAME)
+				DrawRectangleInClient(WndNum,pos.x,pos.y,pos.x+size.cx,pos.y+size.cy,RGB(0,0,0),0,0);
+			else if((pWindowInfo->pChildInfo[i].style&0x0000000F)==SS_GRAYFRAME)
+				DrawRectangleInClient(WndNum,pos.x,pos.y,pos.x+size.cx,pos.y+size.cy,GetSysColor(COLOR_3DSHADOW),0,0);
+			else if((pWindowInfo->pChildInfo[i].style&0x0000000F)==SS_WHITEFRAME)
+				DrawRectangleInClient(WndNum,pos.x,pos.y,pos.x+size.cx,pos.y+size.cy,RGB(255,255,255),0,0);
+			else if((pWindowInfo->pChildInfo[i].style&0x0000001F)==SS_ETCHEDFRAME){
+				rect.left=pos.x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+				rect.top=pos.y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+				rect.right=pos.x+size.cx+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+				rect.bottom=pos.y+size.cy+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+				DrawEdge(hdc,&rect,EDGE_ETCHED,BF_RECT);
+			}
+			else if((pWindowInfo->pChildInfo[i].style&0x0000000F)==SS_BLACKRECT)
+				DrawRectangleInClient(WndNum,pos.x,pos.y,pos.x+size.cx,pos.y+size.cy,GetSysColor(COLOR_3DDKSHADOW),GetSysColor(COLOR_3DDKSHADOW),1);
+			else if((pWindowInfo->pChildInfo[i].style&0x0000000F)==SS_GRAYRECT)
+				DrawRectangleInClient(WndNum,pos.x,pos.y,pos.x+size.cx,pos.y+size.cy,GetSysColor(COLOR_3DSHADOW),GetSysColor(COLOR_3DSHADOW),1);
+			else if((pWindowInfo->pChildInfo[i].style&0x0000000F)==SS_WHITERECT)
+				DrawRectangleInClient(WndNum,pos.x,pos.y,pos.x+size.cx,pos.y+size.cy,RGB(255,255,255),RGB(255,255,255),1);
+			else if((pWindowInfo->pChildInfo[i].style&0x0000000F)==SS_ICON){
+				if(pWindowInfo->pChildInfo[i].ImageCtrlInfo.type==IMGTYPE_FILE)
+					lstrcpy(temporary,pWindowInfo->pChildInfo[i].ImageCtrlInfo.path);
+				else{
+					for(i2=0;i2<ProjectInfo.res.NumberOfIconRes;i2++){
+						if(lstrcmp(pWindowInfo->pChildInfo[i].ImageCtrlInfo.path,
+							ProjectInfo.res.pIconResInfo[i2].IdName)==0) break;
+					}
+					if(i2==ProjectInfo.res.NumberOfIconRes) goto NonIconImage;
+
+					lstrcpy(temporary,ProjectInfo.res.pIconResInfo[i2].path);
+				}
+				GetFullPath(temporary,ProjectInfo.dir);
+				hImage=LoadImage(NULL,temporary,IMAGE_ICON,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE);
+				if(hImage){
+					pWindowInfo->pChildInfo[i].size.cx=32+(pWindowInfo->pChildInfo[i].size.cx-size.cx);
+					pWindowInfo->pChildInfo[i].size.cy=32+(pWindowInfo->pChildInfo[i].size.cy-size.cy);
+					pos=pWindowInfo->pChildInfo[i].pos;
+					size=pWindowInfo->pChildInfo[i].size;
+
+					//ExStyleによる縁を再描画
+					DrawItemEdgeByExStyle(WndNum,pWindowInfo->pChildInfo[i].ExStyle,&pos,&size);
+
+					DrawIcon(hdc,
+						pos.x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x,
+						pos.y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y,
+						(HICON)hImage);
+					DestroyIcon((HICON)hImage);
+				}
+				else{
+NonIconImage:
+					DrawRectangleInClient(WndNum,pos.x,pos.y,pos.x+size.cx,pos.y+size.cy,RGB(0,0,0),0,0);
+					hOldFont=(HFONT)SelectObject(hdc,hFont);
+					rect.left=pos.x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+					rect.top=pos.y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+					rect.right=pos.x+size.cx+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+					rect.bottom=pos.y+size.cy+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+					SetTextColor(hdc,GetSysColor(COLOR_WINDOWTEXT));
+					DrawText(hdc,"icon...",-1,&rect,DT_SINGLELINE|DT_CENTER|DT_VCENTER);
+					SelectObject(hdc,hOldFont);
+				}
+			}
+			else if((pWindowInfo->pChildInfo[i].style&0x0000000F)==SS_BITMAP){
+				BITMAP Bitmap;
+
+				if(pWindowInfo->pChildInfo[i].ImageCtrlInfo.type==IMGTYPE_FILE)
+					lstrcpy(temporary,pWindowInfo->pChildInfo[i].ImageCtrlInfo.path);
+				else{
+					for(i2=0;i2<ProjectInfo.res.NumberOfBitmapRes;i2++){
+						if(lstrcmp(pWindowInfo->pChildInfo[i].ImageCtrlInfo.path,
+							ProjectInfo.res.pBitmapResInfo[i2].IdName)==0) break;
+					}
+					if(i2==ProjectInfo.res.NumberOfBitmapRes) goto NonBitmapImage;
+
+					lstrcpy(temporary,ProjectInfo.res.pBitmapResInfo[i2].path);
+				}
+				GetFullPath(temporary,ProjectInfo.dir);
+				hImage=LoadImage(NULL,temporary,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE);
+				if(hImage){
+					GetObject(hImage,sizeof(BITMAP),&Bitmap);
+
+					pWindowInfo->pChildInfo[i].size.cx=Bitmap.bmWidth+(pWindowInfo->pChildInfo[i].size.cx-size.cx);
+					pWindowInfo->pChildInfo[i].size.cy=Bitmap.bmHeight+(pWindowInfo->pChildInfo[i].size.cy-size.cy);
+					pos=pWindowInfo->pChildInfo[i].pos;
+					size=pWindowInfo->pChildInfo[i].size;
+
+					//ExStyleによる縁を再描画
+					DrawItemEdgeByExStyle(WndNum,pWindowInfo->pChildInfo[i].ExStyle,&pos,&size);
+
+					memdc=CreateCompatibleDC(hdc);
+					SelectObject(memdc,hImage);
+					BitBlt(hdc,
+						pos.x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x,
+						pos.y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y,
+						size.cx, size.cy,
+						memdc, 0,0,
+						SRCCOPY);
+					DeleteDC(memdc);
+					DeleteObject(hImage);
+				}
+				else{
+NonBitmapImage:
+					DrawRectangleInClient(WndNum,pos.x,pos.y,pos.x+size.cx,pos.y+size.cy,RGB(0,0,0),0,0);
+					hOldFont=(HFONT)SelectObject(hdc,hFont);
+					rect.left=pos.x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+					rect.top=pos.y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+					rect.right=pos.x+size.cx+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+					rect.bottom=pos.y+size.cy+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+					SetTextColor(hdc,GetSysColor(COLOR_WINDOWTEXT));
+					DrawText(hdc,"bmp...",-1,&rect,DT_SINGLELINE|DT_CENTER|DT_VCENTER);
+					SelectObject(hdc,hOldFont);
+				}
+			}
+		}
+
+		else if(pWindowInfo->pChildInfo[i].Control==CT_LISTBOX){
+			/////////////////////////
+			// ListBox コントロール
+
+			//内部
+			if(pWindowInfo->pChildInfo[i].style&WS_DISABLED)
+				rgb=GetSysColor(COLOR_3DFACE);
+			else rgb=GetSysColor(COLOR_WINDOW);
+			DrawRectangleInClient(WndNum,
+				pos.x,pos.y,
+				pos.x+size.cx,pos.y+size.cy,
+				rgb,rgb,1);
+
+			if(pWindowInfo->pChildInfo[i].style&LBS_DISABLENOSCROLL)
+				DrawWindowScrollBar(WndNum,pWindowInfo->pChildInfo[i].style|WS_DISABLED,&pos,&size);
+		}
+
+		else if(pWindowInfo->pChildInfo[i].Control==CT_LISTVIEW){
+			//////////////////////////
+			// ListView コントロール
+
+			//内部
+			if(pWindowInfo->pChildInfo[i].style&WS_DISABLED)
+				rgb=GetSysColor(COLOR_3DFACE);
+			else rgb=GetSysColor(COLOR_WINDOW);
+			DrawRectangleInClient(WndNum,
+				pos.x,pos.y,
+				pos.x+size.cx,pos.y+size.cy,
+				rgb,rgb,1);
+
+			if((pWindowInfo->pChildInfo[i].style&LVS_REPORT)&&
+				(!((pWindowInfo->pChildInfo[i].style&LVS_LIST)==LVS_LIST))){
+				//レポート ビュー
+				size.cy=16;
+				DrawButtonEdge(WndNum,&pos,&size);
+			}
+		}
+
+		else if(pWindowInfo->pChildInfo[i].Control==CT_PROGRESSBAR){
+			/////////////////////////////
+			// ProgressBar コントロール
+
+			//内部
+			pos.x++;
+			pos.y++;
+			size.cx-=2;
+			size.cy-=2;
+			rgb=GetSysColor(COLOR_ACTIVECAPTION);
+			if(pWindowInfo->pChildInfo[i].style&PBS_SMOOTH){
+				if(pWindowInfo->pChildInfo[i].style&PBS_VERTICAL){
+					pos.y+=(long)((double)size.cy*0.3);
+					DrawRectangleInClient(WndNum,
+						pos.x,pos.y,
+						pos.x+size.cx,pos.y+(long)((double)size.cy*0.7),
+						rgb,rgb,1);
+				}
+				else{
+					DrawRectangleInClient(WndNum,
+						pos.x,pos.y,
+						pos.x+(long)((double)size.cx*0.7),pos.y+size.cy,
+						rgb,rgb,1);
+				}
+			}
+			else{
+				if(pWindowInfo->pChildInfo[i].style&PBS_VERTICAL){
+					pos.y+=(long)((double)size.cy*0.3);
+					i3=(size.cx*2)/3;
+					i2=(int)((double)size.cy*0.7);
+					for(;i2>i3;i2-=i3+2){
+						DrawRectangleInClient(WndNum,
+							pos.x,pos.y+i2-i3,
+							pos.x+size.cx,pos.y+i2,
+							rgb,rgb,1);
+					}
+				}
+				else{
+					i3=(size.cy*2)/3;
+					i4=(int)((double)size.cx*0.7);
+					for(i2=0;i2+i3<i4;i2+=i3+2){
+						DrawRectangleInClient(WndNum,
+							pos.x+i2,pos.y,
+							pos.x+i2+i3,pos.y+size.cy,
+							rgb,rgb,1);
+					}
+				}
+			}
+		}
+
+		else if(pWindowInfo->pChildInfo[i].Control==CT_RADIOBUTTON){
+			/////////////////////////////
+			// RadioButton コントロール
+
+			if(pWindowInfo->pChildInfo[i].style&BS_PUSHLIKE){
+				//ボタンの縁を描画
+				DrawButtonEdge(WndNum,&pos,&size);
+			}
+			else{
+				//ラジオボタンを描画
+				size2.cx=12;
+				size2.cy=12;
+				if(pWindowInfo->pChildInfo[i].style&BS_LEFTTEXT)
+					pos2.x=pos.x+size.cx-size2.cx;
+				else pos2.x=pos.x+1;
+				if((pWindowInfo->pChildInfo[i].style&BS_VCENTER)==BS_VCENTER||
+					(pWindowInfo->pChildInfo[i].style&BS_VCENTER)==0)
+					pos2.y=pos.y+(size.cy/2)-(size2.cy/2);
+				else if(pWindowInfo->pChildInfo[i].style&BS_TOP)
+					pos2.y=pos.y+1;
+				else if(pWindowInfo->pChildInfo[i].style&BS_BOTTOM)
+					pos2.y=pos.y+size.cy-size2.cy-1;
+
+				hResource=LoadResource(hResInst,FindResource(hResInst,MAKEINTRESOURCE(IDB_RADIOBUTTON),RT_BITMAP));
+				pBitmapInfo=(BITMAPINFO *)LockResource(hResource);
+				pByte=(BYTE *)pBitmapInfo+pBitmapInfo->bmiHeader.biSize;
+				pByte2=(BYTE *)GlobalAlloc(GMEM_FIXED,pBitmapInfo->bmiHeader.biWidth*pBitmapInfo->bmiHeader.biHeight*3);
+				for(i2=0,i3=0;i2<pBitmapInfo->bmiHeader.biWidth*pBitmapInfo->bmiHeader.biHeight;i2++,i3+=3){
+					rgb=RGB(pByte[i3+2],pByte[i3+1],pByte[i3]);
+
+					if(rgb==RGB(255,255,0)){
+						if(pWindowInfo->bgColor==COLOR_3DFACE) rgb=GetSysColor(COLOR_3DFACE);
+						else rgb=-pWindowInfo->bgColor;
+					}
+
+					//影側
+					else if(rgb==RGB(0,0,0)) rgb=GetSysColor(COLOR_3DSHADOW);
+					else if(rgb==RGB(255,0,0)) rgb=GetSysColor(COLOR_3DDKSHADOW);
+
+					//光源側
+					else if(rgb==RGB(0,0,255)) rgb=GetSysColor(COLOR_3DLIGHT);
+					else if(rgb==RGB(0,255,0)) rgb=GetSysColor(COLOR_3DHIGHLIGHT);
+
+					//内部
+					else if(rgb==RGB(255,255,255)){
+						if(pWindowInfo->pChildInfo[i].style&WS_DISABLED) rgb=GetSysColor(COLOR_3DFACE);
+					}
+
+					pByte2[i3+2]=LOBYTE(LOWORD(rgb));
+					pByte2[i3+1]=HIBYTE(LOWORD(rgb));
+					pByte2[i3]=LOBYTE(HIWORD(rgb));
+				}
+				SetDIBitsToDevice(hdc,
+					pos2.x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x,
+					pos2.y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y,
+					pBitmapInfo->bmiHeader.biWidth, pBitmapInfo->bmiHeader.biHeight,
+					0,0,
+					0,pBitmapInfo->bmiHeader.biHeight,
+					pByte2,
+					pBitmapInfo,
+					DIB_RGB_COLORS);
+				GlobalFree(pByte2);
+
+				if(!(pWindowInfo->pChildInfo[i].style&BS_LEFTTEXT)) pos.x+=17;
+				else pos.x++;
+				size.cx-=17;
+			}
+
+			if(!(pWindowInfo->pChildInfo[i].style&(BS_ICON|BS_BITMAP))){
+				//キャプション テキスト
+				rect.left=pos.x+1+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+				rect.top=pos.y+1+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+				rect.right=pos.x+size.cx-2+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+				rect.bottom=pos.y+size.cy-2+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+
+				if(pWindowInfo->pChildInfo[i].style&BS_MULTILINE) i4=0;
+				else i4=DT_SINGLELINE;
+
+				//ビットを考慮してBS_CENTERを最初に比較する
+				if((pWindowInfo->pChildInfo[i].style&BS_CENTER)==BS_CENTER) i2=DT_CENTER;
+				else if(pWindowInfo->pChildInfo[i].style&BS_LEFT) i2=DT_LEFT;
+				else if(pWindowInfo->pChildInfo[i].style&BS_RIGHT) i2=DT_RIGHT;
+				else i2=DT_LEFT;
+
+				//ビットを考慮してBS_VCENTERを最初に比較する
+				if((pWindowInfo->pChildInfo[i].style&BS_VCENTER)==BS_VCENTER) i3=DT_VCENTER;
+				else if(pWindowInfo->pChildInfo[i].style&BS_TOP) i3=DT_TOP;
+				else if(pWindowInfo->pChildInfo[i].style&BS_BOTTOM) i3=DT_BOTTOM;
+				else i3=DT_VCENTER;
+
+				hOldFont=(HFONT)SelectObject(hdc,hFont);
+				if(pWindowInfo->pChildInfo[i].style&WS_DISABLED){
+					SetTextColor(hdc,RGB(255,255,255));
+					rc2.left=rect.left+1;
+					rc2.top=rect.top+1;
+					rc2.right=rect.right+1;
+					rc2.bottom=rect.bottom+1;
+					DrawText(hdc,pWindowInfo->pChildInfo[i].caption,-1,&rc2,i4|i2|i3);
+					SetTextColor(hdc,GetSysColor(COLOR_GRAYTEXT));
+				}
+				else SetTextColor(hdc,GetSysColor(COLOR_BTNTEXT));
+
+				DrawText(hdc,pWindowInfo->pChildInfo[i].caption,-1,&rect,i4|i2|i3);
+				SelectObject(hdc,hOldFont);
+			}
+		}
+
+		else if(pWindowInfo->pChildInfo[i].Control==CT_STATIC){
+			////////////////////////
+			// Static コントロール
+
+			//キャプション テキスト
+			rect.left=pos.x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+			rect.top=pos.y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+			rect.right=pos.x+size.cx+MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+			rect.bottom=pos.y+size.cy+MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+
+			//ビットを考慮してSS_LEFTを最後に検討する
+			if(pWindowInfo->pChildInfo[i].style&SS_CENTER) i2=DT_CENTER;
+			else if(pWindowInfo->pChildInfo[i].style&SS_RIGHT) i2=DT_RIGHT;
+			else i2=DT_LEFT;
+
+			hOldFont=(HFONT)SelectObject(hdc,hFont);
+			if(pWindowInfo->pChildInfo[i].style&WS_DISABLED){
+				SetTextColor(hdc,RGB(255,255,255));
+				rc2.left=rect.left+1;
+				rc2.top=rect.top+1;
+				rc2.right=rect.right+1;
+				rc2.bottom=rect.bottom+1;
+				DrawText(hdc,pWindowInfo->pChildInfo[i].caption,-1,&rc2,i2);
+				SetTextColor(hdc,GetSysColor(COLOR_GRAYTEXT));
+			}
+			else
+				SetTextColor(hdc,GetSysColor(COLOR_BTNTEXT));
+
+			//折り返すかどうか
+			if(!(pWindowInfo->pChildInfo[i].style&SS_LEFTNOWORDWRAP)){
+				i2|=DT_WORDBREAK;
+			}
+
+			DrawText(hdc,pWindowInfo->pChildInfo[i].caption,-1,&rect,i2);
+			SelectObject(hdc,hOldFont);
+		}
+
+		else if(pWindowInfo->pChildInfo[i].Control==CT_TRACKBAR){
+			//////////////////////////
+			// TrackBar コントロール
+
+			if(pWindowInfo->pChildInfo[i].style&TBS_VERT){
+				pos.x+=2;
+				size.cx-=2;
+				if(size.cx>21) size.cx=21;
+				pos.y+=8;
+				size.cy-=16;
+
+				rect.left=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pos.x+(size.cx/2)-2;
+				rect.right=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pos.x+(size.cx/2)+2;
+				rect.top=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pos.y;
+				rect.bottom=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pos.y+size.cy;
+				DrawEdge(hdc,&rect,EDGE_SUNKEN,BF_RECT);
+
+				size.cy=size.cx/2;
+				DrawButtonEdge(WndNum,&pos,&size);
+			}
+			else{
+				pos.x+=8;
+				size.cx-=16;
+				pos.y+=2;
+				size.cy-=2;
+				if(size.cy>21) size.cy=21;
+
+				rect.left=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pos.x;
+				rect.right=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+pos.x+size.cx;
+				rect.top=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pos.y+(size.cy/2)-2;
+				rect.bottom=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+pos.y+(size.cy/2)+2;
+				DrawEdge(hdc,&rect,EDGE_SUNKEN,BF_RECT);
+
+				size.cx=size.cy/2;
+				DrawButtonEdge(WndNum,&pos,&size);
+			}
+		}
+
+		else if(pWindowInfo->pChildInfo[i].Control==CT_TREEVIEW){
+			//////////////////////////
+			// TreeView コントロール
+
+			//内部
+			if(pWindowInfo->pChildInfo[i].style&WS_DISABLED)
+				rgb=GetSysColor(COLOR_3DFACE);
+			else rgb=GetSysColor(COLOR_WINDOW);
+			DrawRectangleInClient(WndNum,
+				pos.x,pos.y,
+				pos.x+size.cx,pos.y+size.cy,
+				rgb,rgb,1);
+		}
+
+		else if(pWindowInfo->pChildInfo[i].Control==CT_UPDOWN){
+			///////////////////////////////
+			// アップ ダウン コントロール
+			if(pWindowInfo->pChildInfo[i].style&UDS_HORZ)
+				DrawUpDownControl(WndNum,pWindowInfo->pChildInfo[i].style,0,&pos,&size);
+			else DrawUpDownControl(WndNum,pWindowInfo->pChildInfo[i].style,1,&pos,&size);
+		}
+
+		else if(pWindowInfo->pChildInfo[i].Control==CT_VSCROLLBAR){
+			////////////////////////////////////
+			// 垂直スクロールバー コントロール
+			DrawScrollBar(WndNum,pWindowInfo->pChildInfo[i].style,1,&pos,&size);
+		}
+	}
+	DeleteObject(hFont);
+}
+void DrawRadWindow(int WndNum,WINDOW_INFO *pWindowInfo){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HBRUSH hOldBrush;
+	POINT pos;
+
+	SetBkMode(MdiInfo[WndNum].MdiRadInfo->hMemDC,TRANSPARENT);
+
+	hOldBrush=(HBRUSH)SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,GetStockObject(WHITE_BRUSH));
+	PatBlt(MdiInfo[WndNum].MdiRadInfo->hMemDC,0,0,ScreenX*2,ScreenY*2,PATCOPY);
+	SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,hOldBrush);
+
+	pos.x=LEVER_THICK;
+	pos.y=LEVER_THICK;
+	DesigningWindow(WndNum,MdiInfo[WndNum].MdiRadInfo->hMemDC,&pos,pWindowInfo);
+
+	InvalidateRect(MdiInfo[WndNum].MdiRadInfo->hRad,NULL,0);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/EndPairCommandComplement.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/EndPairCommandComplement.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/EndPairCommandComplement.cpp	(revision 178)
@@ -0,0 +1,457 @@
+#include "common.h"
+
+///////////////////////////////////////////////////////////////////
+// ここから、ペアステートメント補完を行うための関数郡
+///////////////////////////////////////////////////////////////////
+
+int GetStartCommandId_FromBuffer(char *buffer){
+	int i;
+	char temporary[VN_SIZE];
+
+	for(i=0;;i++){
+		if(!IsVariableChar(buffer[i])){
+			temporary[i]=0;
+			break;
+		}
+		temporary[i]=buffer[i];
+	}
+
+	if(lstrcmpi(temporary,"If")==0){
+		//If文の場合はブロック形式の有無を判定
+
+		int IsStr=0;
+		for(;;i++){
+			if(buffer[i]=='\"') IsStr^=1;
+			if((buffer[i]=='\''||IsCommandDelimitation(buffer,i))&&IsStr==0){
+				i--;
+				break;
+			}
+		}
+
+		while(buffer[i]==' '||buffer[i]=='\t') i--;
+
+		if(memicmp(buffer+i-3,"Then",4)==0){
+			//ブロック形式のIf
+			return COM_IF;
+		}
+		else{
+			//一行のみのIf
+			return 0;
+		}
+	}
+
+	if(lstrcmpi(temporary,"Virtual")==0||
+		lstrcmpi(temporary,"Override")==0||
+		lstrcmpi(temporary,"Static")==0){
+		if(temporary[0]=='s'||temporary[0]=='S')
+			i=7;
+		else if(temporary[0]=='v'||temporary[0]=='V')
+			i=8;
+		else i=9;
+
+		while(buffer[i]==' '||buffer[i]=='\t') i++;
+
+		int i2;
+		for(i2=0;;i++,i2++){
+			if(!IsVariableChar(buffer[i])){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=buffer[i];
+		}
+
+		if(lstrcmpi(temporary,"Function")==0) return COM_FUNCTION;
+		if(lstrcmpi(temporary,"Sub")==0) return COM_SUB;
+		return 0;
+	}
+
+	if(lstrcmpi(temporary,"Class")==0) return COM_CLASS;
+	if(lstrcmpi(temporary,"Interface")==0) return COM_INTERFACE;
+	if(lstrcmpi(temporary,"Do")==0) return COM_DO;
+	if(lstrcmpi(temporary,"Enum")==0) return COM_ENUM;
+	if(lstrcmpi(temporary,"For")==0) return COM_FOR;
+	if(lstrcmpi(temporary,"Function")==0) return COM_FUNCTION;
+	if(lstrcmpi(temporary,"Namespace")==0) return COM_NAMESPACE;
+	if(lstrcmpi(temporary,"Select")==0) return COM_SELECT;
+	if(lstrcmpi(temporary,"Sub")==0) return COM_SUB;
+	if(lstrcmpi(temporary,"Type")==0) return COM_TYPE;
+	if(lstrcmpi(temporary,"While")==0) return COM_WHILE;
+	if(lstrcmpi(temporary,"With")==0) return COM_WITH;
+
+	return 0;
+}
+int GetEndCommandId_FromBuffer(char *buffer){
+	int i,i2;
+	char temporary[VN_SIZE];
+
+	for(i=0,i2=0;;i++,i2++){
+		if(!IsVariableChar(buffer[i])){
+			temporary[i2]=0;
+
+			if(lstrcmpi(temporary,"End")==0&&
+				(buffer[i]==' '||buffer[i]=='\t')){
+				while(buffer[i]==' '||buffer[i]=='\t') i++;
+				i--;
+				i2--;
+				continue;
+			}
+
+			break;
+		}
+		temporary[i2]=buffer[i];
+	}
+
+	if(lstrcmpi(temporary,"EndClass")==0) return COM_CLASS;
+	if(lstrcmpi(temporary,"EndInterface")==0) return COM_INTERFACE;
+	if(lstrcmpi(temporary,"Loop")==0) return COM_DO;
+	if(lstrcmpi(temporary,"EndEnum")==0) return COM_ENUM;
+	if(lstrcmpi(temporary,"Next")==0) return COM_FOR;
+	if(lstrcmpi(temporary,"EndFunction")==0) return COM_FUNCTION;
+	if(lstrcmpi(temporary,"EndIf")==0) return COM_IF;
+	if(lstrcmpi(temporary,"EndNamespace")==0) return COM_NAMESPACE;
+	if(lstrcmpi(temporary,"EndSelect")==0) return COM_SELECT;
+	if(lstrcmpi(temporary,"EndSub")==0) return COM_SUB;
+	if(lstrcmpi(temporary,"EndType")==0) return COM_TYPE;
+	if(lstrcmpi(temporary,"Wend")==0) return COM_WHILE;
+	if(lstrcmpi(temporary,"EndWith")==0) return COM_WITH;
+
+	return 0;
+}
+void GetNameOfEndCommand(int CmdId,char *buffer){
+	switch(CmdId){
+		case COM_CLASS:
+			lstrcpy(buffer,"End Class");
+			break;
+		case COM_INTERFACE:
+			lstrcpy(buffer,"End Interface");
+			break;
+		case COM_DO:
+			lstrcpy(buffer,"Loop");
+			break;
+		case COM_ENUM:
+			lstrcpy(buffer,"End Enum");
+			break;
+		case COM_FOR:
+			lstrcpy(buffer,"Next");
+			break;
+		case COM_FUNCTION:
+			lstrcpy(buffer,"End Function");
+			break;
+		case COM_IF:
+			lstrcpy(buffer,"End If");
+			break;
+		case COM_NAMESPACE:
+			lstrcpy(buffer,"End Namespace");
+			break;
+		case COM_SELECT:
+			lstrcpy(buffer,"End Select");
+			break;
+		case COM_SUB:
+			lstrcpy(buffer,"End Sub");
+			break;
+		case COM_TYPE:
+			lstrcpy(buffer,"End Type");
+			break;
+		case COM_WHILE:
+			lstrcpy(buffer,"Wend");
+			break;
+		case COM_WITH:
+			lstrcpy(buffer,"End With");
+			break;
+	}
+}
+BOOL IsIntoStringQuotes(char *buffer,int i){
+	int i2;
+
+	i2=i;
+	while(i2&&buffer[i2]!='\n') i2--;
+	if(i2==-1) i2=0;
+	if(buffer[i2]=='\n') i2++;
+
+	int IsStr=0;
+	for(;i2<i;i2++){
+		if(buffer[i2]=='\"') IsStr^=1;
+	}
+	return IsStr;
+}
+BOOL GetEndPairCommandInfo(char *buffer,int p){
+	int i,i2,i3,CmdId;
+	char epcName[32];
+	char indent[255],LineNum;
+
+	int stack[255];
+	int sp;
+
+	CmdId=0;
+	LineNum=0;
+	sp=-1;
+
+	i=p;
+
+	//入力中の行を除く
+	for(i--;i>=0;i--){
+		i2=IsCommandDelimitation(buffer,i);
+		if(i2) break;
+	}
+
+	while(1){
+
+		//i2に一行前の先頭位置を格納
+		for(i--;i>=0;i--){
+			i2=IsCommandDelimitation(buffer,i);
+			if(i2){
+				if(IsIntoStringQuotes(buffer,i)){
+					//文字列中の場合
+					continue;
+				}
+
+				if(i2==1) i2=i+1;
+				else{
+					i2=i+2;
+					LineNum++;
+
+					if(LineNum>pobj_nv->BackNum_PairStatementComplement){
+						//設定された行数を超えた場合
+						return 0;
+					}
+				}
+
+				break;
+			}
+		}
+		if(i==-1) i2=i+1;
+
+		//インデント文字列をindentにコピー
+		for(i3=0;;i2++,i3++){
+			if(buffer[i2]!='\t'){
+				indent[i3]=0;
+				break;
+			}
+			indent[i3]=buffer[i2];
+		}
+
+		//空白文字を飛び越す
+		while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+
+		//終了コマンドを取得（End Class、End Sub、Next、Wendなど…）
+		i3=GetEndCommandId_FromBuffer(buffer+i2);
+		if(i3){
+			sp++;
+			stack[sp]=i3;
+		}
+
+		//開始コマンドを取得（Class、Sub、For、Whileなど…）
+		i3=GetStartCommandId_FromBuffer(buffer+i2);
+		if(i3){
+			if(sp==-1){
+				CmdId=i3;
+				break;
+			}
+
+			if(stack[sp]!=i3) return 0;
+			sp--;
+		}
+
+		if(i<=0) break;
+	}
+
+	if(!CmdId) return 0;
+
+	extern HANDLE hHeap;
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+	if(CmdId==COM_IF){
+		//Else、ElseIf、End Ifをリストに追加
+
+		///////////////////////
+		// 補完情報
+		///////////////////////
+
+		ComplementWndInfo.pMemberInfo=(MEMBERINFO *)HeapAlloc(hHeap,0,sizeof(MEMBERINFO)*2);
+		ComplementWndInfo.MemberNum=2;
+
+		ComplementWndInfo.pMemberInfo[0].pName=(char *)HeapAlloc(hHeap,0,5);
+		lstrcpy(ComplementWndInfo.pMemberInfo[0].pName,"Else");
+		ComplementWndInfo.pMemberInfo[0].dwProc=0;
+		ComplementWndInfo.pMemberInfo[0].dwAccess=ACCESS_PAIRCOMMAND;
+
+		ComplementWndInfo.pMemberInfo[1].pName=(char *)HeapAlloc(hHeap,0,7);
+		lstrcpy(ComplementWndInfo.pMemberInfo[1].pName,"End If");
+		ComplementWndInfo.pMemberInfo[1].dwProc=0;
+		ComplementWndInfo.pMemberInfo[1].dwAccess=ACCESS_PAIRCOMMAND;
+	}
+	else if(CmdId==COM_CLASS){
+		ComplementWndInfo.pMemberInfo=(MEMBERINFO *)HeapAlloc(hHeap,0,sizeof(MEMBERINFO)*4);
+		ComplementWndInfo.MemberNum=4;
+
+		ComplementWndInfo.pMemberInfo[0].pName=(char *)HeapAlloc(hHeap,0,10);
+		lstrcpy(ComplementWndInfo.pMemberInfo[0].pName,"End Class");
+		ComplementWndInfo.pMemberInfo[0].dwProc=0;
+		ComplementWndInfo.pMemberInfo[0].dwAccess=ACCESS_PAIRCOMMAND;
+
+		ComplementWndInfo.pMemberInfo[1].pName=(char *)HeapAlloc(hHeap,0,8);
+		lstrcpy(ComplementWndInfo.pMemberInfo[1].pName,"Private");
+		ComplementWndInfo.pMemberInfo[1].dwProc=0;
+		ComplementWndInfo.pMemberInfo[1].dwAccess=ACCESS_PAIRCOMMAND;
+
+		ComplementWndInfo.pMemberInfo[2].pName=(char *)HeapAlloc(hHeap,0,10);
+		lstrcpy(ComplementWndInfo.pMemberInfo[2].pName,"Protected");
+		ComplementWndInfo.pMemberInfo[2].dwProc=0;
+		ComplementWndInfo.pMemberInfo[2].dwAccess=ACCESS_PAIRCOMMAND;
+
+		ComplementWndInfo.pMemberInfo[3].pName=(char *)HeapAlloc(hHeap,0,7);
+		lstrcpy(ComplementWndInfo.pMemberInfo[3].pName,"Public");
+		ComplementWndInfo.pMemberInfo[3].dwProc=0;
+		ComplementWndInfo.pMemberInfo[3].dwAccess=ACCESS_PAIRCOMMAND;
+	}
+	else if(CmdId==COM_SELECT){
+		ComplementWndInfo.pMemberInfo=(MEMBERINFO *)HeapAlloc(hHeap,0,sizeof(MEMBERINFO)*4);
+		ComplementWndInfo.MemberNum=2;
+
+		ComplementWndInfo.pMemberInfo[0].pName=(char *)HeapAlloc(hHeap,0,10);
+		lstrcpy(ComplementWndInfo.pMemberInfo[0].pName,"End Select");
+		ComplementWndInfo.pMemberInfo[0].dwProc=0;
+		ComplementWndInfo.pMemberInfo[0].dwAccess=ACCESS_PAIRCOMMAND;
+
+		ComplementWndInfo.pMemberInfo[1].pName=(char *)HeapAlloc(hHeap,0,8);
+		lstrcpy(ComplementWndInfo.pMemberInfo[1].pName,"Case");
+		ComplementWndInfo.pMemberInfo[1].dwProc=0;
+		ComplementWndInfo.pMemberInfo[1].dwAccess=ACCESS_PAIRCOMMAND;
+	}
+	else{
+		//その他のコマンド
+
+		//エンドペアステートメントの名前を取得
+		GetNameOfEndCommand(CmdId,epcName);
+
+
+		///////////////////////
+		// 補完情報
+		///////////////////////
+
+		ComplementWndInfo.pMemberInfo=(MEMBERINFO *)HeapAlloc(hHeap,0,sizeof(MEMBERINFO));
+		ComplementWndInfo.MemberNum=1;
+
+		ComplementWndInfo.pMemberInfo[0].pName=(char *)HeapAlloc(hHeap,0,lstrlen(epcName)+1);
+		lstrcpy(ComplementWndInfo.pMemberInfo[0].pName,epcName);
+
+		ComplementWndInfo.pMemberInfo[0].dwProc=0;
+		ComplementWndInfo.pMemberInfo[0].dwAccess=ACCESS_PAIRCOMMAND;
+	}
+	lstrcpy(ComplementWndInfo.szIndent,indent);
+
+
+	return 1;
+}
+BOOL IsNeedNewIndentCommand(char *name){
+	if(lstrcmpi(name,"Case")==0) return 1;
+	return 0;
+}
+
+
+
+///////////////////////////////////////////////
+// Withで構成されるオブジェクト識別子を取得
+///////////////////////////////////////////////
+
+void GetWithObjectVariable(char *buffer,int p,char *pObjectVar){
+	int i,i2,i3,i4,CmdId;
+	char LineNum;
+	char temporary[VN_SIZE];
+
+	int stack[255];
+	int sp;
+
+	CmdId=0;
+	LineNum=0;
+	sp=-1;
+	pObjectVar[0]=0;
+
+	i=p;
+
+	//入力中の行を除く
+	for(i--;i>=0;i--){
+		i2=IsCommandDelimitation(buffer,i);
+		if(i2) break;
+	}
+
+	while(1){
+
+		//i2に一行前の先頭位置を格納
+		for(i--;i>=0;i--){
+			i2=IsCommandDelimitation(buffer,i);
+			if(i2){
+				if(i2==1) i2=i+1;
+				else{
+					i2=i+2;
+					LineNum++;
+
+					if(LineNum>pobj_nv->BackNum_PairStatementComplement){
+						//設定された行数を超えた場合
+						return;
+					}
+				}
+
+				break;
+			}
+		}
+		if(i==-1) i2=i+1;
+
+		//インデントを飛び越す
+		while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+
+		//終了コマンドを取得（End Class、End Sub、Next、Wendなど…）
+		CmdId=GetEndCommandId_FromBuffer(buffer+i2);
+		if(CmdId){
+			sp++;
+			stack[sp]=CmdId;
+		}
+
+		//開始コマンドを取得（Class、Sub、For、Whileなど…）
+		CmdId=GetStartCommandId_FromBuffer(buffer+i2);
+		if(CmdId){
+			if(sp==-1){
+				if(CmdId==COM_WITH){
+					//オブジェクト識別子を付加
+					i2+=5;
+					while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+
+					for(i3=0;;i2++,i3++){
+						if(buffer[i2]=='-'&&buffer[i2+1]=='>'){
+							temporary[i3++]=buffer[i2++];
+							temporary[i3]=buffer[i2];
+							continue;
+						}
+						if(buffer[i2]=='['){
+							i4=GetStringInBracket(temporary+i3,buffer+i2);
+							i2+=i4-1;
+							i3+=i4-1;
+							continue;
+						}
+						if(buffer[i2]=='('){
+							i4=GetStringInPare(temporary+i3,buffer+i2);
+							i2+=i4-1;
+							i3+=i4-1;
+							continue;
+						}
+						if(!(IsVariableChar(buffer[i2])||buffer[i2]=='.')){
+							temporary[i3]=0;
+							break;
+						}
+						temporary[i3]=buffer[i2];
+					}
+					lstrcat(temporary,pObjectVar);
+					lstrcpy(pObjectVar,temporary);
+				}
+			}
+			else{
+				if(stack[sp]!=CmdId){
+					pObjectVar[0]=0;
+					break;
+				}
+				sp--;
+			}
+		}
+
+		if(i<=0) break;
+	}
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/ExtensionLink.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/ExtensionLink.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/ExtensionLink.cpp	(revision 178)
@@ -0,0 +1,599 @@
+#include "common.h"
+
+
+#ifndef ListView_SetCheckState
+   #define ListView_SetCheckState(hwndLV, i, fCheck) \
+      ListView_SetItemState(hwndLV, i, \
+      INDEXTOSTATEIMAGEMASK((fCheck)+1), LVIS_STATEIMAGEMASK)
+#endif
+
+
+
+COneExt::COneExt(BOOL bReg,char *lpszExtension,char *lpszNote,BOOL bWindowsSearch,COLORREF tab_color){
+	m_bReg=bReg;
+	lstrcpy(m_szExtension,lpszExtension);
+	lstrcpy(m_szNote,lpszNote);
+	m_bWindowsSearch=bWindowsSearch;
+	TabColor=tab_color;
+}
+COneExt::~COneExt(){
+}
+
+CExtLink::CExtLink(){
+	ppobj_ExtItems=(COneExt **)malloc(1);
+	iExtItemNum=0;
+}
+CExtLink::~CExtLink(){
+	int i;
+	for(i=0;i<iExtItemNum;i++){
+		delete ppobj_ExtItems[i];
+	}
+	free(ppobj_ExtItems);
+	ppobj_ExtItems=0;
+}
+
+void CExtLink::load(char *path){
+	char *buffer;
+	buffer=ReadBuffer_NonErrMsg(path);
+	if(buffer){
+		int i=0;
+		char temporary[64],temp2[255],temp3[64],temp4[64];
+		while(1){
+			//関連付けをおこなうかどうかのチェック
+			BOOL bReg;
+			i=GetOneParameter(buffer,i,temporary);
+			if(temporary[0]=='\0') break;
+			bReg=atoi(temporary);
+
+			//拡張子
+			i=GetOneParameter(buffer,i,temporary);
+			if(temporary[0]=='\0') break;
+
+			//説明
+			i=GetOneParameter(buffer,i,temp2);
+			if(temp2[0]=='\0') break;
+
+			//Windows検索
+			i=GetOneParameter(buffer,i,temp3);
+			if(temp3[0]=='\0') break;
+
+			//タブの色
+			i=GetOneParameter(buffer,i,temp4);
+			if(temp4[0]=='\0') break;
+
+			DWORD dwColor;
+			sscanf(temp4,"%x",&dwColor);
+
+			add(bReg,temporary,temp2,atoi(temp3),(COLORREF)dwColor);
+
+			if(buffer[i]=='\r'&&buffer[i+1]=='\n'){
+				i+=2;
+			}
+			else break;
+		}
+
+		HeapDefaultFree(buffer);
+	}
+	else{
+		//デフォルト値をセット
+		SetInitData();
+	}
+}
+void CExtLink::save(char *path){
+	int i;
+	char buffer[8192];
+	buffer[0]=0;
+	for(i=0;i<iExtItemNum;i++){
+		sprintf(buffer+lstrlen(buffer),"%d,%s,%s,%d,%x\r\n",
+			ppobj_ExtItems[i]->m_bReg,
+			ppobj_ExtItems[i]->m_szExtension,
+			ppobj_ExtItems[i]->m_szNote,
+			ppobj_ExtItems[i]->m_bWindowsSearch,
+			ppobj_ExtItems[i]->TabColor);
+	}
+
+	//保存
+	WriteBuffer(path,buffer,lstrlen(buffer));
+}
+
+BOOL CExtLink::add(BOOL bReg,char *lpszExtension,char *lpszNote,BOOL bWindowsSearch,COLORREF tab_color){
+	//重複チェック
+	int i;
+	for(i=0;i<iExtItemNum;i++){
+		if(lstrcmpi(ppobj_ExtItems[i]->m_szExtension,lpszExtension)==0){
+			return 0;
+		}
+	}
+
+	ppobj_ExtItems=(COneExt **)realloc(ppobj_ExtItems,(iExtItemNum+1)*sizeof(COneExt*));
+	ppobj_ExtItems[iExtItemNum]=new COneExt(bReg,lpszExtension,lpszNote,bWindowsSearch,tab_color);
+	iExtItemNum++;
+
+	return 1;
+}
+void CExtLink::del(char *lpszExtension){
+	int i;
+	for(i=0;i<iExtItemNum;i++){
+		if(lstrcmpi(lpszExtension,ppobj_ExtItems[i]->m_szExtension)==0)
+			break;
+	}
+	if(i==iExtItemNum) return;
+
+	delete ppobj_ExtItems[i];
+
+	iExtItemNum--;
+	for(;i<iExtItemNum;i++){
+		ppobj_ExtItems[i]=ppobj_ExtItems[i+1];
+	}
+}
+
+void CExtLink::SetInitData(void){
+	///////////////////////////////////
+	// 初期立ち上げ時用の値をセット
+	///////////////////////////////////
+
+#ifdef THETEXT
+	add(1,"txt","テキスト ドキュメント",1,TABCOLOR_GRAY);
+	add(0,"htm","HTML ドキュメント",1,TABCOLOR_BLUE);
+	add(0,"html","HTML ドキュメント",1,TABCOLOR_BLUE);
+	add(1,"cgi","CGI ドキュメント",1,TABCOLOR_GREEN);
+	add(1,"pl","Perl ドキュメント",1,TABCOLOR_GREEN);
+	add(1,"php","PHP ドキュメント",1,TABCOLOR_RED);
+	add(1,"tpl","テンプレート ドキュメント",1,TABCOLOR_YELLOW);
+#else
+	add(1,"ab","Basic ソースコード",1,TABCOLOR_BLUE);
+	add(1,"abp","Basic ソースコード",1,TABCOLOR_BLUE);
+	add(1,"bas","Basic ソースコード",1,TABCOLOR_BLUE);
+	add(1,"sbp","サブソースコード",1,TABCOLOR_GREEN);
+	add(1,"pj","ActiveBasic プロジェクト ドキュメント",0,TABCOLOR_GRAY);
+#endif
+}
+
+void CExtLink::ResetListView(HWND hListView){
+	ListView_DeleteAllItems(hListView);
+
+	int i;
+	for(i=0;  i < pobj_nv->pobj_ExtLink->iExtItemNum;  i++){
+		LV_ITEM item;
+
+		//拡張子
+		item.mask=LVIF_TEXT;
+		item.pszText=ppobj_ExtItems[i]->m_szExtension;
+		item.iItem=i;
+		item.iSubItem=0;
+		ListView_InsertItem(hListView,&item);
+
+		//説明
+		item.pszText=ppobj_ExtItems[i]->m_szNote;
+		item.iItem=i;
+		item.iSubItem++;
+		ListView_SetItem(hListView,&item);
+
+		//Windows検索
+		if(ppobj_ExtItems[i]->m_bWindowsSearch)
+			item.pszText="有効";
+		else item.pszText="無効";
+		item.iItem=i;
+		item.iSubItem++;
+		ListView_SetItem(hListView,&item);
+
+		//タブの色
+		if(ppobj_ExtItems[i]->TabColor==TABCOLOR_GRAY)			item.pszText="灰色";
+		else if(ppobj_ExtItems[i]->TabColor==TABCOLOR_WHITE)	item.pszText="白";
+		else if(ppobj_ExtItems[i]->TabColor==TABCOLOR_RED)		item.pszText="赤";
+		else if(ppobj_ExtItems[i]->TabColor==TABCOLOR_GREEN)	item.pszText="緑";
+		else if(ppobj_ExtItems[i]->TabColor==TABCOLOR_BLUE)		item.pszText="青";
+		else if(ppobj_ExtItems[i]->TabColor==TABCOLOR_YELLOW)	item.pszText="黄色";
+		else item.pszText="ユーザー設定";
+		item.iItem=i;
+		item.iSubItem++;
+		ListView_SetItem(hListView,&item);
+
+		//チェックマーク
+		ListView_SetCheckState(hListView,i,ppobj_ExtItems[i]->m_bReg);
+	}
+}
+
+COLORREF CExtLink::GetTabColorFromFilePath(char *path){
+	//拡張子を識別し、タブの色を決定
+	char szExt[255],*lpszTemp;
+	_splitpath(path,NULL,NULL,NULL,szExt);
+	if(szExt[0]=='.') lpszTemp=szExt+1;
+	else lpszTemp=szExt;
+	for(int i=0;i<iExtItemNum;i++){
+		if(lstrcmpi(lpszTemp,ppobj_ExtItems[i]->m_szExtension)==0){
+			return ppobj_ExtItems[i]->TabColor;
+		}
+	}
+	return TABCOLOR_GRAY;
+}
+
+
+BOOL CALLBACK DlgFileLinkAdd(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	static COneExt *pobj_OneExt;
+
+	static int TabColor;
+	switch(message){
+		case WM_INITDIALOG:
+			if(lParam){
+				pobj_OneExt=(COneExt *)lParam;
+
+				SetDlgItemText(hwnd,IDC_EXTENSION,pobj_OneExt->m_szExtension);
+				SetDlgItemText(hwnd,IDC_NOTE,pobj_OneExt->m_szNote);
+				TabColor=pobj_OneExt->TabColor;
+
+				if(pobj_OneExt->m_bWindowsSearch)
+					SendDlgItemMessage(hwnd,IDC_SEARCH_ON,BM_SETCHECK,BST_CHECKED,0);
+				else
+					SendDlgItemMessage(hwnd,IDC_SEARCH_OFF,BM_SETCHECK,BST_CHECKED,0);
+
+				EnableWindow(GetDlgItem(hwnd,IDC_EXTENSION),0);
+
+				SetFocus(GetDlgItem(hwnd,IDC_NOTE));
+			}
+			else{
+				pobj_OneExt=0;
+				TabColor=TABCOLOR_GRAY;
+
+				SendDlgItemMessage(hwnd,IDC_SEARCH_ON,BM_SETCHECK,BST_CHECKED,0);
+
+				SetFocus(GetDlgItem(hwnd,IDC_EXTENSION));
+			}
+
+			SendMessage(hwnd,WM_COMMAND,IDC_EXTENSION,0);
+
+			break;
+		case WM_DRAWITEM:
+			LPDRAWITEMSTRUCT pds;
+			pds=(LPDRAWITEMSTRUCT)lParam;
+
+			HBRUSH hBrush,hOldBrush;
+
+			if(wParam==IDC_COLOR_BUTTON){
+				//////////////
+				// 色を描画
+				//////////////
+
+				//ペンとブラシを生成
+				HPEN hPen,hOldPen;
+				hPen=(HPEN)GetStockObject(WHITE_PEN);
+				hBrush=CreateSolidBrush(TabColor);
+
+				//塗りつぶす
+				hOldPen=(HPEN)SelectObject(pds->hDC,hPen);
+				hOldBrush=(HBRUSH)SelectObject(pds->hDC,hBrush);
+				Rectangle(pds->hDC,0,0,pds->rcItem.right,pds->rcItem.bottom);
+				SelectObject(pds->hDC,hOldPen);
+				SelectObject(pds->hDC,hOldBrush);
+
+				//ブラシを破棄
+				DeleteObject(hBrush);
+			}
+			return 1;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					char szExtension[64];
+					GetDlgItemText(hwnd,IDC_EXTENSION,szExtension,64);
+
+					char szNote[255];
+					GetDlgItemText(hwnd,IDC_NOTE,szNote,255);
+
+					BOOL bWindowsSearch;
+					if(SendDlgItemMessage(hwnd,IDC_SEARCH_ON,BM_GETCHECK,0,0))
+						bWindowsSearch=1;
+					else bWindowsSearch=0;
+
+					if(pobj_OneExt){
+						//変更
+						lstrcpy(pobj_OneExt->m_szNote,szNote);
+						pobj_OneExt->m_bWindowsSearch=bWindowsSearch;
+						pobj_OneExt->TabColor=TabColor;
+					}
+					else{
+						//追加
+						if(!pobj_nv->pobj_ExtLink->add(1,szExtension,szNote,bWindowsSearch,TabColor)){
+							char temporary[255];
+							sprintf(temporary,"拡張子 %s は既にリストに存在します。",szExtension);
+							MessageBox(hwnd,temporary,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+
+							return 1;
+						}
+					}
+
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+				case IDC_COLOR_BUTTON:
+					POINT pos;
+					GetCursorPos(&pos);
+					extern HMENU hTabColorMenu;
+					TrackPopupMenu(hTabColorMenu,TPM_LEFTALIGN,pos.x,pos.y,0,hwnd,0);
+					return 1;
+
+				case IDC_EXTENSION:
+					if(GetWindowTextLength(GetDlgItem(hwnd,IDC_EXTENSION)))
+						EnableWindow(GetDlgItem(hwnd,IDOK),1);
+					else
+						EnableWindow(GetDlgItem(hwnd,IDOK),0);
+					return 1;
+
+				case IDM_USER_COLOR:
+					COLORREF colorUser;
+					colorUser=TabColor;
+					{
+						CHOOSECOLOR cc;
+						COLORREF CusColors[16]={
+							RGB(255,255,255),
+							RGB(0,0,0),
+							RGB(128,128,128),
+							RGB(192,192,192),
+							RGB(128,0,0),
+							RGB(255,0,0),
+							RGB(128,128,0),
+							RGB(255,255,0),
+							RGB(0,128,0),
+							RGB(0,255,0),
+							RGB(0,128,128),
+							RGB(0,255,255),
+							RGB(0,0,128),
+							RGB(0,0,255),
+							RGB(128,0,128),
+							RGB(255,0,255)};
+						cc.lStructSize=sizeof(CHOOSECOLOR);
+						cc.hwndOwner=hwnd;
+						cc.rgbResult=colorUser;
+						cc.lpCustColors=CusColors;
+						cc.Flags=CC_RGBINIT|CC_FULLOPEN;
+						if(!ChooseColor(&cc)){
+							return 0;
+						}
+						colorUser=cc.rgbResult;
+					}
+				case IDM_GRAY:
+				case IDM_WHITE:
+				case IDM_RED:
+				case IDM_GREEN:
+				case IDM_BLUE:
+				case IDM_YELLOW:
+					if(LOWORD(wParam)==IDM_GRAY)	TabColor=TABCOLOR_GRAY;
+					if(LOWORD(wParam)==IDM_WHITE)	TabColor=TABCOLOR_WHITE;
+					if(LOWORD(wParam)==IDM_RED)		TabColor=TABCOLOR_RED;
+					if(LOWORD(wParam)==IDM_GREEN)	TabColor=TABCOLOR_GREEN;
+					if(LOWORD(wParam)==IDM_BLUE)	TabColor=TABCOLOR_BLUE;
+					if(LOWORD(wParam)==IDM_YELLOW)	TabColor=TABCOLOR_YELLOW;
+					if(LOWORD(wParam)==IDM_USER_COLOR) TabColor=colorUser;
+					InvalidateRect(GetDlgItem(hwnd,IDC_COLOR_BUTTON),NULL,0);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+BOOL CALLBACK DlgLinkFile(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	int i;
+	HWND hListView;
+	char temporary[255];
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+
+
+
+			///////////////////////////
+			// カラムの設定
+			///////////////////////////
+
+			//拡張スタイル
+			DWORD dwStyle;
+			hListView=GetDlgItem(hwnd,IDC_EXTENSION_LIST);
+			dwStyle=ListView_GetExtendedListViewStyle(hListView);
+			dwStyle|=LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_CHECKBOXES;
+			ListView_SetExtendedListViewStyle(hListView,dwStyle);
+
+			LV_COLUMN ListView_Column;
+			ListView_Column.mask=LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
+			ListView_Column.fmt=LVCFMT_LEFT;
+
+			ListView_Column.cx=50;
+			ListView_Column.pszText="拡張子";
+			ListView_Column.iSubItem=0;
+			ListView_InsertColumn(hListView,ListView_Column.iSubItem,&ListView_Column);
+
+			ListView_Column.cx=150;
+			ListView_Column.pszText="説明";
+			ListView_Column.iSubItem++;
+			ListView_InsertColumn(hListView,ListView_Column.iSubItem,&ListView_Column);
+
+			ListView_Column.cx=90;
+			ListView_Column.pszText="Windows検索";
+			ListView_Column.iSubItem++;
+			ListView_InsertColumn(hListView,ListView_Column.iSubItem,&ListView_Column);
+
+			ListView_Column.cx=80;
+			ListView_Column.pszText="タブの色";
+			ListView_Column.iSubItem++;
+			ListView_InsertColumn(hListView,ListView_Column.iSubItem,&ListView_Column);
+
+
+			pobj_nv->pobj_ExtLink->ResetListView(hListView);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_ADD_BUTTON:
+					if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_EXTENSION_ADD),hwnd,DlgFileLinkAdd,0)) return 1;
+
+					pobj_nv->pobj_ExtLink->ResetListView(GetDlgItem(hwnd,IDC_EXTENSION_LIST));
+
+					return 1;
+				case IDC_EDIT_BUTTON:
+					hListView=GetDlgItem(hwnd,IDC_EXTENSION_LIST);
+
+					for(i=0;i<ListView_GetItemCount(hListView);i++){
+						if(ListView_GetItemState(hListView,i,LVIS_SELECTED)){
+							break;
+						}
+					}
+					if(i==ListView_GetItemCount(hListView)) return 1;
+
+					if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_EXTENSION_ADD),hwnd,DlgFileLinkAdd,(LPARAM)pobj_nv->pobj_ExtLink->ppobj_ExtItems[i])) return 1;
+
+					pobj_nv->pobj_ExtLink->ResetListView(GetDlgItem(hwnd,IDC_EXTENSION_LIST));
+
+					return 1;
+				case IDC_DELETE_BUTTON:
+					hListView=GetDlgItem(hwnd,IDC_EXTENSION_LIST);
+
+					for(i=0;i<ListView_GetItemCount(hListView);i++){
+						if(ListView_GetItemState(hListView,i,LVIS_SELECTED)){
+							ListView_GetItemText(hListView,i,0,temporary,255);
+
+							char temp2[255];
+							sprintf(temp2,"%s をリストから削除します。",temporary);
+							if(MessageBox(hwnd,temp2,APPLICATION_NAME,MB_OKCANCEL)==IDCANCEL) return 1;
+
+							ListView_DeleteItem(hListView,i);
+
+							pobj_nv->pobj_ExtLink->del(temporary);
+							break;
+						}
+					}
+					return 1;
+				case IDOK:
+					hListView=GetDlgItem(hwnd,IDC_EXTENSION_LIST);
+
+					for(i=0;i<ListView_GetItemCount(hListView);i++){
+						pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_bReg=ListView_GetCheckState(hListView,i);
+					}
+
+					if(MessageBox(hwnd,"指定された内容で拡張子に関するレジストリキーを登録します。よろしいですか？",APPLICATION_NAME,MB_YESNO)==IDNO)
+						return 1;
+
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					hListView=GetDlgItem(hwnd,IDC_EXTENSION_LIST);
+
+					for(i=0;i<ListView_GetItemCount(hListView);i++){
+						pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_bReg=ListView_GetCheckState(hListView,i);
+					}
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			break;
+		case WM_NOTIFY:
+			hListView=GetDlgItem(hwnd,IDC_EXTENSION_LIST);
+
+			NMHDR *hdr;
+			hdr=(NMHDR *)lParam;
+			if(hdr->hwndFrom==hListView&&hdr->code==NM_DBLCLK){
+				SendMessage(hwnd,WM_COMMAND,IDC_EDIT_BUTTON,0);
+			}
+			break;
+	}
+	return 0;
+}
+
+HKEY ClassRoot_CreateKey(char *path,char *lpszData){
+	HKEY hKey;
+	RegCreateKeyEx(HKEY_CLASSES_ROOT,path,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,NULL);
+	RegSetValueEx(hKey,NULL,0,REG_SZ,(const unsigned char *)lpszData,lstrlen(lpszData));
+	return hKey;
+}
+void ExtensionLink(HWND hwnd){
+	int i;
+	HKEY hKey;
+
+	//初期状態の重複起動で関連付けを作動しないようにする
+	pobj_nv->save();
+
+	if(DialogBox(hResInst,MAKEINTRESOURCE(IDD_EXTENSION_LINK),hwnd,DlgLinkFile)==0) return;
+
+	char szApplicationPath[MAX_PATH];
+	GetModuleFileName(hInst,szApplicationPath,MAX_PATH);
+
+	char temporary[MAX_PATH],temp2[255],temp3[255];
+	for(i=0;i<pobj_nv->pobj_ExtLink->iExtItemNum;i++){
+		if(pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_bReg==0) continue;
+
+		//「.拡張子」キー
+		sprintf(temp2,".%s",pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_szExtension);
+		sprintf(temp3,"%sfile",pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_szExtension);
+		hKey=ClassRoot_CreateKey(temp2,temp3);
+
+		sprintf(temp2,"%s file.",pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_szExtension);
+		RegSetValueEx(hKey,"Content Type",0,REG_SZ,(const unsigned char *)temp2,lstrlen(temp2));
+
+		RegCloseKey(hKey);
+
+
+		if(pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_bWindowsSearch){
+			//検索対象に含める
+			sprintf(temporary,".%s\\PersistentHandler",pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_szExtension);
+			hKey=ClassRoot_CreateKey(temporary,"{5e941d80-bf96-11cd-b579-08002b30bfeb}");
+			RegCloseKey(hKey);
+		}
+		else{
+			//検索対象に含めない
+			sprintf(temporary,".%s\\PersistentHandler",pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_szExtension);
+			RegDeleteKey(HKEY_CLASSES_ROOT,temporary);
+		}
+
+
+		//説明
+		RegCreateKeyEx(HKEY_CLASSES_ROOT,temp3,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,NULL);
+		RegSetValueEx(hKey,NULL,0,REG_SZ,
+			(const unsigned char *)pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_szNote,
+			lstrlen(pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_szNote));
+		RegCloseKey(hKey);
+
+
+		//アプリケーションパス
+		sprintf(temporary,"\"%s\" \"%%1\"",szApplicationPath);
+		sprintf(temp2,"%s\\shell\\open\\command",temp3);
+		RegCreateKeyEx(HKEY_CLASSES_ROOT,temp2,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,NULL);
+		RegSetValueEx(hKey,NULL,0,REG_SZ,(const unsigned char *)temporary,lstrlen(temporary));
+		RegCloseKey(hKey);
+
+
+#ifndef THETEXT
+		/////////////////////
+		// アイコン設定
+		// ※ProjectEditorのみ
+		/////////////////////
+
+		sprintf(temp2,"%s\\DefaultIcon",temp3);
+		if(lstrcmpi(pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_szExtension,"bas")==0){
+			sprintf(temporary,"\"%s\",8",szApplicationPath);
+			RegCreateKeyEx(HKEY_CLASSES_ROOT,temp2,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,NULL);
+			RegSetValueEx(hKey,NULL,0,REG_SZ,(const unsigned char *)temporary,lstrlen(temporary));
+			RegCloseKey(hKey);
+		}
+		if(lstrcmpi(pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_szExtension,"ab")==0||
+			lstrcmpi(pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_szExtension,"abp")==0){
+			sprintf(temporary,"\"%s\",8",szApplicationPath);
+			RegCreateKeyEx(HKEY_CLASSES_ROOT,temp2,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,NULL);
+			RegSetValueEx(hKey,NULL,0,REG_SZ,(const unsigned char *)temporary,lstrlen(temporary));
+			RegCloseKey(hKey);
+		}
+		if(lstrcmpi(pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_szExtension,"sbp")==0){
+			sprintf(temporary,"\"%s\",9",szApplicationPath);
+			RegCreateKeyEx(HKEY_CLASSES_ROOT,temp2,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,NULL);
+			RegSetValueEx(hKey,NULL,0,REG_SZ,(const unsigned char *)temporary,lstrlen(temporary));
+			RegCloseKey(hKey);
+		}
+		if(lstrcmpi(pobj_nv->pobj_ExtLink->ppobj_ExtItems[i]->m_szExtension,"pj")==0){
+			sprintf(temporary,"\"%s\",7",szApplicationPath);
+			RegCreateKeyEx(HKEY_CLASSES_ROOT,temp2,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,&hKey,NULL);
+			RegSetValueEx(hKey,NULL,0,REG_SZ,(const unsigned char *)temporary,lstrlen(temporary));
+			RegCloseKey(hKey);
+		}
+#endif
+	}
+
+	//アイコンの関連付けを瞬時に反映させる
+	SHChangeNotify( SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL );
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/ExtensionLink.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/ExtensionLink.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/ExtensionLink.h	(revision 178)
@@ -0,0 +1,37 @@
+
+class COneExt{
+public:
+	BOOL m_bReg;
+	char m_szExtension[64];
+	char m_szNote[255];
+	BOOL m_bWindowsSearch;
+
+	COLORREF TabColor;
+
+	COneExt(BOOL bReg,char *lpszExtension,char *lpszNote,BOOL bWindowsSearch,COLORREF tab_color);
+	~COneExt();
+};
+
+class CExtLink{
+public:
+	COneExt **ppobj_ExtItems;
+	int iExtItemNum;
+
+	CExtLink();
+	~CExtLink();
+
+	void load(char *path);
+	void save(char *path);
+
+	BOOL add(BOOL bReg,char *lpszExtension,char *lpszNote,BOOL bWindowsSearch,COLORREF tab_color);
+	void del(char *lpszExtension);
+
+	void SetInitData();
+
+	void ResetListView(HWND hListView);
+
+	COLORREF GetTabColorFromFilePath(char *path);
+};
+
+
+void ExtensionLink(HWND hwnd);
Index: tag/abdev(2007.06.20)/ProjectEditor/FileOperation.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/FileOperation.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/FileOperation.cpp	(revision 178)
@@ -0,0 +1,605 @@
+#include "Common.h"
+
+void MakeUserSettingDir(void){
+	char temporary[MAX_PATH];
+	sprintf(temporary,"%sUserSetting",pj_editor_Dir);
+
+	HANDLE hFind;
+	WIN32_FIND_DATA wfd;
+	hFind=FindFirstFile(temporary,&wfd);
+	if(hFind==INVALID_HANDLE_VALUE){
+		//UserSettingディレクトリを作成
+		if(!CreateDirectory(temporary,NULL)){
+			MessageBox(hOwner,"UserSettingディレクトリの作成に失敗",APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+			return;
+		}
+	}
+}
+
+char *ReadBuffer(char *path){
+	extern HANDLE hHeap;
+	int i;
+	DWORD dw;
+	char *buffer,temporary[MAX_PATH];
+	HANDLE hFile;
+
+	hFile=CreateFile(path,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE){
+		//"\"%s\" ファイルの読み込みに失敗しました。"
+		sprintf(temporary,STRING_ERROR_CANT_FILEOPEN,path);
+		MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+
+		return 0;
+	}
+	i=GetFileSize(hFile,0);
+	buffer=(char *)HeapAlloc(hHeap,0,i+1);
+	ReadFile(hFile,buffer,i,&dw,0);
+	buffer[dw]=0;
+	CloseHandle(hFile);
+	return buffer;
+}
+char *ReadBuffer_NonErrMsg(char *path){
+	extern HANDLE hHeap;
+	int i;
+	DWORD dw;
+	char *buffer;
+	HANDLE hFile;
+
+	hFile=CreateFile(path,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE) return 0;
+	i=GetFileSize(hFile,0);
+	buffer=(char *)HeapAlloc(hHeap,0,i+1);
+	ReadFile(hFile,buffer,i,&dw,0);
+	buffer[dw]=0;
+	CloseHandle(hFile);
+	return buffer;
+}
+_int8 WriteBuffer(char *path,char *buffer,int length, bool isEnableError){
+	HANDLE hFile;
+	DWORD dw;
+	hFile=CreateFile(path,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE){
+		char temporary[MAX_PATH];
+
+		if( isEnableError ){
+			//"\"%s\" ファイルへの書き込みに失敗しました。"
+			sprintf(temporary,STRING_ERROR_CANT_FILESAVE,path);
+			MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+		}
+		return 0;
+	}
+	if(length) WriteFile(hFile,buffer,length,&dw,NULL);
+	CloseHandle(hFile);
+	return 1;
+}
+_int8 WriteBuffer_NonErrMsg(char *path,char *buffer,int length){
+	return WriteBuffer( path, buffer, length, false );
+}
+void GetRelationalPath(char *path,char *dir){
+	//相対パスを取得
+	int i,i2,i3,i4,i5;
+	char temporary[MAX_PATH],temp2[MAX_PATH],temp3[MAX_PATH],temp4[MAX_PATH];
+
+	//ドライブ名をチェック
+	_splitpath(path,temporary,0,0,0);
+	_splitpath(dir,temp2,0,0,0);
+	if(lstrcmpi(temporary,temp2)!=0) return;
+
+	_splitpath(path,0,temporary,0,0);
+	_splitpath(dir,0,temp2,0,0);
+	i=1;i2=1;
+	while(1){
+		i4=i;
+		if(temporary[i-1]=='\\'&&temporary[i]){	//path側
+			for(i3=0;;i++,i3++){
+				if(temporary[i]=='\\'){
+					temp3[i3]=0;
+					i++;
+					break;
+				}
+				temp3[i3]=temporary[i];
+			}
+		}
+		else temp3[0]=0;
+
+		i5=i2;
+		if(temp2[i2-1]=='\\'&&temp2[i2]){		//dir側
+			for(i3=0;;i2++,i3++){
+				if(temp2[i2]=='\\'){
+					temp4[i3]=0;
+					i2++;
+					break;
+				}
+				temp4[i3]=temp2[i2];
+			}
+		}
+		else temp4[0]=0;
+
+		if(temp3[0]=='\0'&&temp4[0]=='\0') break;
+
+		if(lstrcmpi(temp3,temp4)!=0){
+			for(i3=0;;i5++){
+				if(temp2[i5]=='\0') break;
+				if(temp2[i5]=='\\') i3++;
+			}
+			temp3[0]=0;
+			for(i2=0;i2<i3;i2++) lstrcat(temp3,"..\\");
+			lstrcat(temp3,temporary+i4);
+			break;
+		}
+	}
+	_splitpath(path,0,0,temporary,temp2);
+	lstrcat(temp3,temporary);
+	lstrcat(temp3,temp2);
+	lstrcpy(path,temp3);
+}
+void GetFullPath(char *path,char *dir){
+	int i,i2,i3,i4;
+	char temporary[MAX_PATH];
+
+	if(strstr(path,":")||strstr(path,"\\\\")) return;
+
+	i=0;i2=0;
+	while(1){
+		if(path[i]=='.'&&path[i+1]=='\\') i+=2;
+		if(path[i]=='.'&&path[i+1]=='.'&&path[i+2]=='\\'){
+			i2++;
+			i+=3;
+		}
+		else break;
+	}
+
+	i3=lstrlen(dir);i4=0;
+	while(i4<i2){
+		for(i3--;;i3--){
+			if(dir[i3-1]=='\\'){
+				i4++;
+				break;
+			}
+		}
+	}
+	memcpy(temporary,dir,i3);
+	temporary[i3]=0;
+	lstrcat(temporary,path+i);
+	lstrcpy(path,temporary);
+}
+
+void RemoveDirectoryStrong(const char *dirPath){
+	char tempDirPath[MAX_PATH];
+	lstrcpy( tempDirPath, dirPath );
+
+	if( tempDirPath[lstrlen(tempDirPath)-1] == '\\' ){
+		 tempDirPath[lstrlen(tempDirPath)-1] = 0;
+	}
+
+	HANDLE hFind;
+	WIN32_FIND_DATA wfd;
+	char temporary[MAX_PATH];
+	sprintf(temporary,"%s\\*",tempDirPath);
+
+	hFind=FindFirstFile(temporary,&wfd);
+	if(hFind!=INVALID_HANDLE_VALUE){
+		do{
+			if(wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY){
+				if(!(lstrcmp(wfd.cFileName,".")==0||lstrcmp(wfd.cFileName,"..")==0)){
+					//ディレクトリのとき
+					sprintf(temporary,"%s\\%s\\",tempDirPath,wfd.cFileName);
+					RemoveDirectoryStrong(temporary);
+				}
+			}
+			else{
+				//ファイルのとき
+				sprintf(temporary,"%s\\%s",tempDirPath,wfd.cFileName);
+
+				DeleteFile(temporary);
+			}
+		}while(FindNextFile(hFind,&wfd));
+
+		FindClose( hFind );
+	}
+
+	if( !RemoveDirectory(tempDirPath) ){
+		OutputDebugString( GetLastErrorString().c_str() );
+		OutputDebugString( "\r\n" );
+		OutputDebugString( "一時ディレクトリの削除に失敗\r\n" );
+	}
+}
+
+BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,_int8 IsOpen){
+	OPENFILENAME ofstr;
+	filename[0]=0;
+	ofstr.lStructSize=sizeof(OPENFILENAME);
+	ofstr.hwndOwner=hwnd;
+	ofstr.hInstance=0;
+	ofstr.lpstrFilter=Filter;
+	ofstr.lpstrCustomFilter=NULL;
+	ofstr.nMaxCustFilter=0;
+	ofstr.nFilterIndex=1;
+	ofstr.lpstrFile=filename;
+	ofstr.nMaxFile=MAX_PATH;
+	ofstr.lpstrFileTitle=NULL;
+	ofstr.nMaxFileTitle=0;
+	ofstr.lpstrInitialDir=pobj_nv->DefSaveDir;
+	ofstr.lpstrTitle=Title;
+	ofstr.Flags=OFN_FILEMUSTEXIST|OFN_HIDEREADONLY|OFN_PATHMUSTEXIST;
+	ofstr.nFileOffset=0;
+	ofstr.nFileExtension=0;
+	ofstr.lpstrDefExt="*";
+	ofstr.lCustData=NULL;
+	ofstr.lpfnHook=NULL;
+	ofstr.lpTemplateName=NULL;
+	if(IsOpen){
+		if(!GetOpenFileName(&ofstr)) return FALSE;
+	}
+	else{
+		if(!GetSaveFileName(&ofstr)) return FALSE;
+	}
+
+	//次回の初期ディレクトリをセット
+	char temporary[MAX_PATH];
+	_splitpath(filename,pobj_nv->DefSaveDir,temporary,NULL,NULL);
+	lstrcat(pobj_nv->DefSaveDir,temporary);
+
+	return TRUE;
+}
+BOOL GetFolder(HWND hWnd,char *folder,char *OpenFolderTitle){
+	BROWSEINFO BrowseInfo;
+	LPITEMIDLIST pidlBrowse;
+	LPMALLOC g_pMalloc;
+	char temporary[MAX_PATH];
+
+	BrowseInfo.hwndOwner=hWnd;
+	BrowseInfo.pszDisplayName=temporary;
+	BrowseInfo.pidlRoot=NULL;
+	BrowseInfo.lpszTitle=OpenFolderTitle;
+	BrowseInfo.ulFlags=BIF_RETURNONLYFSDIRS;
+	BrowseInfo.lpfn=NULL;
+	BrowseInfo.lParam=(LPARAM)0;
+	BrowseInfo.iImage=0;
+	pidlBrowse=SHBrowseForFolder(&BrowseInfo);
+	if(pidlBrowse){
+		if(SHGetMalloc(&g_pMalloc)!=0) return 0;
+		SHGetPathFromIDList(pidlBrowse,folder);
+		g_pMalloc->Free(pidlBrowse);
+		g_pMalloc->Release();
+		return 1;
+	}
+	return 0;
+}
+
+int GetFileExtension(char *path){
+	char temporary[MAX_PATH];
+	_splitpath(path,0,0,0,temporary);
+
+	if(lstrcmpi(temporary,".bas")==0||
+		lstrcmpi(temporary,".ab")==0||
+		lstrcmpi(temporary,".abp")==0) return FT_BASICPROGRAM;
+	if(lstrcmpi(temporary,".sbp")==0) return FT_SUBPROGRAM;
+	if(lstrcmpi(temporary,".txt")==0) return FT_TEXT;
+	if(lstrcmpi(temporary,".pj")==0) return FT_PROJECT;
+	if(lstrcmpi(temporary,".ico")==0) return FT_ICON;
+
+	if(lstrcmpi(temporary,".html")==0||
+		lstrcmpi(temporary,".htm")==0||
+		lstrcmpi(temporary,".tpl")==0||
+		lstrcmpi(temporary,".php")==0)
+		return FT_HTML;
+
+	return FT_OTHER;
+}
+HWND OpenFileWithExtension(char *OpenFileName){
+	int i;
+	_int8 DocumentType;
+
+	i=GetFileExtension(OpenFileName);
+
+#ifndef THETEXT
+	if(i==FT_PROJECT){
+		//「最近使ったプロジェクト」に追加
+		pobj_nv->pobj_ProjectHistory->insert(OpenFileName);
+
+		OpenProject(OpenFileName);
+		return 0;
+	}
+#endif
+
+	//「最近使ったファイル」に追加
+	pobj_nv->pobj_History->insert(OpenFileName);
+
+	if(i==FT_ICON){
+		NewIconEditWindow(OpenFileName);
+		return 0;
+	}
+	else if(i==FT_BASICPROGRAM||i==FT_SUBPROGRAM){
+		DocumentType=WNDTYPE_BASIC;
+
+#ifdef THETEXT
+		DocumentType=WNDTYPE_TEXT;
+#endif
+	}
+	else if(i==FT_HTML) DocumentType=WNDTYPE_HTML;
+	else DocumentType=WNDTYPE_TEXT;
+
+	COLORREF TabColor;
+	TabColor=pobj_nv->pobj_ExtLink->GetTabColorFromFilePath(OpenFileName);
+
+	return NewTextEditWindow(OpenFileName,DocumentType,TabColor);
+}
+BOOL SaveDocument(HWND hChild,char *SaveFileName){	//ウィンドウからバッファを読み取り、ファイルに保存
+	extern LPSTR IconFileFilter;
+	extern HWND hClient,hDocCombo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int WndNum,i2;
+	char temporary[MAX_PATH],str[MAX_PATH],str2[32];
+	HANDLE fh;
+	DWORD dummy;
+
+	WndNum=GetWndNum(hChild);
+
+	char szOldTitle[MAX_PATH];
+	lstrcpy(szOldTitle,MdiInfo[WndNum].title);
+
+	if(MdiInfo[WndNum].DocType==WNDTYPE_RAD||MdiInfo[WndNum].DocType==WNDTYPE_MENU){
+		////////////////////////////////////
+		// RADツール及びメニューエディタ
+		////////////////////////////////////
+
+		extern PROJECTINFO ProjectInfo;
+		if(ProjectInfo.ModifyOfMaterial){
+			sprintf(temporary,"%s%s.wnd",ProjectInfo.dir,ProjectInfo.name);
+			SaveWindowFile(temporary,ProjectInfo.pWindowInfo,ProjectInfo.NumberOfWindows);
+
+			//.wbpファイルを生成
+			SaveWindowProgram();
+		}
+	}
+	else if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+		//////////////////////////
+		// テキストドキュメント
+		//////////////////////////
+
+		if(SaveFileName){
+			lstrcpy(temporary,SaveFileName);
+			if((fh=CreateFile(temporary,GENERIC_WRITE,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL))==INVALID_HANDLE_VALUE){
+				sprintf(str,STRING_FILE_OVERWRIDE,temporary);
+				if(MessageBox(hOwner,str,APPLICATION_NAME,MB_YESNO|MB_ICONINFORMATION)==IDNO){
+					CloseHandle(fh);
+					return 0;
+				}
+			}
+			CloseHandle(fh);
+
+			//ドキュメント セレクト コンボボックスから消去
+			i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[WndNum].title);
+			SendMessage(hDocCombo,CB_DELETESTRING,i2,0);
+
+			//新しいパスをセット
+			GlobalFree(MdiInfo[WndNum].path);
+			MdiInfo[WndNum].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(temporary)+1);
+			lstrcpy(MdiInfo[WndNum].path,temporary);
+
+			//ドキュメント セレクト コンボボックスに挿入
+			_splitpath(temporary,NULL,NULL,str,str2);
+			lstrcat(str,str2);
+			GlobalFree(MdiInfo[WndNum].title);
+			MdiInfo[WndNum].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(str)+1);
+			lstrcpy(MdiInfo[WndNum].title,str);
+			SendMessage(hDocCombo,CB_ADDSTRING,0,(long)MdiInfo[WndNum].title);
+			i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[WndNum].title);
+			SendMessage(hDocCombo,CB_SETCURSEL,i2,0);
+
+			//MDIウィンドウのタイトルを再設定
+			SetWindowText(hChild,MdiInfo[WndNum].title);
+		}
+		else{
+			if(MdiInfo[WndNum].path[0]=='\0'){
+				//"保存先のファイルを指定してください"
+get_file_path:
+
+				LPSTR ff;
+
+				extern LPSTR DefFileFilter;
+				extern LPSTR HtmlFileFilter;
+				extern LPSTR TextFileFilter;
+				if(MdiInfo[WndNum].DocType==WNDTYPE_BASIC)
+					ff=DefFileFilter;
+				else if(MdiInfo[WndNum].DocType==WNDTYPE_HTML)
+					ff=HtmlFileFilter;
+				else if(MdiInfo[WndNum].DocType==WNDTYPE_TEXT)
+					ff=TextFileFilter;
+
+				if(!GetFilePathDialog(hOwner,temporary,ff,STRING_FILESAVETITLE_DEFAULT,FALSE)) return 0;
+				SaveDocument(hChild,temporary);
+				return 1;
+			}
+			lstrcpy(temporary,MdiInfo[WndNum].path);
+		}
+
+		if(!IsExistFile(temporary)){
+			//保存先ファイルが存在しないとき
+			char temp2[MAX_PATH];
+
+			//初期ディレクトリをセット
+			_splitpath(temporary,pobj_nv->DefSaveDir,temp2,NULL,NULL);
+			lstrcat(pobj_nv->DefSaveDir,temp2);
+
+			goto get_file_path;
+		}
+
+		//文字コードを復元
+		char *pBuf;
+		pBuf=nkf.RestoreBuffer(MdiInfo[WndNum].pMdiTextEdit->buffer,MdiInfo[WndNum].pMdiTextEdit->iCharCode);
+
+		//改行コードを復元
+		if(MdiInfo[WndNum].pMdiTextEdit->iLfCode==LFCODE_LF) nkf.ToLF(pBuf);
+		else if(MdiInfo[WndNum].pMdiTextEdit->iLfCode==LFCODE_CR) nkf.ToCR(pBuf);
+
+
+		////////////////////////
+		// 保存
+		////////////////////////
+
+		fh=CreateFile(temporary,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+		if(fh==INVALID_HANDLE_VALUE){
+			sprintf(str,STRING_ERROR_CANT_FILESAVE,temporary);
+			MessageBox(hOwner,str,STRING_ERROR,MB_OK|MB_ICONSTOP);
+			return 0;
+		}
+		WriteFile(fh,pBuf,lstrlen(pBuf),&dummy,NULL);
+		CloseHandle(fh);
+
+
+		HeapDefaultFree(pBuf);
+
+		//変更フラグをオフにする
+		MdiInfo[WndNum].pMdiTextEdit->UnModify();
+	}
+	else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+		///////////////////
+		// ICON
+		///////////////////
+
+		if(SaveFileName){
+			lstrcpy(temporary,SaveFileName);
+			if((fh=CreateFile(temporary,GENERIC_WRITE,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL))==INVALID_HANDLE_VALUE){
+				sprintf(str,STRING_FILE_OVERWRIDE,temporary);
+				if(MessageBox(hOwner,str,APPLICATION_NAME,MB_YESNO|MB_ICONINFORMATION)==IDNO){
+					CloseHandle(fh);
+					return 0;
+				}
+			}
+			CloseHandle(fh);
+			GlobalFree(MdiInfo[WndNum].path);
+			MdiInfo[WndNum].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(temporary)+1);
+			lstrcpy(MdiInfo[WndNum].path,temporary);
+			i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[WndNum].title);
+			SendMessage(hDocCombo,CB_DELETESTRING,i2,0);
+			_splitpath(temporary,NULL,NULL,str,str2);
+			lstrcat(str,str2);
+			lstrcpy(MdiInfo[WndNum].title,str);
+			SendMessage(hDocCombo,CB_ADDSTRING,0,(long)MdiInfo[WndNum].title);
+			i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[WndNum].title);
+			SendMessage(hDocCombo,CB_SETCURSEL,i2,0);
+			SetWindowText(hChild,MdiInfo[WndNum].title);
+		}
+		else{
+			if(MdiInfo[WndNum].path[0]=='\0'){
+				//"保存先のファイルを指定してください"
+				if(!GetFilePathDialog(hOwner,temporary,IconFileFilter,STRING_FILESAVETITLE_DEFAULT,FALSE)) return 0;
+				SaveDocument(hChild,temporary);
+				return 1;
+			}
+			lstrcpy(temporary,MdiInfo[WndNum].path);
+		}
+		SaveIconFile(temporary,hChild);
+
+		MdiInfo[WndNum].MdiIconEditInfo->bModify=0;
+	}
+
+
+	//タブコントロールを再設定
+	if(pobj_nv->bSaveTabToHead){
+		COLORREF color;
+		color=pobj_MainTab->GetItemColor(szOldTitle);
+		pobj_MainTab->DeleteItem( szOldTitle, false );
+		pobj_MainTab->InsertItem( MdiInfo[WndNum].title, false, color );
+	}
+	else{
+		pobj_MainTab->RenameItem( szOldTitle, MdiInfo[WndNum].title );
+	}
+
+	//「最近使ったファイル」を更新
+	pobj_nv->pobj_History->insert(MdiInfo[WndNum].path);
+
+	return 1;
+}
+BOOL ShortPathToLongPath(char ShortPath[MAX_PATH],char *LongPath){
+	HANDLE hFind;
+	WIN32_FIND_DATA wfd;
+	int i;
+	char dummy[MAX_PATH];
+	for(i=0;i<MAX_PATH;i++){
+		LongPath[i]=ShortPath[i];
+		if((ShortPath[i-1]==':'&&ShortPath[i]=='\\')||(ShortPath[i-1]=='\\'&&ShortPath[i]=='\\')){
+			LongPath[i+1]=0;
+			break;
+		}
+	}
+	if(ShortPath[i-1]=='\\'&&ShortPath[i]=='\\'){
+		for(i++;i<MAX_PATH;i++){
+			if(IsDBCSLeadByte(ShortPath[i])){
+				i++;
+				continue;
+			}
+			LongPath[i]=ShortPath[i];
+			if(ShortPath[i]=='\\'){
+				LongPath[i+1]=0;
+				break;
+			}
+		}
+		for(i++;i<MAX_PATH;i++){
+			if(IsDBCSLeadByte(ShortPath[i])){
+				i++;
+				continue;
+			}
+			LongPath[i]=ShortPath[i];
+			if(ShortPath[i]=='\\'){
+				LongPath[i+1]=0;
+				break;
+			}
+		}
+	}
+	for(i++;i<MAX_PATH;i++){
+		if(IsDBCSLeadByte(ShortPath[i])){
+			i++;
+			continue;
+		}
+		if(ShortPath[i]=='\\'||ShortPath[i]=='\0'){
+			strncpy(dummy,ShortPath,i);
+			dummy[i]=0;
+			if((hFind=FindFirstFile(dummy,&wfd))!=INVALID_HANDLE_VALUE) FindClose(hFind);
+			lstrcat(LongPath,wfd.cFileName);
+
+			if(ShortPath[i]=='\0') break;
+			lstrcat(LongPath,"\\");
+
+			if(ShortPath[i]=='\\'&&ShortPath[i+1]=='\0'){
+				break;
+			}
+		}
+	}
+	return 1;
+}
+
+bool IsExistFile( const char *FilePath ){
+	WIN32_FIND_DATA wfd;
+	HANDLE hFind;
+
+	hFind = FindFirstFile(FilePath,&wfd);
+	if( hFind == INVALID_HANDLE_VALUE ){
+		return false;
+	}
+	FindClose( hFind );
+
+	return true;
+}
+
+bool IsExistDirectory( const char *DirPath ){
+	WIN32_FIND_DATA wfd;
+	HANDLE hFind;
+
+	hFind = FindFirstFile(DirPath,&wfd);
+	if( hFind == INVALID_HANDLE_VALUE ){
+		//存在しない
+		return false;
+	}
+	FindClose( hFind );
+
+	if( wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ){
+		//ディレクトリの場合
+		return true;
+	}
+
+	//存在しない
+	return false;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/FileTree.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/FileTree.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/FileTree.cpp	(revision 178)
@@ -0,0 +1,197 @@
+#include "common.h"
+
+CFileTree *pobj_FileTree;
+
+WNDPROC OldFileTreeViewProc;
+
+BOOL CALLBACK DlgProject_FileProperty(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern PROJECTINFO ProjectInfo;
+	HTREEITEM hTreeItem;
+	int i;
+	char temporary[MAX_PATH];
+	HANDLE hFile;
+	FILETIME LastWriteTime,LocalTime;
+	SYSTEMTIME SystemTime;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+
+			hTreeItem=TreeView_GetSelection(pobj_FileTree->hTree);
+
+			char *path;
+			path=ProjectInfo.pobj_DBFileInfo->GetPath(hTreeItem);
+
+			//絶対パス、相対パスを表示
+			lstrcpy(temporary,path);
+			GetFullPath(temporary,ProjectInfo.dir);
+			SetDlgItemText(hwnd,IDC_USING_FILE,temporary);
+			SetDlgItemText(hwnd,IDC_DEFINED_FILE,path);
+
+			//最終更新日時を表示
+			hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+			if(hFile==INVALID_HANDLE_VALUE){
+				//"エラー"
+				lstrcpy(temporary,STRING_ERROR);
+			}
+			else{
+				GetFileTime(hFile,NULL,NULL,&LastWriteTime);
+				FileTimeToLocalFileTime(&LastWriteTime,&LocalTime);
+				FileTimeToSystemTime(&LocalTime,&SystemTime);
+				if(SystemTime.wHour>=12){
+					//"午後 "
+					lstrcpy(temporary,STRING_AFTERNOON);
+					lstrcat(temporary," ");
+					SystemTime.wHour-=12;
+				}
+				else{
+					//"午前 "
+					lstrcpy(temporary,STRING_MORNING);
+					lstrcat(temporary," ");
+				}
+				sprintf(temporary+5,"%02d:%02d:%02d %04d/%02d/%02d",
+					SystemTime.wHour,SystemTime.wMinute,SystemTime.wSecond,
+					SystemTime.wYear,SystemTime.wMonth,SystemTime.wDay);
+				CloseHandle(hFile);
+			}
+			SetDlgItemText(hwnd,IDC_UPDATE_TIME,temporary);
+
+
+			//////////////
+			// 形式を表示
+			//////////////
+			i=GetFileExtension(path);
+
+			//"Basic プログラム"
+			if(i==FT_BASICPROGRAM) lstrcpy(temporary,STRING_FILETYPE_BASICPROGRAM);
+			//"サブ プログラム"
+			else if(i==FT_SUBPROGRAM) lstrcpy(temporary,STRING_FILETYPE_SUBPROGRAM);
+			//"テキスト ドキュメント"
+			else if(i==FT_TEXT) lstrcpy(temporary,STRING_FILETYPE_TEXT);
+			//"判別できません"
+			else lstrcpy(temporary,STRING_FILETYPE_UNKNOWN);
+
+			SetDlgItemText(hwnd,IDC_FILETYPE,temporary);
+
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					EndDialog(hwnd,0);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+LRESULT CALLBACK FileTreeViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	HTREEITEM hTreeItem;
+	char temporary[MAX_PATH];
+	char *path;
+	switch(message){
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDM_FILETREE_INSERT:
+					//"プロジェクトへ挿入するファイルを指定して下さい"
+					extern LPSTR DefFileFilter;
+					if(!GetFilePathDialog(hOwner,temporary,DefFileFilter,STRING_FILEOPENTITLE_INSERTEDPROJECT,1)) break;
+					Project_File_Insert(temporary);
+					break;
+				case IDM_FILETREE_OPEN:
+					hTreeItem=TreeView_GetSelection(hwnd);
+
+					path=ProjectInfo.pobj_DBFileInfo->GetPath(hTreeItem);
+					if(!path) break;
+
+					lstrcpy(temporary,path);
+					GetFullPath(temporary,ProjectInfo.dir);
+					OpenFileWithExtension(temporary);
+					break;
+				case IDM_FILETREE_DELETE:
+					hTreeItem=TreeView_GetSelection(hwnd);
+					Project_File_Delete(hTreeItem);
+					break;
+				case IDM_FILETREE_PROPERTY:
+					DialogBox(hResInst,MAKEINTRESOURCE(IDD_PROJECT_FILEPROPERTY),hOwner,DlgProject_FileProperty);
+					break;
+			}
+			return 0;
+		case WM_CHAR:
+			if(wParam==VK_RETURN){
+				SendMessage(hwnd,WM_COMMAND,IDM_FILETREE_OPEN,0);
+				//デフォルトのメッセージ処理をするとビープ音がしてしまうので避ける
+				return 0;
+			}
+			break;
+		case WM_KEYDOWN:
+			if(wParam==VK_DELETE){
+				SendMessage(hwnd,WM_COMMAND,IDM_FILETREE_DELETE,0);
+			}
+			break;
+		case WM_LBUTTONDBLCLK:
+			SendMessage(hwnd,WM_COMMAND,IDM_FILETREE_OPEN,0);
+			break;
+	}
+	return CallWindowProc(OldFileTreeViewProc,hwnd,message,wParam,lParam);
+}
+
+CFileTree::CFileTree(HWND hParent){
+	hTree=CreateWindowEx(WS_EX_CLIENTEDGE,WC_TREEVIEW,"",
+		WS_CHILD|TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT|TVS_SHOWSELALWAYS,
+		0,0,0,0,
+		hParent,0,hInst,0);
+	OldFileTreeViewProc=(WNDPROC)GetWindowLong(hTree,GWL_WNDPROC);
+	SetWindowLong(hTree,GWL_WNDPROC,(long)FileTreeViewProc);
+
+	//イメージリスト読み込み、設定
+	hImageList=ImageList_Create(16,16,ILC_COLOR24|ILC_MASK,3,0);
+	ImageList_AddIcon(hImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FOLDER_CLOSE)));
+	ImageList_AddIcon(hImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FOLDER_OPEN)));
+	ImageList_AddIcon(hImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_TEXTDOCUMENT)));
+	TreeView_SetImageList(hTree,hImageList,TVSIL_NORMAL);
+}
+CFileTree::~CFileTree(){
+	DestroyWindow(hTree);
+	ImageList_Destroy(hImageList);
+}
+
+void CFileTree::ContextMenu(POINT *pPos){
+	//右クリックによるメニューを表示
+	TV_HITTESTINFO tvHitTestInfo;
+	tvHitTestInfo.pt=*pPos;
+	ScreenToClient(hTree,&tvHitTestInfo.pt);
+
+	HTREEITEM hTreeItem;
+	hTreeItem=TreeView_HitTest(hTree,&tvHitTestInfo);
+	if(hTreeItem){
+		TreeView_SelectItem(hTree,hTreeItem);
+
+		extern HMENU hFileTreeMenuBase;
+		if(TreeView_GetRoot(hTree)==hTreeItem)
+			TrackPopupMenu(GetSubMenu(hFileTreeMenuBase,0),TPM_LEFTALIGN,pPos->x,pPos->y,0,hTree,0);
+		else TrackPopupMenu(GetSubMenu(hFileTreeMenuBase,1),TPM_LEFTALIGN,pPos->x,pPos->y,0,hTree,0);
+	}
+}
+
+HTREEITEM CFileTree::insert(char *str){
+	//////////////////////
+	//ツリービューに追加
+
+	TV_INSERTSTRUCT tv;
+	tv.hInsertAfter=TVI_SORT;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+	tv.item.iImage=2;
+	tv.item.iSelectedImage=2;
+	tv.hParent=TreeView_GetRoot(hTree);
+	tv.item.pszText=str;
+
+	return TreeView_InsertItem(hTree,&tv);
+}
+
+void CFileTree::resize(int x,int y,int cx,int cy){
+	MoveWindow(hTree,x,y,cx,cy,1);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/FileTree.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/FileTree.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/FileTree.h	(revision 178)
@@ -0,0 +1,17 @@
+
+
+class CFileTree{
+	HIMAGELIST hImageList;
+public:
+	HWND hTree;
+	CFileTree(HWND hParent);
+	~CFileTree();
+
+	void ContextMenu(POINT *pPos);
+
+	HTREEITEM insert(char *str);
+
+	void resize(int x,int y,int cx,int cy);
+};
+
+extern CFileTree *pobj_FileTree;
Index: tag/abdev(2007.06.20)/ProjectEditor/History.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/History.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/History.cpp	(revision 178)
@@ -0,0 +1,117 @@
+#include "common.h"
+
+CHistory::CHistory(int BaseID){
+	iNum=0;
+	iMaxHistoryNum=15;
+
+	m_BaseID=BaseID;
+}
+CHistory::~CHistory(){
+	int i;
+	for(i=0;i<iNum;i++){
+		HeapDefaultFree(lpszPath[i]);
+	}
+}
+
+void CHistory::load(char *path){
+	char temporary[MAX_PATH];
+
+	char *buffer;
+	buffer=ReadBuffer_NonErrMsg(path);
+	if(buffer){
+		int i;
+		i=0;
+		while(buffer[i]){
+			//表示名
+			i=GetOneParameter(buffer,i,temporary);
+			if(temporary[0]=='\0') break;
+
+			if(buffer[i]=='\r'&&buffer[i+1]=='\n'){
+				i+=2;
+			}
+
+			add(temporary);
+		}
+		HeapDefaultFree(buffer);
+	}
+}
+void CHistory::save(char *path){
+	char *buffer;
+	buffer=(char *)HeapAlloc(hHeap,0,iNum*MAX_PATH+1);
+	buffer[0]=0;
+
+	int i;
+	for(i=0;i<iNum;i++){
+		sprintf(buffer+lstrlen(buffer),"%s\r\n",lpszPath[i]);
+	}
+
+	WriteBuffer(path,buffer,lstrlen(buffer));
+
+	HeapDefaultFree(buffer);
+}
+void CHistory::add(char *path){
+	lpszPath[iNum]=(char *)HeapAlloc(hHeap,0,lstrlen(path)+1);
+	lstrcpy(lpszPath[iNum],path);
+	iNum++;
+}
+void CHistory::insert(char *path){
+	//重複チェック
+	int i;
+	for(i=0;i<iNum;i++){
+		if(lstrcmpi(path,lpszPath[i])==0) break;
+	}
+	if(i==iNum){
+		//ローテーション
+		for(i=iNum;i>0;i--){
+			lpszPath[i]=lpszPath[i-1];
+		}
+
+		if(iNum+1 == iMaxHistoryNum){
+			//一番古い情報を削除
+			HeapDefaultFree(lpszPath[iNum]);
+		}
+		else iNum++;
+	}
+	else{
+		//ローテーション
+		HeapDefaultFree(lpszPath[i]);
+
+		for(;i>0;i--){
+			lpszPath[i]=lpszPath[i-1];
+		}
+	}
+
+	lpszPath[0]=(char *)HeapAlloc(hHeap,0,lstrlen(path)+1);
+	lstrcpy(lpszPath[0],path);
+}
+
+void CHistory::ResetFileMenu(CSubMenuEx *pobj_SubMenu,BOOL bOwnerDraw){
+	//古いメニューアイテムを消去
+	while(0<pobj_SubMenu->iMenuItemNum){
+		pobj_SubMenu->RemoveItem(0);
+	}
+
+	if(iNum==0){
+		//なし
+		pobj_SubMenu->InsertItem(0,100,"なし");
+		pobj_SubMenu->EnableItem(100,MF_BYCOMMAND|MF_GRAYED);
+		return;
+	}
+
+
+	int i;
+	for(i=0;i<iNum;i++){
+		//挿入
+		pobj_SubMenu->InsertItem(i,m_BaseID+i,lpszPath[i]);
+
+		//アイコンをセット
+		if(IsExistFile(lpszPath[i])){
+			SHFILEINFO shfi;
+			SHGetFileInfo( lpszPath[i], FILE_ATTRIBUTE_ARCHIVE, &shfi, sizeof(SHFILEINFO), SHGFI_ICON | SHGFI_SMALLICON );
+
+			if(shfi.hIcon){
+				pobj_SubMenu->SetIcon(m_BaseID+i,shfi.hIcon);
+			}
+		}
+	}
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/HtmlAnalysis.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/HtmlAnalysis.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/HtmlAnalysis.cpp	(revision 178)
@@ -0,0 +1,691 @@
+#include "common.h"
+
+extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+
+#define ADD_TAG_PARAM(str) AddComplimentInfo(str,ACCESS_HTML_PARAM);
+
+int IsHtmlTagWord(char *str){
+	if(str[0]=='a'||str[0]=='A'){
+		if(lstrcmpi(str,"a")==0) return 1;
+		if(lstrcmpi(str,"abbr")==0) return 1;
+		if(lstrcmpi(str,"acronym")==0) return 1;
+		if(lstrcmpi(str,"address")==0) return 1;
+		if(lstrcmpi(str,"applet")==0) return 1;
+		if(lstrcmpi(str,"area")==0) return 1;
+	}
+	else if(str[0]=='b'||str[0]=='B'){
+		if(lstrcmpi(str,"b")==0) return 1;
+		if(lstrcmpi(str,"base")==0) return 1;
+		if(lstrcmpi(str,"basefont")==0) return 1;
+		if(lstrcmpi(str,"bdo")==0) return 1;
+		if(lstrcmpi(str,"bgsound")==0) return 1;
+		if(lstrcmpi(str,"big")==0) return 1;
+		if(lstrcmpi(str,"blink")==0) return 1;
+		if(lstrcmpi(str,"blockquote")==0) return 1;
+		if(lstrcmpi(str,"body")==0) return 1;
+		if(lstrcmpi(str,"br")==0) return 1;
+		if(lstrcmpi(str,"button")==0) return 1;
+	}
+	else if(str[0]=='c'||str[0]=='C'){
+		if(lstrcmpi(str,"caption")==0) return 1;
+		if(lstrcmpi(str,"center")==0) return 1;
+		if(lstrcmpi(str,"cite")==0) return 1;
+		if(lstrcmpi(str,"code")==0) return 1;
+		if(lstrcmpi(str,"col")==0) return 1;
+		if(lstrcmpi(str,"colgroup")==0) return 1;
+		if(lstrcmpi(str,"comment")==0) return 1;
+	}
+	else if(str[0]=='d'||str[0]=='D'){
+		if(lstrcmpi(str,"dd")==0) return 1;
+		if(lstrcmpi(str,"del")==0) return 1;
+		if(lstrcmpi(str,"dfn")==0) return 1;
+		if(lstrcmpi(str,"dir")==0) return 1;
+		if(lstrcmpi(str,"div")==0) return 1;
+		if(lstrcmpi(str,"dl")==0) return 1;
+		if(lstrcmpi(str,"dt")==0) return 1;
+	}
+	else if(str[0]=='e'||str[0]=='E'){
+		if(lstrcmpi(str,"em")==0) return 1;
+		if(lstrcmpi(str,"embed")==0) return 1;
+	}
+	else if(str[0]=='f'||str[0]=='F'){
+		if(lstrcmpi(str,"fieldset")==0) return 1;
+		if(lstrcmpi(str,"font")==0) return 1;
+		if(lstrcmpi(str,"form")==0) return 1;
+		if(lstrcmpi(str,"frame")==0) return 1;
+		if(lstrcmpi(str,"frameset")==0) return 1;
+	}
+	else if(str[0]=='h'||str[0]=='H'){
+		if(lstrcmpi(str,"h1")==0) return 1;
+		if(lstrcmpi(str,"h2")==0) return 1;
+		if(lstrcmpi(str,"h3")==0) return 1;
+		if(lstrcmpi(str,"h4")==0) return 1;
+		if(lstrcmpi(str,"h5")==0) return 1;
+		if(lstrcmpi(str,"h6")==0) return 1;
+		if(lstrcmpi(str,"head")==0) return 1;
+		if(lstrcmpi(str,"hr")==0) return 1;
+		if(lstrcmpi(str,"html")==0) return 1;
+	}
+	else if(str[0]=='i'||str[0]=='I'){
+		if(lstrcmpi(str,"i")==0) return 1;
+		if(lstrcmpi(str,"iframe")==0) return 1;
+		if(lstrcmpi(str,"ilayer")==0) return 1;
+		if(lstrcmpi(str,"img")==0) return 1;
+		if(lstrcmpi(str,"input")==0) return 1;
+		if(lstrcmpi(str,"ins")==0) return 1;
+		if(lstrcmpi(str,"isindex")==0) return 1;
+	}
+	else if(str[0]=='k'||str[0]=='K'){
+		if(lstrcmpi(str,"kbd")==0) return 1;
+		if(lstrcmpi(str,"keygen")==0) return 1;
+	}
+	else if(str[0]=='l'||str[0]=='L'){
+		if(lstrcmpi(str,"label")==0) return 1;
+		if(lstrcmpi(str,"layer")==0) return 1;
+		if(lstrcmpi(str,"legend")==0) return 1;
+		if(lstrcmpi(str,"li")==0) return 1;
+		if(lstrcmpi(str,"link")==0) return 1;
+		if(lstrcmpi(str,"listing")==0) return 1;
+	}
+	else if(str[0]=='m'||str[0]=='M'){
+		if(lstrcmpi(str,"map")==0) return 1;
+		if(lstrcmpi(str,"marquee")==0) return 1;
+		if(lstrcmpi(str,"menu")==0) return 1;
+		if(lstrcmpi(str,"meta")==0) return 1;
+		if(lstrcmpi(str,"multicol")==0) return 1;
+	}
+	else if(str[0]=='n'||str[0]=='N'){
+		if(lstrcmpi(str,"nobr")==0) return 1;
+		if(lstrcmpi(str,"noembed")==0) return 1;
+		if(lstrcmpi(str,"noframes")==0) return 1;
+		if(lstrcmpi(str,"nolayer")==0) return 1;
+		if(lstrcmpi(str,"noscript")==0) return 1;
+	}
+	else if(str[0]=='o'||str[0]=='O'){
+		if(lstrcmpi(str,"object")==0) return 1;
+		if(lstrcmpi(str,"ol")==0) return 1;
+		if(lstrcmpi(str,"optgroup")==0) return 1;
+		if(lstrcmpi(str,"option")==0) return 1;
+	}
+	else if(str[0]=='p'||str[0]=='P'){
+		if(lstrcmpi(str,"p")==0) return 1;
+		if(lstrcmpi(str,"param")==0) return 1;
+		if(lstrcmpi(str,"plaintext")==0) return 1;
+		if(lstrcmpi(str,"pre")==0) return 1;
+	}
+	else if(str[0]=='q'||str[0]=='Q'){
+		if(lstrcmpi(str,"q")==0) return 1;
+	}
+	else if(str[0]=='r'||str[0]=='R'){
+		if(lstrcmpi(str,"rb")==0) return 1;
+		if(lstrcmpi(str,"rp")==0) return 1;
+		if(lstrcmpi(str,"rt")==0) return 1;
+		if(lstrcmpi(str,"ruby")==0) return 1;
+	}
+	else if(str[0]=='s'||str[0]=='S'){
+		if(lstrcmpi(str,"s")==0) return 1;
+		if(lstrcmpi(str,"samp")==0) return 1;
+		if(lstrcmpi(str,"script")==0) return 1;
+		if(lstrcmpi(str,"select")==0) return 1;
+		if(lstrcmpi(str,"server")==0) return 1;
+		if(lstrcmpi(str,"small")==0) return 1;
+		if(lstrcmpi(str,"span")==0) return 1;
+		if(lstrcmpi(str,"strike")==0) return 1;
+		if(lstrcmpi(str,"strong")==0) return 1;
+		if(lstrcmpi(str,"style")==0) return 1;
+		if(lstrcmpi(str,"sub")==0) return 1;
+		if(lstrcmpi(str,"sup")==0) return 1;
+	}
+	else if(str[0]=='t'||str[0]=='T'){
+		if(lstrcmpi(str,"table")==0) return 1;
+		if(lstrcmpi(str,"tbody")==0) return 1;
+		if(lstrcmpi(str,"td")==0) return 1;
+		if(lstrcmpi(str,"textarea")==0) return 1;
+		if(lstrcmpi(str,"tfoot")==0) return 1;
+		if(lstrcmpi(str,"th")==0) return 1;
+		if(lstrcmpi(str,"thead")==0) return 1;
+		if(lstrcmpi(str,"title")==0) return 1;
+		if(lstrcmpi(str,"tr")==0) return 1;
+		if(lstrcmpi(str,"tt")==0) return 1;
+	}
+	else if(str[0]=='u'||str[0]=='U'){
+		if(lstrcmpi(str,"u")==0) return 1;
+		if(lstrcmpi(str,"ul")==0) return 1;
+	}
+	else if(str[0]=='v'||str[0]=='V'){
+		if(lstrcmpi(str,"var")==0) return 1;
+	}
+	else if(str[0]=='w'||str[0]=='W'){
+		if(lstrcmpi(str,"wbr")==0) return 1;
+	}
+	else if(str[0]=='x'||str[0]=='X'){
+		if(lstrcmpi(str,"xmp")==0) return 1;
+	}
+
+
+	return 0;
+}
+int IsHtmlReservedWord(char *str){
+	return IsHtmlTagWord(str);
+}
+
+void AddComplimentInfo(char *str,DWORD dwAccess){
+	ComplementWndInfo.pMemberInfo=(MEMBERINFO *)HeapReAlloc(hHeap,0,
+		ComplementWndInfo.pMemberInfo,
+		(ComplementWndInfo.MemberNum+1)*sizeof(MEMBERINFO));
+
+	ComplementWndInfo.pMemberInfo[ComplementWndInfo.MemberNum].pName=
+		(char *)HeapAlloc(hHeap,0,lstrlen(str)+1);
+	lstrcpy(
+		ComplementWndInfo.pMemberInfo[ComplementWndInfo.MemberNum].pName,
+		str);
+
+	ComplementWndInfo.pMemberInfo[ComplementWndInfo.MemberNum].dwProc=0;
+
+	ComplementWndInfo.pMemberInfo[ComplementWndInfo.MemberNum].dwAccess=dwAccess;
+
+	ComplementWndInfo.MemberNum++;
+}
+
+BOOL GetNowTagInfo(char *buffer,int p){
+	int i,i2,i3;
+	for(i=p;i>0;i--){
+		if(buffer[i]=='\r'&&buffer[i+1]=='\n') break;
+	}
+
+	int IsStr=0;
+	char szTag[1024];
+	szTag[0]=0;
+	for(;i<p;i++){
+		if(buffer[i]=='\0') break;
+		if(buffer[i]=='<'){
+			IsStr=0;
+
+			i2=i+1;
+			while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+
+			if(IsAlphabet(buffer[i2])){
+				for(i3=0;;i2++,i3++){
+					if(!IsAlphabet(buffer[i2])){
+						szTag[i3]=0;
+						break;
+					}
+					szTag[i3]=buffer[i2];
+				}
+			}
+			else szTag[0]=0;
+		}
+		if(buffer[i]=='>'&&IsStr==0){
+			szTag[0]=0;
+		}
+
+		if(buffer[i]=='\"'&&szTag[0]){
+			//タグ内のダブルクォート
+			IsStr^=1;
+		}
+	}
+
+	if(IsStr){
+		//文字列内では補完しない
+		return 0;
+	}
+
+	if(!IsHtmlTagWord(szTag)){
+		//未登録のタグはサポートしない
+		return 0;
+	}
+
+	ComplementWndInfo.pMemberInfo=(MEMBERINFO *)HeapAlloc(hHeap,0,1);
+	ComplementWndInfo.MemberNum=0;
+
+	BOOL bUseGeneralParam=1;
+	if(lstrcmpi(szTag,"a")==0){
+		ADD_TAG_PARAM("href");
+		ADD_TAG_PARAM("name");
+		ADD_TAG_PARAM("target");
+	}
+	else if(lstrcmpi(szTag,"applet")==0){
+		ADD_TAG_PARAM("alt");
+		ADD_TAG_PARAM("archive");
+		ADD_TAG_PARAM("code");
+		ADD_TAG_PARAM("codebase");
+		ADD_TAG_PARAM("mayscript");
+		ADD_TAG_PARAM("object");
+		ADD_TAG_PARAM("src");
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("height");
+		ADD_TAG_PARAM("hspace");
+		ADD_TAG_PARAM("vspace");
+		ADD_TAG_PARAM("width");
+	}
+	else if(lstrcmpi(szTag,"area")==0){
+		ADD_TAG_PARAM("shape");
+		ADD_TAG_PARAM("coords");
+		ADD_TAG_PARAM("href");
+		ADD_TAG_PARAM("alt");
+		ADD_TAG_PARAM("accesskey");
+		ADD_TAG_PARAM("nohref");
+		ADD_TAG_PARAM("hreflang");
+		ADD_TAG_PARAM("methods");
+		ADD_TAG_PARAM("rel");
+		ADD_TAG_PARAM("rev");
+		ADD_TAG_PARAM("tabindex");
+		ADD_TAG_PARAM("target");
+	}
+	else if(lstrcmpi(szTag,"base")==0){
+		ADD_TAG_PARAM("href");
+		ADD_TAG_PARAM("target");
+
+		bUseGeneralParam=0;
+	}
+	else if(lstrcmpi(szTag,"basefont")==0){
+		ADD_TAG_PARAM("size");
+		ADD_TAG_PARAM("color");
+		ADD_TAG_PARAM("face");
+	}
+	else if(lstrcmpi(szTag,"bgsound")==0){
+		ADD_TAG_PARAM("balance");
+		ADD_TAG_PARAM("loop");
+		ADD_TAG_PARAM("src");
+		ADD_TAG_PARAM("volume");
+	}
+	else if(lstrcmpi(szTag,"blockquote")==0){
+		ADD_TAG_PARAM("cite");
+	}
+	else if(lstrcmpi(szTag,"body")==0){
+		ADD_TAG_PARAM("text");
+		ADD_TAG_PARAM("link");
+		ADD_TAG_PARAM("vlink");
+		ADD_TAG_PARAM("alink");
+		ADD_TAG_PARAM("bgcolor");
+		ADD_TAG_PARAM("background");
+		ADD_TAG_PARAM("bgproperties");
+		ADD_TAG_PARAM("marginheight");
+		ADD_TAG_PARAM("marginwidth");
+		ADD_TAG_PARAM("topmargin");
+		ADD_TAG_PARAM("leftmargin");
+		ADD_TAG_PARAM("bottommargin");
+		ADD_TAG_PARAM("rightmargin");
+		ADD_TAG_PARAM("scroll");
+	}
+	else if(lstrcmpi(szTag,"br")==0){
+		ADD_TAG_PARAM("/");
+		ADD_TAG_PARAM("clear");
+	}
+	else if(lstrcmpi(szTag,"button")==0){
+		ADD_TAG_PARAM("accesskey");
+		ADD_TAG_PARAM("disabled");
+		ADD_TAG_PARAM("tabindex");
+		ADD_TAG_PARAM("type");
+		ADD_TAG_PARAM("value");
+	}
+	else if(lstrcmpi(szTag,"caption")==0){
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("valign");
+	}
+	else if(lstrcmpi(szTag,"col")==0){
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("bgcolor");
+		ADD_TAG_PARAM("char");
+		ADD_TAG_PARAM("charoff");
+		ADD_TAG_PARAM("span");
+		ADD_TAG_PARAM("valign");
+		ADD_TAG_PARAM("width");
+	}
+	else if(lstrcmpi(szTag,"colgroup")==0){
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("bgcolor");
+		ADD_TAG_PARAM("char");
+		ADD_TAG_PARAM("charoff");
+		ADD_TAG_PARAM("span");
+		ADD_TAG_PARAM("valign");
+		ADD_TAG_PARAM("width");
+	}
+	else if(lstrcmpi(szTag,"del")==0){
+		ADD_TAG_PARAM("cite");
+		ADD_TAG_PARAM("datetime");
+	}
+	else if(lstrcmpi(szTag,"div")==0){
+		ADD_TAG_PARAM("align");
+	}
+	else if(lstrcmpi(szTag,"dl")==0){
+		ADD_TAG_PARAM("compact");
+	}
+	else if(lstrcmpi(szTag,"embed")==0){
+		ADD_TAG_PARAM("src");
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("height");
+		ADD_TAG_PARAM("width");
+		ADD_TAG_PARAM("hspace");
+		ADD_TAG_PARAM("vspace");
+		ADD_TAG_PARAM("compact");
+		ADD_TAG_PARAM("units");
+		ADD_TAG_PARAM("border");
+		ADD_TAG_PARAM("frameborder");
+		ADD_TAG_PARAM("hidden");
+		ADD_TAG_PARAM("alt");
+		ADD_TAG_PARAM("code");
+		ADD_TAG_PARAM("codebase");
+		ADD_TAG_PARAM("type");
+		ADD_TAG_PARAM("palette");
+		ADD_TAG_PARAM("pluginspage");
+		ADD_TAG_PARAM("pluginurl");
+		ADD_TAG_PARAM("autostart");
+		ADD_TAG_PARAM("autoplay");
+		ADD_TAG_PARAM("control");
+		ADD_TAG_PARAM("loop");
+		ADD_TAG_PARAM("repeat");
+		ADD_TAG_PARAM("textfocus");
+	}
+	else if(lstrcmpi(szTag,"fieldset")==0){
+		ADD_TAG_PARAM("align");
+	}
+	else if(lstrcmpi(szTag,"font")==0){
+		ADD_TAG_PARAM("size");
+		ADD_TAG_PARAM("color");
+		ADD_TAG_PARAM("face");
+	}
+	else if(lstrcmpi(szTag,"form")==0){
+		ADD_TAG_PARAM("action");
+		ADD_TAG_PARAM("method");
+		ADD_TAG_PARAM("target");
+		ADD_TAG_PARAM("accept");
+		ADD_TAG_PARAM("accept-charset");
+		ADD_TAG_PARAM("autocomplete");
+		ADD_TAG_PARAM("enctype");
+		ADD_TAG_PARAM("urn");
+	}
+	else if(lstrcmpi(szTag,"frame")==0){
+		ADD_TAG_PARAM("src");
+		ADD_TAG_PARAM("height");
+		ADD_TAG_PARAM("width");
+		ADD_TAG_PARAM("bordercolor");
+		ADD_TAG_PARAM("frameborder");
+		ADD_TAG_PARAM("marginheight");
+		ADD_TAG_PARAM("marginwidth");
+		ADD_TAG_PARAM("noresize");
+		ADD_TAG_PARAM("longdesc");
+		ADD_TAG_PARAM("scrolling");
+		ADD_TAG_PARAM("allowtransparency");
+	}
+	else if(lstrcmpi(szTag,"frameset")==0){
+		ADD_TAG_PARAM("border");
+		ADD_TAG_PARAM("bordercolor");
+		ADD_TAG_PARAM("cols");
+		ADD_TAG_PARAM("frameborder");
+		ADD_TAG_PARAM("framespacing");
+		ADD_TAG_PARAM("rows");
+	}
+	else if(lstrcmpi(szTag,"h1")==0||
+		lstrcmpi(szTag,"h2")==0||
+		lstrcmpi(szTag,"h3")==0||
+		lstrcmpi(szTag,"h4")==0||
+		lstrcmpi(szTag,"h5")==0||
+		lstrcmpi(szTag,"h6")==0){
+		ADD_TAG_PARAM("align");
+	}
+	else if(lstrcmpi(szTag,"hr")==0){
+		ADD_TAG_PARAM("/");
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("color");
+		ADD_TAG_PARAM("noshade");
+		ADD_TAG_PARAM("size");
+		ADD_TAG_PARAM("width");
+	}
+	else if(lstrcmpi(szTag,"iframe")==0){
+		ADD_TAG_PARAM("src");
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("height");
+		ADD_TAG_PARAM("width");
+		ADD_TAG_PARAM("hspace");
+		ADD_TAG_PARAM("vspace");
+		ADD_TAG_PARAM("marginheight");
+		ADD_TAG_PARAM("marginwidth");
+		ADD_TAG_PARAM("border");
+		ADD_TAG_PARAM("bordercolor");
+		ADD_TAG_PARAM("frameborder");
+		ADD_TAG_PARAM("framespacing");
+		ADD_TAG_PARAM("longdesc");
+		ADD_TAG_PARAM("scrolling");
+	}
+	else if(lstrcmpi(szTag,"img")==0){
+		ADD_TAG_PARAM("src");
+		ADD_TAG_PARAM("alt");
+		ADD_TAG_PARAM("height");
+		ADD_TAG_PARAM("width");
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("border");
+		ADD_TAG_PARAM("galleryimg");
+		ADD_TAG_PARAM("hspace");
+		ADD_TAG_PARAM("longdesc");
+		ADD_TAG_PARAM("lowsrc");
+		ADD_TAG_PARAM("suppress");
+		ADD_TAG_PARAM("vspace");
+		ADD_TAG_PARAM("ismap");
+		ADD_TAG_PARAM("usemap");
+		ADD_TAG_PARAM("controls");
+		ADD_TAG_PARAM("dynsrc");
+		ADD_TAG_PARAM("loop");
+		ADD_TAG_PARAM("start");
+	}
+	else if(lstrcmpi(szTag,"input")==0){
+		ADD_TAG_PARAM("accesskey");
+		ADD_TAG_PARAM("disabled");
+		ADD_TAG_PARAM("tabindex");
+		ADD_TAG_PARAM("type");
+		ADD_TAG_PARAM("autocomplete");
+		ADD_TAG_PARAM("istyle");
+		ADD_TAG_PARAM("maxlength");
+		ADD_TAG_PARAM("readonly");
+		ADD_TAG_PARAM("value");
+		ADD_TAG_PARAM("accept");
+		ADD_TAG_PARAM("checked");
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("alt");
+		ADD_TAG_PARAM("border");
+		ADD_TAG_PARAM("dynsrc");
+		ADD_TAG_PARAM("height");
+		ADD_TAG_PARAM("ismap");
+		ADD_TAG_PARAM("lowsrc");
+		ADD_TAG_PARAM("src");
+		ADD_TAG_PARAM("width");
+	}
+	else if(lstrcmpi(szTag,"ins")==0){
+		ADD_TAG_PARAM("cite");
+		ADD_TAG_PARAM("datetime");
+	}
+	else if(lstrcmpi(szTag,"label")==0){
+		ADD_TAG_PARAM("accesskey");
+		ADD_TAG_PARAM("for");
+	}
+	else if(lstrcmpi(szTag,"legend")==0){
+		ADD_TAG_PARAM("accesskey");
+		ADD_TAG_PARAM("align");
+	}
+	else if(lstrcmpi(szTag,"li")==0){
+		ADD_TAG_PARAM("type");
+		ADD_TAG_PARAM("value");
+	}
+	else if(lstrcmpi(szTag,"link")==0){
+		ADD_TAG_PARAM("rel");
+		ADD_TAG_PARAM("href");
+		ADD_TAG_PARAM("src");
+		ADD_TAG_PARAM("charset");
+		ADD_TAG_PARAM("media");
+		ADD_TAG_PARAM("type");
+	}
+	else if(lstrcmpi(szTag,"marquee")==0){
+		ADD_TAG_PARAM("behavior");
+		ADD_TAG_PARAM("bgcolor");
+		ADD_TAG_PARAM("direction");
+		ADD_TAG_PARAM("height");
+		ADD_TAG_PARAM("hspace");
+		ADD_TAG_PARAM("loop");
+		ADD_TAG_PARAM("scrollamount");
+		ADD_TAG_PARAM("scrolldelay");
+		ADD_TAG_PARAM("truespeed");
+		ADD_TAG_PARAM("vspace");
+		ADD_TAG_PARAM("width");
+	}
+	else if(lstrcmpi(szTag,"meta")==0){
+		ADD_TAG_PARAM("name");
+		ADD_TAG_PARAM("http-equiv");
+		ADD_TAG_PARAM("content");
+	}
+	else if(lstrcmpi(szTag,"object")==0){
+		ADD_TAG_PARAM("alt");
+		ADD_TAG_PARAM("archive");
+		ADD_TAG_PARAM("border");
+		ADD_TAG_PARAM("classid");
+		ADD_TAG_PARAM("code");
+		ADD_TAG_PARAM("codebase");
+		ADD_TAG_PARAM("codetype");
+		ADD_TAG_PARAM("data");
+		ADD_TAG_PARAM("declare");
+		ADD_TAG_PARAM("name");
+		ADD_TAG_PARAM("standby");
+		ADD_TAG_PARAM("tabindex");
+		ADD_TAG_PARAM("type");
+		ADD_TAG_PARAM("usemap");
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("width");
+		ADD_TAG_PARAM("height");
+		ADD_TAG_PARAM("hspace");
+		ADD_TAG_PARAM("vspace");
+	}
+	else if(lstrcmpi(szTag,"ol")==0){
+		ADD_TAG_PARAM("compact");
+		ADD_TAG_PARAM("start");
+		ADD_TAG_PARAM("type");
+	}
+	else if(lstrcmpi(szTag,"option")==0){
+		ADD_TAG_PARAM("disabled");
+		ADD_TAG_PARAM("label");
+		ADD_TAG_PARAM("selected");
+		ADD_TAG_PARAM("value");
+	}
+	else if(lstrcmpi(szTag,"p")==0){
+		ADD_TAG_PARAM("align");
+	}
+	else if(lstrcmpi(szTag,"param")==0){
+		ADD_TAG_PARAM("name");
+		ADD_TAG_PARAM("value");
+		ADD_TAG_PARAM("valuetype");
+		ADD_TAG_PARAM("type");
+	}
+	else if(lstrcmpi(szTag,"pre")==0){
+		ADD_TAG_PARAM("cols");
+		ADD_TAG_PARAM("width");
+		ADD_TAG_PARAM("wrap");
+	}
+	else if(lstrcmpi(szTag,"script")==0){
+		ADD_TAG_PARAM("charset");
+		ADD_TAG_PARAM("defer");
+		ADD_TAG_PARAM("event");
+		ADD_TAG_PARAM("for");
+		ADD_TAG_PARAM("src");
+		ADD_TAG_PARAM("type");
+	}
+	else if(lstrcmpi(szTag,"select")==0){
+		ADD_TAG_PARAM("accesskey");
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("disabled");
+		ADD_TAG_PARAM("multiple");
+		ADD_TAG_PARAM("size");
+		ADD_TAG_PARAM("tabindex");
+	}
+	else if(lstrcmpi(szTag,"style")==0){
+		ADD_TAG_PARAM("disabled");
+		ADD_TAG_PARAM("media");
+		ADD_TAG_PARAM("type");
+	}
+	else if(lstrcmpi(szTag,"table")==0){
+		ADD_TAG_PARAM("border");
+		ADD_TAG_PARAM("bordercolor");
+		ADD_TAG_PARAM("bordercolordark");
+		ADD_TAG_PARAM("bordercolorlight");
+		ADD_TAG_PARAM("frame");
+		ADD_TAG_PARAM("rules");
+		ADD_TAG_PARAM("background");
+		ADD_TAG_PARAM("bgcolor");
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("cellpadding");
+		ADD_TAG_PARAM("cellspacing");
+		ADD_TAG_PARAM("height");
+		ADD_TAG_PARAM("hspace");
+		ADD_TAG_PARAM("vspace");
+		ADD_TAG_PARAM("width");
+		ADD_TAG_PARAM("cols");
+		ADD_TAG_PARAM("summary");
+	}
+	else if(lstrcmpi(szTag,"tbody")==0||
+		lstrcmpi(szTag,"tfoot")==0||
+		lstrcmpi(szTag,"thead")==0){
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("bgcolor");
+		ADD_TAG_PARAM("char");
+		ADD_TAG_PARAM("charoff");
+		ADD_TAG_PARAM("valign");
+	}
+	else if(lstrcmpi(szTag,"td")==0||
+		lstrcmpi(szTag,"th")==0){
+		ADD_TAG_PARAM("bordercolor");
+		ADD_TAG_PARAM("bordercolordark");
+		ADD_TAG_PARAM("bordercolorlight");
+		ADD_TAG_PARAM("background");
+		ADD_TAG_PARAM("bgcolor");
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("valign");
+		ADD_TAG_PARAM("height");
+		ADD_TAG_PARAM("width");
+		ADD_TAG_PARAM("nowrap");
+		ADD_TAG_PARAM("char");
+		ADD_TAG_PARAM("charoff");
+		ADD_TAG_PARAM("colspan");
+		ADD_TAG_PARAM("rowspan");
+		ADD_TAG_PARAM("abbr");
+		ADD_TAG_PARAM("axis");
+		ADD_TAG_PARAM("headers");
+		ADD_TAG_PARAM("scope");
+	}
+	else if(lstrcmpi(szTag,"textarea")==0){
+		ADD_TAG_PARAM("accesskey");
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("cols");
+		ADD_TAG_PARAM("istyle");
+		ADD_TAG_PARAM("readonly");
+		ADD_TAG_PARAM("rows");
+		ADD_TAG_PARAM("wrap");
+		ADD_TAG_PARAM("tabindex");
+	}
+	else if(lstrcmpi(szTag,"title")==0){
+		bUseGeneralParam=0;
+	}
+	else if(lstrcmpi(szTag,"tr")==0){
+		ADD_TAG_PARAM("bordercolor");
+		ADD_TAG_PARAM("bordercolordark");
+		ADD_TAG_PARAM("bordercolorlight");
+		ADD_TAG_PARAM("bgcolor");
+		ADD_TAG_PARAM("align");
+		ADD_TAG_PARAM("char");
+		ADD_TAG_PARAM("charoff");
+		ADD_TAG_PARAM("height");
+		ADD_TAG_PARAM("valign");
+	}
+	else if(lstrcmpi(szTag,"ul")==0){
+		ADD_TAG_PARAM("compact");
+		ADD_TAG_PARAM("type");
+	}
+
+
+
+
+	if(bUseGeneralParam){
+		//一般属性
+		AddComplimentInfo("class",ACCESS_HTML_GENERAL_PARAM);
+		AddComplimentInfo("id",ACCESS_HTML_GENERAL_PARAM);
+		AddComplimentInfo("style",ACCESS_HTML_GENERAL_PARAM);
+	}
+
+	return 1;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/HtmlAnalysis.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/HtmlAnalysis.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/HtmlAnalysis.h	(revision 178)
@@ -0,0 +1,2 @@
+int IsHtmlReservedWord(char *str);
+BOOL GetNowTagInfo(char *buffer,int p);
Index: tag/abdev(2007.06.20)/ProjectEditor/IconEditor.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/IconEditor.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/IconEditor.cpp	(revision 178)
@@ -0,0 +1,568 @@
+#include "Common.h"
+
+RGBQUAD DefaultColorTable16[16]={
+	0,0,0,0,
+	0,0,128,0,
+	0,128,0,0,
+	0,128,128,0,
+	128,0,0,0,
+	128,0,128,0,
+	128,128,0,0,
+	128,128,128,0,
+	192,192,192,0,
+	0,0,255,0,
+	0,255,0,0,
+	0,255,255,0,
+	255,0,0,0,
+	255,0,255,0,
+	255,255,0,0,
+	255,255,255,0,
+};
+RGBQUAD DefaultColorTable256[256];	//ファイルから読み込む（SetupProjectEditor関数を参照）
+
+void ResizeIconWindow(HWND hMain,HWND hToolDlg,HWND hColorDlg,int width,int height){
+	MoveWindow(hMain,0,0,width-170,height-50,1);
+	MoveWindow(hToolDlg,width-170,0,170,height,1);
+	MoveWindow(hColorDlg,0,height-50,width-170,50,1);
+}
+void ResetIconType(int WndNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	HWND hCombo;
+	char temporary[MAX_PATH];
+	BITMAPINFOHEADER *pBmpInfoHdr;
+
+	hCombo=GetDlgItem(MdiInfo[WndNum].MdiIconEditInfo->hToolDlg,IDC_ICONTYPECOMBO);
+
+	for(i=0;i<MdiInfo[WndNum].MdiIconEditInfo->num;i++){
+		pBmpInfoHdr=(BITMAPINFOHEADER *)MdiInfo[WndNum].MdiIconEditInfo->pIconImage[i];
+
+		//例: "32*32 (xxxx色)"
+		sprintf(temporary,"%d*%d (%d%s)",
+			pBmpInfoHdr->biWidth,
+			pBmpInfoHdr->biHeight/2,
+			(int)pow((double)2,(double)pBmpInfoHdr->biBitCount),
+			STRING_UNIT_COLORS);
+		SendMessage(hCombo,CB_ADDSTRING,0,(long)temporary);
+	}
+	SendMessage(hCombo,CB_SETCURSEL,0,0);
+}
+BYTE *CreateIconType(int IconType,DWORD *dwBytes){
+	extern HANDLE hHeap;
+	int i,width,BitCount,dwBytesInRes;
+	BITMAPINFOHEADER *pBmpHdr;
+	BYTE *pImageBuffer;
+
+	switch(IconType){
+		case ICONTYPE_16_16:
+			width=16;
+			BitCount=4;
+			break;
+		case ICONTYPE_16_256:
+			width=16;
+			BitCount=8;
+			break;
+		case ICONTYPE_32_16:
+			width=32;
+			BitCount=4;
+			break;
+		case ICONTYPE_32_256:
+			width=32;
+			BitCount=8;
+			break;
+	}
+
+	//イメージサイズを計算
+	dwBytesInRes=sizeof(BITMAPINFOHEADER)+
+		sizeof(RGBQUAD)*(int)pow((double)2,(double)BitCount)+
+		BitCount*width*width/8;
+	if(width==16) dwBytesInRes+=width*width*2/8;
+	else dwBytesInRes+=width*width/8;
+	*dwBytes=dwBytesInRes;
+
+	//メモリ領域を確保
+	pImageBuffer=(BYTE *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,dwBytesInRes);
+
+	//ヘッダ情報をセット
+	pBmpHdr=(BITMAPINFOHEADER *)pImageBuffer;
+	pBmpHdr->biSize=sizeof(BITMAPINFOHEADER);
+	pBmpHdr->biWidth=width;
+	pBmpHdr->biHeight=width*2;
+	pBmpHdr->biPlanes=1;
+	pBmpHdr->biBitCount=BitCount;
+
+	//カラーテーブルをセット
+	RGBQUAD *pRgbq;
+	pRgbq=(RGBQUAD *)(pImageBuffer+sizeof(BITMAPINFOHEADER));
+	if(BitCount==4){
+		//16色
+		memcpy(pRgbq,DefaultColorTable16,sizeof(RGBQUAD)*16);
+	}
+	else if(BitCount==8){
+		//256色
+		memcpy(pRgbq,DefaultColorTable256,sizeof(RGBQUAD)*256);
+	}
+
+	//マスクビットをセット
+	BYTE *pMaskBuf;
+	pMaskBuf=pImageBuffer+
+		sizeof(BITMAPINFOHEADER)+
+		sizeof(RGBQUAD)*(int)pow((double)2,(double)BitCount)+
+		BitCount*width*width/8;
+	if(width==16){
+		//一行の4バイト境界を考慮
+		for(i=0;i<16;i++){
+			pMaskBuf[i*4]=0xFF;
+			pMaskBuf[i*4+1]=0xFF;
+			pMaskBuf[i*4+2]=0;
+			pMaskBuf[i*4+3]=0;
+		}
+	}
+	else memset(pMaskBuf,0xFF,width*width/8);
+
+	return pImageBuffer;
+}
+void AddIconType(int WndNum,int IconType){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,width,BitCount;
+
+	switch(IconType){
+		case ICONTYPE_16_16:
+			width=16;
+			BitCount=4;
+			break;
+		case ICONTYPE_16_256:
+			width=16;
+			BitCount=8;
+			break;
+		case ICONTYPE_32_16:
+			width=32;
+			BitCount=4;
+			break;
+		case ICONTYPE_32_256:
+			width=32;
+			BitCount=8;
+			break;
+	}
+
+	MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->num]=
+		CreateIconType(IconType,
+		&MdiInfo[WndNum].MdiIconEditInfo->dwBytesInRes[MdiInfo[WndNum].MdiIconEditInfo->num]);
+
+	//イメージ選択用のメモリを解放
+	if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==2)
+		DeleteObject(MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp);
+	MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=0;
+
+	//アイコンタイプを追加
+	MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum=MdiInfo[WndNum].MdiIconEditInfo->num;
+	MdiInfo[WndNum].MdiIconEditInfo->num++;
+
+	//変更情報を初期化
+	i=MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum;
+	MdiInfo[WndNum].MdiIconEditInfo->undo[i].NowPos=0;
+	memset(MdiInfo[WndNum].MdiIconEditInfo->undo[i].lpData,0,sizeof(BYTE *)*MAX_ICONEDIT_UNDONUM);
+
+	//アイコンタイプコンボボックスに追加
+	char temporary[32];
+	HWND hCombo;
+	hCombo=GetDlgItem(MdiInfo[WndNum].MdiIconEditInfo->hToolDlg,IDC_ICONTYPECOMBO);
+
+	//例: "32*32 (xxxx色)"
+	sprintf(temporary,"%d*%d (%d%s)",
+		width,
+		width,
+		(int)pow((double)2,(double)BitCount),
+		STRING_UNIT_COLORS);
+	i=SendMessage(hCombo,CB_ADDSTRING,0,(long)temporary);
+
+	SendMessage(hCombo,CB_SETCURSEL,i,0);
+
+	//再描画
+	HBRUSH hOldBrush;
+	hOldBrush=(HBRUSH)SelectObject(MdiInfo[WndNum].MdiIconEditInfo->memdc,GetStockObject(WHITE_BRUSH));
+	PatBlt(MdiInfo[WndNum].MdiIconEditInfo->memdc,0,0,400,400,PATCOPY);
+	SelectObject(MdiInfo[WndNum].MdiIconEditInfo->memdc,hOldBrush);
+	DrawIconToMemBmp(WndNum,0);
+	InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hMain,NULL,1);
+	InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hColorDlg,NULL,0);
+}
+void DeleteIconType(int WndNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+
+	//変更情報を解放
+	for(i=0;i<MAX_ICONEDIT_UNDONUM;i++){
+		if(MdiInfo[WndNum].MdiIconEditInfo->undo[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum].lpData[i])
+			HeapDefaultFree(MdiInfo[WndNum].MdiIconEditInfo->undo[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum].lpData[i]);
+	}
+
+	//メモリを解放
+	HeapDefaultFree(MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]);
+
+	//イメージ選択用のメモリを解放
+	if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==2)
+		DeleteObject(MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp);
+	MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=0;
+
+	////////////////////////
+	// アイコンタイプを削除
+	for(i=MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum;i<MdiInfo[WndNum].MdiIconEditInfo->num-1;i++){
+		MdiInfo[WndNum].MdiIconEditInfo->pIconImage[i]=MdiInfo[WndNum].MdiIconEditInfo->pIconImage[i+1];
+		MdiInfo[WndNum].MdiIconEditInfo->dwBytesInRes[i]=MdiInfo[WndNum].MdiIconEditInfo->dwBytesInRes[i+1];
+		MdiInfo[WndNum].MdiIconEditInfo->undo[i]=MdiInfo[WndNum].MdiIconEditInfo->undo[i+1];
+	}
+	MdiInfo[WndNum].MdiIconEditInfo->num--;
+	if(MdiInfo[WndNum].MdiIconEditInfo->num==MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum)
+		MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum=MdiInfo[WndNum].MdiIconEditInfo->num-1;
+
+	//コンボボックスからアイコンタイプを削除
+	HWND hCombo;
+	hCombo=GetDlgItem(MdiInfo[WndNum].MdiIconEditInfo->hToolDlg,IDC_ICONTYPECOMBO);
+	i=SendMessage(hCombo,CB_DELETESTRING,
+		SendMessage(hCombo,CB_GETCURSEL,0,0),
+		0);
+	SendMessage(hCombo,CB_SETCURSEL,MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum,0);
+
+	//再描画
+	HBRUSH hOldBrush;
+	hOldBrush=(HBRUSH)SelectObject(MdiInfo[WndNum].MdiIconEditInfo->memdc,GetStockObject(WHITE_BRUSH));
+	PatBlt(MdiInfo[WndNum].MdiIconEditInfo->memdc,0,0,400,400,PATCOPY);
+	SelectObject(MdiInfo[WndNum].MdiIconEditInfo->memdc,hOldBrush);
+	DrawIconToMemBmp(WndNum,0);
+	InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hMain,NULL,1);
+	InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hColorDlg,NULL,0);
+}
+void NewIconEditWindow(char *filepath){
+	extern HINSTANCE hInst,hResInst;
+	extern HANDLE hHeap;
+	extern HWND hDocCombo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2,IconNum;
+	char str[MAX_PATH],str2[32],*buffer;
+	BYTE *pImageBuffer[8];
+	DWORD dwBytesInRes[8];
+	HWND hChild;
+	HDC hdc;
+	MDICREATESTRUCT mdic;
+
+	if(filepath){
+
+		//すでに指定されたファイルが開かれている場合
+		hChild=GetWindow(hClient,GW_CHILD);
+		while(hChild){
+			i=GetWndNum(hChild);
+			if(MdiInfo[i].DocType==WNDTYPE_ICONEDIT){
+				if(lstrcmpi(MdiInfo[i].path,filepath)==0) break;
+			}
+			hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+		}
+		if(hChild){
+			BringWindowToTop(hChild);
+			return;
+		}
+
+		//ファイル読み込み（正常に読み込めるかの確認も含む）
+		HANDLE hFile;
+		DWORD dw;
+		hFile=CreateFile(filepath,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		if(hFile==INVALID_HANDLE_VALUE){
+			//"\"%s\" ファイルの読み込みに失敗しました。"
+			sprintf(str,STRING_ERROR_CANT_FILEOPEN,filepath);
+			MessageBox(hOwner,str,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+			return;
+		}
+		i=GetFileSize(hFile,NULL);
+		buffer=(char *)HeapAlloc(hHeap,0,i+1);
+		ReadFile(hFile,buffer,i,&dw,NULL);
+		CloseHandle(hFile);
+
+		ICONDIR *pIconDir;
+		ICONDIRENTRY *pIconDirEntry;
+		pIconDir=(ICONDIR *)buffer;
+		IconNum=pIconDir->idCount;
+		bool FileOk = true;
+		for(i=0;i<IconNum;i++){
+			pIconDirEntry=(ICONDIRENTRY *)(buffer+sizeof(ICONDIR)+sizeof(ICONDIRENTRY)*i);
+
+			pImageBuffer[i]=(BYTE *)HeapAlloc(hHeap,0,pIconDirEntry->dwBytesInRes);
+			memcpy(pImageBuffer[i],buffer+pIconDirEntry->dwImageOffset,pIconDirEntry->dwBytesInRes);
+
+			dwBytesInRes[i]=pIconDirEntry->dwBytesInRes;
+
+			//対応チェック
+			BITMAPINFOHEADER *pBmpInfoHdr=(BITMAPINFOHEADER *)pImageBuffer[i];
+			if( !(pBmpInfoHdr->biBitCount == 4 || pBmpInfoHdr->biBitCount == 8 ) ){
+				//16色、256色以外の場合
+				//未対応
+				FileOk = false;
+			}
+		}
+
+		_splitpath(filepath,NULL,NULL,str,str2);
+		lstrcat(str,str2);
+		mdic.szTitle=str;
+
+		HeapDefaultFree(buffer);
+
+		if( !FileOk ){
+			for(i=0;i<IconNum;i++){
+				HeapDefaultFree( pImageBuffer[i] );
+			}
+
+			char msg[1024];
+			sprintf( msg, "\"%s\"\n\n16色または256色以外の形式のファイルには対応していません。", filepath );
+			MessageBox( hOwner, msg, "ActiveBasic", MB_OK | MB_ICONEXCLAMATION );
+			return;
+		}
+	}
+	else{
+		extern int DocumentCounter;
+		buffer=0;
+		DocumentCounter++;
+		sprintf(str,"Icon[%d]",DocumentCounter);
+		mdic.szTitle=str;
+
+		IconNum=1;
+		pImageBuffer[0]=CreateIconType(ICONTYPE_32_16,&dwBytesInRes[0]);
+	}
+	mdic.szClass="MDIClientWindow_IconEdit";
+	mdic.hOwner=hInst;
+	mdic.x=CW_USEDEFAULT;
+	mdic.y=CW_USEDEFAULT;
+	mdic.cx=CW_USEDEFAULT;
+	mdic.cy=CW_USEDEFAULT;
+
+	hChild=GetWindow(hClient,GW_CHILD);
+	if(IsWindow(hChild)){
+		if(IsZoomed(hChild)) mdic.style=WS_MAXIMIZE;
+		else mdic.style=0;
+	}
+	else{
+		if(pobj_nv->bMDIZoomed) mdic.style=WS_MAXIMIZE;
+		else mdic.style=0;
+	}
+
+	mdic.lParam=0;
+	hChild=(HWND)SendMessage(hClient,WM_MDICREATE,0,(long)&mdic);	//ウィンドウ作成
+
+	////////////////////
+	//子ウィンドウ作成
+
+	//エディタ中央部分を作成
+	HWND hMain;
+	hMain=CreateWindowEx(WS_EX_CLIENTEDGE,"IconEditWindowProc",NULL,
+		WS_CHILD|WS_VISIBLE,
+		0,0,0,0,
+		hChild,NULL,hInst,NULL);
+
+	//ツールダイアログ部分を作成
+	HWND hToolDlg;
+	hToolDlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_ICONEDIT_TOOL),hChild,(DLGPROC)DlgIconToolProc);
+
+	//ツールダイアログのボタン部分を作成
+	HWND hButtonsDlg;
+	hButtonsDlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_ICONEDIT_BUTTONS),hToolDlg,(DLGPROC)DlgIconButtons);
+
+	//カラーテーブルダイアログ部分を作成
+	HWND hColorDlg;
+	hColorDlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_ICONEDIT_COLOR),hChild,(DLGPROC)DlgIconColorProc);
+
+	//ウィンドウのID登録
+	for(i=0;i<MAX_WNDNUM;i++){
+		if(MdiInfo[i].hwnd==0){
+			MdiInfo[i].hwnd=hChild;
+			MdiInfo[i].DocType=WNDTYPE_ICONEDIT;
+			MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(str)+1);
+			lstrcpy(MdiInfo[i].title,str);
+			if(filepath){
+				MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(filepath)+1);
+				lstrcpy(MdiInfo[i].path,filepath);
+			}
+			else MdiInfo[i].path=(char *)GlobalAlloc(GPTR,1);
+
+			MdiInfo[i].MdiIconEditInfo=(MDIICONEDITINFO *)HeapAlloc(hHeap,0,sizeof(MDIICONEDITINFO));
+			MdiInfo[i].MdiIconEditInfo->hMain=hMain;
+			MdiInfo[i].MdiIconEditInfo->hToolDlg=hToolDlg;
+			MdiInfo[i].MdiIconEditInfo->hButtonsDlg=hButtonsDlg;
+			MdiInfo[i].MdiIconEditInfo->hColorDlg=hColorDlg;
+			hdc=GetDC(hMain);
+			MdiInfo[i].MdiIconEditInfo->memdc=CreateCompatibleDC(hdc);
+			MdiInfo[i].MdiIconEditInfo->hMemBmp=CreateCompatibleBitmap(hdc,600,400);
+			SelectObject(MdiInfo[i].MdiIconEditInfo->memdc,MdiInfo[i].MdiIconEditInfo->hMemBmp);
+			ReleaseDC(hMain,hdc);
+
+			MdiInfo[i].MdiIconEditInfo->SelectLevel=0;
+
+			MdiInfo[i].MdiIconEditInfo->num=IconNum;
+			MdiInfo[i].MdiIconEditInfo->SelectIconNum=0;
+			memcpy(MdiInfo[i].MdiIconEditInfo->pIconImage,pImageBuffer,sizeof(DWORD)*IconNum);
+
+			memcpy(MdiInfo[i].MdiIconEditInfo->dwBytesInRes,dwBytesInRes,sizeof(DWORD)*IconNum);
+
+			MdiInfo[i].MdiIconEditInfo->NowTool=IDC_TOOL_PEN;
+			MdiInfo[i].MdiIconEditInfo->MainColor=RGB(0,0,0);
+			extern COLORREF TransparentClrRef;
+			MdiInfo[i].MdiIconEditInfo->SubColor=TransparentClrRef;
+
+			for(i2=0;i2<MdiInfo[i].MdiIconEditInfo->num;i2++){
+				MdiInfo[i].MdiIconEditInfo->undo[i2].NowPos=0;
+				memset(MdiInfo[i].MdiIconEditInfo->undo[i2].lpData,0,sizeof(BYTE *)*MAX_ICONEDIT_UNDONUM);
+			}
+			MdiInfo[i].MdiIconEditInfo->bModify=0;
+			break;
+		}
+	}
+
+	//メモリへ初期描画を行う
+	HBRUSH hOldBrush;
+	hOldBrush=(HBRUSH)SelectObject(MdiInfo[i].MdiIconEditInfo->memdc,GetStockObject(WHITE_BRUSH));
+	PatBlt(MdiInfo[i].MdiIconEditInfo->memdc,0,0,600,400,PATCOPY);
+	SelectObject(MdiInfo[i].MdiIconEditInfo->memdc,hOldBrush);
+	DrawIconToMemBmp(i,0);
+
+	//ウィンドウ位置を初期化
+	RECT rc;
+	GetClientRect(hChild,&rc);
+	ResizeIconWindow(hMain,hToolDlg,hColorDlg,rc.right,rc.bottom);
+
+	//アイコンタイプコンボボックスをセット
+	ResetIconType(i);
+
+	if(MdiInfo[i].MdiIconEditInfo->num<=1)
+		EnableWindow(GetDlgItem(hToolDlg,IDC_DELETE_ICONTYPE),0);
+
+	//Docコンボボックスに追加
+	i=SendMessage(hDocCombo,CB_ADDSTRING,0,(long)str);
+	SendMessage(hDocCombo,CB_SETCURSEL,i,0);
+
+	//タブに追加
+	pobj_MainTab->InsertItem( str, true );
+
+	SetStatusText(NULL);
+
+	//メニュー状態を設定
+	ResetState_DocMenu();
+}
+void SaveIconFile(char *filepath,HWND hwnd){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2,WndNum;
+	char buffer[8192],temporary[MAX_PATH];
+	int ImgBufSize[8];
+
+	WndNum=GetWndNum(hwnd);
+
+	i2=0;
+
+	///////////
+	// ICONDIR
+	*((WORD *)(buffer+i2))=0;	//idReserved
+	i2+=sizeof(WORD);
+	*((WORD *)(buffer+i2))=1;	//idType
+	i2+=sizeof(WORD);
+	*((WORD *)(buffer+i2))=MdiInfo[WndNum].MdiIconEditInfo->num;	//idCount
+	i2+=sizeof(WORD);
+
+	////////////////
+	// ICONDIRENTRY
+	ICONDIRENTRY IconDirEntry;
+	memset(&IconDirEntry,0,sizeof(ICONDIRENTRY));
+
+	//イメージバッファの初期位置
+	IconDirEntry.dwImageOffset=sizeof(ICONDIR)+
+		sizeof(ICONDIRENTRY)*MdiInfo[WndNum].MdiIconEditInfo->num;
+
+	for(i=0;i<MdiInfo[WndNum].MdiIconEditInfo->num;i++){
+		BITMAPINFOHEADER *pBmpInfoHdr;
+		pBmpInfoHdr=(BITMAPINFOHEADER *)MdiInfo[WndNum].MdiIconEditInfo->pIconImage[i];
+
+		IconDirEntry.bWidth=(BYTE)pBmpInfoHdr->biWidth;
+		IconDirEntry.bHeight=(BYTE)pBmpInfoHdr->biHeight/2;
+		if(pBmpInfoHdr->biBitCount<=8)
+			IconDirEntry.bColorCount=(BYTE)pow((double)2,(double)pBmpInfoHdr->biBitCount);
+		else IconDirEntry.bColorCount=0;
+
+		IconDirEntry.dwBytesInRes=sizeof(BITMAPINFOHEADER);
+		if(pBmpInfoHdr->biBitCount<=8)	//256色以下の場合はカラーパレットのサイズを考慮
+			IconDirEntry.dwBytesInRes+=(DWORD)pow((double)2,(double)pBmpInfoHdr->biBitCount)*sizeof(long);
+		IconDirEntry.dwBytesInRes+=pBmpInfoHdr->biBitCount*pBmpInfoHdr->biWidth*(pBmpInfoHdr->biHeight/2)/8;
+		if(pBmpInfoHdr->biWidth==16){
+			//16*16のアイコン
+			IconDirEntry.dwBytesInRes+=pBmpInfoHdr->biWidth*(pBmpInfoHdr->biHeight/2)/8*2;
+		}
+		else{
+			//32*32のアイコン
+			IconDirEntry.dwBytesInRes+=pBmpInfoHdr->biWidth*(pBmpInfoHdr->biHeight/2)/8;
+		}
+
+		ImgBufSize[i]=IconDirEntry.dwBytesInRes;
+
+		memcpy(buffer+i2,&IconDirEntry,sizeof(ICONDIRENTRY));
+		i2+=sizeof(ICONDIRENTRY);
+
+		IconDirEntry.dwImageOffset+=IconDirEntry.dwBytesInRes;
+	}
+
+	////////////////////
+	// イメージバッファ
+	for(i=0;i<MdiInfo[WndNum].MdiIconEditInfo->num;i++){
+		memcpy(buffer+i2,
+			MdiInfo[WndNum].MdiIconEditInfo->pIconImage[i],
+			ImgBufSize[i]);
+
+		i2+=ImgBufSize[i];
+	}
+
+
+	//ファイルへ書き込み
+	HANDLE hFile;
+	DWORD dummy;
+	hFile=CreateFile(filepath,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE){
+		//"\"%s\" ファイルへの書き込みに失敗しました。"
+		sprintf(temporary,STRING_ERROR_CANT_FILESAVE,filepath);
+		MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONSTOP);
+		return;
+	}
+	WriteFile(hFile,buffer,i2,&dummy,NULL);
+	CloseHandle(hFile);
+}
+
+LRESULT CALLBACK MDIClientWindow_IconEdit(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HWND hDocCombo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,WndNum;
+
+	switch(message){
+		case WM_MDIACTIVATE:
+			if(!lParam) return 0;
+			i=GetWndNum((HWND)lParam);
+			if(i==-1) return 0;	//ウィンドウが初期状態の場合
+
+			i=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[i].title);
+			SendMessage(hDocCombo,CB_SETCURSEL,i,0);
+			SetStatusText(NULL);
+			ResetState_EditMenu();
+			return 0;
+		case WM_SIZE:
+			WndNum=GetWndNum(hwnd);
+			if(WndNum==-1) break;
+			ResizeIconWindow(MdiInfo[WndNum].MdiIconEditInfo->hMain,
+				MdiInfo[WndNum].MdiIconEditInfo->hToolDlg,
+				MdiInfo[WndNum].MdiIconEditInfo->hColorDlg,
+				LOWORD(lParam),HIWORD(lParam));
+			break;
+		case WM_CLOSE:
+			CloseDocWindow(GetWndNum(hwnd));
+			pobj_nv->bMDIZoomed=IsZoomed(hwnd);
+			i=DefMDIChildProc(hwnd,message,wParam,lParam);
+
+			//メニュー状態を設定
+			ResetState_DocMenu();
+
+			return i;
+	}
+	return DefMDIChildProc(hwnd,message,wParam,lParam);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/IconEditor_Color.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/IconEditor_Color.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/IconEditor_Color.cpp	(revision 178)
@@ -0,0 +1,182 @@
+#include "common.h"
+
+extern RGBQUAD DefaultColorTable16[16];
+
+BOOL CALLBACK DlgIconColorProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern COLORREF TransparentClrRef;
+	int i,i2,WndNum;
+	RGBQUAD *pRgbq;
+	RECT rect;
+	POINT pos,pos2;
+	COLORREF ColorRef;
+	HDC hdc;
+
+	switch(message){
+		case WM_LBUTTONDOWN:
+		case WM_RBUTTONDOWN:
+			pos.x=LOWORD(lParam);
+			pos.y=HIWORD(lParam);
+
+			WndNum=GetWndNum(GetParent(hwnd));
+
+			pos2=pos;
+			ClientToScreen(hwnd,&pos2);
+			ScreenToClient(GetDlgItem(hwnd,IDC_STATIC_COLOR),&pos2);
+
+			if((8+1)*15<pos2.x&&pos2.x<(8+1)*15+13&&
+				0<pos2.y&&pos2.y<13){
+				//透明色をクリックした場合
+				if(message==WM_LBUTTONDOWN)
+					MdiInfo[WndNum].MdiIconEditInfo->MainColor=TransparentClrRef;
+				else
+					MdiInfo[WndNum].MdiIconEditInfo->SubColor=TransparentClrRef;
+				InvalidateRect(hwnd,NULL,0);
+				return 1;
+			}
+
+			if(pos2.x%15==0||pos2.x%15>=12||
+				pos2.y%15==0||pos2.y%15>=12||
+				0>pos2.x||pos2.x/15>=8||
+				0>pos2.y||pos2.y/15>=2){
+				//パディング部分をクリックした場合は抜け出す
+				return 1;
+			}
+
+			//選択カラーを取得
+			hdc=GetDC(hwnd);
+			ColorRef=GetPixel(hdc,pos.x,pos.y);
+			ReleaseDC(hwnd,hdc);
+
+			if(message==WM_LBUTTONDOWN)
+				MdiInfo[WndNum].MdiIconEditInfo->MainColor=ColorRef;
+			else
+				MdiInfo[WndNum].MdiIconEditInfo->SubColor=ColorRef;
+
+			InvalidateRect(hwnd,NULL,0);
+			return 1;
+		case WM_PAINT:
+			WndNum=GetWndNum(GetParent(hwnd));
+			if(WndNum==-1) break;
+
+			////////////////////////
+			// カラーテーブルを表示
+			PAINTSTRUCT ps;
+			HPEN hPen,hOldPen;
+			HBRUSH hBrush,hOldBrush;
+
+			GetWindowRect(GetDlgItem(hwnd,IDC_STATIC_COLOR),&rect);
+			pos.x=rect.left;
+			pos.y=rect.top;
+			ScreenToClient(hwnd,&pos);
+			GetWindowRect(GetDlgItem(hwnd,IDC_NOWCOLOR),&rect);
+			pos2.x=rect.left;
+			pos2.y=rect.top;
+			ScreenToClient(hwnd,&pos2);
+
+			//カラーテーブルを取得
+			pRgbq=(RGBQUAD *)(MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]+sizeof(BITMAPINFOHEADER));
+
+			hdc=BeginPaint(hwnd,&ps);
+			hPen=CreatePen(PS_SOLID,0,RGB(0,0,0));
+			hOldPen=(HPEN)SelectObject(hdc,hPen);
+			if(MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biBitCount==4){
+				////////
+				// 16色
+
+				//カラーテーブルを描画
+				i2=16;
+				for(i=0;i<i2;i++){
+					hBrush=CreateSolidBrush(RGB(pRgbq[i].rgbRed,pRgbq[i].rgbGreen,pRgbq[i].rgbBlue));
+					hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+					if(i<i2/2){
+						Rectangle(hdc,
+							pos.x+i*15,
+							pos.y,
+							pos.x+i*15+13,
+							pos.y+13);
+					}
+					else{
+						Rectangle(hdc,
+							pos.x+(i-i2/2)*15,
+							pos.y+15,
+							pos.x+(i-i2/2)*15+13,
+							pos.y+15+13);
+					}
+					SelectObject(hdc,hOldBrush);
+					DeleteObject(hBrush);
+				}
+			}
+			else{
+				/////////
+				// 256色
+
+				//カラーテーブルを描画
+				i2=16;
+				for(i=0;i<i2;i++){
+					hBrush=CreateSolidBrush(RGB(DefaultColorTable16[i].rgbRed,DefaultColorTable16[i].rgbGreen,DefaultColorTable16[i].rgbBlue));
+					hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+					if(i<i2/2){
+						Rectangle(hdc,
+							pos.x+i*15,
+							pos.y,
+							pos.x+i*15+13,
+							pos.y+13);
+					}
+					else{
+						Rectangle(hdc,
+							pos.x+(i-i2/2)*15,
+							pos.y+15,
+							pos.x+(i-i2/2)*15+13,
+							pos.y+15+13);
+					}
+					SelectObject(hdc,hOldBrush);
+					DeleteObject(hBrush);
+				}
+			}
+
+			//透明色カラーを表示
+			hBrush=CreateSolidBrush(TransparentClrRef);
+			hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+			Rectangle(hdc,
+				pos.x+(i2/2+1)*15,
+				pos.y,
+				pos.x+(i2/2+1)*15+13,
+				pos.y+13);
+			SelectObject(hdc,hOldBrush);
+			DeleteObject(hBrush);
+
+			MoveToEx(hdc,pos.x+(i2/2+1)*15,pos.y,NULL);
+			LineTo(hdc,pos.x+(i2/2+1)*15+13,pos.y+13);
+
+
+			//現在選択中のサブカラーを表示
+			hBrush=CreateSolidBrush(MdiInfo[WndNum].MdiIconEditInfo->SubColor);
+			hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+			Rectangle(hdc,
+				pos2.x+10,
+				pos2.y+10,
+				pos2.x+23,
+				pos2.y+23);
+			SelectObject(hdc,hOldBrush);
+			DeleteObject(hBrush);
+
+			//現在選択中のメインカラーを表示
+			hBrush=CreateSolidBrush(MdiInfo[WndNum].MdiIconEditInfo->MainColor);
+			hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+			Rectangle(hdc,
+				pos2.x+3,
+				pos2.y+3,
+				pos2.x+16,
+				pos2.y+16);
+			SelectObject(hdc,hOldBrush);
+			DeleteObject(hBrush);
+
+			SelectObject(hdc,hOldPen);
+			DeleteObject(hPen);
+			EndPaint(hwnd,&ps);
+			return 1;
+	}
+	return 0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/IconEditor_Main.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/IconEditor_Main.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/IconEditor_Main.cpp	(revision 178)
@@ -0,0 +1,1584 @@
+#include "Common.h"
+
+#define ZOOMED_XPOS 100
+#define PIXEL_WIDTH	10
+
+RGBQUAD TransparentRgbq={230,230,255};	//blue,green,red（透明色）
+COLORREF TransparentClrRef=RGB(255,230,230);	//red,green,blue（透明色）
+
+void IconEdit_SelectImage(int WndNum);
+
+void LimitRectFormat(int WndNum,RECT *pRect){
+	//はみ出した場合は範囲内におさめる
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	if(pRect->left<0) pRect->left=0;
+	if(pRect->top<0) pRect->top=0;
+	if(pRect->left>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biWidth)
+		pRect->left=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biWidth-1;
+	if(pRect->top>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biHeight/2)
+		pRect->top=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biHeight/2-1;
+
+	if(pRect->right<0) pRect->right=0;
+	if(pRect->bottom<0) pRect->bottom=0;
+	if(pRect->right>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biWidth)
+		pRect->right=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biWidth-1;
+	if(pRect->bottom>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biHeight/2)
+		pRect->bottom=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biHeight/2-1;
+}
+void GetZoomedPos(POINT *pPos){
+	pPos->x=pPos->x*PIXEL_WIDTH+ZOOMED_XPOS;
+	pPos->y*=PIXEL_WIDTH;
+}
+void SetZoomedPixel(HDC hdc,int WndNum,int x,int y){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	POINT pos;
+
+	if(x<0||y<0||
+		x>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biWidth||
+		y>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biHeight/2)
+		return;
+
+	pos.x=x;
+	pos.y=y;
+	GetZoomedPos(&pos);
+	Rectangle(hdc,pos.x,pos.y,pos.x+11,pos.y+11);
+}
+DWORD GetColorCode(int WndNum,COLORREF ColorRef){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2;
+	RGBQUAD *pRgbq;
+
+	//透明色の場合
+	if(ColorRef==TransparentClrRef) return -1;
+
+	//カラーテーブルを取得
+	pRgbq=(RGBQUAD *)(MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]+sizeof(BITMAPINFOHEADER));
+
+	i2=(int)pow((double)2,(double)MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biBitCount);
+	for(i=0;i<i2;i++){
+		if(ColorRef==RGB(pRgbq[i].rgbRed,pRgbq[i].rgbGreen,pRgbq[i].rgbBlue)) break;
+	}
+	if(i==i2) i=0;
+
+	return i;
+}
+HGLOBAL IconEdit_GetChildInfoClipboardData(int WndNum){
+	//////////////////////////////////////////////
+	// 選択中のイメージをクリップボードへ保存する
+	//////////////////////////////////////////////
+
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HDC hDC;
+	HBITMAP hBmp;
+	SIZE size;
+	int sw;
+
+	//何も選択されていない場合は0を返す
+	sw=0;
+	if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==0) return 0;
+	if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==1){
+		IconEdit_SelectImage(WndNum);
+		sw=1;
+	}
+
+	size.cx=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.right-MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left+1;
+	size.cy=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.bottom-MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top+1;
+
+	hDC=CreateCompatibleDC(MdiInfo[WndNum].MdiIconEditInfo->memdc);
+	hBmp=CreateCompatibleBitmap(
+		MdiInfo[WndNum].MdiIconEditInfo->memdc,
+		size.cx,
+		size.cy);
+	SelectObject(hDC,hBmp);
+
+	BitBlt(hDC,0,0,size.cx,size.cy,
+		MdiInfo[WndNum].MdiIconEditInfo->memdc,
+		MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left,
+		MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top,
+		SRCCOPY);
+
+	DeleteDC(hDC);
+
+	if(sw){
+		DeleteObject(MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp);
+		MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=1;
+	}
+
+	return hBmp;
+}
+void IconEdit_PasteChildInfoClipboardData(int WndNum,HBITMAP hBmp){
+	////////////////////////////////////
+	// クリップボードの内容を貼り付ける
+	////////////////////////////////////
+
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HDC hDC,hDC2;
+	BITMAP Bitmap;
+
+	if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==2)
+		IconEdit_PasteImage(WndNum);
+
+	GetObject(hBmp,sizeof(Bitmap),&Bitmap);
+
+	hDC=CreateCompatibleDC(MdiInfo[WndNum].MdiIconEditInfo->memdc);
+	MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp=
+		CreateCompatibleBitmap(MdiInfo[WndNum].MdiIconEditInfo->memdc,Bitmap.bmWidth,Bitmap.bmHeight);
+	SelectObject(hDC,MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp);
+	hDC2=CreateCompatibleDC(MdiInfo[WndNum].MdiIconEditInfo->memdc);
+	SelectObject(hDC2,hBmp);
+
+	BitBlt(hDC,0,0,Bitmap.bmWidth,Bitmap.bmHeight,
+		hDC2,0,0,SRCCOPY);
+
+	DeleteDC(hDC);
+	DeleteDC(hDC2);
+
+	MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left=0;
+	MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top=0;
+	MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.right=Bitmap.bmWidth-1;
+	MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.bottom=Bitmap.bmHeight-1;
+
+	InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hMain,NULL,0);
+
+	MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=2;
+}
+
+void IconEdit_SelectImage(int WndNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	SIZE size;
+	HDC hDC;
+
+	size.cx=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.right-MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left+1;
+	size.cy=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.bottom-MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top+1;
+
+	hDC=CreateCompatibleDC(MdiInfo[WndNum].MdiIconEditInfo->memdc);
+	MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp=
+		CreateCompatibleBitmap(MdiInfo[WndNum].MdiIconEditInfo->memdc,size.cx,size.cy);
+	SelectObject(hDC,MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp);
+	BitBlt(hDC,0,0,size.cx,size.cy,
+		MdiInfo[WndNum].MdiIconEditInfo->memdc,
+		MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left,
+		MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top,
+		SRCCOPY);
+	DeleteDC(hDC);
+
+	MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=2;
+}
+void IconEdit_PasteImage(int WndNum){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2,i3,x,y,y2,selecting_x,selecting_y;
+	DWORD dwRgbq;
+
+	//コピー先
+	RGBQUAD *pRgbq;
+	BYTE *pBuffer,*pMaskBuf;
+	BITMAPINFOHEADER *pBmpInfoHdr;
+
+	//コピー元
+	BITMAP Bitmap;
+	BITMAPINFO SelectingBitmapInfo;
+	COLORREF *pSelectingBuffer;
+
+	//変更情報
+	IconEdit_NoticeChanging(WndNum);
+
+	GetObject(MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp,sizeof(BITMAP),&Bitmap);
+	pSelectingBuffer=(COLORREF *)HeapAlloc(hHeap,0,Bitmap.bmWidth*Bitmap.bmHeight*sizeof(COLORREF));
+	SelectingBitmapInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
+	SelectingBitmapInfo.bmiHeader.biWidth=Bitmap.bmWidth;
+	SelectingBitmapInfo.bmiHeader.biHeight=Bitmap.bmHeight;
+	SelectingBitmapInfo.bmiHeader.biPlanes=1;
+	SelectingBitmapInfo.bmiHeader.biBitCount=32;
+	SelectingBitmapInfo.bmiHeader.biCompression=BI_RGB;
+	GetDIBits(MdiInfo[WndNum].MdiIconEditInfo->memdc,
+		MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp,
+		0,Bitmap.bmHeight,
+		pSelectingBuffer,&SelectingBitmapInfo,DIB_RGB_COLORS);
+
+	pBmpInfoHdr=(BITMAPINFOHEADER *)MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum];
+
+	//カラーテーブルを取得
+	pRgbq=(RGBQUAD *)(MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]+sizeof(BITMAPINFOHEADER));
+
+	//ビットバッファを取得
+	pBuffer=MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]+
+		sizeof(BITMAPINFOHEADER);
+	if(pBmpInfoHdr->biBitCount<=8)
+		pBuffer+=sizeof(DWORD)*(int)pow((double)2,(double)pBmpInfoHdr->biBitCount);
+
+	//マスクバッファを取得
+	pMaskBuf=pBuffer+pBmpInfoHdr->biBitCount*pBmpInfoHdr->biWidth*(pBmpInfoHdr->biHeight/2)/8;
+
+	for(y=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.bottom;y>=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top;y--){
+		for(x=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left;x<=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.right;x++){
+			if(x<0||y<0||
+				x>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biWidth||
+				y>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biHeight/2){
+				//範囲外の場合
+				continue;
+			}
+
+			selecting_x=x-MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left;
+			selecting_y=y-MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top;
+			dwRgbq=pSelectingBuffer[(Bitmap.bmHeight-1-selecting_y)*Bitmap.bmWidth+selecting_x];
+
+			if(pBmpInfoHdr->biBitCount==4||pBmpInfoHdr->biBitCount==8){
+				i=(pBmpInfoHdr->biHeight/2-1-y)*pBmpInfoHdr->biWidth+x;
+				if(dwRgbq==*(DWORD *)&TransparentRgbq){
+					//////////////////
+					// 透明色にセット
+					if(pBmpInfoHdr->biWidth==16){
+						//一行の4バイト境界を考慮
+						y2=(pBmpInfoHdr->biHeight/2-1)-y;
+						pMaskBuf[(i+pBmpInfoHdr->biWidth*y2)/8]|=0x01<<(8-(i%8+1));
+					}
+					else pMaskBuf[i/8]|=0x01<<(8-(i%8+1));
+
+					/////////////////
+					// 色を0にセット
+					i3=(int)pow((double)2,(double)pBmpInfoHdr->biBitCount);
+					for(i2=0;i2<i3;i2++){
+						if(dwRgbq==((DWORD *)pRgbq)[i2]) break;
+					}
+					switch(pBmpInfoHdr->biBitCount){
+						case 4:		//16色
+							if(i%2==0) *(pBuffer+i/2)&=0x0F;
+							else *(pBuffer+i/2)&=0xF0;
+							break;
+						case 8:		//256色
+							pBuffer[i]=0;
+							break;
+					}
+				}
+				else{
+					////////////////////
+					// 無透明色にセット
+					if(pBmpInfoHdr->biWidth==16){
+						//一行の4バイト境界を考慮
+						y2=(pBmpInfoHdr->biHeight/2-1)-y;
+						pMaskBuf[(i+pBmpInfoHdr->biWidth*y2)/8]&=~(0x01<<(8-(i%8+1)));
+					}
+					else pMaskBuf[i/8]&=~(0x01<<(8-(i%8+1)));
+
+					//////////////
+					// 色をセット
+					i3=(int)pow((double)2,(double)pBmpInfoHdr->biBitCount);
+					for(i2=0;i2<i3;i2++){
+						if(dwRgbq==((DWORD *)pRgbq)[i2]) break;
+					}
+					switch(pBmpInfoHdr->biBitCount){
+						case 4:		//16色
+							if(i%2==0){
+								*(pBuffer+i/2)&=0x0F;
+								*(pBuffer+i/2)|=i2<<4;
+							}
+							else{
+								*(pBuffer+i/2)&=0xF0;
+								*(pBuffer+i/2)|=i2;
+							}
+							break;
+						case 8:		//256色
+							pBuffer[i]=i2;
+							break;
+					}
+				}
+			}
+		}
+	}
+	HeapDefaultFree(pSelectingBuffer);
+
+	DeleteObject(MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp);
+	MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=0;
+
+	DrawIconToMemBmp(WndNum,0);
+	InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hMain,NULL,0);
+}
+
+void DrawIconToMemBmp(int WndNum,RECT *pRect){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HPEN hPen,hOldPen;
+	HBRUSH hBrush,hOldBrush;
+	int i,i2,i3,x,y,y2;
+	POINT pos;
+	RGBQUAD *pRgbq;
+	COLORREF ColorRef;
+	BYTE *pBuffer,*pMaskBuf;
+	BITMAPINFOHEADER *pBmpInfoHdr;
+
+	pBmpInfoHdr=(BITMAPINFOHEADER *)MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum];
+
+	if( !(pBmpInfoHdr->biBitCount == 4 || pBmpInfoHdr->biBitCount == 8 ) ){
+		//16色、256色以外の場合
+		//未対応
+		return;
+	}
+
+	hPen=CreatePen(PS_SOLID,0,RGB(200,200,200));
+	hOldPen=(HPEN)SelectObject(MdiInfo[WndNum].MdiIconEditInfo->memdc,hPen);
+
+	//カラーテーブルを取得
+	pRgbq=(RGBQUAD *)(MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]+sizeof(BITMAPINFOHEADER));
+
+	//ビットバッファを取得
+	pBuffer=MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]+
+		sizeof(BITMAPINFOHEADER);
+	if(pBmpInfoHdr->biBitCount<=8)
+		pBuffer+=sizeof(DWORD)*(int)pow((double)2,(double)pBmpInfoHdr->biBitCount);
+
+	//マスクバッファを取得
+	pMaskBuf=pBuffer+pBmpInfoHdr->biBitCount*pBmpInfoHdr->biWidth*(pBmpInfoHdr->biHeight/2)/8;
+
+	i=0;	//標準ピクセルのバイトカウンタ
+	i3=0;	//透明ピクセルのバイトカウンタ
+	for(y=pBmpInfoHdr->biHeight/2-1;y>=0;y--){
+		for(x=0;x<pBmpInfoHdr->biWidth;x++,i++,i3++){
+			if(pRect){
+				//メモリへの再描画が必要ない場合を検証（実行速度向上のため）
+				if(!(pRect->left<=x&&x<=pRect->right&&
+					pRect->top<=y&&y<=pRect->bottom)) continue;
+			}
+
+			//////////////////////
+			// マスクビットの確認
+			if(pBmpInfoHdr->biWidth==16){
+				//一行の4バイト境界を考慮
+				y2=(pBmpInfoHdr->biHeight/2-1)-y;
+				i2=(pMaskBuf[(i+pBmpInfoHdr->biWidth*y2)/8]>>(8-(i%8+1)))&0x01;
+			}
+			else i2=(pMaskBuf[i/8]>>(8-(i%8+1)))&0x01;
+			if(i2){
+				hBrush=CreateSolidBrush(TransparentClrRef);
+				hOldBrush=(HBRUSH)SelectObject(MdiInfo[WndNum].MdiIconEditInfo->memdc,hBrush);
+				pos.x=x;
+				pos.y=y;
+				GetZoomedPos(&pos);
+				Rectangle(MdiInfo[WndNum].MdiIconEditInfo->memdc,
+					pos.x,
+					pos.y,
+					pos.x+11,
+					pos.y+11);
+				SelectObject(MdiInfo[WndNum].MdiIconEditInfo->memdc,hOldBrush);
+				DeleteObject(hBrush);
+
+				SetPixel(MdiInfo[WndNum].MdiIconEditInfo->memdc,x,y,TransparentClrRef);
+				continue;
+			}
+
+			////////////////
+			// 通常ピクセル
+			if( pBmpInfoHdr->biBitCount == 4 ){
+				//16色
+				i2=*(pBuffer+i/2);
+				if(i%2==0) i2>>=4;
+				i2&=0x0F;
+				ColorRef=RGB(pRgbq[i2].rgbRed,pRgbq[i2].rgbGreen,pRgbq[i2].rgbBlue);
+			}
+			else if( pBmpInfoHdr->biBitCount == 8 ){
+				//256色
+				i2=pBuffer[i];
+				ColorRef=RGB(pRgbq[i2].rgbRed,pRgbq[i2].rgbGreen,pRgbq[i2].rgbBlue);
+				break;
+			}
+
+			hBrush=CreateSolidBrush(ColorRef);
+			hOldBrush=(HBRUSH)SelectObject(MdiInfo[WndNum].MdiIconEditInfo->memdc,hBrush);
+			pos.x=x;
+			pos.y=y;
+			GetZoomedPos(&pos);
+			Rectangle(MdiInfo[WndNum].MdiIconEditInfo->memdc,
+				pos.x,
+				pos.y,
+				pos.x+11,
+				pos.y+11);
+			SelectObject(MdiInfo[WndNum].MdiIconEditInfo->memdc,hOldBrush);
+			DeleteObject(hBrush);
+
+			SetPixel(MdiInfo[WndNum].MdiIconEditInfo->memdc,x,y,ColorRef);
+		}
+	}
+
+	SelectObject(MdiInfo[WndNum].MdiIconEditInfo->memdc,hOldPen);
+	DeleteObject(hPen);
+}
+
+void PixelChange(int WndNum,int x,int y,DWORD ColorCode){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	int y2;
+	BYTE *pBuffer,*pMaskBuf;
+	BITMAPINFOHEADER *pBmpInfoHdr;
+
+	if(x<0||y<0) return;
+	if(x>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biWidth||
+		y>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biHeight/2)
+		return;
+
+	pBmpInfoHdr=(BITMAPINFOHEADER *)MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum];
+
+	pBuffer=MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]+
+		sizeof(BITMAPINFOHEADER);
+	pBuffer+=sizeof(DWORD)*(int)pow((double)2,(double)pBmpInfoHdr->biBitCount);
+
+	pMaskBuf=pBuffer+pBmpInfoHdr->biBitCount*pBmpInfoHdr->biWidth*(pBmpInfoHdr->biHeight/2)/8;
+
+	if(x>=pBmpInfoHdr->biWidth||y>=pBmpInfoHdr->biHeight/2) return;
+	y2=(pBmpInfoHdr->biHeight/2-1)-y;
+	i=pBmpInfoHdr->biWidth*y2+x;
+
+	//////////////////
+	// マスクピクセル
+	if(ColorCode==-1){
+		//透明色に指定
+		if(pBmpInfoHdr->biWidth==16){
+			//一行の4バイト境界を考慮
+			pMaskBuf[(i+pBmpInfoHdr->biWidth*y2)/8]|=0x01<<(8-(i%8+1));
+		}
+		else pMaskBuf[i/8]|=0x01<<(8-(i%8+1));
+
+		ColorCode=0;
+	}
+	else{
+		//無透明色に指定
+		if(pBmpInfoHdr->biWidth==16){
+			//一行の4バイト境界を考慮
+			pMaskBuf[(i+pBmpInfoHdr->biWidth*y2)/8]&=~(0x01<<(8-(i%8+1)));
+		}
+		else pMaskBuf[i/8]&=~(0x01<<(8-(i%8+1)));
+	}
+
+	////////////////
+	// 通常ピクセル
+	switch(pBmpInfoHdr->biBitCount){
+		case 4:
+			////////
+			// 16色
+			if(i%2) *(pBuffer+i/2)=(*(pBuffer+i/2)&0xF0)|(BYTE)ColorCode;
+			else *(pBuffer+i/2)=(*(pBuffer+i/2)&0x0F)|(BYTE)ColorCode<<4;
+			break;
+		case 8:
+			/////////
+			// 256色
+			pBuffer[i]=(BYTE)ColorCode;
+			break;
+	}
+}
+COLORREF IconEdit_GetPixel(int WndNum,int x,int y){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2;
+	int y2;
+	BYTE *pBuffer,*pMaskBuf;
+	BITMAPINFOHEADER *pBmpInfoHdr;
+	RGBQUAD *pRgbq;
+	COLORREF ColorRef;
+
+	if(x<0||y<0) return 0;
+	if(x>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biWidth||
+		y>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biHeight/2)
+		return 0;
+
+	pBmpInfoHdr=(BITMAPINFOHEADER *)MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum];
+
+	//カラーテーブルを取得
+	pRgbq=(RGBQUAD *)(MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]+sizeof(BITMAPINFOHEADER));
+
+	//通常バッファを取得
+	pBuffer=MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]+
+		sizeof(BITMAPINFOHEADER)+
+		sizeof(DWORD)*(int)pow((double)2,(double)pBmpInfoHdr->biBitCount);
+
+	//マスクバッファを取得
+	pMaskBuf=pBuffer+pBmpInfoHdr->biBitCount*pBmpInfoHdr->biWidth*(pBmpInfoHdr->biHeight/2)/8;
+
+	if(x>=pBmpInfoHdr->biWidth||y>=pBmpInfoHdr->biHeight/2) return 0;
+	y2=(pBmpInfoHdr->biHeight/2-1)-y;
+	i=pBmpInfoHdr->biWidth*y2+x;
+
+	//////////////////
+	// マスクピクセル
+	if(pBmpInfoHdr->biWidth==16){
+		//一行の4バイト境界を考慮
+		if((pMaskBuf[(i+pBmpInfoHdr->biWidth*y2)/8]>>(8-(i%8+1)))&0x01)
+			return TransparentClrRef;
+	}
+	else{
+		if((pMaskBuf[i/8]>>(8-(i%8+1)))&0x01)
+			return TransparentClrRef;
+	}
+
+	////////////////
+	// 通常ピクセル
+	switch(pBmpInfoHdr->biBitCount){
+		case 4:		//16色
+			if(i%2) i2=*(pBuffer+i/2)&0x0F;
+			else i2=(*(pBuffer+i/2)>>4)&0x0F;
+			ColorRef=RGB(pRgbq[i2].rgbRed,pRgbq[i2].rgbGreen,pRgbq[i2].rgbBlue);
+			break;
+		case 8:		//256色
+			i2=pBuffer[i];
+			ColorRef=RGB(pRgbq[i2].rgbRed,pRgbq[i2].rgbGreen,pRgbq[i2].rgbBlue);
+			break;
+	}
+	return ColorRef;
+}
+void IconEdit_DrawLine(int WndNum,int x1,int y1,int x2,int y2,DWORD ColorCode){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int dx,dy,s,step;
+
+	dx=abs(x2-x1);
+	dy=abs(y2-y1);
+	if(dx>dy){
+		if(x1>x2){
+			step=(y1>y2)?1:-1;
+			s=x1;
+			x1=x2;
+			x2=s;
+			y1=y2;
+		}
+		else step=(y1<y2)?1:-1;
+
+		PixelChange(WndNum,x1,y1,ColorCode);
+
+		s=dx>>1;
+		while(++x1<=x2){
+			if((s-=dy)<0){
+				s+=dx;
+				y1+=step;
+			}
+
+			PixelChange(WndNum,x1,y1,ColorCode);
+		}
+	}
+	else{
+		if(y1>y2){
+			step=(x1>x2)?1:-1;
+			s=y1;
+			y1=y2;
+			y2=s;
+			x1=x2;
+		}
+		else step=(x1<x2)?1:-1;
+
+		PixelChange(WndNum,x1,y1,ColorCode);
+
+		s=dy>>1;
+		while(++y1<=y2){
+			if((s-=dx)<0){
+				s+=dy;
+				x1+=step;
+			}
+
+			PixelChange(WndNum,x1,y1,ColorCode);
+		}
+	}
+}
+void IconEdit_FloodFill(int WndNum,int x,int y,COLORREF FilledColor,DWORD ColorCode){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	if(x<0||y<0) return;
+	if(x>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biWidth||
+		y>=MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]->biHeight/2)
+		return;
+
+	PixelChange(WndNum,x,y,ColorCode);
+
+	if(IconEdit_GetPixel(WndNum,x,y+1)==FilledColor)
+		IconEdit_FloodFill(WndNum,x,y+1,FilledColor,ColorCode);
+	if(IconEdit_GetPixel(WndNum,x+1,y)==FilledColor)
+		IconEdit_FloodFill(WndNum,x+1,y,FilledColor,ColorCode);
+	if(IconEdit_GetPixel(WndNum,x,y-1)==FilledColor)
+		IconEdit_FloodFill(WndNum,x,y-1,FilledColor,ColorCode);
+	if(IconEdit_GetPixel(WndNum,x-1,y)==FilledColor)
+		IconEdit_FloodFill(WndNum,x-1,y,FilledColor,ColorCode);
+}
+void IconEdit_DrawRectangle(int WndNum,int x1,int y1,int x2,int y2,DWORD ColorCode,DWORD FillClrCode,BOOL bFill){
+	RectNaturalFormat(&x1,&y1,&x2,&y2);
+
+	IconEdit_DrawLine(WndNum,x1,y1,x1,y2,ColorCode);
+	IconEdit_DrawLine(WndNum,x2,y1,x2,y2,ColorCode);
+	IconEdit_DrawLine(WndNum,x1+1,y1,x2-1,y1,ColorCode);
+	IconEdit_DrawLine(WndNum,x1+1,y2,x2-1,y2,ColorCode);
+
+	if(bFill){
+		int x,y;
+		for(x=x1+1;x<x2;x++){
+			for(y=y1+1;y<y2;y++) PixelChange(WndNum,x,y,FillClrCode);
+		}
+	}
+}
+void IconEdit_DrawEllipse(int WndNum,int x1,int y1,int x2,int y2,DWORD ColorCode){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	RECT rect,rc2;
+
+	rect.left=x1;
+	rect.top=y1;
+	rect.right=x2;
+	rect.bottom=y2;
+	RectNaturalFormat(&rect,&rc2);
+
+	int xc,yc,rx,ry;
+	int x,y,r;
+
+	rx=(rc2.right-rc2.left)/2;
+	ry=(rc2.bottom-rc2.top)/2;
+	xc=rc2.left+rx;
+	yc=rc2.top+ry;
+	if(rx==0&&ry==0){
+		if(rc2.bottom-rc2.top==1&&rc2.bottom-rc2.top==1)
+			IconEdit_DrawRectangle(WndNum,x1,y1,x2,y2,ColorCode,0,0);
+		else IconEdit_DrawLine(WndNum,x1,y1,x2,y2,ColorCode);
+		return;
+	}
+
+	int bX,bY;
+	if((rc2.right-rc2.left)%2) bX=1;
+	else bX=0;
+	if((rc2.bottom-rc2.top)%2) bY=1;
+	else bY=0;
+
+	if(rx>ry){
+		x=r=rx;
+		y=0;
+		while(x>=y){
+			x1=x*ry/rx;
+			y1=y*ry/rx;
+
+			PixelChange(WndNum,xc+x+bX,yc+y1+bY,ColorCode);
+			PixelChange(WndNum,xc+x+bX,yc-y1,ColorCode);
+			PixelChange(WndNum,xc-x,yc+y1+bY,ColorCode);
+			PixelChange(WndNum,xc-x,yc-y1,ColorCode);
+			PixelChange(WndNum,xc+y+bX,yc+x1+bY,ColorCode);
+			PixelChange(WndNum,xc+y+bX,yc-x1,ColorCode);
+			PixelChange(WndNum,xc-y,yc+x1+bY,ColorCode);
+			PixelChange(WndNum,xc-y,yc-x1,ColorCode);
+
+			if((r-=(y++<<1)+1)<=0) r+=(x-- -1)<<1;
+		}
+	}
+	else{
+		x=r=ry;
+		y=0;
+		while(x>=y){
+			x1=x*rx/ry;
+			y1=y*rx/ry;
+
+			PixelChange(WndNum,xc+x1+bX,yc+y+bY,ColorCode);
+			PixelChange(WndNum,xc+x1+bX,yc-y,ColorCode);
+			PixelChange(WndNum,xc-x1,yc+y+bY,ColorCode);
+			PixelChange(WndNum,xc-x1,yc-y,ColorCode);
+			PixelChange(WndNum,xc+y1+bX,yc+x+bY,ColorCode);
+			PixelChange(WndNum,xc+y1+bX,yc-x,ColorCode);
+			PixelChange(WndNum,xc-y1,yc+x+bY,ColorCode);
+			PixelChange(WndNum,xc-y1,yc-x,ColorCode);
+
+			if((r-=(y++<<1)+1)<=0) r+=(x-- -1)<<1;
+		}
+	}
+}
+
+void IconEdit_EraseRect(int WndNum,RECT *pRect){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+	//変更情報
+	IconEdit_NoticeChanging(WndNum);
+
+	IconEdit_DrawRectangle(WndNum,
+		pRect->left,
+		pRect->top,
+		pRect->right,
+		pRect->bottom,
+		GetColorCode(WndNum,MdiInfo[WndNum].MdiIconEditInfo->SubColor),
+		GetColorCode(WndNum,MdiInfo[WndNum].MdiIconEditInfo->SubColor),1);
+
+	DrawIconToMemBmp(WndNum,0);
+	InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hMain,NULL,0);
+}
+
+void IconEdit_DrawFrame(HWND hwnd,int WndNum,RECT *pRect){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HDC hdc;
+	HPEN hPen,hOldPen;
+	HBRUSH hOldBrush;
+	RECT rect;
+	POINT pos;
+
+	//////////////////////
+	// 選択フレームの描画
+
+	hdc=GetDC(hwnd);
+
+	//以前の選択フレームを消去
+	BITMAPINFOHEADER *pBmpInfoHdr;
+	pBmpInfoHdr=(BITMAPINFOHEADER *)MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum];
+	pos.x=pBmpInfoHdr->biWidth;
+	pos.y=pBmpInfoHdr->biHeight/2;
+	GetZoomedPos(&pos);
+	BitBlt(hdc,0,0,pos.x,pos.y,MdiInfo[WndNum].MdiIconEditInfo->memdc,0,0,SRCCOPY);
+
+
+	hPen=CreatePen(PS_DOT,0,RGB(0,0,0));
+	SetBkMode(hdc,TRANSPARENT);
+	hOldPen=(HPEN)SelectObject(hdc,hPen);
+	hOldBrush=(HBRUSH)SelectObject(hdc,GetStockObject(NULL_BRUSH));
+
+	pos.x=pRect->left;
+	pos.y=pRect->top;
+	GetZoomedPos(&pos);
+	rect.left=pos.x;
+	rect.top=pos.y;
+
+	pos.x=pRect->right+1;
+	pos.y=pRect->bottom+1;
+	GetZoomedPos(&pos);
+	rect.right=pos.x+1;
+	rect.bottom=pos.y+1;
+
+	Rectangle(hdc,rect.left,rect.top,rect.right,rect.bottom);
+	SelectObject(hdc,hOldBrush);
+	SelectObject(hdc,hOldPen);
+	DeleteObject(hPen);
+
+	ReleaseDC(hwnd,hdc);
+}
+void IconEdit_DrawSelectingRect(HDC hdc,int WndNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i2,i3;
+	HPEN hPen,hOldPen;
+	HBRUSH hOldBrush;
+	COLORREF rgb;
+	RECT rect;
+
+	rect.left=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left*PIXEL_WIDTH+ZOOMED_XPOS;
+	rect.top=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top*PIXEL_WIDTH;
+	rect.right=(MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.right+1)*PIXEL_WIDTH+ZOOMED_XPOS+1;
+	rect.bottom=(MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.bottom+1)*PIXEL_WIDTH+1;
+
+	SetBkMode(hdc,TRANSPARENT);
+
+	//主線
+	hOldBrush=(HBRUSH)SelectObject(hdc,GetStockObject(NULL_BRUSH));
+	hPen=CreatePen(PS_SOLID,0,RGB(0,0,0));
+	hOldPen=(HPEN)SelectObject(hdc,hPen);
+	Rectangle(hdc,
+		rect.left+2, rect.top+2,
+		rect.right-2, rect.bottom-2);
+	SelectObject(hdc,hOldPen);
+	DeleteObject(hPen);
+	hPen=CreatePen(PS_SOLID,0,RGB(255,255,255));
+	hOldPen=(HPEN)SelectObject(hdc,hPen);
+	Rectangle(hdc,
+		rect.left+1, rect.top+1,
+		rect.right-1, rect.bottom-1);
+	SelectObject(hdc,hOldPen);
+	DeleteObject(hPen);
+	SelectObject(hdc,hOldBrush);
+
+	rgb=RGB(255,60,30);
+	hPen=CreatePen(PS_SOLID,0,rgb);
+	hOldPen=(HPEN)SelectObject(hdc,hPen);
+
+	hOldBrush=(HBRUSH)SelectObject(hdc,GetStockObject(WHITE_BRUSH));
+
+	Rectangle(hdc,
+		rect.left,rect.top,
+		rect.left+5,rect.top+5);
+	Rectangle(hdc,
+		rect.left,rect.bottom-5,
+		rect.left+5,rect.bottom);
+	Rectangle(hdc,
+		rect.right-5,rect.top,
+		rect.right,rect.top+5);
+	Rectangle(hdc,
+		rect.right-5,rect.bottom-5,
+		rect.right,rect.bottom);
+
+	i2=(rect.right-rect.left)/2;
+	i3=(rect.bottom-rect.top)/2;
+	Rectangle(hdc,
+		rect.left+i2-2,rect.top,
+		rect.left+i2+3,rect.top+5);
+	Rectangle(hdc,
+		rect.left+i2-2,rect.bottom-5,
+		rect.left+i2+3,rect.bottom);
+	Rectangle(hdc,
+		rect.left,rect.top+i3-2,
+		rect.left+5,rect.top+i3+3);
+	Rectangle(hdc,
+		rect.right-5,rect.top+i3-2,
+		rect.right,rect.top+i3+3);
+
+	SelectObject(hdc,hOldBrush);
+
+	SelectObject(hdc,hOldPen);
+	DeleteObject(hPen);
+}
+void DrawZoomedBitmap(HDC hdc,int WndNum,POINT *pPos){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int x,y;
+	RGBQUAD rgbq;
+	HPEN hPen,hOldPen;
+	POINT pos;
+
+	BITMAP Bitmap;
+	BITMAPINFO SelectingBitmapInfo;
+	COLORREF *pSelectingBuffer;
+
+	GetObject(MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp,sizeof(BITMAP),&Bitmap);
+	pSelectingBuffer=(COLORREF *)HeapAlloc(hHeap,0,Bitmap.bmWidth*Bitmap.bmHeight*sizeof(COLORREF));
+	SelectingBitmapInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
+	SelectingBitmapInfo.bmiHeader.biWidth=Bitmap.bmWidth;
+	SelectingBitmapInfo.bmiHeader.biHeight=Bitmap.bmHeight;
+	SelectingBitmapInfo.bmiHeader.biPlanes=1;
+	SelectingBitmapInfo.bmiHeader.biBitCount=32;
+	SelectingBitmapInfo.bmiHeader.biCompression=BI_RGB;
+	GetDIBits(MdiInfo[WndNum].MdiIconEditInfo->memdc,
+		MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp,
+		0,Bitmap.bmHeight,
+		pSelectingBuffer,&SelectingBitmapInfo,DIB_RGB_COLORS);
+
+	hPen=CreatePen(PS_SOLID,0,RGB(200,200,200));
+	hOldPen=(HPEN)SelectObject(hdc,hPen);
+
+	for(y=Bitmap.bmHeight-1;y>=0;y--){
+		for(x=0;x<Bitmap.bmWidth;x++){
+			memcpy(&rgbq,
+				&pSelectingBuffer[(Bitmap.bmHeight-y-1)*Bitmap.bmWidth+x],
+				sizeof(RGBQUAD));
+
+			HBRUSH hBrush,hOldBrush;
+			hBrush=CreateSolidBrush(RGB(rgbq.rgbRed,rgbq.rgbGreen,rgbq.rgbBlue));
+			hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+
+			pos.x=pPos->x+x;
+			pos.y=pPos->y+y;
+			GetZoomedPos(&pos);
+			Rectangle(hdc,pos.x,pos.y,pos.x+11,pos.y+11);
+
+			SelectObject(hdc,hOldBrush);
+			DeleteObject(hBrush);
+		}
+	}
+
+	SelectObject(hdc,hOldPen);
+	DeleteObject(hPen);
+
+	HeapDefaultFree(pSelectingBuffer);
+}
+int IconEdit_GetStateOfDraggingFrame(int WndNum,int x,int y){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	POINT pos;
+	RECT rect;
+
+	pos.x=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left;
+	pos.y=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top;
+	GetZoomedPos(&pos);
+	rect.left=pos.x;
+	rect.top=pos.y;
+	pos.x=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.right+1;
+	pos.y=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.bottom+1;
+	GetZoomedPos(&pos);
+	rect.right=pos.x;
+	rect.bottom=pos.y;
+
+	if(rect.left<x&&x<rect.right&&
+		rect.top<y&&y<rect.bottom) return FRAME_INSIDE;
+	return 0;
+}
+void DrawSelectingImage(HDC hdc,int WndNum){
+	/////////////////////////////////
+	// 選択されているイメージを表示
+
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HDC hDC2;
+	SIZE size;
+	POINT pos;
+
+	size.cx=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.right-MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left;
+	size.cy=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.bottom-MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top;
+	hDC2=CreateCompatibleDC(MdiInfo[WndNum].MdiIconEditInfo->memdc);
+	SelectObject(hDC2,MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp);
+	BitBlt(hdc,
+		MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left,
+		MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top,
+		size.cx,size.cy,
+		hDC2,0,0,SRCCOPY);
+	DeleteDC(hDC2);
+
+	//拡大選択イメージを表示
+	pos.x=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left;
+	pos.y=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top;
+	DrawZoomedBitmap(hdc,WndNum,&pos);
+}
+void TempLine(HDC hdc,int WndNum,int x1,int y1,int x2,int y2,COLORREF ColorRef){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int dx,dy,s,step;
+	HPEN hPen,hOldPen;
+	HBRUSH hBrush,hOldBrush;
+
+	hPen=CreatePen(PS_SOLID,0,RGB(200,200,200));
+	hOldPen=(HPEN)SelectObject(hdc,hPen);
+	hBrush=CreateSolidBrush(ColorRef);
+	hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+
+	dx=abs(x2-x1);
+	dy=abs(y2-y1);
+	if(dx>dy){
+		if(x1>x2){
+			step=(y1>y2)?1:-1;
+			s=x1;
+			x1=x2;
+			x2=s;
+			y1=y2;
+		}
+		else step=(y1<y2)?1:-1;
+
+		SetZoomedPixel(hdc,WndNum,x1,y1);
+
+		s=dx>>1;
+		while(++x1<=x2){
+			if((s-=dy)<0){
+				s+=dx;
+				y1+=step;
+			}
+
+			SetZoomedPixel(hdc,WndNum,x1,y1);
+		}
+	}
+	else{
+		if(y1>y2){
+			step=(x1>x2)?1:-1;
+			s=y1;
+			y1=y2;
+			y2=s;
+			x1=x2;
+		}
+		else step=(x1<x2)?1:-1;
+
+		SetZoomedPixel(hdc,WndNum,x1,y1);
+
+		s=dy>>1;
+		while(++y1<=y2){
+			if((s-=dx)<0){
+				s+=dy;
+				x1+=step;
+			}
+
+			SetZoomedPixel(hdc,WndNum,x1,y1);
+		}
+	}
+
+	SelectObject(hdc,hOldBrush);
+	SelectObject(hdc,hOldPen);
+	DeleteObject(hPen);
+	DeleteObject(hBrush);
+}
+void TempRectangle(HDC hdc,int WndNum,int x1,int y1,int x2,int y2,COLORREF ColorRef,COLORREF FillClrRef,BOOL bFill){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int x,y;
+	HPEN hPen,hOldPen;
+	HBRUSH hBrush,hOldBrush;
+	RECT rect,rc2;
+
+	hPen=CreatePen(PS_SOLID,0,ColorRef);
+	hOldPen=(HPEN)SelectObject(hdc,hPen);
+	if(!bFill) hBrush=(HBRUSH)GetStockObject(NULL_BRUSH);
+	else hBrush=CreateSolidBrush(FillClrRef);
+	hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+	Rectangle(hdc,x1,y1,x2,y2);
+	SelectObject(hdc,hOldBrush);
+	SelectObject(hdc,hOldPen);
+	DeleteObject(hPen);
+	if(bFill) DeleteObject(hBrush);
+
+	rect.left=x1;
+	rect.top=y1;
+	rect.right=x2;
+	rect.bottom=y2;
+	RectNaturalFormat(&rect,&rc2);
+
+	hPen=CreatePen(PS_SOLID,0,RGB(200,200,200));
+	hOldPen=(HPEN)SelectObject(hdc,hPen);
+	hBrush=CreateSolidBrush(ColorRef);
+	hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+
+	x=rc2.left;
+	for(y=rc2.top;y<=rc2.bottom;y++)
+		SetZoomedPixel(hdc,WndNum,x,y);
+
+	x=rc2.right;
+	for(y=rc2.top;y<=rc2.bottom;y++)
+		SetZoomedPixel(hdc,WndNum,x,y);
+
+	y=rc2.top;
+	for(x=rc2.left+1;x<rc2.right;x++)
+		SetZoomedPixel(hdc,WndNum,x,y);
+
+	y=rc2.bottom;
+	for(x=rc2.left+1;x<rc2.right;x++)
+		SetZoomedPixel(hdc,WndNum,x,y);
+
+	SelectObject(hdc,hOldBrush);
+	DeleteObject(hBrush);
+
+	if(bFill){
+		hBrush=CreateSolidBrush(FillClrRef);
+		hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+		for(x=rc2.left+1;x<rc2.right;x++){
+			for(y=rc2.top+1;y<rc2.bottom;y++) SetZoomedPixel(hdc,WndNum,x,y);
+		}
+		SelectObject(hdc,hOldBrush);
+		DeleteObject(hBrush);
+	}
+
+	SelectObject(hdc,hOldPen);
+	DeleteObject(hPen);
+}
+void TempEllipse(HDC hdc,int WndNum,int x1,int y1,int x2,int y2,COLORREF ColorRef){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HPEN hPen,hOldPen;
+	HBRUSH hBrush,hOldBrush;
+	RECT rect,rc2;
+
+	rect.left=x1;
+	rect.top=y1;
+	rect.right=x2;
+	rect.bottom=y2;
+	RectNaturalFormat(&rect,&rc2);
+
+	int xc,yc,rx,ry;
+	int x,y,r;
+
+	rx=(rc2.right-rc2.left)/2;
+	ry=(rc2.bottom-rc2.top)/2;
+	xc=rc2.left+rx;
+	yc=rc2.top+ry;
+	if(rx==0&&ry==0){
+		if(rc2.bottom-rc2.top==1&&rc2.bottom-rc2.top==1)
+			TempRectangle(hdc,WndNum,x1,y1,x2,y2,ColorRef,0,0);
+		else TempLine(hdc,WndNum,x1,y1,x2,y2,ColorRef);
+		return;
+	}
+
+	int bX,bY;
+	if((rc2.right-rc2.left)%2) bX=1;
+	else bX=0;
+	if((rc2.bottom-rc2.top)%2) bY=1;
+	else bY=0;
+
+	hPen=CreatePen(PS_SOLID,0,RGB(200,200,200));
+	hOldPen=(HPEN)SelectObject(hdc,hPen);
+	hBrush=CreateSolidBrush(ColorRef);
+	hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+
+	if(rx>ry){
+		x=r=rx;
+		y=0;
+		while(x>=y){
+			x1=x*ry/rx;
+			y1=y*ry/rx;
+
+			SetZoomedPixel(hdc,WndNum,xc+x+bX,yc+y1+bY);
+			SetZoomedPixel(hdc,WndNum,xc+x+bX,yc-y1);
+			SetZoomedPixel(hdc,WndNum,xc-x,yc+y1+bY);
+			SetZoomedPixel(hdc,WndNum,xc-x,yc-y1);
+			SetZoomedPixel(hdc,WndNum,xc+y+bX,yc+x1+bY);
+			SetZoomedPixel(hdc,WndNum,xc+y+bX,yc-x1);
+			SetZoomedPixel(hdc,WndNum,xc-y,yc+x1+bY);
+			SetZoomedPixel(hdc,WndNum,xc-y,yc-x1);
+
+			SetPixel(hdc,xc+x+bX,yc+y1+bY,ColorRef);
+			SetPixel(hdc,xc+x+bX,yc-y1,ColorRef);
+			SetPixel(hdc,xc-x,yc+y1+bY,ColorRef);
+			SetPixel(hdc,xc-x,yc-y1,ColorRef);
+			SetPixel(hdc,xc+y+bX,yc+x1+bY,ColorRef);
+			SetPixel(hdc,xc+y+bX,yc-x1,ColorRef);
+			SetPixel(hdc,xc-y,yc+x1+bY,ColorRef);
+			SetPixel(hdc,xc-y,yc-x1,ColorRef);
+
+			if((r-=(y++<<1)+1)<=0) r+=(x-- -1)<<1;
+		}
+	}
+	else{
+		x=r=ry;
+		y=0;
+		while(x>=y){
+			x1=x*rx/ry;
+			y1=y*rx/ry;
+
+			SetZoomedPixel(hdc,WndNum,xc+x1+bX,yc+y+bY);
+			SetZoomedPixel(hdc,WndNum,xc+x1+bX,yc-y);
+			SetZoomedPixel(hdc,WndNum,xc-x1,yc+y+bY);
+			SetZoomedPixel(hdc,WndNum,xc-x1,yc-y);
+			SetZoomedPixel(hdc,WndNum,xc+y1+bX,yc+x+bY);
+			SetZoomedPixel(hdc,WndNum,xc+y1+bX,yc-x);
+			SetZoomedPixel(hdc,WndNum,xc-y1,yc+x+bY);
+			SetZoomedPixel(hdc,WndNum,xc-y1,yc-x);
+
+			SetPixel(hdc,xc+x1+bX,yc+y+bY,ColorRef);
+			SetPixel(hdc,xc+x1+bX,yc-y,ColorRef);
+			SetPixel(hdc,xc-x1,yc+y+bY,ColorRef);
+			SetPixel(hdc,xc-x1,yc-y,ColorRef);
+			SetPixel(hdc,xc+y1+bX,yc+x+bY,ColorRef);
+			SetPixel(hdc,xc+y1+bX,yc-x,ColorRef);
+			SetPixel(hdc,xc-y1,yc+x+bY,ColorRef);
+			SetPixel(hdc,xc-y1,yc-x,ColorRef);
+
+			if((r-=(y++<<1)+1)<=0) r+=(x-- -1)<<1;
+		}
+	}
+
+	SelectObject(hdc,hOldBrush);
+	SelectObject(hdc,hOldPen);
+	DeleteObject(hPen);
+	DeleteObject(hBrush);
+}
+LRESULT CALLBACK IconEditWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int WndNum,dx,dy;
+	BOOL bRedrawMemBmp;
+	HDC hdc;
+	POINT pos,p2;
+	RECT rect,rc2;
+	COLORREF ColorRef,MainClrRef,SubClrRef;
+	static DWORD dwDrag;		//左クリック時は1、右クリック時は2、それ以外は0
+	static int NowDragging;
+	static POINT LastPos;
+	static RECT OldRect;
+
+	switch(message){
+		case WM_LBUTTONDOWN:
+		case WM_RBUTTONDOWN:
+			if(dwDrag) return 0;
+
+			pos.x=(short)(LOWORD(lParam)-ZOOMED_XPOS)/PIXEL_WIDTH;
+			pos.y=(short)HIWORD(lParam)/PIXEL_WIDTH;
+
+			SetFocus(hwnd);
+			WndNum=GetWndNum(GetParent(hwnd));
+
+			SetCapture(hwnd);
+			if(message==WM_LBUTTONDOWN){
+				dwDrag=1;
+				MainClrRef=MdiInfo[WndNum].MdiIconEditInfo->MainColor;
+				SubClrRef=MdiInfo[WndNum].MdiIconEditInfo->SubColor;
+			}
+			else{
+				dwDrag=2;
+				MainClrRef=MdiInfo[WndNum].MdiIconEditInfo->SubColor;
+				SubClrRef=MdiInfo[WndNum].MdiIconEditInfo->MainColor;
+			}
+
+			if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_SELECT){
+				if(dwDrag==2){
+					dwDrag=0;
+					ReleaseCapture();
+					break;
+				}
+
+				if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel){
+					NowDragging=IconEdit_GetStateOfDraggingFrame(WndNum,LOWORD(lParam),HIWORD(lParam));
+					if(NowDragging==0){
+						if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==1){
+							MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=0;
+							InvalidateRect(hwnd,NULL,0);
+						}
+						else if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==2)
+							IconEdit_PasteImage(WndNum);
+
+						NowDragging=SELECTING_FRAME;
+					}
+					else if(NowDragging==FRAME_INSIDE){
+						if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==1){
+							IconEdit_SelectImage(WndNum);
+							IconEdit_EraseRect(WndNum,&MdiInfo[WndNum].MdiIconEditInfo->DraggingRect);
+						}
+
+						OldRect=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect;
+					}
+				}
+				else{
+					NowDragging=SELECTING_FRAME;
+					SetCursor(LoadCursor(NULL,IDC_CROSS));
+				}
+
+				LastPos=pos;
+				InvalidateRect(hwnd,NULL,0);
+			}
+			else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_PEN){
+				//変更情報
+				IconEdit_NoticeChanging(WndNum);
+
+				PixelChange(WndNum,pos.x,pos.y,GetColorCode(WndNum,MainClrRef));
+				LastPos=pos;
+
+				rect.left=pos.x;
+				rect.top=pos.y;
+				rect.right=pos.x;
+				rect.bottom=pos.y;
+				DrawIconToMemBmp(WndNum,&rect);
+				InvalidateRect(hwnd,NULL,0);
+
+				SetCursor(LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_PEN)));
+			}
+			else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_FILL){
+				//変更情報
+				IconEdit_NoticeChanging(WndNum);
+
+				hdc=GetDC(hwnd);
+				ColorRef=GetPixel(hdc,pos.x,pos.y);
+				ReleaseDC(hwnd,hdc);
+				if(ColorRef!=MainClrRef){
+					IconEdit_FloodFill(WndNum,pos.x,pos.y,ColorRef,GetColorCode(WndNum,MainClrRef));
+
+					DrawIconToMemBmp(WndNum,0);
+					InvalidateRect(hwnd,NULL,0);
+				}
+				SetCursor(LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_FILL)));
+			}
+			else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_LINE||
+				MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_RECTANGLE||
+				MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_FILLRECT||
+				MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_FILLRECT2||
+				MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_ELLIPSE){
+				hdc=GetDC(hwnd);
+				TempLine(hdc,WndNum,pos.x,pos.y,pos.x,pos.y,MainClrRef);
+				ReleaseDC(hwnd,hdc);
+
+				LastPos=pos;
+
+				SetCursor(LoadCursor(NULL,IDC_CROSS));
+			}
+			return 0;
+		case WM_LBUTTONUP:
+		case WM_RBUTTONUP:
+			if(dwDrag==0) return 0;
+			if(dwDrag==1&&message==WM_RBUTTONUP||
+				dwDrag==2&&message==WM_LBUTTONUP) return 0;
+
+			WndNum=GetWndNum(GetParent(hwnd));
+
+			pos.x=(short)(LOWORD(lParam)-ZOOMED_XPOS)/PIXEL_WIDTH;
+			pos.y=(short)HIWORD(lParam)/PIXEL_WIDTH;
+
+			if(dwDrag==1){
+				MainClrRef=MdiInfo[WndNum].MdiIconEditInfo->MainColor;
+				SubClrRef=MdiInfo[WndNum].MdiIconEditInfo->SubColor;
+			}
+			else{
+				MainClrRef=MdiInfo[WndNum].MdiIconEditInfo->SubColor;
+				SubClrRef=MdiInfo[WndNum].MdiIconEditInfo->MainColor;
+			}
+
+			ReleaseCapture();
+			dwDrag=0;
+
+			bRedrawMemBmp=0;
+			if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_SELECT){
+				if(NowDragging==SELECTING_FRAME){
+					if(LastPos.x==pos.x&&LastPos.y==pos.y){
+						ResetState_EditMenu();
+						return 0;
+					}
+					rect.left=LastPos.x;
+					rect.top=LastPos.y;
+					rect.right=pos.x;
+					rect.bottom=pos.y;
+
+					RectNaturalFormat(&rect,&MdiInfo[WndNum].MdiIconEditInfo->DraggingRect);
+					LimitRectFormat(WndNum,&MdiInfo[WndNum].MdiIconEditInfo->DraggingRect);
+					MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=1;
+					InvalidateRect(hwnd,NULL,0);
+				}
+				else if(NowDragging==FRAME_INSIDE)
+					InvalidateRect(hwnd,NULL,0);
+			}
+			else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_LINE){
+				//変更情報
+				IconEdit_NoticeChanging(WndNum);
+
+				IconEdit_DrawLine(WndNum,LastPos.x,LastPos.y,pos.x,pos.y,GetColorCode(WndNum,MainClrRef));
+
+				bRedrawMemBmp=1;
+			}
+			else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_RECTANGLE){
+				//変更情報
+				IconEdit_NoticeChanging(WndNum);
+
+				IconEdit_DrawRectangle(WndNum,LastPos.x,LastPos.y,pos.x,pos.y,GetColorCode(WndNum,MainClrRef),0,0);
+
+				bRedrawMemBmp=1;
+			}
+			else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_FILLRECT){
+				//変更情報
+				IconEdit_NoticeChanging(WndNum);
+
+				IconEdit_DrawRectangle(WndNum,LastPos.x,LastPos.y,pos.x,pos.y,
+					GetColorCode(WndNum,MainClrRef),
+					GetColorCode(WndNum,SubClrRef),1);
+
+				bRedrawMemBmp=1;
+			}
+			else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_FILLRECT2){
+				//変更情報
+				IconEdit_NoticeChanging(WndNum);
+
+				IconEdit_DrawRectangle(WndNum,LastPos.x,LastPos.y,pos.x,pos.y,
+					GetColorCode(WndNum,MainClrRef),
+					GetColorCode(WndNum,MainClrRef),1);
+
+				bRedrawMemBmp=1;
+			}
+			else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_ELLIPSE){
+				//変更情報
+				IconEdit_NoticeChanging(WndNum);
+
+				IconEdit_DrawEllipse(WndNum,LastPos.x,LastPos.y,pos.x,pos.y,GetColorCode(WndNum,MainClrRef));
+
+				bRedrawMemBmp=1;
+			}
+
+			if(bRedrawMemBmp){
+				rect.left=LastPos.x;
+				rect.top=LastPos.y;
+				rect.right=pos.x;
+				rect.bottom=pos.y;
+				RectNaturalFormat(&rect,&rc2);
+				DrawIconToMemBmp(WndNum,&rc2);
+				InvalidateRect(hwnd,NULL,0);
+			}
+
+			ResetState_EditMenu();
+			return 0;
+		case WM_MOUSEMOVE:
+			WndNum=GetWndNum(GetParent(hwnd));
+
+			pos.x=(short)(LOWORD(lParam)-ZOOMED_XPOS)/PIXEL_WIDTH;
+			pos.y=(short)HIWORD(lParam)/PIXEL_WIDTH;
+
+			if(dwDrag==1){
+				MainClrRef=MdiInfo[WndNum].MdiIconEditInfo->MainColor;
+				SubClrRef=MdiInfo[WndNum].MdiIconEditInfo->SubColor;
+			}
+			else{
+				MainClrRef=MdiInfo[WndNum].MdiIconEditInfo->SubColor;
+				SubClrRef=MdiInfo[WndNum].MdiIconEditInfo->MainColor;
+			}
+
+			if(dwDrag){
+				if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_SELECT){
+					if(NowDragging==SELECTING_FRAME){
+						//範囲選択中
+						rect.left=LastPos.x;
+						rect.top=LastPos.y;
+						rect.right=pos.x;
+						rect.bottom=pos.y;
+						RectNaturalFormat(&rect,&rc2);
+						LimitRectFormat(WndNum,&rc2);
+						IconEdit_DrawFrame(hwnd,WndNum,&rc2);
+					}
+					else if(NowDragging==FRAME_INSIDE){
+						//移動中
+						dx=pos.x-LastPos.x;
+						dy=pos.y-LastPos.y;
+						MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left+=dx;
+						MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.right+=dx;
+						MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top+=dy;
+						MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.bottom+=dy;
+						LastPos=pos;
+
+
+						////////////////////////
+						// 古い選択範囲を再描画
+						HRGN hRgn,hRgn2;
+
+						OldRect.right++;
+						OldRect.bottom++;
+
+						hRgn=CreateRectRgnIndirect(&OldRect);
+						hRgn2=CreateRectRgnIndirect(&MdiInfo[WndNum].MdiIconEditInfo->DraggingRect);
+						CombineRgn(hRgn,hRgn,hRgn2,RGN_XOR);
+						DeleteObject(hRgn2);
+
+						p2.x=OldRect.left;
+						p2.y=OldRect.top;
+						GetZoomedPos(&p2);
+						rect.left=p2.x;
+						rect.top=p2.y;
+						p2.x=OldRect.right;
+						p2.y=OldRect.bottom;
+						GetZoomedPos(&p2);
+						rect.right=p2.x+1;
+						rect.bottom=p2.y+1;
+						hRgn2=CreateRectRgnIndirect(&rect);
+						CombineRgn(hRgn,hRgn,hRgn2,RGN_OR);
+						DeleteObject(hRgn2);
+
+						p2.x=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.left;
+						p2.y=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.top;
+						GetZoomedPos(&p2);
+						rect.left=p2.x;
+						rect.top=p2.y;
+						p2.x=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.right;
+						p2.y=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect.bottom;
+						GetZoomedPos(&p2);
+						rect.right=p2.x+1;
+						rect.bottom=p2.y+1;
+						hRgn2=CreateRectRgnIndirect(&rect);
+						CombineRgn(hRgn,hRgn,hRgn2,RGN_XOR);
+						DeleteObject(hRgn2);
+
+						InvalidateRgn(hwnd,hRgn,0);
+						DeleteObject(hRgn);
+						UpdateWindow(hwnd);
+						hdc=GetDC(hwnd);
+						DrawSelectingImage(hdc,WndNum);
+						ReleaseDC(hwnd,hdc);
+
+						OldRect=MdiInfo[WndNum].MdiIconEditInfo->DraggingRect;
+					}
+				}
+				else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_PEN){
+					if(abs(pos.x-LastPos.x)>1||abs(pos.y-LastPos.y)>1){
+						IconEdit_DrawLine(WndNum,LastPos.x,LastPos.y,pos.x,pos.y,GetColorCode(WndNum,MainClrRef));
+
+						rect.left=LastPos.x;
+						rect.top=LastPos.y;
+						rect.right=pos.x;
+						rect.bottom=pos.y;
+						RectNaturalFormat(&rect,&rc2);
+						DrawIconToMemBmp(WndNum,&rc2);
+						InvalidateRect(hwnd,NULL,0);
+					}
+					else{
+						PixelChange(WndNum,pos.x,pos.y,GetColorCode(WndNum,MainClrRef));
+
+						rect.left=pos.x;
+						rect.top=pos.y;
+						rect.right=pos.x;
+						rect.bottom=pos.y;
+						DrawIconToMemBmp(WndNum,&rect);
+						InvalidateRect(hwnd,NULL,0);
+					}
+					LastPos=pos;
+				}
+				else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_LINE){
+					InvalidateRect(hwnd,NULL,0);
+					UpdateWindow(hwnd);
+
+					hdc=GetDC(hwnd);
+					TempLine(hdc,WndNum,LastPos.x,LastPos.y,pos.x,pos.y,MainClrRef);
+					ReleaseDC(hwnd,hdc);
+				}
+				else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_RECTANGLE){
+					InvalidateRect(hwnd,NULL,0);
+					UpdateWindow(hwnd);
+
+					hdc=GetDC(hwnd);
+					TempRectangle(hdc,WndNum,LastPos.x,LastPos.y,pos.x,pos.y,MainClrRef,0,0);
+					ReleaseDC(hwnd,hdc);
+				}
+				else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_FILLRECT){
+					InvalidateRect(hwnd,NULL,0);
+					UpdateWindow(hwnd);
+
+					hdc=GetDC(hwnd);
+					TempRectangle(hdc,WndNum,LastPos.x,LastPos.y,pos.x,pos.y,
+						MainClrRef,
+						SubClrRef,1);
+					ReleaseDC(hwnd,hdc);
+				}
+				else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_FILLRECT2){
+					InvalidateRect(hwnd,NULL,0);
+					UpdateWindow(hwnd);
+
+					hdc=GetDC(hwnd);
+					TempRectangle(hdc,WndNum,LastPos.x,LastPos.y,pos.x,pos.y,
+						MainClrRef,
+						MainClrRef,1);
+					ReleaseDC(hwnd,hdc);
+				}
+				else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_ELLIPSE){
+					InvalidateRect(hwnd,NULL,0);
+					UpdateWindow(hwnd);
+
+					hdc=GetDC(hwnd);
+					TempEllipse(hdc,WndNum,LastPos.x,LastPos.y,pos.x,pos.y,MainClrRef);
+					ReleaseDC(hwnd,hdc);
+				}
+			}
+			else{
+				//ドラッグ中でないとき
+				if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_SELECT){
+					if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel)
+						SetCursorByState(IconEdit_GetStateOfDraggingFrame(WndNum,LOWORD(lParam),HIWORD(lParam)));
+					else
+						SetCursor(LoadCursor(NULL,IDC_CROSS));
+				}
+				else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_PEN)
+					SetCursor(LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_PEN)));
+				else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_FILL)
+					SetCursor(LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_FILL)));
+				else if(MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_LINE||
+					MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_RECTANGLE||
+					MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_FILLRECT||
+					MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_FILLRECT2||
+					MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_ELLIPSE){
+					SetCursor(LoadCursor(NULL,IDC_CROSS));
+				}
+			}
+			return 0;
+		case WM_KEYDOWN:
+			switch(wParam){
+				case VK_ESCAPE:
+					WndNum=GetWndNum(GetParent(hwnd));
+					if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==2){
+						DeleteObject(MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp);
+						MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=0;
+					}
+					InvalidateRect(hwnd,NULL,0);
+					return 0;
+			}
+			break;
+		case WM_PAINT:
+			PAINTSTRUCT ps;
+			SIZE size;
+
+			WndNum=GetWndNum(GetParent(hwnd));
+			BITMAPINFOHEADER *pBmpInfoHdr;
+			pBmpInfoHdr=(BITMAPINFOHEADER *)MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum];
+
+			hdc=BeginPaint(hwnd,&ps);
+
+			size.cx=ZOOMED_XPOS+pBmpInfoHdr->biWidth*PIXEL_WIDTH+1;
+			size.cy=pBmpInfoHdr->biWidth*PIXEL_WIDTH+1;
+
+			BitBlt(hdc,
+				0,0,
+				size.cx,
+				size.cy,
+				MdiInfo[WndNum].MdiIconEditInfo->memdc,0,0,SRCCOPY);
+
+			HBRUSH hOldBrush;
+			hOldBrush=(HBRUSH)SelectObject(hdc,GetStockObject(WHITE_BRUSH));
+			PatBlt(hdc,
+				0,size.cy,
+				ScreenX,ScreenY-size.cy,
+				PATCOPY);
+			PatBlt(hdc,
+				size.cx,0,
+				ScreenX-size.cx,size.cy,
+				PATCOPY);
+
+			if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==1)
+				IconEdit_DrawSelectingRect(hdc,WndNum);
+			if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==2){
+				DrawSelectingImage(hdc,WndNum);
+				if(dwDrag==0) IconEdit_DrawSelectingRect(hdc,WndNum);
+			}
+
+			EndPaint(hwnd,&ps);
+			return 0;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/IconEditor_Tool.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/IconEditor_Tool.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/IconEditor_Tool.cpp	(revision 178)
@@ -0,0 +1,229 @@
+#include "common.h"
+
+char *GetIconEditToolName(DWORD id){
+	char *pTemp=0;
+
+#if defined(JPN)
+	//日本語
+	if(id==IDC_TOOL_SELECT) pTemp="選択";
+	else if(id==IDC_TOOL_PEN) pTemp="ペン";
+	else if(id==IDC_TOOL_LINE) pTemp="線";
+	else if(id==IDC_TOOL_FILL) pTemp="塗りつぶし";
+	else if(id==IDC_TOOL_RECTANGLE) pTemp="四角形";
+	else if(id==IDC_TOOL_FILLRECT) pTemp="縁付き四角形";
+	else if(id==IDC_TOOL_FILLRECT2) pTemp="塗りつぶし四角形";
+	else if(id==IDC_TOOL_ELLIPSE) pTemp="楕円";
+#else
+	//英語
+	if(id==IDC_TOOL_SELECT) pTemp="Tool";
+	else if(id==IDC_TOOL_PEN) pTemp="Pen";
+	else if(id==IDC_TOOL_LINE) pTemp="Line";
+	else if(id==IDC_TOOL_FILL) pTemp="Fill";
+	else if(id==IDC_TOOL_RECTANGLE) pTemp="Rectangle";
+	else if(id==IDC_TOOL_FILLRECT) pTemp="Rectangle with edge";
+	else if(id==IDC_TOOL_FILLRECT2) pTemp="Fill Rectangle";
+	else if(id==IDC_TOOL_ELLIPSE) pTemp="Ellipse";
+#endif
+
+	return pTemp;
+}
+
+BOOL CALLBACK DlgIconButtons(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int WndNum;
+	RECT rect;
+#define BMPNUM_ICONTOOLBAR 8
+	TBBUTTON IconToolBar[]={
+		{0,IDC_TOOL_SELECT,TBSTATE_ENABLED|TBSTATE_WRAP,TBSTYLE_CHECKGROUP,0,0},
+		{1,IDC_TOOL_PEN,TBSTATE_ENABLED|TBSTATE_CHECKED,TBSTYLE_CHECKGROUP,0,0},
+		{2,IDC_TOOL_LINE,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{3,IDC_TOOL_FILL,TBSTATE_ENABLED|TBSTATE_WRAP,TBSTYLE_CHECKGROUP,0,0},
+		{4,IDC_TOOL_RECTANGLE,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{5,IDC_TOOL_FILLRECT,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{6,IDC_TOOL_FILLRECT2,TBSTATE_ENABLED|TBSTATE_WRAP,TBSTYLE_CHECKGROUP,0,0},
+		{7,IDC_TOOL_ELLIPSE,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+	};
+	TOOLTIPTEXT *pTipText;
+	static HWND hToolBar;
+
+	switch(message){
+		case WM_INITDIALOG:
+			MoveWindow(hwnd,20,120,80,200,1);
+
+			hToolBar=CreateToolbarEx(hwnd,WS_CHILD|WS_VISIBLE|CCS_NODIVIDER|TBSTYLE_FLAT|TBSTYLE_TOOLTIPS,
+				NULL,
+				BMPNUM_ICONTOOLBAR,	/*ビットマップの個数*/
+				hResInst,(unsigned int)MAKEINTRESOURCE(IDR_ICONTOOLBAR),IconToolBar,
+				BMPNUM_ICONTOOLBAR,	/*アイテムの個数*/
+				0,0,16,15,sizeof(TBBUTTON));
+
+
+			//Windows9x系OSでの不具合を防ぐため
+			PostMessage(hwnd,WM_USER+120,0,0);
+
+			break;
+		case WM_USER+120:
+			GetClientRect(hwnd,&rect);
+			MoveWindow(hToolBar,0,0,rect.right,rect.bottom,1);
+			return 1;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_TOOL_SELECT:
+				case IDC_TOOL_PEN:
+				case IDC_TOOL_LINE:
+				case IDC_TOOL_FILL:
+				case IDC_TOOL_RECTANGLE:
+				case IDC_TOOL_FILLRECT:
+				case IDC_TOOL_FILLRECT2:
+				case IDC_TOOL_ELLIPSE:
+					WndNum=GetWndNum(GetParent(GetParent(hwnd)));
+					if(LOWORD(wParam)!=IDC_TOOL_SELECT&&
+						MdiInfo[WndNum].MdiIconEditInfo->NowTool==IDC_TOOL_SELECT){
+						MdiInfo[WndNum].MdiIconEditInfo->NowTool=LOWORD(wParam);
+						if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel){
+							if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==2)
+								DeleteObject(MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp);
+							MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=0;
+						}
+						InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hMain,NULL,0);
+					}
+					else MdiInfo[WndNum].MdiIconEditInfo->NowTool=LOWORD(wParam);
+					return 1;
+			}
+			break;
+		case WM_NOTIFY:
+			pTipText=(TOOLTIPTEXT *)lParam;
+			if(pTipText->hdr.code==TTN_NEEDTEXT){
+				//ツールチップを表示
+				pTipText->lpszText=GetIconEditToolName(pTipText->hdr.idFrom);
+			}
+			break;
+	}
+	return 0;
+}
+BOOL CALLBACK DlgIconType(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,WndNum;
+	HWND hList;
+	BOOL bExist[4];
+	char temporary[32];
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+
+			WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+			memset(bExist,0,sizeof(BOOL)*4);
+			for(i=0;i<MdiInfo[WndNum].MdiIconEditInfo->num;i++){
+				if(MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[i]->biWidth==16&&
+					MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[i]->biBitCount==4){
+					bExist[0]=1;
+				}
+				if(MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[i]->biWidth==16&&
+					MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[i]->biBitCount==8){
+					bExist[1]=1;
+				}
+				if(MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[i]->biWidth==32&&
+					MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[i]->biBitCount==4){
+					bExist[2]=1;
+				}
+				if(MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[i]->biWidth==32&&
+					MdiInfo[WndNum].MdiIconEditInfo->pBmpHdr[i]->biBitCount==8){
+					bExist[3]=1;
+				}
+			}
+
+			hList=GetDlgItem(hwnd,IDC_TYPELIST);
+			if(bExist[0]==0){
+				//"16*16 (16色)"
+				sprintf(temporary,"16*16 (16%s)",STRING_UNIT_COLORS);
+				SendMessage(hList,LB_ADDSTRING,0,(long)temporary);
+			}
+			if(bExist[1]==0){
+				//"16*16 (256色)"
+				sprintf(temporary,"16*16 (256%s)",STRING_UNIT_COLORS);
+				SendMessage(hList,LB_ADDSTRING,0,(long)temporary);
+			}
+			if(bExist[2]==0){
+				//"32*32 (16色)"
+				sprintf(temporary,"32*32 (16%s)",STRING_UNIT_COLORS);
+				SendMessage(hList,LB_ADDSTRING,0,(long)temporary);
+			}
+			if(bExist[3]==0){
+				//"32*32 (256色)"
+				sprintf(temporary,"32*32 (256%s)",STRING_UNIT_COLORS);
+				SendMessage(hList,LB_ADDSTRING,0,(long)temporary);
+			}
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					hList=GetDlgItem(hwnd,IDC_TYPELIST);
+					SendMessage(hList,LB_GETTEXT,SendMessage(hList,LB_GETCURSEL,0,0),(long)temporary);
+
+					if(temporary[0]=='1'&&temporary[7]=='1') i=ICONTYPE_16_16;
+					if(temporary[0]=='1'&&temporary[7]=='2') i=ICONTYPE_16_256;
+					if(temporary[0]=='3'&&temporary[7]=='1') i=ICONTYPE_32_16;
+					if(temporary[0]=='3'&&temporary[7]=='2') i=ICONTYPE_32_256;
+					EndDialog(hwnd,i);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,-1);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+BOOL CALLBACK DlgIconToolProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,WndNum;
+
+	switch(message){
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_ADD_ICONTYPE:
+					i=DialogBox(hResInst,MAKEINTRESOURCE(IDD_ICONEDIT_ICONTYPE),GetParent(hwnd),(DLGPROC)DlgIconType);
+					if(i==-1) return 1;
+
+					WndNum=GetWndNum(GetParent(hwnd));
+					AddIconType(WndNum,i);
+
+					EnableWindow(GetDlgItem(hwnd,IDC_DELETE_ICONTYPE),1);
+					return 1;
+				case IDC_DELETE_ICONTYPE:
+					WndNum=GetWndNum(GetParent(hwnd));
+					DeleteIconType(WndNum);
+
+					if(MdiInfo[WndNum].MdiIconEditInfo->num<=1)
+						EnableWindow(GetDlgItem(hwnd,IDC_DELETE_ICONTYPE),0);
+					return 1;
+				case IDC_ICONTYPECOMBO:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						WndNum=GetWndNum(GetParent(hwnd));
+
+						//イメージ選択用のメモリを解放
+						if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==2)
+							DeleteObject(MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp);
+						MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=0;
+
+						MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum=
+							SendDlgItemMessage(hwnd,IDC_ICONTYPECOMBO,CB_GETCURSEL,0,0);
+
+						HBRUSH hOldBrush;
+						hOldBrush=(HBRUSH)SelectObject(MdiInfo[WndNum].MdiIconEditInfo->memdc,GetStockObject(WHITE_BRUSH));
+						PatBlt(MdiInfo[WndNum].MdiIconEditInfo->memdc,0,0,400,400,PATCOPY);
+						SelectObject(MdiInfo[WndNum].MdiIconEditInfo->memdc,hOldBrush);
+						DrawIconToMemBmp(WndNum,0);
+
+						InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hMain,NULL,1);
+						InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hColorDlg,NULL,0);
+					}
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/IconEditor_UndoRedo.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/IconEditor_UndoRedo.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/IconEditor_UndoRedo.cpp	(revision 178)
@@ -0,0 +1,100 @@
+#include "common.h"
+
+void IconEdit_UndoCommand(int WndNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	BYTE *pByte;
+	ICONEDIT_UNDOSTATE *pUndoState;
+
+	pUndoState=&MdiInfo[WndNum].MdiIconEditInfo->undo[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum];
+
+	i=pUndoState->NowPos-1;
+	if(i==-1) i=MAX_ICONEDIT_UNDONUM-1;
+	if(!pUndoState->lpData[i]){
+		MessageBeep(0);
+		return;
+	}
+	pUndoState->NowPos=i;
+
+	pByte=MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum];
+	MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]=
+		pUndoState->lpData[i];
+	pUndoState->lpData[i]=pByte;
+
+	//選択フレームを消去
+	if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==2){
+		DeleteObject(MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp);
+		MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=0;
+	}
+
+	//再描画
+	DrawIconToMemBmp(WndNum,0);
+	InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hMain,NULL,0);
+
+	MdiInfo[WndNum].MdiIconEditInfo->bModify=1;
+
+	//メニューを有効化
+	ResetState_UndoMenu();
+}
+void IconEdit_RedoCommand(int WndNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	BYTE *pByte;
+	ICONEDIT_UNDOSTATE *pUndoState;
+
+	pUndoState=&MdiInfo[WndNum].MdiIconEditInfo->undo[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum];
+
+	if(!pUndoState->lpData[pUndoState->NowPos]){
+		MessageBeep(0);
+		return;
+	}
+
+	pByte=MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum];
+	MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]=
+		pUndoState->lpData[pUndoState->NowPos];
+	pUndoState->lpData[pUndoState->NowPos]=pByte;
+
+	DrawIconToMemBmp(WndNum,0);
+	InvalidateRect(MdiInfo[WndNum].MdiIconEditInfo->hMain,NULL,0);
+
+	pUndoState->NowPos++;
+	if(pUndoState->NowPos==MAX_ICONEDIT_UNDONUM) pUndoState->NowPos=0;
+
+	MdiInfo[WndNum].MdiIconEditInfo->bModify=1;
+
+	ResetState_UndoMenu();
+}
+void IconEdit_NoticeChanging(int WndNum){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	ICONEDIT_UNDOSTATE *pUndoState;
+
+	pUndoState=&MdiInfo[WndNum].MdiIconEditInfo->undo[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum];
+
+	//Redoされた場合の不要なデータを削除する
+	for(i=pUndoState->NowPos;;i++){
+		if(i==MAX_ICONEDIT_UNDONUM) i=0;
+		if(pUndoState->lpData[i]==0) break;
+		HeapDefaultFree(pUndoState->lpData[i]);
+		pUndoState->lpData[i]=0;
+	}
+
+	pUndoState->lpData[pUndoState->NowPos]=(BYTE *)
+		HeapAlloc(hHeap,0,MdiInfo[WndNum].MdiIconEditInfo->dwBytesInRes[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]);
+
+	memcpy(pUndoState->lpData[pUndoState->NowPos],
+		MdiInfo[WndNum].MdiIconEditInfo->pIconImage[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum],
+		MdiInfo[WndNum].MdiIconEditInfo->dwBytesInRes[MdiInfo[WndNum].MdiIconEditInfo->SelectIconNum]);
+
+	pUndoState->NowPos++;
+	if(pUndoState->NowPos==MAX_ICONEDIT_UNDONUM) pUndoState->NowPos=0;
+	if(pUndoState->lpData[pUndoState->NowPos]){
+		//一番古い情報を切り捨てる
+		HeapDefaultFree(pUndoState->lpData[pUndoState->NowPos]);
+		pUndoState->lpData[pUndoState->NowPos]=0;
+	}
+
+	MdiInfo[WndNum].MdiIconEditInfo->bModify=1;
+
+	ResetState_UndoMenu();
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/LuxCtrl.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/LuxCtrl.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/LuxCtrl.cpp	(revision 178)
@@ -0,0 +1,5 @@
+#include "common.h"
+
+HINSTANCE hLib_LuxCtrl;
+
+PROC_LuxToolbar_CreateInstance LuxToolbar_CreateInstance;
Index: tag/abdev(2007.06.20)/ProjectEditor/LuxCtrl.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/LuxCtrl.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/LuxCtrl.h	(revision 178)
@@ -0,0 +1,26 @@
+
+
+extern "C++"
+{
+class ILuxToolbar:public IUnknown{
+public:
+	virtual void _stdcall Create(HWND hParent);
+	virtual HWND _stdcall GetHandle(void);
+	virtual void _stdcall Insert(int index,int id,HICON hIcon,LPSTR lpszToolTip);
+	virtual void _stdcall Add(int id,HICON hIcon,LPSTR lpszToolTip);
+	virtual void _stdcall Clear(void);
+	virtual void _stdcall EnableItem(int id,BOOL bEnabled);
+	virtual void _stdcall GetSize(SIZE &ref_size);
+};
+}// extern "C++"
+
+extern HINSTANCE hLib_LuxCtrl;
+
+typedef ILuxToolbar *(_stdcall *PROC_LuxToolbar_CreateInstance)(void);
+extern PROC_LuxToolbar_CreateInstance LuxToolbar_CreateInstance;
+
+
+
+extern ILuxToolbar *pobj_StandardToolbar;
+extern ILuxToolbar *pobj_ReleaseToolbar;
+extern ILuxToolbar *pobj_DebuggerToolbar;
Index: tag/abdev(2007.06.20)/ProjectEditor/MdiTextEdit.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/MdiTextEdit.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/MdiTextEdit.cpp	(revision 178)
@@ -0,0 +1,56 @@
+#include "common.h"
+
+CMdiTextEdit::CMdiTextEdit( MDIINFO *pMdiInfo ){
+	this->pMdiInfo = pMdiInfo;
+
+	isModified = false;
+
+	BaseNumOfUndoRedo = 0;
+
+	pTextEditUndoState = (TEXTEDIT_UNDOSTATE *)HeapAlloc( hHeap, HEAP_ZERO_MEMORY, sizeof( TEXTEDIT_UNDOSTATE ) );
+	pTextEditUndoState->NowPos = 0;
+}
+CMdiTextEdit::~CMdiTextEdit(){
+	for( int i=0; i<MAX_UNDONUM; i++ ){
+		if( pTextEditUndoState->Command[i] ){
+			TextEdit_DeleteUndoData( pTextEditUndoState, i );
+		}
+	}
+	HeapDefaultFree( pTextEditUndoState );
+}
+
+void CMdiTextEdit::Modify(){
+	//変更時
+	isModified = true;
+
+	//タブ文字列に変更を示すアスタリスクを付ける
+	pobj_MainTab->NofityModifyDocument( pMdiInfo->title );
+}
+void CMdiTextEdit::UnModify(){
+	//変更状態解除
+	isModified = false;
+
+	//アスタリスク表示を解除する
+	pobj_MainTab->NofityUnModifyDocument( pMdiInfo->title );
+
+	//アンドゥーリドゥーのベース番号を取得
+	BaseNumOfUndoRedo = pTextEditUndoState->NowPos;
+}
+bool CMdiTextEdit::IsModified(){
+	return isModified;
+}
+
+void CMdiTextEdit::NofityUndoRedoToModify(){
+	if( BaseNumOfUndoRedo == pTextEditUndoState->NowPos ){
+		//変更なし
+		if( IsModified() ){
+			UnModify();
+		}
+	}
+	else{
+		//変更あり
+		if( ! IsModified() ){
+			Modify();
+		}
+	}
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/MdiTextEdit.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/MdiTextEdit.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/MdiTextEdit.h	(revision 178)
@@ -0,0 +1,60 @@
+
+struct MDIINFO;
+struct TEXTEDIT_UNDOSTATE;
+
+class CMdiTextEdit{
+	//変更ありの状態かどうか
+	bool isModified;
+
+	//アンドゥーリドゥーのベース
+	int BaseNumOfUndoRedo;
+
+	MDIINFO *pMdiInfo;
+
+public:
+	CMdiTextEdit( MDIINFO *pMdiInfo );
+	~CMdiTextEdit();
+
+	//変更あり
+	void Modify();
+
+	//変更なし
+	void UnModify();
+
+	//変更状態を取得 ( true/変更あり, false/変更なし )
+	bool IsModified();
+
+	//アンドゥーリドゥーからの変更通知
+	void NofityUndoRedoToModify();
+
+	HWND hEdit;
+
+	//Web検索ウィンドウ
+	CWebResult *pobj_WebResult;
+
+	//ルーラーウィンドウ
+	CRuler *pobj_Ruler;
+
+	//アイコン
+	HICON hIcon;
+
+	char *buffer;
+	COLORREF *pColorRef;
+	int iUnderStart;
+	int iUnderEnd;
+
+	POINT StartCaretPos;
+	POINT EndCaretPos;
+	int Temp_UpDown_CaretXPos;
+	BOOL bAutoScroll;
+
+	//コントロールタブスペースの幅と行番号の文字数
+	int iWidth_ControlTabSpace;
+	int iLineNumberTextCount;
+
+	int iCharCode;
+	int iLfCode;
+
+	//元に戻す、やり直し機能
+	TEXTEDIT_UNDOSTATE *pTextEditUndoState;
+};
Index: tag/abdev(2007.06.20)/ProjectEditor/MenuProc.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/MenuProc.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/MenuProc.cpp	(revision 178)
@@ -0,0 +1,893 @@
+#include "Common.h"
+
+#if defined(JPN)
+//日本語
+#include "rad_msg_jpn.h"
+#else
+//英語
+#include "rad_msg_eng.h"
+#endif
+
+int GetMenuInfoNum(char *name){
+	extern PROJECTINFO ProjectInfo;
+	int i;
+	for(i=0;i<ProjectInfo.NumberOfMenu;i++){
+		if(lstrcmpi(name,ProjectInfo.pMenuInfo[i].IdName)==0) return i;
+	}
+	return -1;
+}
+void HeapMenuDataFree(MENU_INFO *pMenuInfo,int ItemNum,int *NumberOfFreedItem){
+	extern HANDLE hHeap;
+	int i;
+	for(i=0;i<ItemNum;i++){
+		if(NumberOfFreedItem) (*NumberOfFreedItem)++;
+		if(pMenuInfo[i].caption) HeapDefaultFree(pMenuInfo[i].caption);
+		if(pMenuInfo[i].IdName) HeapDefaultFree(pMenuInfo[i].IdName);
+		if(pMenuInfo[i].pMenuInfo){
+			HeapMenuDataFree(pMenuInfo[i].pMenuInfo,pMenuInfo[i].NumberOfMenu,NumberOfFreedItem);
+			HeapDefaultFree(pMenuInfo[i].pMenuInfo);
+		}
+	}
+}
+
+BOOL CALLBACK DlgProject_MenuID_Input(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern char NewIdName[MAX_PATH];
+	switch(message){
+		case WM_INITDIALOG:
+			if(lParam==0){
+				//"新規メニュー"
+				SetWindowText(hwnd,STRING_MENUEDIT_MAKE_NEWMENU);
+			}
+			else{
+				//"メニューIDの変更"
+				SetWindowText(hwnd,STRING_MENUEDIT_RENAME_MENUID);
+				SetDlgItemText(hwnd,IDC_IDNAME,(char *)lParam);
+			}
+			SetPosCenter(hwnd);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					GetDlgItemText(hwnd,IDC_IDNAME,NewIdName,MAX_PATH);
+					if(!NewIdName[0]){
+						//"ID名を入力して下さい。"
+						MessageBox(hwnd,STRING_ERROR_MUST_IDNAME,STRING_ERROR,MB_OK);
+						return 1;
+					}
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+void Project_Menu_Insert(void){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern char NewIdName[MAX_PATH];
+	int i;
+	char temporary[MAX_PATH];
+	MENU_INFO *MenuInfo;
+
+	if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,(DLGPROC)DlgProject_MenuID_Input,0)) return;
+
+	//重複チェック
+	for(i=0;i<ProjectInfo.NumberOfMenu;i++){
+		if(lstrcmpi(NewIdName,ProjectInfo.pMenuInfo[i].IdName)==0){
+			//"\"%s\" メニューは既にプロジェクト内に存在します。"
+			sprintf(temporary,STRING_MENUEDIT_DUPLICATIONERROR,ProjectInfo.pMenuInfo[i].IdName);
+			MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+			return;
+		}
+	}
+
+	ProjectInfo.pMenuInfo=(MENU_INFO *)HeapReAlloc(hHeap,0,ProjectInfo.pMenuInfo,(ProjectInfo.NumberOfMenu+1)*sizeof(MENU_INFO));
+	MenuInfo=&ProjectInfo.pMenuInfo[ProjectInfo.NumberOfMenu];
+
+	MenuInfo->IdName=(char *)HeapAlloc(hHeap,0,lstrlen(NewIdName)+1);
+	lstrcpy(MenuInfo->IdName,NewIdName);
+
+	MenuInfo->caption=0;
+
+	MenuInfo->NumberOfMenu=0;
+	MenuInfo->pMenuInfo=(MENU_INFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+
+
+	//////////////////////
+	//ツリービューに追加
+
+	extern HWND hMaterialTreeView;
+	TV_INSERTSTRUCT tv;
+	tv.hInsertAfter=TVI_SORT;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+	tv.item.iImage=3;
+	tv.item.iSelectedImage=3;
+	tv.hParent=ProjectInfo.hMenuTreeItem;
+	tv.item.pszText=MenuInfo->IdName;
+
+	MenuInfo->hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
+
+	TreeView_SelectItem(hMaterialTreeView,MenuInfo->hTreeItem);
+
+
+	ProjectInfo.NumberOfMenu++;
+	ProjectInfo.ModifyOfMaterial=1;
+
+
+	////////////////////////////////
+	// ウィンドウ プロパティを更新
+	for(i=0;i<MAX_WNDNUM;i++){
+		if(MdiInfo[i].hwnd&&MdiInfo[i].DocType==WNDTYPE_RAD){
+			if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
+				ChangePropertyWindow(i,GetWndInfoNum(MdiInfo[i].path));
+		}
+	}
+
+	NewMenuWindow(&ProjectInfo.pMenuInfo[ProjectInfo.NumberOfMenu-1]);
+}
+void Project_Menu_Delete(int MenuInfoNum){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i;
+
+	//ウィンドウが開かれている場合は閉じる
+	for(i=0;i<MAX_WNDNUM;i++){
+		if(MdiInfo[i].hwnd&&lstrcmpi(ProjectInfo.pMenuInfo[MenuInfoNum].IdName,MdiInfo[i].path)==0){
+			SendMessage(MdiInfo[i].hwnd,WM_CLOSE,0,0);
+			break;
+		}
+	}
+
+	//メニュー情報のメモリを解放
+	HeapMenuDataFree(ProjectInfo.pMenuInfo[MenuInfoNum].pMenuInfo,ProjectInfo.pMenuInfo[MenuInfoNum].NumberOfMenu,0);
+	HeapDefaultFree(ProjectInfo.pMenuInfo[MenuInfoNum].pMenuInfo);
+	HeapDefaultFree(ProjectInfo.pMenuInfo[MenuInfoNum].IdName);
+
+	//ツリービューから削除
+	extern HWND hMaterialTreeView;
+	TreeView_DeleteItem(hMaterialTreeView,ProjectInfo.pMenuInfo[MenuInfoNum].hTreeItem);
+
+	//ProjectInfo.pMenuInfo構造体から削除
+	ProjectInfo.NumberOfMenu--;
+	for(i=MenuInfoNum;i<ProjectInfo.NumberOfMenu;i++) ProjectInfo.pMenuInfo[i]=ProjectInfo.pMenuInfo[i+1];
+	if(ProjectInfo.NumberOfMenu==0){
+		HeapDefaultFree(ProjectInfo.pMenuInfo);
+		ProjectInfo.pMenuInfo=(MENU_INFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+	}
+	else ProjectInfo.pMenuInfo=(MENU_INFO *)HeapReAlloc(hHeap,0,ProjectInfo.pMenuInfo,ProjectInfo.NumberOfMenu*sizeof(MENU_INFO));
+
+	ProjectInfo.ModifyOfMaterial=1;
+
+
+	////////////////////////////////
+	// ウィンドウ プロパティを更新
+	for(i=0;i<MAX_WNDNUM;i++){
+		if(MdiInfo[i].hwnd&&MdiInfo[i].DocType==WNDTYPE_RAD){
+			if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
+				ChangePropertyWindow(i,GetWndInfoNum(MdiInfo[i].path));
+		}
+	}
+}
+
+void SetMenuDataList(HWND hList,MENU_INFO *pMenuInfo,int GradeNum){
+	int i;
+	char temporary[MAX_PATH];
+	for(i=0;i<pMenuInfo->NumberOfMenu;i++){
+		memset(temporary,' ',GradeNum*4);
+		temporary[GradeNum*4]=0;
+		if(pMenuInfo->pMenuInfo[i].type==MFT_SEPARATOR)
+			lstrcpy(temporary+GradeNum*4,"-");
+		else
+			lstrcpy(temporary+GradeNum*4,pMenuInfo->pMenuInfo[i].caption);
+		SendMessage(hList,LB_ADDSTRING,0,(long)temporary);
+		if(pMenuInfo->pMenuInfo[i].pMenuInfo)
+			SetMenuDataList(hList,&pMenuInfo->pMenuInfo[i],GradeNum+1);
+	}
+}
+void NewMenuWindow(MENU_INFO *pMenuInfo){
+	extern HINSTANCE hInst;
+	extern HWND hDocCombo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	HWND hChild,hListWnd,hMenuEdit;
+	RECT rect;
+	MDICREATESTRUCT mdic;
+
+	//すでに指定されたファイルが開かれている場合
+	hChild=GetWindow(hClient,GW_CHILD);
+	while(hChild){
+		i=GetWndNum(hChild);
+		if(MdiInfo[i].DocType==WNDTYPE_MENU){
+			if(lstrcmpi(MdiInfo[i].path,pMenuInfo->IdName)==0) break;
+		}
+		hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+	}
+	if(hChild){
+		BringWindowToTop(hChild);
+		return;
+	}
+
+	mdic.szTitle=pMenuInfo->IdName;
+	mdic.szClass="MDIClientWindow_Menu";
+	mdic.hOwner=hInst;
+	mdic.x=CW_USEDEFAULT;
+	mdic.y=CW_USEDEFAULT;
+	mdic.cx=CW_USEDEFAULT;
+	mdic.cy=CW_USEDEFAULT;
+
+	hChild=GetWindow(hClient,GW_CHILD);
+	if(IsWindow(hChild)){
+		if(IsZoomed(hChild)) mdic.style=WS_MAXIMIZE;
+		else mdic.style=0;
+	}
+	else{
+		if(pobj_nv->bMDIZoomed) mdic.style=WS_MAXIMIZE;
+		else mdic.style=0;
+	}
+
+	mdic.lParam=0;
+	hChild=(HWND)SendMessage(hClient,WM_MDICREATE,0,(long)&mdic);	//ウィンドウ作成
+
+
+	////////////////////
+	//子ウィンドウ作成
+
+	//ダイアログの下地を作成
+	hMenuEdit=CreateWindowEx(WS_EX_CLIENTEDGE,"MenuEditWindow",NULL,
+		WS_CHILD|WS_VSCROLL|WS_VISIBLE,
+		0,0,0,0,
+		hChild,NULL,hInst,NULL);
+
+	//メニュー リスト ウィンドウを作成
+	hListWnd=CreateWindowEx(WS_EX_CLIENTEDGE,"LISTBOX",NULL,
+		WS_CHILD|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE|LBS_NOTIFY|LBS_NOINTEGRALHEIGHT,
+		0,0,0,0,
+		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;
+		}
+	}
+
+	//ウィンドウ位置を初期化
+	GetClientRect(hChild,&rect);
+	MoveWindow(MdiInfo[i].MdiMenuInfo->hMenuEdit,0,0,172,rect.bottom,1);
+	MoveWindow(MdiInfo[i].MdiMenuInfo->hList,172,0,rect.right-172,rect.bottom,1);
+
+	//Docコンボボックスに追加
+	i=SendMessage(hDocCombo,CB_ADDSTRING,0,(long)pMenuInfo->IdName);
+	SendMessage(hDocCombo,CB_SETCURSEL,i,0);
+
+	//タブに追加
+	pobj_MainTab->InsertItem( pMenuInfo->IdName, true );
+
+	SetFocus(hListWnd);
+
+	//メニュー状態を設定
+	ResetState_DocMenu();
+}
+
+int GetNumberOfMenu(MENU_INFO *pMenuInfo){
+	int i,i2;
+	for(i=0,i2=0;i<pMenuInfo->NumberOfMenu;i++,i2++){
+		if(pMenuInfo->pMenuInfo[i].pMenuInfo) i2+=GetNumberOfMenu(&pMenuInfo->pMenuInfo[i]);
+	}
+	return i2;
+}
+MENU_INFO *GetMenuInfoFromList(MENU_INFO *pMenuInfo,int *pPos,int index,int *GradeNum){
+	int i;
+	MENU_INFO *pRetMenuInfo;
+	for(i=0;i<pMenuInfo->NumberOfMenu;i++){
+		if((*pPos)==index){
+			*pPos=i;
+			return pMenuInfo;
+		}
+		(*pPos)++;
+		if(pMenuInfo->pMenuInfo[i].pMenuInfo){
+			(*GradeNum)++;
+			pRetMenuInfo=GetMenuInfoFromList(&pMenuInfo->pMenuInfo[i],pPos,index,GradeNum);
+			if(pRetMenuInfo) return pRetMenuInfo;
+			(*GradeNum)--;
+		}
+	}
+	return 0;
+}
+BOOL CALLBACK DlgMenuProperty_Rename(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern HWND hClient,hOwner;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	char temporary[MAX_PATH];
+	static MENU_INFO *pMenuInfo;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+			i=GetWndNum(GetWindow(hClient,GW_CHILD));
+			GetDlgItemText(MdiInfo[i].MdiMenuInfo->hEdit_Dlg,IDC_IDNAME,temporary,MAX_PATH);
+			SetDlgItemText(hwnd,IDC_IDNAME,temporary);
+			GetDlgItemText(MdiInfo[i].MdiMenuInfo->hEdit_Dlg,IDC_CAPTION,temporary,MAX_PATH);
+			SetDlgItemText(hwnd,IDC_CAPTION,temporary);
+
+			pMenuInfo=(MENU_INFO *)lParam;
+			if(pMenuInfo->pMenuInfo){
+				EnableWindow(GetDlgItem(hwnd,IDC_IDSTATIC),0);
+				EnableWindow(GetDlgItem(hwnd,IDC_IDNAME),0);
+			}
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					i=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+					if(!pMenuInfo->pMenuInfo){
+						//ID
+						GetDlgItemText(hwnd,IDC_IDNAME,temporary,MAX_PATH);
+						if(!temporary[0]){
+							//"ID名を入力して下さい。"
+							MessageBox(hOwner,STRING_ERROR_MUST_IDNAME,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+							break;
+						}
+						HeapDefaultFree(pMenuInfo->IdName);
+						pMenuInfo->IdName=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+						lstrcpy(pMenuInfo->IdName,temporary);
+					}
+
+					//キャプション
+					GetDlgItemText(hwnd,IDC_CAPTION,temporary,MAX_PATH);
+					if(!temporary[0]){
+						//"キャプションを入力して下さい。"
+						MessageBox(hOwner,STRING_ERROR_MUST_CAPTION,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+						break;
+					}
+					HeapDefaultFree(pMenuInfo->caption);
+					pMenuInfo->caption=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+					lstrcpy(pMenuInfo->caption,temporary);
+
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+BOOL CALLBACK MenuEditDlg(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3,i4,WndNum,MenuInfoNum;
+	char temporary[MAX_PATH];
+	MENU_INFO *pMenuInfo,tempMenuInfo;
+
+	switch(message){
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_RENAME:
+					WndNum=GetWndNum(GetParent(GetParent(hwnd)));
+					if(WndNum==-1) return 1;
+					MenuInfoNum=GetMenuInfoNum(MdiInfo[WndNum].path);
+
+					i4=SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_GETCURSEL,0,0);
+					if(i4==LB_ERR) return 1;
+					i2=0;
+					i3=0;
+					pMenuInfo=GetMenuInfoFromList(&ProjectInfo.pMenuInfo[MenuInfoNum],&i2,i4,&i3);
+					pMenuInfo=&pMenuInfo->pMenuInfo[i2];
+
+					if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_PROJECT_MENURENAME),hOwner,(DLGPROC)DlgMenuProperty_Rename,(long)pMenuInfo)) return 1;
+					GetDlgItemText(hwnd,IDC_IDNAME,temporary,MAX_PATH);
+
+					if(!pMenuInfo->pMenuInfo){
+						//ID
+						SetDlgItemText(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_IDNAME,pMenuInfo->IdName);
+					}
+
+					//キャプション
+					SetDlgItemText(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_CAPTION,pMenuInfo->caption);
+
+					//リストへキャプションを反映
+					SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_DELETESTRING,i4,0);
+					memset(temporary,' ',i3*4);
+					lstrcpy(temporary+i3*4,pMenuInfo->caption);
+					SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_INSERTSTRING,i4,(long)temporary);
+
+					SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_SETCURSEL,i4,0);
+					ProjectInfo.ModifyOfMaterial=1;
+					return 1;
+				case IDC_POPUP:
+					WndNum=GetWndNum(GetParent(GetParent(hwnd)));
+					if(WndNum==-1) return 1;
+					MenuInfoNum=GetMenuInfoNum(MdiInfo[WndNum].path);
+
+					i4=SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_GETCURSEL,0,0);
+					if(i4==LB_ERR) return 1;
+					i2=0;
+					i3=0;
+					pMenuInfo=GetMenuInfoFromList(&ProjectInfo.pMenuInfo[MenuInfoNum],&i2,i4,&i3);
+					pMenuInfo=&pMenuInfo->pMenuInfo[i2];
+
+					if(pMenuInfo->pMenuInfo){
+						if(pMenuInfo->NumberOfMenu){
+							//"この操作を行うとポップアップされるメニュー アイテムも削除されます。"
+							if(MessageBox(hOwner,STRING_MENUEDIT_DELETECHECK,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)==IDCANCEL) return 1;
+						}
+						i=0;
+						HeapMenuDataFree(pMenuInfo->pMenuInfo,pMenuInfo->NumberOfMenu,&i);
+
+						for(i2=0;i2<i;i2++)
+							SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_DELETESTRING,i4+1,0);
+
+						HeapDefaultFree(pMenuInfo->pMenuInfo);
+						pMenuInfo->pMenuInfo=0;
+						lstrcpy(temporary,"IDM_name");
+						pMenuInfo->IdName=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+						lstrcpy(pMenuInfo->IdName,temporary);
+					}
+					else{
+						if(pMenuInfo->type==MFT_STRING){
+							HeapDefaultFree(pMenuInfo->IdName);
+							pMenuInfo->IdName=0;
+						}
+						else if(pMenuInfo->type==MFT_SEPARATOR){
+							lstrcpy(temporary,"caption text");
+							pMenuInfo->caption=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+							lstrcpy(pMenuInfo->caption,temporary);
+						}
+						pMenuInfo->NumberOfMenu=0;
+						pMenuInfo->pMenuInfo=(MENU_INFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+						pMenuInfo->type=MFT_STRING;
+					}
+					SendMessage(MdiInfo[WndNum].hwnd,WM_COMMAND,MAKELONG(0,LBN_SELCHANGE),(long)MdiInfo[WndNum].MdiMenuInfo->hList);
+					ProjectInfo.ModifyOfMaterial=1;
+					return 1;
+				case IDC_SEPARATOR:
+					WndNum=GetWndNum(GetParent(GetParent(hwnd)));
+					if(WndNum==-1) return 1;
+					MenuInfoNum=GetMenuInfoNum(MdiInfo[WndNum].path);
+
+					i4=SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_GETCURSEL,0,0);
+					if(i4==LB_ERR) return 1;
+					i2=0;
+					i3=0;
+					pMenuInfo=GetMenuInfoFromList(&ProjectInfo.pMenuInfo[MenuInfoNum],&i2,i4,&i3);
+					pMenuInfo=&pMenuInfo->pMenuInfo[i2];
+
+					if(SendDlgItemMessage(hwnd,IDC_SEPARATOR,BM_GETCHECK,0,0)){
+						HeapDefaultFree(pMenuInfo->caption);
+						pMenuInfo->caption=0;
+						HeapDefaultFree(pMenuInfo->IdName);
+						pMenuInfo->IdName=0;
+						pMenuInfo->type=MFT_SEPARATOR;
+
+						SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_DELETESTRING,i4,0);
+						memset(temporary,' ',i3*4);
+						lstrcpy(temporary+i3*4,"-");
+						SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_INSERTSTRING,i4,(long)temporary);
+					}
+					else{
+						lstrcpy(temporary,"caption text");
+						pMenuInfo->caption=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+						lstrcpy(pMenuInfo->caption,temporary);
+						lstrcpy(temporary,"IDM_name");
+						pMenuInfo->IdName=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+						lstrcpy(pMenuInfo->IdName,temporary);
+						pMenuInfo->type=MFT_STRING;
+
+						SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_DELETESTRING,i4,0);
+						memset(temporary,' ',i3*4);
+						lstrcpy(temporary+i3*4,pMenuInfo->caption);
+						SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_INSERTSTRING,i4,(long)temporary);
+					}
+					SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_SETCURSEL,i4,0);
+					SendMessage(MdiInfo[WndNum].hwnd,WM_COMMAND,MAKELONG(0,LBN_SELCHANGE),(long)MdiInfo[WndNum].MdiMenuInfo->hList);
+					return 1;
+				case IDC_CHECKED:
+					WndNum=GetWndNum(GetParent(GetParent(hwnd)));
+					if(WndNum==-1) return 1;
+					MenuInfoNum=GetMenuInfoNum(MdiInfo[WndNum].path);
+
+					i4=SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_GETCURSEL,0,0);
+					if(i4==LB_ERR) return 1;
+					i2=0;
+					i3=0;
+					pMenuInfo=GetMenuInfoFromList(&ProjectInfo.pMenuInfo[MenuInfoNum],&i2,i4,&i3);
+					pMenuInfo=&pMenuInfo->pMenuInfo[i2];
+
+					if(SendDlgItemMessage(hwnd,IDC_CHECKED,BM_GETCHECK,0,0))
+						pMenuInfo->state|=MFS_CHECKED;
+					else
+						pMenuInfo->state&=~MFS_CHECKED;
+
+					ProjectInfo.ModifyOfMaterial=1;
+					return 1;
+				case IDC_DISABLED:
+					WndNum=GetWndNum(GetParent(GetParent(hwnd)));
+					if(WndNum==-1) return 1;
+					MenuInfoNum=GetMenuInfoNum(MdiInfo[WndNum].path);
+
+					i4=SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_GETCURSEL,0,0);
+					if(i4==LB_ERR) return 1;
+					i2=0;
+					i3=0;
+					pMenuInfo=GetMenuInfoFromList(&ProjectInfo.pMenuInfo[MenuInfoNum],&i2,i4,&i3);
+					pMenuInfo=&pMenuInfo->pMenuInfo[i2];
+
+					if(SendDlgItemMessage(hwnd,IDC_DISABLED,BM_GETCHECK,0,0))
+						pMenuInfo->state|=MFS_DISABLED;
+					else
+						pMenuInfo->state&=~MFS_DISABLED;
+
+					ProjectInfo.ModifyOfMaterial=1;
+					return 1;
+				case IDC_INSERTMENUITEM:
+					WndNum=GetWndNum(GetParent(GetParent(hwnd)));
+					if(WndNum==-1) return 1;
+					MenuInfoNum=GetMenuInfoNum(MdiInfo[WndNum].path);
+
+					if(ProjectInfo.pMenuInfo[MenuInfoNum].NumberOfMenu==0){
+						ProjectInfo.pMenuInfo[MenuInfoNum].pMenuInfo=(MENU_INFO *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,ProjectInfo.pMenuInfo[MenuInfoNum].pMenuInfo,(ProjectInfo.pMenuInfo[MenuInfoNum].NumberOfMenu+1)*sizeof(MENU_INFO));
+						pMenuInfo=&ProjectInfo.pMenuInfo[MenuInfoNum].pMenuInfo[ProjectInfo.pMenuInfo[MenuInfoNum].NumberOfMenu];
+
+						sprintf(temporary,"caption text");
+						pMenuInfo->caption=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+						lstrcpy(pMenuInfo->caption,temporary);
+
+						sprintf(temporary,"IDM_name");
+						pMenuInfo->IdName=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+						lstrcpy(pMenuInfo->IdName,temporary);
+
+						pMenuInfo->state=0;
+						pMenuInfo->type=MFT_STRING;
+						pMenuInfo->pMenuInfo=0;
+
+						ProjectInfo.pMenuInfo[MenuInfoNum].NumberOfMenu++;
+
+						SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_INSERTSTRING,0,(long)pMenuInfo->caption);
+						SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_SETCURSEL,0,0);
+						SendMessage(GetParent(MdiInfo[WndNum].MdiMenuInfo->hMenuEdit),WM_COMMAND,MAKELONG(0,LBN_SELCHANGE),(long)MdiInfo[WndNum].MdiMenuInfo->hList);
+					}
+					else{
+						i4=SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_GETCURSEL,0,0);
+						if(i4==LB_ERR){
+							//"新しいメニュー アイテムの挿入位置を選択して下さい"
+							MessageBox(hOwner,STRING_MENUEDIT_MUSTSELECT_NEW_ITEM,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+							return 1;
+						}
+						i2=0;
+						i3=0;
+						pMenuInfo=GetMenuInfoFromList(&ProjectInfo.pMenuInfo[MenuInfoNum],&i2,i4,&i3);
+						if(pMenuInfo->pMenuInfo[i2].pMenuInfo){
+							//"ポップアップ アイテムを作成する場合は \"はい\" を、ポップアップと同じ階層にメニュー アイテムを作成する場合は \"いいえ\" を押して下さい。"
+							i=MessageBox(hOwner,STRING_MENUEDIT_INSERTTYPE_YESNO,APPLICATION_NAME,MB_YESNOCANCEL);
+							if(i==IDYES){
+								pMenuInfo=&pMenuInfo->pMenuInfo[i2];
+								i2=0;
+								i3++;
+							}
+							else if(i==IDNO){
+								i4+=GetNumberOfMenu(&pMenuInfo->pMenuInfo[i2]);
+								i2++;
+							}
+							else return 1;
+						}
+						else i2++;
+						i4++;
+						pMenuInfo->pMenuInfo=(MENU_INFO *)HeapReAlloc(hHeap,0,pMenuInfo->pMenuInfo,(pMenuInfo->NumberOfMenu+1)*sizeof(MENU_INFO));
+						for(i=pMenuInfo->NumberOfMenu;i>i2;i--){
+							pMenuInfo->pMenuInfo[i]=pMenuInfo->pMenuInfo[i-1];
+						}
+						memset(&pMenuInfo->pMenuInfo[i2],0,sizeof(MENU_INFO));
+
+						sprintf(temporary,"caption text");
+						pMenuInfo->pMenuInfo[i2].caption=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+						lstrcpy(pMenuInfo->pMenuInfo[i2].caption,temporary);
+
+						sprintf(temporary,"IDM_name");
+						pMenuInfo->pMenuInfo[i2].IdName=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+						lstrcpy(pMenuInfo->pMenuInfo[i2].IdName,temporary);
+
+						memset(temporary,' ',i3*4);
+						lstrcpy(temporary+i3*4,pMenuInfo->pMenuInfo[i2].caption);
+
+						pMenuInfo->NumberOfMenu++;
+
+						SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_INSERTSTRING,i4,(long)temporary);
+						SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_SETCURSEL,i4,0);
+						SendMessage(GetParent(MdiInfo[WndNum].MdiMenuInfo->hMenuEdit),WM_COMMAND,MAKELONG(0,LBN_SELCHANGE),(long)MdiInfo[WndNum].MdiMenuInfo->hList);
+					}
+					ProjectInfo.ModifyOfMaterial=1;
+					return 1;
+				case IDC_DELETEMENUITEM:
+					WndNum=GetWndNum(GetParent(GetParent(hwnd)));
+					if(WndNum==-1) return 1;
+					MenuInfoNum=GetMenuInfoNum(MdiInfo[WndNum].path);
+
+					i4=SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_GETCURSEL,0,0);
+					if(i4==LB_ERR){
+						//"削除するメニュー アイテムを選択して下さい"
+						MessageBox(hOwner,STRING_MENUEDIT_MUSTSELECT_DELETE_MENUITEM,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+						return 1;
+					}
+					i2=0;
+					i3=0;
+					pMenuInfo=GetMenuInfoFromList(&ProjectInfo.pMenuInfo[MenuInfoNum],&i2,i4,&i3);
+
+					i3=1;
+					if(pMenuInfo->pMenuInfo[i2].pMenuInfo){
+						if(pMenuInfo->pMenuInfo[i2].NumberOfMenu){
+							//"この操作を行うとポップアップされるメニュー アイテムも削除されます。"
+							if(MessageBox(hOwner,STRING_MENUEDIT_DELETECHECK,APPLICATION_NAME,MB_OKCANCEL)==IDCANCEL) return 1;
+						}
+						HeapMenuDataFree(pMenuInfo->pMenuInfo[i2].pMenuInfo,pMenuInfo->pMenuInfo[i2].NumberOfMenu,&i3);
+						HeapDefaultFree(pMenuInfo->pMenuInfo[i2].pMenuInfo);
+					}
+					else HeapDefaultFree(pMenuInfo->pMenuInfo[i2].IdName);
+
+					if(pMenuInfo->pMenuInfo[i2].type!=MFT_SEPARATOR)
+						HeapDefaultFree(pMenuInfo->pMenuInfo[i2].caption);
+
+					for(i=i2;i<pMenuInfo->NumberOfMenu-1;i++)
+						pMenuInfo->pMenuInfo[i]=pMenuInfo->pMenuInfo[i+1];
+
+					pMenuInfo->NumberOfMenu--;
+					pMenuInfo->pMenuInfo=(MENU_INFO *)HeapReAlloc(hHeap,0,pMenuInfo->pMenuInfo,pMenuInfo->NumberOfMenu*sizeof(MENU_INFO));
+
+					for(i=0;i<i3;i++)
+						SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_DELETESTRING,i4,0);
+
+					i=SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_GETCOUNT,0,0)-1;
+					if(i){
+						if(i<i4) i4=i;
+						SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_SETCURSEL,i4,0);
+					}
+
+					ProjectInfo.ModifyOfMaterial=1;
+					return 1;
+				case IDC_UP:
+					WndNum=GetWndNum(GetParent(GetParent(hwnd)));
+					if(WndNum==-1) return 1;
+					MenuInfoNum=GetMenuInfoNum(MdiInfo[WndNum].path);
+
+					i4=SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_GETCURSEL,0,0);
+					if(i4==LB_ERR){
+						//"移動するメニュー アイテムを選択して下さい"
+						MessageBox(hOwner,STRING_MENUEDIT_MUSTSELECT_MOVE_MENUITEM,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+						return 1;
+					}
+					i2=0;
+					i3=0;
+					pMenuInfo=GetMenuInfoFromList(&ProjectInfo.pMenuInfo[MenuInfoNum],&i2,i4,&i3);
+					if(i2==0) return 1;
+					i2--;
+
+					memcpy(&tempMenuInfo,&pMenuInfo->pMenuInfo[i2],sizeof(MENU_INFO));
+					memcpy(&pMenuInfo->pMenuInfo[i2],&pMenuInfo->pMenuInfo[i2+1],sizeof(MENU_INFO));
+					memcpy(&pMenuInfo->pMenuInfo[i2+1],&tempMenuInfo,sizeof(MENU_INFO));
+
+					SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_RESETCONTENT,0,0);
+					SetMenuDataList(MdiInfo[WndNum].MdiMenuInfo->hList,&ProjectInfo.pMenuInfo[MenuInfoNum],0);
+					if(!pMenuInfo->pMenuInfo[i2].pMenuInfo)
+						SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_SETCURSEL,i4-1,0);
+
+					ProjectInfo.ModifyOfMaterial=1;
+					return 1;
+				case IDC_DOWN:
+					WndNum=GetWndNum(GetParent(GetParent(hwnd)));
+					if(WndNum==-1) return 1;
+					MenuInfoNum=GetMenuInfoNum(MdiInfo[WndNum].path);
+
+					i4=SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_GETCURSEL,0,0);
+					if(i4==LB_ERR){
+						//"移動するメニュー アイテムを選択して下さい"
+						MessageBox(hOwner,STRING_MENUEDIT_MUSTSELECT_MOVE_MENUITEM,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+						return 1;
+					}
+					i2=0;
+					i3=0;
+					pMenuInfo=GetMenuInfoFromList(&ProjectInfo.pMenuInfo[MenuInfoNum],&i2,i4,&i3);
+					if(pMenuInfo->NumberOfMenu<=i2+1) return 1;
+
+					memcpy(&tempMenuInfo,&pMenuInfo->pMenuInfo[i2],sizeof(MENU_INFO));
+					memcpy(&pMenuInfo->pMenuInfo[i2],&pMenuInfo->pMenuInfo[i2+1],sizeof(MENU_INFO));
+					memcpy(&pMenuInfo->pMenuInfo[i2+1],&tempMenuInfo,sizeof(MENU_INFO));
+
+					SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_RESETCONTENT,0,0);
+					SetMenuDataList(MdiInfo[WndNum].MdiMenuInfo->hList,&ProjectInfo.pMenuInfo[MenuInfoNum],0);
+					if(!pMenuInfo->pMenuInfo[i2].pMenuInfo)
+						SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_SETCURSEL,i4+1,0);
+
+					ProjectInfo.ModifyOfMaterial=1;
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+LRESULT CALLBACK MenuEditWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HINSTANCE hInst;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i;
+	RECT rect;
+	SCROLLINFO ScrollInfo;
+
+	switch(message){
+		case WM_MOUSEACTIVATE:
+			BringWindowToTop(GetParent(hwnd));
+			return 0;
+		case WM_VSCROLL:
+			ScrollInfo.cbSize=sizeof(SCROLLINFO);
+			ScrollInfo.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
+			GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
+			if(LOWORD(wParam)==SB_LINEUP) i=-20;
+			else if(LOWORD(wParam)==SB_LINEDOWN) i=20;
+			else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)ScrollInfo.nPage;
+			else if(LOWORD(wParam)==SB_PAGEDOWN) i=ScrollInfo.nPage;
+			else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-ScrollInfo.nPos;
+			else i=0;
+			GetClientRect(hwnd,&rect);
+			i=max(-ScrollInfo.nPos,min(i,ScrollInfo.nMax-rect.bottom-ScrollInfo.nPos));
+			if(i!=0){
+				ScrollInfo.nPos+=i;
+				SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1);
+				ScrollWindow(hwnd,0,-i,NULL,NULL);
+				UpdateWindow(hwnd);
+			}
+			return 0;
+		case WM_SIZE:
+			i=GetWndNum(GetParent(hwnd));
+			if(i==-1) return 0;	//ウィンドウが初期状態の場合
+			ScrollInfo.cbSize=sizeof(SCROLLINFO);
+			ScrollInfo.fMask=SIF_PAGE|SIF_RANGE|SIF_POS;
+			GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
+			GetClientRect(MdiInfo[i].MdiMenuInfo->hEdit_Dlg,&rect);
+			ScrollInfo.nMin=0;
+			ScrollInfo.nMax=rect.bottom;
+			ScrollInfo.nPage=HIWORD(lParam);
+			SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1);
+
+			i=ScrollInfo.nPos;
+			ScrollInfo.fMask=SIF_POS;
+			GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
+			if(i>ScrollInfo.nPos){
+				ScrollWindow(hwnd,0,i-ScrollInfo.nPos,NULL,NULL);
+				UpdateWindow(hwnd);
+			}
+			return 0;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
+LRESULT CALLBACK MDIClientWindow_Menu(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HWND hDocCombo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3,WndNum,MenuInfoNum;
+	MENU_INFO *pMenuInfo;
+
+	switch(message){
+		case WM_COMMAND:
+			WndNum=GetWndNum(hwnd);
+			if(WndNum==-1) return 0;
+			MenuInfoNum=GetMenuInfoNum(MdiInfo[WndNum].path);
+			if((HWND)lParam==MdiInfo[WndNum].MdiMenuInfo->hList&&HIWORD(wParam)==LBN_SELCHANGE){
+				i=SendMessage(MdiInfo[WndNum].MdiMenuInfo->hList,LB_GETCURSEL,0,0);
+				i2=0;
+				i3=0;
+				pMenuInfo=GetMenuInfoFromList(&ProjectInfo.pMenuInfo[MenuInfoNum],&i2,i,&i3);
+				pMenuInfo=&pMenuInfo->pMenuInfo[i2];
+
+				if(pMenuInfo->pMenuInfo){
+					SetDlgItemText(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_CAPTION,pMenuInfo->caption);
+					SetDlgItemText(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_IDNAME,"");
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_IDSTATIC),0);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_RENAME),1);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_POPUP),1);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_SEPARATOR),0);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_CHECKED),1);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_DISABLED),1);
+					SendDlgItemMessage(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_POPUP,BM_SETCHECK,BST_CHECKED,0);
+					SendDlgItemMessage(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_SEPARATOR,BM_SETCHECK,BST_UNCHECKED,0);
+				}
+				else if(pMenuInfo->type==MFT_STRING){
+					SetDlgItemText(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_CAPTION,pMenuInfo->caption);
+					SetDlgItemText(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_IDNAME,pMenuInfo->IdName);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_IDSTATIC),1);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_CAPTIONSTATIC),1);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_RENAME),1);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_POPUP),1);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_SEPARATOR),1);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_CHECKED),1);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_DISABLED),1);
+					SendDlgItemMessage(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_POPUP,BM_SETCHECK,BST_UNCHECKED,0);
+					SendDlgItemMessage(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_SEPARATOR,BM_SETCHECK,BST_UNCHECKED,0);
+				}
+				else if(pMenuInfo->type==MFT_SEPARATOR){
+					SetDlgItemText(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_CAPTION,"");
+					SetDlgItemText(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_IDNAME,"");
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_IDSTATIC),0);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_CAPTIONSTATIC),0);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_RENAME),0);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_POPUP),0);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_SEPARATOR),1);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_CHECKED),0);
+					EnableWindow(GetDlgItem(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_DISABLED),0);
+					SendDlgItemMessage(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_POPUP,BM_SETCHECK,BST_UNCHECKED,0);
+					SendDlgItemMessage(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_SEPARATOR,BM_SETCHECK,BST_CHECKED,0);
+				}
+
+				if(pMenuInfo->state&MFS_CHECKED) i2=BST_CHECKED;
+				else i2=BST_UNCHECKED;
+				SendDlgItemMessage(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_CHECKED,BM_SETCHECK,i2,0);
+				if(pMenuInfo->state&MFS_DISABLED) i2=BST_CHECKED;
+				else i2=BST_UNCHECKED;
+				SendDlgItemMessage(MdiInfo[WndNum].MdiMenuInfo->hEdit_Dlg,IDC_DISABLED,BM_SETCHECK,i2,0);
+			}
+			return 0;
+		case WM_MDIACTIVATE:
+			if(!lParam) return 0;
+			i=GetWndNum((HWND)lParam);
+			if(i==-1) return 0;	//ウィンドウが初期状態の場合
+
+			i=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[i].title);
+			SendMessage(hDocCombo,CB_SETCURSEL,i,0);
+			SetStatusText(NULL);
+			ResetState_EditMenu();
+			return 0;
+		case WM_SIZE:
+			WndNum=GetWndNum(hwnd);
+			if(WndNum==-1) break;
+			MoveWindow(MdiInfo[WndNum].MdiMenuInfo->hMenuEdit,0,0,172,HIWORD(lParam),1);
+			MoveWindow(MdiInfo[WndNum].MdiMenuInfo->hList,172,0,LOWORD(lParam)-172,HIWORD(lParam),1);
+			break;
+		case WM_CLOSE:
+			CloseDocWindow(GetWndNum(hwnd));
+			pobj_nv->bMDIZoomed=IsZoomed(hwnd);
+			i=DefMDIChildProc(hwnd,message,wParam,lParam);
+
+			//メニュー状態を設定
+			ResetState_DocMenu();
+
+			return i;
+	}
+	return DefMDIChildProc(hwnd,message,wParam,lParam);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/MessageCallOperation.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/MessageCallOperation.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/MessageCallOperation.cpp	(revision 178)
@@ -0,0 +1,706 @@
+#include "Common.h"
+
+////////////////////////////////////////////////////////////////////////////
+//このソースファイルではイベントプロシージャの管理を行う（MainWnd.abなど）
+////////////////////////////////////////////////////////////////////////////
+
+int NowMenuNum;
+
+int GetItemMessageInfo(int WndInfoNum,char *buffer,char *EventName){
+	extern PROJECTINFO ProjectInfo; 
+	int i;
+
+	for(i=lstrlen(buffer);i>=0;i--){
+		if(buffer[i]=='_') break;
+	}
+	if(i==-1) return 0;
+	lstrcpy(EventName,buffer+i+1);
+	buffer[i]=0;
+	if(lstrcmp(EventName,"MenuClick")==0) return CT_MENU;
+	for(i=0;i<ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows;i++){
+		if(lstrcmp(buffer,ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].IdName)==0) break;
+	}
+	if(i==ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows) return 0;
+
+	return ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].Control;
+}
+char **GetProcedureNamesOfMessageCall(int WndInfoNum,ITEMEVENTINFO **ppItemEventInfo,int *num,BOOL *pbAlways){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3,i4,i5,i6,NameLen,CallBackNameLen;
+	char *buffer,**ppNames,temporary[MAX_PATH],temp2[MAX_PATH];
+
+	NameLen=lstrlen(ProjectInfo.pWindowInfo[WndInfoNum].name);
+	CallBackNameLen=lstrlen(ProjectInfo.pWindowInfo[WndInfoNum].CallBackName);
+
+	sprintf(temporary,"%s%s",ProjectInfo.dir,ProjectInfo.pWindowInfo[WndInfoNum].filepath);
+	buffer=ReadBuffer(temporary);
+
+	*num=0;
+	ppNames=(char **)HeapAlloc(hHeap,0,1);
+
+	*pbAlways=0;
+
+	//メッセージ
+	*ppItemEventInfo=(ITEMEVENTINFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(ITEMEVENTINFO));
+	for(i=0,i4=0;;i++){
+		if(buffer[i]=='\0') break;
+
+		//注釈（複数行）
+		if(buffer[i]=='/'&&buffer[i+1]=='*'){
+			i+=2;
+			while(!(buffer[i]=='*'&&buffer[i+1]=='/')){
+				if(buffer[i]=='\0'){
+					i--;
+					break;
+				}
+				i++;
+			}
+			continue;
+		}
+
+		if((buffer[i]=='\r'&&buffer[i+1]=='\n'&&buffer[i+2]!='\0')||i==0){
+			if(buffer[i]=='\r'&&buffer[i+1]=='\n') i2=i+2;
+			else i2=i;
+			while(buffer[i2]>='0'&&buffer[i2]<='9') i2++;
+			while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+			if(memicmp(buffer+i2,"Sub",3)==0&&(buffer[i2+3]==' '||buffer[i2+3]=='\t')){
+				i2+=4;
+				while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+				strncpy(temporary,buffer+i2,NameLen);
+				temporary[NameLen]=0;
+				if(lstrcmp(temporary,ProjectInfo.pWindowInfo[WndInfoNum].name)==0&&buffer[i2+NameLen]=='_'){
+					for(i2+=NameLen+1,i3=0;;i2++,i3++){
+						if(!IsVariableChar(buffer[i2])){
+							temporary[i3]=0;
+							break;
+						}
+						temporary[i3]=buffer[i2];
+					}
+					i6=GetItemMessageInfo(WndInfoNum,temporary,temp2);
+					if(i6){
+						//アイテムメッセージ（WM_COMMAND、WM_NOTIFY）
+						for(i5=0;;i5++){
+							if((*ppItemEventInfo)[i5].IdName==0){
+								*ppItemEventInfo=(ITEMEVENTINFO *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,*ppItemEventInfo,(i4+2)*sizeof(ITEMEVENTINFO));
+								(*ppItemEventInfo)[i4].IdName=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+								lstrcpy((*ppItemEventInfo)[i4].IdName,temporary);
+								(*ppItemEventInfo)[i4].pEventNames=(char **)HeapAlloc(hHeap,0,1);
+								(*ppItemEventInfo)[i4].ClassID=i6;
+								i4++;
+								break;
+							}
+							if(lstrcmp((*ppItemEventInfo)[i5].IdName,temporary)==0) break;
+						}
+						(*ppItemEventInfo)[i5].pEventNames=(char **)HeapReAlloc(hHeap,0,(*ppItemEventInfo)[i5].pEventNames,((*ppItemEventInfo)[i5].EventNum+1)*sizeof(char *));
+						(*ppItemEventInfo)[i5].pEventNames[(*ppItemEventInfo)[i5].EventNum]=(char *)HeapAlloc(hHeap,0,lstrlen(temp2)+1);
+						lstrcpy((*ppItemEventInfo)[i5].pEventNames[(*ppItemEventInfo)[i5].EventNum],temp2);
+						(*ppItemEventInfo)[i5].EventNum++;
+					}
+					else if(temporary[0]){
+						//一般メッセージ
+						ppNames=(char **)HeapReAlloc(hHeap,0,ppNames,(*num+1)*sizeof(char *));
+						ppNames[*num]=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+						lstrcpy(ppNames[*num],temporary);
+						(*num)++;
+					}
+				}
+			}
+			if(memicmp(buffer+i2,"Function",8)==0&&(buffer[i2+8]==' '||buffer[i2+8]=='\t')){
+				//[WndName]_WindowProcのみFunction定義
+				i2+=9;
+				while(buffer[i2]==' '||buffer[i2]=='\t') i2++;
+				if(memicmp(buffer+i2,ProjectInfo.pWindowInfo[WndInfoNum].CallBackName,CallBackNameLen)==0&&
+					(buffer[i2+CallBackNameLen]==' '||buffer[i2+CallBackNameLen]=='\t'||buffer[i2+CallBackNameLen]=='(')){
+					*pbAlways=1;
+				}
+			}
+		}
+	}
+	HeapDefaultFree(buffer);
+
+	return ppNames;
+}
+void SelectProcedureOfMessageCall(int WndInfoNum,char *ProcedureName,char *Parameter){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3,WndNum;
+	char temporary[MAX_PATH],*pBuf;
+	HWND hChild;
+	POINT pos;
+
+	sprintf(temporary,"%s%s",ProjectInfo.dir,ProjectInfo.pWindowInfo[WndInfoNum].filepath);
+	hChild=OpenFileWithExtension(temporary);
+	if(!hChild) return;
+	WndNum=GetWndNum(hChild);
+
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+	for(i=0;;i++){
+		if(pBuf[i]=='\0') break;
+		if((pBuf[i]=='\r'&&pBuf[i+1]=='\n'&&pBuf[i+2]!='\0')||i==0){
+			if(i) i2=i+2;
+			else i2=i;
+			while(pBuf[i2]>='0'&&pBuf[i2]<='9') i2++;
+			while(pBuf[i2]==' '||pBuf[i2]=='\t') i2++;
+			strncpy(temporary,pBuf+i2,3);
+			temporary[3]=0;
+			if(lstrcmpi(temporary,"Sub")==0&&(pBuf[i2+3]==' '||pBuf[i2+3]=='\t')){
+				pos.x=i2;
+				i2+=4;
+				while(pBuf[i2]==' '||pBuf[i2]=='\t') i2++;
+				for(i3=0;;i2++,i3++){
+					if(!IsVariableChar(pBuf[i2])){
+						temporary[i3]=0;
+						break;
+					}
+					temporary[i3]=pBuf[i2];
+				}
+				if(lstrcmpi(temporary,ProcedureName)==0){
+					for(;;i2++){
+						if(pBuf[i2]=='\r'||pBuf[i2]=='\0'){
+							if(pBuf[i2]=='\r'){
+								if(pBuf[i2+1]!='\n') continue;
+							}
+							pos.y=i2;
+							break;
+						}
+					}
+					break;
+				}
+			}
+		}
+	}
+	if(pBuf[i]){
+		//プロシージャが見つかったとき
+		TextEdit_SetSel(WndNum,pos.x,pos.y);
+	}
+	else{
+		//プロシージャがないときは生成する
+
+		//挿入位置にキャレットを移動
+		TextEdit_SetSel(WndNum,i,i);
+
+		//挿入
+		sprintf(temporary,"\r\nSub %s(%s)",ProcedureName,Parameter);
+		i2=lstrlen(temporary);
+		lstrcat(temporary,"\r\n\r\nEnd Sub\r\n");
+		TextEdit_ReplaceUpdateUndoData(WndNum,temporary,1,1);
+
+		TextEdit_SetSel(WndNum,i+2,i+i2);
+	}
+	SetFocus(MdiInfo[WndNum].pMdiTextEdit->hEdit);
+}
+void InsertEventToList(HWND hList,int ItemNum,char *EventName,char *MessageName,char *OutLine){
+	LV_ITEM item;
+
+	item.mask=LVIF_TEXT;
+	item.pszText=EventName;
+	item.iItem=ItemNum;
+	item.iSubItem=0;
+	ListView_InsertItem(hList,&item);
+	item.pszText=MessageName;
+	item.iItem=ItemNum;
+	item.iSubItem=1;
+	ListView_SetItem(hList,&item);
+	item.pszText=OutLine;
+	item.iItem=ItemNum;
+	item.iSubItem=2;
+	ListView_SetItem(hList,&item);
+}
+BOOL GetEventProcedureNameFromListView(HWND hList,int WndNum,int WndInfoNum,char *EventName,char *Parameter,DWORD dwEventType){
+	extern PROJECTINFO ProjectInfo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,MaxCount;
+	char temporary[MAX_PATH];
+
+	MaxCount=ListView_GetItemCount(hList);
+	if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
+		if(dwEventType==EVENTTYPE_DEFAULT){
+			for(i=0;i<MaxCount;i++){
+				if(ListView_GetItemState(hList,i,LVIS_SELECTED)){
+					ListView_GetItemText(hList,i,0,temporary,MAX_PATH);
+					sprintf(EventName,"%s_%s",
+						ProjectInfo.pWindowInfo[WndInfoNum].name,
+						temporary);
+					break;
+				}
+			}
+			if(i==MaxCount) return 0;
+
+			if(i==0) lstrcpy(Parameter,"state As Integer, minimized As Integer");
+			else if(i==1) lstrcpy(Parameter,"ByRef CreateStruct As CREATESTRUCT");
+			else if(i==2) Parameter[0]=0;
+			else if(i==3) lstrcpy(Parameter,"hDrop As HDROP");
+			else if(i==4) lstrcpy(Parameter,"nScrollCode As Long, nPos As Integer, hwndScrollBar As HWND");
+			else if(i==5) lstrcpy(Parameter,"KeyCode As Long, flags As Long");
+			else if(i==6) lstrcpy(Parameter,"KeyCode As Long, flags As Long");
+			else if(i==7) lstrcpy(Parameter,"KeyCode As Long, flags As Long");
+			else if(i==8) lstrcpy(Parameter,"flags As Long, x As Integer, y As Integer");
+			else if(i==9) lstrcpy(Parameter,"flags As Long, x As Integer, y As Integer");
+			else if(i==10) lstrcpy(Parameter,"flags As Long, x As Integer, y As Integer");
+			else if(i==11) lstrcpy(Parameter,"flags As Long, x As Integer, y As Integer");
+			else if(i==12) lstrcpy(Parameter,"flags As Long, x As Integer, y As Integer");
+			else if(i==13) lstrcpy(Parameter,"flags As Long, x As Integer, y As Integer");
+			else if(i==14) lstrcpy(Parameter,"flags As Long, x As Integer, y As Integer");
+			else if(i==15) lstrcpy(Parameter,"x As Integer, y As Integer");
+			else if(i==16) lstrcpy(Parameter,"ByRef nmHdr As NMHDR");
+			else if(i==17) lstrcpy(Parameter,"hDC As HDC");
+			else if(i==18) lstrcpy(Parameter,"ByRef cancel As Integer");
+			else if(i==19) lstrcpy(Parameter,"flags As Long, x As Integer, y As Integer");
+			else if(i==20) lstrcpy(Parameter,"flags As Long, x As Integer, y As Integer");
+			else if(i==21) lstrcpy(Parameter,"flags As Long, x As Integer, y As Integer");
+			else if(i==22) lstrcpy(Parameter,"SizeType As Long, cx As Integer, cy As Integer");
+			else if(i==23) Parameter[0]=0;
+			else if(i==24) lstrcpy(Parameter,"TimerID As DWord");
+			else if(i==25) lstrcpy(Parameter,"nScrollCode As Long, nPos As Integer, hwndScrollBar As HWND");
+		}
+		else if(dwEventType==EVENTTYPE_MENU){
+			for(i=0;i<MaxCount;i++){
+				if(ListView_GetItemState(hList,i,LVIS_SELECTED)){
+					ListView_GetItemText(hList,i,0,temporary,MAX_PATH);
+					sprintf(EventName,"%s_%s_MenuClick",
+						ProjectInfo.pWindowInfo[WndInfoNum].name,
+						temporary);
+					break;
+				}
+			}
+			if(i==MaxCount) return 0;
+
+			Parameter[0]=0;
+		}
+		else if(dwEventType==EVENTTYPE_MMSYS){
+			for(i=0;i<MaxCount;i++){
+				if(ListView_GetItemState(hList,i,LVIS_SELECTED)){
+					ListView_GetItemText(hList,i,0,temporary,MAX_PATH);
+					sprintf(EventName,"%s_%s",
+						ProjectInfo.pWindowInfo[WndInfoNum].name,
+						temporary);
+					break;
+				}
+			}
+			if(i==MaxCount) return 0;
+
+			if(i==0) lstrcpy(Parameter,"flags As Long, DevID As DWord");
+		}
+	}
+	else{
+		for(i=0;i<MaxCount;i++){
+			if(ListView_GetItemState(hList,i,LVIS_SELECTED)){
+				ListView_GetItemText(hList,i,0,temporary,MAX_PATH);
+				sprintf(EventName,"%s_%s_%s",
+					ProjectInfo.pWindowInfo[WndInfoNum].name,
+					ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].IdName,
+					temporary);
+				break;
+			}
+		}
+		if(i==MaxCount) return 0;
+
+		if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_LISTVIEW){
+			//ListView
+			if(i==0) lstrcpy(Parameter,"ByRef nmListView As NMLISTVIEW");
+			else if(i==1) lstrcpy(Parameter,"ByRef nmListView As NMLISTVIEW");
+			else if(i==2) lstrcpy(Parameter,"ByRef nmHdr As NMHDR");
+			else if(i==3) lstrcpy(Parameter,"ByRef nmHdr As NMHDR");
+			else if(i==4) lstrcpy(Parameter,"ByRef nmListView As NMLISTVIEW");
+			else if(i==5) lstrcpy(Parameter,"ByRef nmListView As NMLISTVIEW");
+			else if(i==6) lstrcpy(Parameter,"ByRef nmHdr As NMHDR");
+			else if(i==7) lstrcpy(Parameter,"ByRef nmHdr As NMHDR");
+			else if(i==8) lstrcpy(Parameter,"ByRef nmListView As NMLISTVIEW");
+			else if(i==9) lstrcpy(Parameter,"ByRef nmLVDispInfo As NMLVDISPINFO");
+			else if(i==10) lstrcpy(Parameter,"ByRef nmListView As NMLISTVIEW");
+			else if(i==11) lstrcpy(Parameter,"ByRef nmListView As NMLISTVIEW");
+			else if(i==12) lstrcpy(Parameter,"ByRef nmListView As NMLISTVIEW");
+			else if(i==13) lstrcpy(Parameter,"ByRef nmListView As NMLISTVIEW");
+			else if(i==14) lstrcpy(Parameter,"ByRef nmLVDispInfo As NMLVDISPINFO");
+			else if(i==15) lstrcpy(Parameter,"ByRef nmLVDispInfo As NMLVDISPINFO");
+			else if(i==16) lstrcpy(Parameter,"ByRef nmListView As NMLISTVIEW");
+			else if(i==17) lstrcpy(Parameter,"ByRef nmListView As NMLISTVIEW");
+			else if(i==18) lstrcpy(Parameter,"ByRef nmListView As NMLISTVIEW");
+			else if(i==19) lstrcpy(Parameter,"ByRef nmLVKeyDown As NMLVKEYDOWN");
+			else if(i==20) lstrcpy(Parameter,"ByRef nmLVDispInfo As NMLVDISPINFO");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_PROGRESSBAR){
+			//ProgressBar
+			lstrcpy(Parameter,"ByRef nmHdr As NMHDR");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_TRACKBAR){
+			//TrackBar
+			lstrcpy(Parameter,"ByRef nmHdr As NMHDR");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_TREEVIEW){
+			//TreeView
+			if(0<=i&&i<=7) lstrcpy(Parameter,"ByRef nmHdr As NMHDR");
+			else lstrcpy(Parameter,"ByRef nmTreeView As NMTREEVIEW");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_UPDOWN){
+			//UpDown
+			if(i==0) lstrcpy(Parameter,"ByRef nmHdr As NMHDR");
+			else if(i==1) lstrcpy(Parameter,"ByRef nmUpDown As NMUPDOWN");
+		}
+		else Parameter[0]=0;
+	}
+
+	return 1;
+}
+int SetDefaultNotifyMessagesInList(HWND hList,int ClassID){
+	int i;
+	i=0;
+	InsertEventToList(hList,i++,"Click","NM_CLICK","ｺﾝﾄﾛｰﾙ内でﾏｳｽの左ﾎﾞﾀﾝがｸﾘｯｸされた時");
+	InsertEventToList(hList,i++,"DblClick","NM_DBLCLK","ｺﾝﾄﾛｰﾙ内でﾏｳｽの左ﾎﾞﾀﾝがﾀﾞﾌﾞﾙ ｸﾘｯｸされた時");
+	InsertEventToList(hList,i++,"KillFocus","NM_KILLFOCUS","入力ﾌｫｰｶｽを失った時");
+	InsertEventToList(hList,i++,"OutOfMemory","NM_OUTOFMEMORY","ﾒﾓﾘ不足でｺﾝﾄﾛｰﾙの動作が完了できない時");
+	InsertEventToList(hList,i++,"RClick","NM_RCLICK","ｺﾝﾄﾛｰﾙ内でﾏｳｽの右ﾎﾞﾀﾝがｸﾘｯｸされた時");
+	InsertEventToList(hList,i++,"RDblClick","NM_RDBLCLK","ｺﾝﾄﾛｰﾙ内でﾏｳｽの右ﾎﾞﾀﾝがﾀﾞﾌﾞﾙ ｸﾘｯｸされた時");
+	InsertEventToList(hList,i++,"Return","NM_RETURN","ｺﾝﾄﾛｰﾙに入力ﾌｫｰｶｽがあるときにEnterｷｰが押された時");
+	InsertEventToList(hList,i++,"SetFocus","NM_SETFOCUS","入力ﾌｫｰｶｽを取得した時");
+	if(ClassID==CT_LISTVIEW){
+		InsertEventToList(hList,i++,"BeginDrag","LVN_BEGINDRAG","ﾏｳｽの左ﾎﾞﾀﾝでﾄﾞﾗｯｸﾞ&ﾄﾞﾛｯﾌﾟを始める時");
+		InsertEventToList(hList,i++,"BeginLabelEdit","LVN_BEGINLABELEDIT","ｱｲﾃﾑのﾗﾍﾞﾙの編集が開始された時");
+		InsertEventToList(hList,i++,"BeginRDrag","LVN_BEGINRDRAG","ﾏｳｽの右ﾎﾞﾀﾝでﾄﾞﾗｯｸﾞ&ﾄﾞﾛｯﾌﾟを始める時");
+		InsertEventToList(hList,i++,"ColumnClick","LVN_COLUMNCLICK","ｶﾗﾑの1つがｸﾘｯｸされた時");
+		InsertEventToList(hList,i++,"DeleteAllItems","LVN_DELETEALLITEMS","ﾋﾞｭｰ内のすべてのｱｲﾃﾑが削除された時");
+		InsertEventToList(hList,i++,"DeleteItem","LVN_DELETEITEM","ﾋﾞｭｰ内のｱｲﾃﾑが削除された時");
+		InsertEventToList(hList,i++,"EndLabelEdit","LVN_ENDLABELEDIT","ｱｲﾃﾑのﾗﾍﾞﾙの編集が終了した時");
+		InsertEventToList(hList,i++,"GetDispInfo","LVN_GETDISPINFO","親ｳｨﾝﾄﾞｳがﾃﾞｨｽﾌﾟﾚｲに関する情報を供給した時");
+		InsertEventToList(hList,i++,"InsertItem","LVN_INSERTITEM","ﾋﾞｭｰ内にｱｲﾃﾑが挿入された時");
+		InsertEventToList(hList,i++,"ItemChanged","LVN_ITEMCHANGED","ﾋﾞｭｰ内のｱｲﾃﾑが変更された時");
+		InsertEventToList(hList,i++,"ItemChanging","LVN_ITEMCHANGING","ﾋﾞｭｰ内のｱｲﾃﾑを変更する時");
+		InsertEventToList(hList,i++,"KeyDown","LVN_KEYDOWN","ｷｰが押された時");
+		InsertEventToList(hList,i++,"SetDispInfo","LVN_SETDISPINFO","親ｳｨﾝﾄﾞｳがｱｲﾃﾑに対して情報を更新する必要がある時");
+	}
+	else if(ClassID==CT_TREEVIEW){
+		//未完成
+	}
+	return i;
+}
+void SetMenuEventToList(HWND hList,MENU_INFO *pMenuInfo,int *pListNum,int *pPos){
+	int i;
+	for(i=0;i<pMenuInfo->NumberOfMenu;i++){
+		if((!pMenuInfo->pMenuInfo[i].pMenuInfo)&&pMenuInfo->pMenuInfo[i].type==MFT_STRING)
+			InsertEventToList(hList,(*pListNum)++,pMenuInfo->pMenuInfo[i].IdName,"WM_COMMAND",pMenuInfo->pMenuInfo[i].caption);
+		(*pPos)++;
+		if(pMenuInfo->pMenuInfo[i].pMenuInfo)
+			SetMenuEventToList(hList,&pMenuInfo->pMenuInfo[i],pListNum,pPos);
+	}
+}
+void SetEventToList(HWND hDlg,DWORD dwEventType){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,WndNum,WndInfoNum;
+	HWND hList;
+
+	hList=GetDlgItem(hDlg,IDC_EVENTLIST);
+	ListView_DeleteAllItems(hList);
+	SetDlgItemText(hDlg,IDC_PROCEDURENAME,"");
+
+	WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+	WndInfoNum=GetWndInfoNum(MdiInfo[WndNum].path);
+	i=0;
+	if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
+		EnableWindow(GetDlgItem(hDlg,IDC_DEFAULT),1);
+		EnableWindow(GetDlgItem(hDlg,IDC_MENU),1);
+		EnableWindow(GetDlgItem(hDlg,IDC_MMSYS),1);
+		if(dwEventType==EVENTTYPE_DEFAULT){
+			SendDlgItemMessage(hDlg,IDC_DEFAULT,BM_SETCHECK,BST_CHECKED,0);
+			InsertEventToList(hList,i++,"Activate","WM_ACTIVATE","ｳｨﾝﾄﾞｳがｱｸﾃｨﾌﾞ、または非ｱｸﾃｨﾌﾞになった時");
+			InsertEventToList(hList,i++,"Create","WM_CREATE","ｳｨﾝﾄﾞｳ作成時");
+			InsertEventToList(hList,i++,"Destroy","WM_DESTROY","ｳｨﾝﾄﾞｳ破棄時");
+			InsertEventToList(hList,i++,"DropFiles","WM_DROPFILES","ｳｨﾝﾄﾞｳにﾌｧｲﾙがﾄﾞﾛｯﾌﾟされた時");
+			InsertEventToList(hList,i++,"HScroll","WM_HSCROLL","水平ｽｸﾛｰﾙ ﾊﾞｰ・ﾄﾗｯｸ ﾊﾞｰが移動した時");
+			InsertEventToList(hList,i++,"KeyDown","WM_KEYDOWN","ｷｰが押された時");
+			InsertEventToList(hList,i++,"KeyPress","WM_CHAR","ANSI文字ｷｰを押して離した時");
+			InsertEventToList(hList,i++,"KeyUp","WM_KEYUP","ｷｰが離された時");
+			InsertEventToList(hList,i++,"LButtonDblClick","WM_LBUTTONDBLCLK","ﾏｳｽの左ﾎﾞﾀﾝがﾀﾞﾌﾞﾙ ｸﾘｯｸされた時");
+			InsertEventToList(hList,i++,"LButtonDown","WM_LBUTTONDOWN","ﾏｳｽの左ﾎﾞﾀﾝが押された時");
+			InsertEventToList(hList,i++,"LButtonUp","WM_LBUTTONUP","ﾏｳｽの左ﾎﾞﾀﾝが離された時");
+			InsertEventToList(hList,i++,"MButtonDblClick","WM_MBUTTONDBLCLK","ﾏｳｽの中央ﾎﾞﾀﾝがﾀﾞﾌﾞﾙ ｸﾘｯｸされた時");
+			InsertEventToList(hList,i++,"MButtonDown","WM_MBUTTONDOWN","ﾏｳｽの中央ﾎﾞﾀﾝが押された時");
+			InsertEventToList(hList,i++,"MButtonUp","WM_MBUTTONUP","ﾏｳｽの中央ﾎﾞﾀﾝが離された時");
+			InsertEventToList(hList,i++,"MouseMove","WM_MOUSEMOVE","ﾏｳｽが移動した時");
+			InsertEventToList(hList,i++,"Move","WM_MOVE","ｳｨﾝﾄﾞｳが移動した時");
+			InsertEventToList(hList,i++,"Notify","WM_NOTIFY","ｺﾓﾝｺﾝﾄﾛｰﾙからﾒｯｾｰｼﾞが通知された時");
+			InsertEventToList(hList,i++,"Paint","WM_PAINT","再描画要求が出された時");
+			InsertEventToList(hList,i++,"QueryClose","WM_CLOSE","ｳｨﾝﾄﾞｳの終了ﾎﾞﾀﾝが押された時");
+			InsertEventToList(hList,i++,"RButtonDblClick","WM_RBUTTONDBLCLK","ﾏｳｽの右ﾎﾞﾀﾝがﾀﾞﾌﾞﾙ ｸﾘｯｸされた時");
+			InsertEventToList(hList,i++,"RButtonDown","WM_RBUTTONDOWN","ﾏｳｽの右ﾎﾞﾀﾝが押された時");
+			InsertEventToList(hList,i++,"RButtonUp","WM_RBUTTONUP","ﾏｳｽの右ﾎﾞﾀﾝが離された時");
+			InsertEventToList(hList,i++,"Resize","WM_SIZE","ｳｨﾝﾄﾞｳの大きさが変更された時");
+			InsertEventToList(hList,i++,"SetFocus","WM_SETFOCUS","ｷｰﾎﾞｰﾄﾞ ﾌｫｰｶｽを受け取った時");
+			InsertEventToList(hList,i++,"Timer","WM_TIMER","設定したﾀｲﾏｰのﾀｲﾑ ｱｳﾄ時");
+			InsertEventToList(hList,i++,"VScroll","WM_VSCROLL","垂直ｽｸﾛｰﾙ ﾊﾞｰ・ﾄﾗｯｸ ﾊﾞｰが移動した時");
+		}
+		else if(dwEventType==EVENTTYPE_MENU){
+			//メニュー イベント
+			SendDlgItemMessage(hDlg,IDC_MENU,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[WndInfoNum].MenuID){
+				int MenuInfoNum;
+				MenuInfoNum=GetMenuInfoNum(ProjectInfo.pWindowInfo[WndInfoNum].MenuID);
+				i=0;
+				i2=0;
+
+				SetMenuEventToList(hList,&ProjectInfo.pMenuInfo[MenuInfoNum],&i,&i2);
+			}
+		}
+		else if(dwEventType==EVENTTYPE_MMSYS){
+			SendDlgItemMessage(hDlg,IDC_MMSYS,BM_SETCHECK,BST_CHECKED,0);
+			InsertEventToList(hList,i++,"MciNotify","MM_MCINOTIFY","MCIｺﾏﾝﾄﾞが完了したり異常終了した場合");
+		}
+	}
+	else{
+		EnableWindow(GetDlgItem(hDlg,IDC_DEFAULT),1);
+		EnableWindow(GetDlgItem(hDlg,IDC_MENU),0);
+		EnableWindow(GetDlgItem(hDlg,IDC_MMSYS),0);
+		SendDlgItemMessage(hDlg,IDC_DEFAULT,BM_SETCHECK,BST_CHECKED,0);
+		if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_BUTTON){
+			//Button
+			InsertEventToList(hList,i++,"Click","BN_CLICKED","ﾎﾞﾀﾝがｸﾘｯｸされた時");
+			InsertEventToList(hList,i++,"DblClick","BN_DBLCLK","ﾎﾞﾀﾝがﾀﾞﾌﾞﾙ ｸﾘｯｸされた時");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_CHECKBOX){
+			//CheckBox
+			InsertEventToList(hList,i++,"Click","BN_CLICKED","ﾁｪｯｸ ﾎﾞｯｸｽがｸﾘｯｸされた時");
+			InsertEventToList(hList,i++,"DblClick","BN_DBLCLK","ﾁｪｯｸ ﾎﾞｯｸｽがﾀﾞﾌﾞﾙ ｸﾘｯｸされた時");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_COMBOBOX){
+			//ComboBox
+			InsertEventToList(hList,i++,"CloseUp","CBN_CLOSEUP","ﾘｽﾄ ﾎﾞｯｸｽが非表示になる時");
+			InsertEventToList(hList,i++,"DblClick","CBN_DBLCLK","ﾘｽﾄ内のｱｲﾃﾑがﾀﾞﾌﾞﾙ ｸﾘｯｸされた時");
+			InsertEventToList(hList,i++,"DropDown","CBN_DROPDOWN","ﾘｽﾄ ﾎﾞｯｸｽがﾄﾞﾛｯﾌﾟ ﾀﾞｳﾝされる時");
+			InsertEventToList(hList,i++,"EditChange","CBN_EDITCHANGE","ｴﾃﾞｨｯﾄ ﾎﾞｯｸｽの内容が変化した時（後処理）");
+			InsertEventToList(hList,i++,"EditUpdate","CBN_EDITUPDATE","ﾘｽﾄ ﾎﾞｯｸｽが非表示になった時");
+			InsertEventToList(hList,i++,"ErrSpace","CBN_ERRSPACE","ﾒﾓﾘ割り当てに失敗した時");
+			InsertEventToList(hList,i++,"KillFocus","CBN_KILLFOCUS","入力ﾌｫｰｶｽを失った時");
+			InsertEventToList(hList,i++,"SelChange","CBN_SELCHANGE","ﾘｽﾄ内の選択が変更された時");
+			InsertEventToList(hList,i++,"SelEndCancel","CBN_SELENDCANCEL","ｺﾝﾎﾞ ﾎﾞｯｸｽの選択を取り消した時");
+			InsertEventToList(hList,i++,"SelEndOk","CBN_SELENDOK","選択した項目が有効である時");
+			InsertEventToList(hList,i++,"SetFocus","CBN_SETFOCUS","入力ﾌｫｰｶｽを取得した時");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_EDIT){
+			//Edit
+			InsertEventToList(hList,i++,"Change","EN_CHANGE","ｴﾃﾞｨｯﾄ ﾎﾞｯｸｽの内容が変更された時（後処理）");
+			InsertEventToList(hList,i++,"ErrSpace","EN_ERRSPACE","ﾒﾓﾘ割り当てに失敗した時");
+			InsertEventToList(hList,i++,"HScroll","EN_HSCROLL","水平ｽｸﾛｰﾙを行った時");
+			InsertEventToList(hList,i++,"KillFocus","EN_KILLFOCUS","入力ﾌｫｰｶｽを失った時");
+			InsertEventToList(hList,i++,"MaxText","EN_MAXTEXT","文字数が上限を超えた時");
+			InsertEventToList(hList,i++,"SetFocus","EN_SETFOCUS","入力ﾌｫｰｶｽを取得した時");
+			InsertEventToList(hList,i++,"Update","EN_UPDATE","ｴﾃﾞｨｯﾄ ﾎﾞｯｸｽの内容が変更される時（前処理）");
+			InsertEventToList(hList,i++,"VScroll","EN_VSCROLL","垂直ｽｸﾛｰﾙを行った時");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_IMAGEBOX){
+			//ImageBox
+			InsertEventToList(hList,i++,"Click","STN_CLICKED","ｲﾒｰｼﾞ ﾎﾞｯｸｽがｸﾘｯｸされた時");
+			InsertEventToList(hList,i++,"DblClick","STN_DBLCLK","ｲﾒｰｼﾞ ﾎﾞｯｸｽがﾀﾞﾌﾞﾙ ｸﾘｯｸされた時");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_LISTBOX){
+			//ListBox
+			InsertEventToList(hList,i++,"SelChange","LBN_SELCHANGE","ﾘｽﾄ内の選択が変更された時");
+			InsertEventToList(hList,i++,"DblClick","LBN_DBLCLK","ﾘｽﾄ内の文字列がﾀﾞﾌﾞﾙ ｸﾘｯｸされた時");
+			InsertEventToList(hList,i++,"ErrSpace","LBN_ERRSPACE","ﾘｽﾄのﾒﾓﾘ割り当てに失敗した時");
+			InsertEventToList(hList,i++,"KillFocus","LBN_KILLFOCUS","入力ﾌｫｰｶｽを失った時");
+			InsertEventToList(hList,i++,"SelCancel","LBN_SELCANCEL","ﾘｽﾄ内の選択が取り消された時");
+			InsertEventToList(hList,i++,"SetFocus","LBN_SETFOCUS","入力ﾌｫｰｶｽを取得した時");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_LISTVIEW){
+			//ListView
+			i=SetDefaultNotifyMessagesInList(hList,CT_LISTVIEW);
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_PROGRESSBAR){
+			//ProgressBar
+			InsertEventToList(hList,i++,"OutOfMemory","NM_OUTOFMEMORY","ﾒﾓﾘ不足でｺﾝﾄﾛｰﾙの動作が完了できない時");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_RADIOBUTTON){
+			//RadioButton
+			InsertEventToList(hList,i++,"Click","BN_CLICKED","ﾗｼﾞｵ ﾎﾞﾀﾝがｸﾘｯｸされた時");
+			InsertEventToList(hList,i++,"DblClick","BN_DBLCLK","ﾗｼﾞｵ ﾎﾞﾀﾝがﾀﾞﾌﾞﾙ ｸﾘｯｸされた時");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_STATIC){
+			//Static
+			InsertEventToList(hList,i++,"Click","STN_CLICKED","ｽﾀﾃｨｯｸ ﾃｷｽﾄがｸﾘｯｸされた時");
+			InsertEventToList(hList,i++,"DblClick","STN_DBLCLK","ｽﾀﾃｨｯｸ ﾃｷｽﾄがﾀﾞﾌﾞﾙ ｸﾘｯｸされた時");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_TRACKBAR){
+			//TrackBar
+			InsertEventToList(hList,i++,"OutOfMemory","NM_OUTOFMEMORY","ﾒﾓﾘ不足でｺﾝﾄﾛｰﾙの動作が完了できない時");
+			InsertEventToList(hList,i++,"ReleasedCapture","NM_RELEASEDCAPTURE ","ﾏｳｽ ｷｬﾌﾟﾁｬ ﾘﾘｰｽの通知");
+			InsertEventToList(hList,i++,"CustomDraw","NM_CUSTOMDRAW ","ｶｽﾀﾑ描画操作の通知");
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_TREEVIEW){
+			//TreeView
+			i=SetDefaultNotifyMessagesInList(hList,CT_TREEVIEW);
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_UPDOWN){
+			//UpDown
+			InsertEventToList(hList,i++,"OutOfMemory","NM_OUTOFMEMORY","ﾒﾓﾘ不足でｺﾝﾄﾛｰﾙの動作が完了できない時");
+			InsertEventToList(hList,i++,"Deltapos","UDN_DELTAPOS","ｺﾝﾄﾛｰﾙの位置が変えられようとしている時");
+		}
+	}
+}
+void Popup_SelectMenu(HWND hDlg){
+	extern PROJECTINFO ProjectInfo;
+	int i;
+	POINT pos;
+	HMENU hMenu;
+
+	if(ProjectInfo.NumberOfMenu==0) return;
+
+	GetCursorPos(&pos);
+
+	hMenu=CreatePopupMenu();
+
+	MENUITEMINFO mii;
+	mii.cbSize=sizeof(MENUITEMINFO);
+	for(i=0;i<ProjectInfo.NumberOfMenu;i++){
+		if(NowMenuNum==i){
+			mii.fMask=MIIM_TYPE|MIIM_ID|MIIM_STATE;
+			mii.fState=MFS_CHECKED;
+		}
+		else mii.fMask=MIIM_TYPE|MIIM_ID;
+		mii.fType=MFT_STRING;
+		mii.wID=100+i;
+		mii.dwTypeData=ProjectInfo.pMenuInfo[i].IdName;
+		InsertMenuItem(hMenu,i,1,&mii);
+	}
+
+	extern HMENU hRadMenuBase;
+	TrackPopupMenu(hMenu,TPM_LEFTALIGN,pos.x,pos.y,0,hDlg,0);
+
+	DestroyMenu(hMenu);
+}
+
+WNDPROC OldEventListViewProc;
+LRESULT CALLBACK EventListViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	if(message==WM_RBUTTONDOWN){
+		if(SendDlgItemMessage(GetParent(hwnd),IDC_MENU,BM_GETCHECK,0,0))
+			Popup_SelectMenu(GetParent(hwnd));
+		return 0;
+	}
+	return CallWindowProc(OldEventListViewProc,hwnd,message,wParam,lParam);
+}
+BOOL CALLBACK DlgEventCode(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int WndNum,WndInfoNum,i,i2;
+	char temporary[MAX_PATH],temp2[MAX_PATH];
+	HWND hList;
+	DWORD dwStyle;
+	RECT rect;
+	LV_COLUMN ListView_Column;
+
+	static DWORD dwEventType;
+
+	if(message==WM_COMMAND&&100<=wParam&&wParam<200){
+		hList=GetDlgItem(hwnd,IDC_EVENTLIST);
+		WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+		WndInfoNum=GetWndInfoNum(MdiInfo[WndNum].path);
+
+		ListView_DeleteAllItems(hList);
+		SetDlgItemText(hwnd,IDC_PROCEDURENAME,"");
+		i=0;
+		i2=0;
+
+		NowMenuNum=wParam-100;
+		SetMenuEventToList(hList,&ProjectInfo.pMenuInfo[wParam-100],&i,&i2);
+	}
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+			SetFocus(GetDlgItem(hwnd,IDC_EVENTLIST));
+
+			hList=GetDlgItem(hwnd,IDC_EVENTLIST);
+			GetClientRect(hList,&rect);
+			dwStyle=ListView_GetExtendedListViewStyle(hList);
+			dwStyle|=LVS_EX_FULLROWSELECT;
+			ListView_SetExtendedListViewStyle(hList,dwStyle);
+
+			ListView_Column.mask=LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
+			ListView_Column.fmt=LVCFMT_LEFT;
+
+			ListView_Column.cx=100;
+			ListView_Column.pszText="イベント";
+			ListView_Column.iSubItem=0;
+			ListView_InsertColumn(hList,0,&ListView_Column);
+
+			ListView_Column.cx=120;
+			ListView_Column.pszText="対応メッセージ";
+			ListView_Column.iSubItem=1;
+			ListView_InsertColumn(hList,1,&ListView_Column);
+
+			ListView_Column.cx=rect.right-240;
+			ListView_Column.pszText="概要";
+			ListView_Column.iSubItem=2;
+			ListView_InsertColumn(hList,2,&ListView_Column);
+
+			dwEventType=lParam;
+			SetEventToList(hwnd,dwEventType);
+			EnableWindow(GetDlgItem(hwnd,IDOK),0);
+
+			OldEventListViewProc=(WNDPROC)GetWindowLong(GetDlgItem(hwnd,IDC_EVENTLIST),GWL_WNDPROC);
+			SetWindowLong(GetDlgItem(hwnd,IDC_EVENTLIST),GWL_WNDPROC,(long)EventListViewProc);
+
+			WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+			WndInfoNum=GetWndInfoNum(MdiInfo[WndNum].path);
+			NowMenuNum=GetMenuInfoNum(ProjectInfo.pWindowInfo[WndInfoNum].MenuID);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_DEFAULT:
+					dwEventType=EVENTTYPE_DEFAULT;
+					SetEventToList(hwnd,dwEventType);
+					EnableWindow(GetDlgItem(hwnd,IDOK),0);
+					break;
+				case IDC_MENU:
+					dwEventType=EVENTTYPE_MENU;
+					SetEventToList(hwnd,dwEventType);
+					EnableWindow(GetDlgItem(hwnd,IDOK),0);
+
+					//「対象メニュー」選択メニューを表示
+					Popup_SelectMenu(hwnd);
+					break;
+				case IDC_MMSYS:
+					dwEventType=EVENTTYPE_MMSYS;
+					SetEventToList(hwnd,dwEventType);
+					EnableWindow(GetDlgItem(hwnd,IDOK),0);
+					break;
+				case IDOK:
+					hList=GetDlgItem(hwnd,IDC_EVENTLIST);
+					WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+					WndInfoNum=GetWndInfoNum(MdiInfo[WndNum].path);
+					if(GetEventProcedureNameFromListView(hList,WndNum,WndInfoNum,temporary,temp2,dwEventType)){
+						SelectProcedureOfMessageCall(WndInfoNum,temporary,temp2);
+						EndDialog(hwnd,0);
+					}
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			break;
+		case WM_NOTIFY:
+			NMLISTVIEW *nmListView;
+			nmListView=(NMLISTVIEW *)lParam;
+			if(nmListView->hdr.idFrom==IDC_EVENTLIST){
+				if(nmListView->hdr.code==LVN_ITEMCHANGED){
+					hList=GetDlgItem(hwnd,IDC_EVENTLIST);
+					WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+					WndInfoNum=GetWndInfoNum(MdiInfo[WndNum].path);
+					if(GetEventProcedureNameFromListView(hList,WndNum,WndInfoNum,temporary,temp2,dwEventType)){
+						sprintf(temporary+lstrlen(temporary),"(%s)",temp2);
+						EnableWindow(GetDlgItem(hwnd,IDOK),1);
+					}
+					else{
+						temporary[0]=0;
+						EnableWindow(GetDlgItem(hwnd,IDOK),0);
+					}
+					SetDlgItemText(hwnd,IDC_PROCEDURENAME,temporary);
+					return 1;
+				}
+				else if(nmListView->hdr.code==NM_DBLCLK)
+					SendMessage(hwnd,WM_COMMAND,IDOK,0);
+			}				
+			break;
+	}
+	return 0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/NonVolatile.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/NonVolatile.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/NonVolatile.cpp	(revision 178)
@@ -0,0 +1,911 @@
+#include "common.h"
+
+
+void GetDefaultEditFont(LOGFONT *pLogFont){
+#if defined(JPN)
+	//日本語
+	pLogFont->lfHeight=-13;
+	pLogFont->lfWidth=0;
+	pLogFont->lfEscapement=0;
+	pLogFont->lfOrientation=0;
+	pLogFont->lfWeight=400;
+	pLogFont->lfItalic=NULL;
+	pLogFont->lfUnderline=NULL;
+	pLogFont->lfStrikeOut=NULL;
+	pLogFont->lfCharSet=SHIFTJIS_CHARSET;
+	pLogFont->lfOutPrecision=OUT_STRING_PRECIS;
+	pLogFont->lfClipPrecision=CLIP_STROKE_PRECIS;
+	pLogFont->lfQuality=DRAFT_QUALITY;
+	pLogFont->lfPitchAndFamily=FIXED_PITCH;
+	sprintf(pLogFont->lfFaceName,"ＭＳ ゴシック");
+#else
+	//英語
+	pLogFont->lfHeight=-15;
+	pLogFont->lfWidth=0;
+	pLogFont->lfEscapement=0;
+	pLogFont->lfOrientation=0;
+	pLogFont->lfWeight=400;
+	pLogFont->lfItalic=NULL;
+	pLogFont->lfUnderline=NULL;
+	pLogFont->lfStrikeOut=NULL;
+	pLogFont->lfCharSet=ANSI_CHARSET;
+	pLogFont->lfOutPrecision=OUT_STRING_PRECIS;
+	pLogFont->lfClipPrecision=CLIP_STROKE_PRECIS;
+	pLogFont->lfQuality=DRAFT_QUALITY;
+	pLogFont->lfPitchAndFamily=FIXED_PITCH;
+	sprintf(pLogFont->lfFaceName,"Courier New");
+#endif
+}
+void GetDefaultHintFont(LOGFONT *pLogFont){
+#if defined(JPN)
+	//日本語
+	pLogFont->lfHeight=-12;
+	pLogFont->lfWidth=0;
+	pLogFont->lfEscapement=0;
+	pLogFont->lfOrientation=0;
+	pLogFont->lfWeight=FW_THIN;
+	pLogFont->lfItalic=NULL;
+	pLogFont->lfUnderline=NULL;
+	pLogFont->lfStrikeOut=NULL;
+	pLogFont->lfCharSet=ANSI_CHARSET;
+	pLogFont->lfOutPrecision=OUT_STRING_PRECIS;
+	pLogFont->lfClipPrecision=CLIP_STROKE_PRECIS;
+	pLogFont->lfQuality=DRAFT_QUALITY;
+	pLogFont->lfPitchAndFamily=VARIABLE_PITCH;
+	sprintf(pLogFont->lfFaceName,"ＭＳ Ｐゴシック");
+#else
+	//英語
+	pLogFont->lfHeight=-12;
+	pLogFont->lfWidth=0;
+	pLogFont->lfEscapement=0;
+	pLogFont->lfOrientation=0;
+	pLogFont->lfWeight=FW_THIN;
+	pLogFont->lfItalic=NULL;
+	pLogFont->lfUnderline=NULL;
+	pLogFont->lfStrikeOut=NULL;
+	pLogFont->lfCharSet=ANSI_CHARSET;
+	pLogFont->lfOutPrecision=OUT_STRING_PRECIS;
+	pLogFont->lfClipPrecision=CLIP_STROKE_PRECIS;
+	pLogFont->lfQuality=DRAFT_QUALITY;
+	pLogFont->lfPitchAndFamily=VARIABLE_PITCH;
+	sprintf(pLogFont->lfFaceName,"Arial");
+#endif
+}
+void GetDefaultPrintFont(LOGFONT *pLogFont){
+	pLogFont->lfHeight=0;	//iPrintFontPointSizeとデバイス情報により決まる
+	pLogFont->lfWidth=0;
+	pLogFont->lfEscapement=0;
+	pLogFont->lfOrientation=0;
+	pLogFont->lfWeight=FW_NORMAL;
+	pLogFont->lfItalic=NULL;
+	pLogFont->lfUnderline=NULL;
+	pLogFont->lfStrikeOut=NULL;
+	pLogFont->lfCharSet=SHIFTJIS_CHARSET;
+	pLogFont->lfOutPrecision=OUT_STRING_PRECIS;
+	pLogFont->lfClipPrecision=CLIP_STROKE_PRECIS;
+	pLogFont->lfQuality=DRAFT_QUALITY;
+	pLogFont->lfPitchAndFamily=FIXED_PITCH;
+	lstrcpy(pLogFont->lfFaceName,"ＭＳ ゴシック");
+}
+
+
+///////////////////////////
+// 不揮発性のデータ管理
+///////////////////////////
+
+CNonVolatile::CNonVolatile(){
+	memset(this,0,sizeof(CNonVolatile));
+
+	//拡張子管理オブジェクトを生成
+	pobj_ExtLink=new CExtLink();
+
+	//Web検索用ドメイン管理オブジェクトを生成
+	pobj_DBDomain=new CDBDomain();
+
+	//「最近使ったファイル」オブジェクトを生成
+	pobj_History=new CHistory(100);
+
+	//「最近使ったプロジェクト」オブジェクトを生成
+	pobj_ProjectHistory=new CHistory(200);
+}
+CNonVolatile::~CNonVolatile(){
+	//拡張子管理オブジェクトを破棄
+	delete pobj_ExtLink;
+	pobj_ExtLink=0;
+
+	//Web検索用ドメイン管理オブジェクトを破棄
+	delete pobj_DBDomain;
+	pobj_DBDomain=0;
+
+	//「最近使ったファイル」オブジェクトを破棄
+	delete pobj_History;
+	pobj_History=0;
+
+	//「最近使ったプロジェクト」オブジェクトを破棄
+	delete pobj_ProjectHistory;
+	pobj_ProjectHistory=0;
+}
+
+BOOL CSettingFile::GetDataLine( const char *name,char *parms){
+	int i,i2,length;
+	length=lstrlen(name);
+	for(i=0;;i++){
+		if(buffer[i]=='\0') break;
+		if(i==0||buffer[i]=='\r'&&buffer[i+1]=='\n'){
+			if(buffer[i]=='\r'&&buffer[i+1]=='\n') i+=2;
+			if(memcmp(buffer+i,name,length)==0&&buffer[i+length]=='='){
+				i+=length+1;
+				for(i2=0;;i++,i2++){
+					if(buffer[i]=='\r'&&buffer[i+1]=='\n'||buffer[i]=='\0'){
+						parms[i2]=0;
+						break;
+					}
+					parms[i2]=buffer[i];
+				}
+				return 1;
+			}
+		}
+	}
+	return 0;
+}
+
+BOOL CSettingFile::GetWholeValue( const char *name, int *pi32data ){
+	char temporary[8192];
+	if(!GetDataLine(name,temporary)) return 0;
+	*pi32data=atoi(temporary);
+	return 1;
+}
+bool CSettingFile::GetBoolean( const char *name,bool &b ){
+	int i=0;
+	if( !GetWholeValue( name, &i ) ){
+		return 0;
+	}
+
+	b = ( i != 0 ) ? true:false;
+
+	return 1;
+}
+BOOL CSettingFile::Get3WholeValue(char *name,int *pd1,int *pd2,int *pd3){
+	char temporary[8192];
+	if(!GetDataLine(name,temporary)) return 0;
+	sscanf(temporary,"%d,%d,%d",pd1,pd2,pd3);
+	return 1;
+}
+BOOL CSettingFile::GetRGBValue(char *name,COLORREF *prgb){
+	char temporary[8192];
+	if(!GetDataLine(name,temporary)) return 0;
+	sscanf(temporary,"%x",prgb);
+	return 1;
+}
+BOOL CSettingFile::GetStringValue(char *name,char *str){
+	if(!GetDataLine(name,str)) return 0;
+	return 1;
+}
+BOOL CSettingFile::GetRectValue(char *name,RECT *prc){
+	char temporary[8192];
+	if(!GetDataLine(name,temporary)) return 0;
+	sscanf(temporary,"%d,%d,%d,%d",&prc->left,&prc->top,&prc->right,&prc->bottom);
+	return 1;
+}
+BOOL CSettingFile::GetLogFont(char *name,LOGFONT *plf){
+	char temporary[8192];
+	if(!GetDataLine(name,temporary)) return 0;
+	sscanf(temporary,"%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",
+		&plf->lfHeight,
+		&plf->lfWidth,
+		&plf->lfEscapement,
+		&plf->lfOrientation,
+		&plf->lfWeight,
+		&plf->lfItalic,
+		&plf->lfUnderline,
+		&plf->lfStrikeOut,
+		&plf->lfCharSet,
+		&plf->lfOutPrecision,
+		&plf->lfClipPrecision,
+		&plf->lfQuality,
+		&plf->lfPitchAndFamily);
+
+	int i;
+	for(i=lstrlen(temporary)-1;i>=0;i--){
+		if(temporary[i]==','){
+			i++;
+			break;
+		}
+	}
+	lstrcpy(plf->lfFaceName,temporary+i);
+	return 1;
+}
+BOOL CSettingFile::GetRebarBand(SAVEREBAR *psr,int num){
+	char name[32];
+	char temporary[8192];
+
+	sprintf(name,"RebarBand%d",num);
+	if(!GetDataLine(name,temporary)) return 0;
+
+	sscanf(temporary,"%d,%d,%d",&psr->RebarID,&psr->RebarLength,&psr->IsBandBreak);
+	return 1;
+}
+
+void CNonVolatile::load(){
+	extern METHODCHECKINFO MethodCheckInfo;
+
+	int i;
+	char temporary[MAX_PATH];
+
+
+	///////////////////////////////////
+	// 関連付け用の拡張子オブジェクト
+	///////////////////////////////////
+	sprintf(temporary,"%sUserSetting\\extlink.ini",pj_editor_Dir);
+	pobj_ExtLink->load(temporary);
+
+
+	//////////////////////////////////////
+	// Web検索用ドメイン管理オブジェクト
+	//////////////////////////////////////
+	pobj_DBDomain->load();
+
+
+	///////////////////////////////////////
+	// 「最近使ったファイル」オブジェクト
+	///////////////////////////////////////
+	sprintf(temporary,"%sUserSetting\\history.ini",pj_editor_Dir);
+	pobj_History->load(temporary);
+
+
+	////////////////////////////////////////////
+	// 「最近使ったプロジェクト」オブジェクト
+	////////////////////////////////////////////
+	sprintf(temporary,"%sUserSetting\\pj_history.ini",pj_editor_Dir);
+	pobj_ProjectHistory->load(temporary);
+
+
+
+	//開く
+	sprintf(temporary,"%sUserSetting\\editor.ini",pj_editor_Dir);
+	buffer=ReadBuffer_NonErrMsg(temporary);
+	if(!buffer){
+
+		//デフォルトの初期設定
+		InitToDefaultData();
+		return;
+	}
+
+	//関連付けを行うかどうか（この関数の最後に呼び出す）
+	if(!GetStringValue("LinkFile",temporary)){
+		ExtensionLink(NULL);
+	}
+
+	//ウィンドウサイズを保存するかしないか
+	if(!GetRectValue("WindowRect",&StartupWindowRect)){
+		StartupWindowRect.left=(int)((double)ScreenX*0.1);
+		StartupWindowRect.top=(int)((double)ScreenX*0.1);
+		StartupWindowRect.right=(int)((double)ScreenX*0.8);
+		StartupWindowRect.bottom=(int)((double)ScreenY*0.8);
+	}
+
+	//ウィンドウを最大化するか
+	if(!GetWholeValue("IsWindowMax",&bWindowMax)) bWindowMax=0;
+
+	//実行時のプロジェクトの保存確認の有無
+	if(!GetWholeValue("Project_SaveCheck",&bSaveCheckProject)) bSaveCheckProject=0;
+
+	//ラインアジャスタ
+	if(!GetWholeValue("Rad_LineAdjust",&bLineAdjust)) bLineAdjust=1;
+
+	//ProjectView位置情報
+	if(!GetRectValue("ProjectViewRect",&rectProjectView)){
+		rectProjectView.left=StartupWindowRect.right-270;
+		rectProjectView.right=StartupWindowRect.right-5;
+		rectProjectView.top=StartupWindowRect.top+60;
+		rectProjectView.bottom=StartupWindowRect.top+380;
+	}
+	if(rectProjectView.right<=0||
+		rectProjectView.left>=ScreenX||
+		rectProjectView.bottom<=0||
+		rectProjectView.top>=ScreenY||
+		rectProjectView.right-rectProjectView.left<10||
+		rectProjectView.bottom-rectProjectView.top<10){
+		//不正なデータは復元
+		rectProjectView.left=StartupWindowRect.right-270;
+		rectProjectView.right=StartupWindowRect.right-5;
+		rectProjectView.top=StartupWindowRect.top+60;
+		rectProjectView.bottom=StartupWindowRect.top+380;
+	}
+
+	//ProjectViewクリップ情報
+	if(!GetWholeValue("IsClipProjectView",&bClipProjectView)) bClipProjectView=1;
+	if(!GetWholeValue("width_ClipProjectView",&width_ClipProjectView)) width_ClipProjectView=200;
+
+	//デバッガビュー クリップ情報
+	if(!GetWholeValue("height_ClipDebuggerView",&height_ClipDebuggerView)) height_ClipDebuggerView=180;
+
+	//コンパイラビュー クリップ情報
+	if(!GetWholeValue("height_ClipCompileView",&height_ClipCompileView)) height_ClipCompileView=130;
+
+	//Web検索クリップ情報
+	if(!GetWholeValue("width_WebSearchView",&width_WebSearchView)) width_WebSearchView=230;
+
+
+	//Rebarバンド情報
+	for(i=0;i<MAX_REBARBANDS;i++){
+		if(!GetRebarBand(&SaveRebar[i],i)){
+			ResetRebarData();
+			break;
+		}
+	}
+
+	//Rebarバンドを固定するか
+	if(!GetWholeValue("IsNoGripper",&bNoGripper)) bNoGripper=0;
+
+
+	//ドキュメントを保存したときにタブを先頭に再配置するかどうか
+	if(!GetWholeValue("IsSaveTabToHead",&bSaveTabToHead)){
+		bSaveTabToHead=0;
+	}
+
+	//フォント
+	if(!GetLogFont("EditorFont",&lf)){
+		//読み込めなかったときは、デフォルトのエディタフォントをセット
+		GetDefaultEditFont(&lf);
+	}
+
+	//タブサイズ
+	if(!GetWholeValue("TabSize",&TabSize)) TabSize=4;
+
+	//エディタの行番号を表示するかどうか
+	if(!GetWholeValue("IsShowLineNumber",&bEditor_LineNumber)) bEditor_LineNumber=1;
+
+	//エディタのルーラーを表示するかどうか
+	if(!GetWholeValue("IsShowRuler",&bEditor_Ruler)) bEditor_Ruler=1;
+
+	//カーソル行を強調表示するかどうか
+	if(!GetWholeValue("IsCaretLine_BackGround",&bEditor_CaretLine_BackGround)) bEditor_CaretLine_BackGround=1;
+
+	//自動折り返し時の一行あたりの文字数
+	if(!GetWholeValue("MaxOneLineTextLength",&iMaxOneLineTextLength)) iMaxOneLineTextLength=75;
+
+	//コード補完機能を有効にするかどうか
+	if(!GetWholeValue("IsShowComplementWnd",&bShowComplementWnd)) bShowComplementWnd=1;
+
+	//ペアステートメント補完を有効にするかどうか
+	if(!GetWholeValue("BackNum_PairStatementComplement",&BackNum_PairStatementComplement)) BackNum_PairStatementComplement=100;
+
+	//パラメータヒント
+	if(!GetWholeValue("ParameterHint",(int *)&dwParameterHint)) dwParameterHint=1;
+
+	//パラメータ ヒント フォント
+	extern METHODCHECKINFO MethodCheckInfo;
+	if(!GetLogFont("HintFont",&MethodCheckInfo.LogFont)){
+		//読み込めなかったときは、デフォルトのヒントフォントをセット
+		GetDefaultHintFont(&MethodCheckInfo.LogFont);
+	}
+
+	//自動インデント
+	if(!GetWholeValue("IsAutoIndent",&bAutoIndent)) bAutoIndent=1;
+
+	//貼り付け時のインデント調整
+	if(!GetWholeValue("IsPasteIndent",&bPasteIndent)) bPasteIndent=0;
+
+	//検索・置換文字列を保存するかどうか
+	if(!GetWholeValue("IsSaveFindStr",&bSaveFindStr)) bSaveFindStr=1;
+
+	//自動折り返しをするかどうか
+	if(!GetWholeValue("IsRightTurn",&bRightTurn)) bRightTurn=0;
+
+	//Ctrlキーによるハイパーリンク
+	if(!GetWholeValue("IsCtrlKeyHyperLink",&bCtrlKeyHyperLink)) bCtrlKeyHyperLink=1;
+
+	//Web検索文字列を保存するかどうか
+	if(!GetWholeValue("IsSaveWebFindStr",&bSaveWebFindStr)) bSaveWebFindStr=1;
+
+	//初回のMDIウィンドウを最大化表示するか
+	if(!GetWholeValue("IsMDIZoomed",&bMDIZoomed)) bMDIZoomed=0;
+
+	//標準保存先ディレクトリ
+	if(!GetStringValue("DefSaveDir",DefSaveDir)) lstrcpy(DefSaveDir,pj_editor_Dir);
+
+	//プロジェクト保存ディレクトリ
+	if(!GetStringValue("ProjectSaveDir",ProjectSaveDir)) sprintf(ProjectSaveDir,"%sMyProjects",pj_editor_Dir);
+
+	//検索時に、大文字小文字を区別するか
+	if(!GetWholeValue("IsFindStrBigSmall",&bFindStrBigSmall)) bFindStrBigSmall=0;
+
+	// 単語単位で検索するか
+	if( !GetBoolean("isWordUnit",isWordUnit) ){
+		isWordUnit = false;
+	}
+
+	//検索時に、正規表現を利用するかどうか
+	if(!GetWholeValue("IsRegExp",&bRegExp)) bRegExp=0;
+
+	//アクティブ デザイン テーマ
+	if(!GetStringValue("ActiveTheme",szActiveTheme)) lstrcpy(szActiveTheme,THEMENAME_CLASSIC);
+
+	//印刷用フォント
+	if(!GetLogFont("PrintFont",&lfPrint)){
+		//読み込めなかったときは、デフォルトのエディタフォントをセット
+		GetDefaultPrintFont(&lfPrint);
+	}
+
+	//印刷用フォントのポイントサイズ
+	if(!GetWholeValue("PrintFontPointSize",&iPrintFontPointSize)){
+		//読み込めなかったときは、デフォルトのポイントサイズをセット
+		iPrintFontPointSize=72;
+	}
+
+	//ページ番号を表示するかどうか
+	if(!GetWholeValue("IsShowPageNum",&bShowPageNum)) bShowPageNum=1;
+
+	//ページ番号文字列
+	if(!GetStringValue("PageStr",szPageStr)) lstrcpy(szPageStr,"ページ &n");
+
+	//インクルードディレクトリ
+	if(!GetStringValue("IncludeDir",szIncludeDir)) lstrcpy(szIncludeDir,".\\Include\\");
+
+	HeapDefaultFree(buffer);
+
+
+	/////////////////
+	// 検索文字列
+	/////////////////
+	int i2,i3;
+
+	sprintf(temporary,"%sUserSetting\\findstr.ini",pj_editor_Dir);
+	buffer=ReadBuffer_NonErrMsg(temporary);
+	if(buffer){
+		i2=0;
+		for(i=0;i<MAX_FINDLIST;i++){
+			for(i3=0;i3<MAX_PATH;i2++,i3++){
+				if(buffer[i2]=='\r'&&buffer[i2+1]=='\n'||buffer[i2]=='\0'){
+					FindStr[i][i3]=0;
+					break;
+				}
+				FindStr[i][i3]=buffer[i2];
+			}
+			if(buffer[i2]=='\r'&&buffer[i2+1]=='\n') i2+=2;
+		}
+
+		HeapDefaultFree(buffer);
+	}
+
+
+	/////////////////
+	// 置換文字列
+	/////////////////
+	sprintf(temporary,"%sUserSetting\\permustr.ini",pj_editor_Dir);
+	buffer=ReadBuffer_NonErrMsg(temporary);
+	if(buffer){
+		i2=0;
+		for(i=0;i<MAX_FINDLIST;i++){
+			for(i3=0;i3<MAX_PATH;i2++,i3++){
+				if(buffer[i2]=='\r'&&buffer[i2+1]=='\n'||buffer[i2]=='\0'){
+					PermutationStr[i][i3]=0;
+					break;
+				}
+				PermutationStr[i][i3]=buffer[i2];
+			}
+			if(buffer[i2]=='\r'&&buffer[i2+1]=='\n') i2+=2;
+		}
+
+		HeapDefaultFree(buffer);
+	}
+
+
+	/////////////////
+	// Web検索文字列
+	/////////////////
+	sprintf(temporary,"%sUserSetting\\webstr.ini",pj_editor_Dir);
+	buffer=ReadBuffer_NonErrMsg(temporary);
+	if(buffer){
+		i2=0;
+		for(i=0;i<MAX_FINDLIST;i++){
+			for(i3=0;i3<MAX_PATH;i2++,i3++){
+				if(buffer[i2]=='\r'&&buffer[i2+1]=='\n'||buffer[i2]=='\0'){
+					WebStr[i][i3]=0;
+					break;
+				}
+				WebStr[i][i3]=buffer[i2];
+			}
+			if(buffer[i2]=='\r'&&buffer[i2+1]=='\n') i2+=2;
+		}
+
+		HeapDefaultFree(buffer);
+	}
+}
+
+void CNonVolatile::InitToDefaultData(){
+	///////////////////////////////////
+	// デフォルトの初期設定
+	///////////////////////////////////
+
+	//検索・置換文字列を保存するかどうか
+	bSaveFindStr=1;
+
+	//自動折り返しをするかどうか
+	bRightTurn=0;
+
+	//Ctrlキーによるハイパーリンク
+	bCtrlKeyHyperLink=1;
+
+	//Web検索文字列を保存するかどうか
+	bSaveWebFindStr=1;
+
+	//アクティブ デザイン テーマ
+	lstrcpy(szActiveTheme,THEMENAME_CLASSIC);
+
+	//印刷用フォント
+	GetDefaultPrintFont(&lfPrint);
+
+	//印刷用フォントのポイントサイズ
+	iPrintFontPointSize=72;
+
+	//ページ番号を表示するかどうか
+	bShowPageNum=1;
+
+	//ページ番号文字列
+	lstrcpy(szPageStr,"ページ &n");
+
+	//インクルードディレクトリ
+	lstrcpy(szIncludeDir,".\\Include\\");
+
+	//ウィンドウ位置、サイズ
+	StartupWindowRect.left=(int)((double)ScreenX*0.1);
+	StartupWindowRect.top=(int)((double)ScreenX*0.1);
+	StartupWindowRect.right=(int)((double)ScreenX*0.8);
+	StartupWindowRect.bottom=(int)((double)ScreenY*0.8);
+
+	//ウィンドウを最大化するか
+	bWindowMax=1;
+
+	//実行時の、プロジェクトの保存確認の有無
+	bSaveCheckProject=0;
+
+	//RADツールのライン アジャスタ
+	bLineAdjust=1;
+
+	//ProjectView位置情報
+	rectProjectView.left=StartupWindowRect.right-270;
+	rectProjectView.right=StartupWindowRect.right-5;
+	rectProjectView.top=StartupWindowRect.top+60;
+	rectProjectView.bottom=StartupWindowRect.top+380;
+
+	//Rebar情報を初期化
+	ResetRebarData();
+
+	//エディタ フォント
+	GetDefaultEditFont(&lf);
+
+	//パラメータ ヒント フォント
+	extern METHODCHECKINFO MethodCheckInfo;
+	GetDefaultHintFont(&MethodCheckInfo.LogFont);
+
+	//タブサイズ
+	TabSize=4;
+
+	//行番号を表示するかどうか
+	bEditor_LineNumber=1;
+
+	//ルーラーを表示するかどうか
+	bEditor_Ruler=1;
+
+	//カーソル行を強調表示するかどうか
+	bEditor_CaretLine_BackGround=1;
+
+	//自動折り返しの文字数
+	iMaxOneLineTextLength=75;
+
+	//パラメータヒント
+	dwParameterHint=1;
+
+	//自動インデント
+	bAutoIndent=1;
+
+	//貼り付け時のインデント調整
+	bPasteIndent=0;
+
+	//初回のMDIウィンドウを最大化表示するか
+	bMDIZoomed=1;
+
+	//標準保存先ディレクトリ
+	lstrcpy(DefSaveDir,pj_editor_Dir);
+
+	//プロジェクト保存ディレクトリ
+	sprintf(ProjectSaveDir,"%sMyProjects",pj_editor_Dir);
+
+	bClipProjectView=1;
+	width_ClipProjectView=200;
+	height_ClipDebuggerView=180;
+	height_ClipCompileView=130;
+	width_WebSearchView=230;
+	bSaveTabToHead=0;
+
+	BackNum_PairStatementComplement=100;
+
+	//ファイルの関連付け
+	ExtensionLink(NULL);
+}
+
+void CSettingFile::SetWholeValue(const char *name,long i32data){
+	sprintf(buffer+lstrlen(buffer),"%s=%d\r\n",name,i32data);
+}
+void CSettingFile::SetBoolean(const char *name,bool b){
+	sprintf(buffer+lstrlen(buffer),"%s=%d\r\n",name,b?1:0);
+}
+void CSettingFile::Set3WholeValue(char *name,long d1,long d2,long d3){
+	sprintf(buffer+lstrlen(buffer),"%s=%d,%d,%d\r\n",name,d1,d2,d3);
+}
+void CSettingFile::SetRGBValue(char *name,COLORREF rgb){
+	rgb=RGB(
+		LOBYTE(LOWORD(rgb)),
+		HIBYTE(LOWORD(rgb)),
+		LOBYTE(HIWORD(rgb))
+		);
+	sprintf(buffer+lstrlen(buffer),"%s=%x\r\n",name,rgb);
+}
+void CSettingFile::SetStringValue(char *name,char *str){
+	sprintf(buffer+lstrlen(buffer),"%s=%s\r\n",name,str);
+}
+void CSettingFile::SetRectValue(char *name,RECT *prc){
+	sprintf(buffer+lstrlen(buffer),"%s=%d,%d,%d,%d\r\n",name,prc->left,prc->top,prc->right,prc->bottom);
+}
+void CSettingFile::SetLogFont(char *name,LOGFONT *plf){
+	sprintf(buffer+lstrlen(buffer),"%s=%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%s\r\n",name,
+		plf->lfHeight,
+		plf->lfWidth,
+		plf->lfEscapement,
+		plf->lfOrientation,
+		plf->lfWeight,
+		plf->lfItalic,
+		plf->lfUnderline,
+		plf->lfStrikeOut,
+		plf->lfCharSet,
+		plf->lfOutPrecision,
+		plf->lfClipPrecision,
+		plf->lfQuality,
+		plf->lfPitchAndFamily,
+		plf->lfFaceName);
+}
+void CSettingFile::SetRebarBand(SAVEREBAR *psr,int num){
+	char name[32];
+
+	sprintf(name,"RebarBand%d",num);
+	sprintf(buffer+lstrlen(buffer),"%s=%d,%d,%d\r\n",name,psr->RebarID,psr->RebarLength,psr->IsBandBreak);
+}
+
+void CNonVolatile::save(){
+	int i;
+	char temporary[MAX_PATH];
+
+	sprintf(temporary,"%sUserSetting",pj_editor_Dir);
+
+	HANDLE hFind;
+	WIN32_FIND_DATA wfd;
+	hFind=FindFirstFile(temporary,&wfd);
+	if(hFind==INVALID_HANDLE_VALUE){
+		//UserSettingディレクトリを作成
+		if(!CreateDirectory(temporary,NULL)){
+			MessageBox(hOwner,"UserSettingディレクトリの作成に失敗",APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+			return;
+		}
+	}
+
+	buffer=(char *)HeapAlloc(hHeap,0,65536);
+	buffer[0]=0;
+
+
+	//ウィンドウサイズを保存するかしないか
+	SetRectValue("WindowRect",&StartupWindowRect);
+
+	//ウィンドウを最大化するか
+	SetWholeValue("IsWindowMax",bWindowMax);
+
+	//実行時のプロジェクトの保存確認の有無
+	SetWholeValue("Project_SaveCheck",bSaveCheckProject);
+
+	//ラインアジャスタ
+	SetWholeValue("Rad_LineAdjust",bLineAdjust);
+
+	//ProjectView位置情報
+	SetRectValue("ProjectViewRect",&rectProjectView);
+
+	//ProjectViewクリップ情報
+	SetWholeValue("IsClipProjectView",bClipProjectView);
+	SetWholeValue("width_ClipProjectView",width_ClipProjectView);
+
+	//デバッガビュー クリップ情報
+	SetWholeValue("height_ClipDebuggerView",height_ClipDebuggerView);
+
+	//コンパイラビュー クリップ情報
+	SetWholeValue("height_ClipCompileView",height_ClipCompileView);
+
+	//Web検索クリップ情報
+	SetWholeValue("width_WebSearchView",width_WebSearchView);
+
+
+	//Rebar情報
+	for(i=0;i<MAX_REBARBANDS;i++){
+		SetRebarBand(&SaveRebar[i],i);
+	}
+
+	//Rebarバンドを固定するか
+	SetWholeValue("IsNoGripper",bNoGripper);
+
+
+	//ドキュメントを保存したときにタブを先頭に再配置するかどうか
+	SetWholeValue("IsSaveTabToHead",bSaveTabToHead);
+
+	//フォント
+	SetLogFont("EditorFont",&lf);
+
+	//タブサイズ
+	SetWholeValue("TabSize",TabSize);
+
+	//エディタの行番号を表示するかどうか
+	SetWholeValue("IsShowLineNumber",bEditor_LineNumber);
+
+	//ルーラーを表示するかどうか
+	SetWholeValue("IsShowRuler",bEditor_Ruler);
+
+	//カーソル行を強調表示するかどうか
+	SetWholeValue("IsCaretLine_BackGround",bEditor_CaretLine_BackGround);
+
+	//自動折り返し時の一行あたりの文字数
+	SetWholeValue("MaxOneLineTextLength",iMaxOneLineTextLength);
+
+	//コード補完機能を有効にするかどうか
+	SetWholeValue("IsShowComplementWnd",bShowComplementWnd);
+
+	//ペアステートメント補完を有効にするかどうか
+	SetWholeValue("BackNum_PairStatementComplement",BackNum_PairStatementComplement);
+
+	//パラメータヒント
+	SetWholeValue("ParameterHint",dwParameterHint);
+
+	//パラメータ ヒント フォント
+	extern METHODCHECKINFO MethodCheckInfo;
+	SetLogFont("HintFont",&MethodCheckInfo.LogFont);
+
+	//検索・置換文字列を保存するかどうか
+	SetWholeValue("IsSaveFindStr",bSaveFindStr);
+
+	//自動インデント
+	SetWholeValue("IsAutoIndent",bAutoIndent);
+
+	//貼り付け時のインデント調整
+	SetWholeValue("IsPasteIndent",bPasteIndent);
+
+	//自動折り返しをするかどうか
+	SetWholeValue("IsRightTurn",bRightTurn);
+
+	//Ctrlキーによるハイパーリンク
+	SetWholeValue("IsCtrlKeyHyperLink",bCtrlKeyHyperLink);
+
+	//Web検索文字列を保存するかどうか
+	SetWholeValue("IsSaveWebFindStr",bSaveWebFindStr);
+
+	//初回のMDIウィンドウを最大化表示するか
+	SetWholeValue("IsMDIZoomed",bMDIZoomed);
+
+	//標準保存先ディレクトリ
+	SetStringValue("DefSaveDir",DefSaveDir);
+
+	//プロジェクト保存ディレクトリ
+	SetStringValue("ProjectSaveDir",ProjectSaveDir);
+
+	//検索時に、大文字小文字を区別するか
+	SetWholeValue("IsFindStrBigSmall",bFindStrBigSmall);
+
+	// 単語単位で検索するか
+	SetBoolean("isWordUnit",isWordUnit);
+
+	//検索時に、正規表現を利用するか
+	SetWholeValue("IsRegExp",bRegExp);
+
+	//次回起動時に関連付けダイアログを表示しないようにする
+	SetStringValue("LinkFile","ok");
+
+	//アクティブ デザイン テーマ
+	SetStringValue("ActiveTheme",szActiveTheme);
+
+	//印刷用フォント
+	SetLogFont("PrintFont",&lfPrint);
+
+	//印刷用フォントのポイントサイズ
+	SetWholeValue("PrintFontPointSize",iPrintFontPointSize);
+
+	//ページ番号を表示するかどうか
+	SetWholeValue("IsShowPageNum",bShowPageNum);
+
+	//ページ番号文字列
+	SetStringValue("PageStr",szPageStr);
+
+	//インクルードディレクトリ
+	SetStringValue("IncludeDir",szIncludeDir);
+
+
+	//保存
+	sprintf(temporary,"%sUserSetting\\editor.ini",pj_editor_Dir);
+	WriteBuffer(temporary,buffer,lstrlen(buffer));
+
+
+
+	/////////////////
+	// 検索文字列
+	/////////////////
+	buffer[0]=0;
+	if(pobj_nv->bSaveFindStr){
+		for(i=0;i<MAX_FINDLIST;i++){
+			lstrcat(buffer,FindStr[i]);
+			lstrcat(buffer,"\r\n");
+		}
+	}
+
+	//保存
+	sprintf(temporary,"%sUserSetting\\findstr.ini",pj_editor_Dir);
+	WriteBuffer(temporary,buffer,lstrlen(buffer));
+
+
+
+	/////////////////
+	// 置換文字列
+	/////////////////
+	buffer[0]=0;
+	if(pobj_nv->bSaveFindStr){
+		for(i=0;i<MAX_FINDLIST;i++){
+			lstrcat(buffer,PermutationStr[i]);
+			lstrcat(buffer,"\r\n");
+		}
+	}
+
+	//保存
+	sprintf(temporary,"%sUserSetting\\permustr.ini",pj_editor_Dir);
+	WriteBuffer(temporary,buffer,lstrlen(buffer));
+
+
+
+	/////////////////
+	// Web検索文字列
+	/////////////////
+	buffer[0]=0;
+	if(pobj_nv->bSaveWebFindStr){
+		for(i=0;i<MAX_FINDLIST;i++){
+			lstrcat(buffer,WebStr[i]);
+			lstrcat(buffer,"\r\n");
+		}
+	}
+
+	//保存
+	sprintf(temporary,"%sUserSetting\\webstr.ini",pj_editor_Dir);
+	WriteBuffer(temporary,buffer,lstrlen(buffer));
+
+	HeapDefaultFree(buffer);
+
+
+
+	///////////////////////////////////
+	// 関連付け用の拡張子オブジェクト
+	///////////////////////////////////
+	sprintf(temporary,"%sUserSetting\\extlink.ini",pj_editor_Dir);
+	pobj_ExtLink->save(temporary);
+
+
+	//////////////////////////////////////
+	// Web検索用ドメイン管理オブジェクト
+	//////////////////////////////////////
+	pobj_DBDomain->save();
+
+
+	///////////////////////////////////////
+	// 「最近使ったファイル」オブジェクト
+	///////////////////////////////////////
+	sprintf(temporary,"%sUserSetting\\history.ini",pj_editor_Dir);
+	pobj_History->save(temporary);
+
+	
+	///////////////////////////////////////
+	// 「最近使ったファイル」オブジェクト
+	///////////////////////////////////////
+	sprintf(temporary,"%sUserSetting\\pj_history.ini",pj_editor_Dir);
+	pobj_ProjectHistory->save(temporary);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/NonVolatile.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/NonVolatile.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/NonVolatile.h	(revision 178)
@@ -0,0 +1,140 @@
+
+
+class CNonVolatile:public CSettingFile{
+	void InitToDefaultData();
+
+public:
+	BOOL bSaveCheckProject;
+	BOOL bLineAdjust;
+	BOOL bWindowMax;
+	DWORD dwParameterHint;
+	BOOL bMDIZoomed;
+	char DefSaveDir[MAX_PATH];
+	char ProjectSaveDir[MAX_PATH];
+	RECT StartupWindowRect;
+	RECT rectProjectView;
+
+	//大文字・小文字検索を見分けるかどうか
+	BOOL bFindStrBigSmall;
+
+	// 単語単位で検索するか
+	bool isWordUnit;
+
+	//正規表現検索を行うかどうか
+	BOOL bRegExp;
+
+	//ProjectViewクリップ情報
+	BOOL bClipProjectView;
+	int width_ClipProjectView;
+
+	//デバッガビュー クリップ情報
+	int height_ClipDebuggerView;
+
+	//コンパイラビュー クリップ情報
+	int height_ClipCompileView;
+
+	//Web検索クリップ情報
+	int width_WebSearchView;
+
+	//レバー情報
+	SAVEREBAR SaveRebar[MAX_REBARBANDS];
+	BOOL bNoGripper;
+
+	//ドキュメントを保存したときにタブを先頭に再配置するかどうか
+	BOOL bSaveTabToHead;
+
+	//エディタフォント
+	LOGFONT lf;
+
+	//タブサイズ
+	int TabSize;
+
+	//行番号を表示するかどうか
+	BOOL bEditor_LineNumber;
+
+	//ルーラーを表示するかどうか
+	BOOL bEditor_Ruler;
+
+	//カーソル行を強調表示するかどうか
+	BOOL bEditor_CaretLine_BackGround;
+
+	//自動折り返し時の一行あたりの文字数
+	int iMaxOneLineTextLength;
+
+	//自動インデント
+	BOOL bAutoIndent;
+
+	//貼り付け時のインデント調整
+	BOOL bPasteIndent;
+
+	//コード補完機能を有効にするかどうか
+	BOOL bShowComplementWnd;
+
+	//ペアステートメント補完を有効にするかどうか
+	int BackNum_PairStatementComplement;
+
+	//検索・置換文字列を保存するかどうか
+	BOOL bSaveFindStr;
+
+	//自動折り返しをするかどうか
+	BOOL bRightTurn;
+
+	//Ctrlキーによるハイパーリンク
+	BOOL bCtrlKeyHyperLink;
+
+	//Web検索文字列を保存するかどうか
+	BOOL bSaveWebFindStr;
+
+	//文字色、背景色
+	char szActiveTheme[255];
+
+	//印刷用フォント
+	LOGFONT lfPrint;
+
+	//印刷用フォントのポイントサイズ
+	int iPrintFontPointSize;
+
+	//ページ番号を表示するかどうか
+	BOOL bShowPageNum;
+
+	//ページ番号文字列
+	char szPageStr[255];
+
+	//インクルードディレクトリ
+	char szIncludeDir[MAX_PATH];
+
+	//////////////////////////////////////////////////////////////
+
+
+
+	//検索、置換文字列（findstr.ini）
+	char FindStr[MAX_FINDLIST][MAX_PATH];
+	char PermutationStr[MAX_FINDLIST][MAX_PATH];
+
+
+	//Web検索文字列（premustr.ini）
+	char WebStr[MAX_FINDLIST][MAX_PATH];
+
+
+	//関連付けの拡張子オブジェクト（extlink.ini）
+	CExtLink *pobj_ExtLink;
+
+
+	//Web検索用ドメイン（webstr.ini）
+	CDBDomain *pobj_DBDomain;
+
+
+	//履歴（history.ini）
+	CHistory *pobj_History;
+
+
+	//プロジェクト履歴（pj_history.ini）
+	CHistory *pobj_ProjectHistory;
+
+
+	CNonVolatile();
+	~CNonVolatile();
+	void load();
+	void save();
+};
+extern CNonVolatile *pobj_nv;
Index: tag/abdev(2007.06.20)/ProjectEditor/ParameterHint.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/ParameterHint.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/ParameterHint.cpp	(revision 178)
@@ -0,0 +1,1285 @@
+#include "common.h"
+
+void ShowCommandMessage(void);
+
+BOOL CheckGrammar(char *buffer){
+	int i,IsStr,PareNum;
+
+	for(i=0,IsStr=0,PareNum=0;;i++){
+		if(buffer[i]=='\"') IsStr^=1;
+		else if(buffer[i]=='(') PareNum++;
+		else if(buffer[i]==')') PareNum--;
+		else if(buffer[i]=='\0'||(buffer[i]=='\r'&&buffer[i+1]=='\n')){
+			if(IsStr||PareNum) return 0;
+			if(buffer[i]=='\0') break;
+			i++;
+			continue;
+		}
+		else if(buffer[i]=='\''&&IsStr==0){
+			while(!(buffer[i]=='\0'||(buffer[i]=='\r'&&buffer[i+1]=='\n'))) i++;
+			i--;
+			continue;
+		}
+	}
+	return 1;
+}
+
+char *GetUserSourceCode(void){
+	//単体ファイルのときはそのファイルを、プロジェクトのときはpjname.abの内容を取得
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	int i;
+	char temporary[MAX_PATH],*pBuf;
+
+	if(ProjectInfo.name[0]){
+		//プロジェクトが開かれているとき
+		lstrcpy(temporary,ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->m_path);
+		GetFullPath(temporary,ProjectInfo.dir);
+
+		extern MDIINFO MdiInfo[MAX_WNDNUM];
+		for(i=0;i<MAX_WNDNUM;i++){
+			if(MdiInfo[i].hwnd){
+				if(lstrcmpi(MdiInfo[i].path,temporary)==0) break;
+			}
+		}
+		if(i==MAX_WNDNUM){
+			//ファイルから開く
+			pBuf=ReadBuffer(temporary);
+		}
+		else{
+			//エディタから読み込む
+			pBuf=(char *)HeapAlloc(hHeap,0,lstrlen(MdiInfo[i].pMdiTextEdit->buffer)+1);
+			lstrcpy(pBuf,MdiInfo[i].pMdiTextEdit->buffer);
+		}
+	}
+	else{
+		//単体ソースコードのとき
+		extern MDIINFO MdiInfo[MAX_WNDNUM];
+		int WndNum;
+
+		WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+		pBuf=(char *)HeapAlloc(hHeap,0,lstrlen(MdiInfo[WndNum].pMdiTextEdit->buffer)+1);
+		lstrcpy(pBuf,MdiInfo[WndNum].pMdiTextEdit->buffer);
+	}
+
+	//ファイルをインクルード
+	pBuf=IncludeFiles(pBuf);
+
+	return pBuf;
+}
+
+BOOL SetCommandMessageToMethodCheck(char *Command){
+	extern METHODCHECKINFO MethodCheckInfo;
+	int CmdValue;
+
+	CmdValue=IsBasicReservedWord(Command);
+	if(CmdValue==COM_ABSTRACT)			lstrcpy(MethodCheckInfo.msg,"Abstract Sub/Function ([arglist]) [As type]]");
+	else if(CmdValue==COM_BEEP)			lstrcpy(MethodCheckInfo.msg,"Beep");
+	else if(CmdValue==COM_CHDIR)		lstrcpy(MethodCheckInfo.msg,"ChDir directory$");
+	else if(CmdValue==COM_CIRCLE)		lstrcpy(MethodCheckInfo.msg,"Circle (x, y), radius, [color], [start], [end], [aspect], [f], [brushcolor]");
+	else if(CmdValue==COM_CLOSE)		lstrcpy(MethodCheckInfo.msg,"Close [filenumber]");
+	else if(CmdValue==COM_CLASS)		lstrcpy(MethodCheckInfo.msg,"Class name");
+	else if(CmdValue==COM_CLS)			lstrcpy(MethodCheckInfo.msg,"Cls [number]");
+	else if(CmdValue==COM_COLOR)		lstrcpy(MethodCheckInfo.msg,"Color color, [backcolor]");
+	else if(CmdValue==COM_CONST)		lstrcpy(MethodCheckInfo.msg,"Const constname = expression");
+	else if(CmdValue==COM_DEBUG)		lstrcpy(MethodCheckInfo.msg,"Debug");
+	else if(CmdValue==COM_DECLARE)		lstrcpy(MethodCheckInfo.msg,"Declare Sub/Function name Lib \"libname\" [Alias \"aliasname\"] ([arglist]) [As type]]");
+	else if(CmdValue==COM_DEF)			lstrcpy(MethodCheckInfo.msg,"Def func([parms] [,parms2])=expression");
+	else if(CmdValue==COM_DIM)			lstrcpy(MethodCheckInfo.msg,"Dim variable [(subscripts)] As type, ...");
+	else if(CmdValue==COM_END)			lstrcpy(MethodCheckInfo.msg,"End [type]");
+	else if(CmdValue==COM_ENUM)			lstrcpy(MethodCheckInfo.msg,"Enum name");
+	else if(CmdValue==COM_FIELD)		lstrcpy(MethodCheckInfo.msg,"Field #filenumber, fieldbyte");
+	else if(CmdValue==COM_FOR)			lstrcpy(MethodCheckInfo.msg,"For variable=start To end [Step step]");
+	else if(CmdValue==COM_FUNCTION)		lstrcpy(MethodCheckInfo.msg,"Function name ([arglist]) [As type]");
+	else if(CmdValue==COM_GET)			lstrcpy(MethodCheckInfo.msg,"Get #filenumber, recode, StrBuffer");
+	else if(CmdValue==COM_GOSUB)		lstrcpy(MethodCheckInfo.msg,"GoSub label");
+	else if(CmdValue==COM_GOTO)			lstrcpy(MethodCheckInfo.msg,"Goto label");
+	else if(CmdValue==COM_IF)			lstrcpy(MethodCheckInfo.msg,"If judgment Then truecommand [Else falsecommand]");
+	else if(CmdValue==COM_INHERITS)		lstrcpy(MethodCheckInfo.msg,"Inherits BaseClass");
+	else if(CmdValue==COM_INPUT)		lstrcpy(MethodCheckInfo.msg,"Input [# filenumber, ] variable, [...]");
+	else if(CmdValue==COM_INTERFACE)	lstrcpy(MethodCheckInfo.msg,"Interface name");
+	else if(CmdValue==COM_KILL)			lstrcpy(MethodCheckInfo.msg,"Kill filename$");
+	else if(CmdValue==COM_LET)			lstrcpy(MethodCheckInfo.msg,"[Let] variable = expression");
+	else if(CmdValue==COM_LINE)			lstrcpy(MethodCheckInfo.msg,"Line [(sx, sy)] -[Step] (ex, ey), [color], [B/Bf], [color2]");
+	else if(CmdValue==COM_LOCATE)		lstrcpy(MethodCheckInfo.msg,"Locate x, y");
+	else if(CmdValue==COM_LOOP)			lstrcpy(MethodCheckInfo.msg,"Loop while/until judgment");
+	else if(CmdValue==COM_MKDIR)		lstrcpy(MethodCheckInfo.msg,"MkDir directory$");
+	else if(CmdValue==COM_MSGBOX)		lstrcpy(MethodCheckInfo.msg,"MsgBox hWnd, String$, [Title$], [BoxType], [retAns]");
+	else if(CmdValue==COM_NAMESPACE)	lstrcpy(MethodCheckInfo.msg,"Namespace namespaceStr");
+	else if(CmdValue==COM_NEXT)			lstrcpy(MethodCheckInfo.msg,"Next");
+	else if(CmdValue==COM_OPEN)			lstrcpy(MethodCheckInfo.msg,"Open filename$ [For Input/Output/Append] As number");
+	else if(CmdValue==COM_PAINT)		lstrcpy(MethodCheckInfo.msg,"Paint (x, y), brushcolor, [linecolor]");
+	else if(CmdValue==COM_PRINT)		lstrcpy(MethodCheckInfo.msg,"Print outdata, [...]");
+	else if(CmdValue==COM_PRIVATE)		lstrcpy(MethodCheckInfo.msg,"Private");
+	else if(CmdValue==COM_PROTECTED)	lstrcpy(MethodCheckInfo.msg,"Protected");
+	else if(CmdValue==COM_PSET)			lstrcpy(MethodCheckInfo.msg,"PSet (x, y), [color]");
+	else if(CmdValue==COM_PUBLIC)		lstrcpy(MethodCheckInfo.msg,"Public");
+	else if(CmdValue==COM_PUT)			lstrcpy(MethodCheckInfo.msg,"Put #filenumber, recode, StrBuffer");
+	else if(CmdValue==COM_RANDOMIZE)	lstrcpy(MethodCheckInfo.msg,"Randomize [number]");
+	else if(CmdValue==COM_REM)			lstrcpy(MethodCheckInfo.msg,"Rem [comment]");
+	else if(CmdValue==COM_RETURN)		lstrcpy(MethodCheckInfo.msg,"Return");
+	else if(CmdValue==COM_SELECT)		lstrcpy(MethodCheckInfo.msg,"Select Case testexpression");
+	else if(CmdValue==COM_SUB)			lstrcpy(MethodCheckInfo.msg,"Sub name ([arglist])");
+	else if(CmdValue==COM_TYPE)			lstrcpy(MethodCheckInfo.msg,"Type name");
+	else if(CmdValue==COM_TYPEDEF)		lstrcpy(MethodCheckInfo.msg,"TypeDef newtype = basetype");
+	else if(CmdValue==COM_VIRTUAL)		lstrcpy(MethodCheckInfo.msg,"Virtual Sub/Function ([arglist]) [As type]]");
+	else if(CmdValue==COM_OVERRIDE)		lstrcpy(MethodCheckInfo.msg,"Override Sub/Function ([arglist]) [As type]]");
+	else if(CmdValue==COM_WEND)			lstrcpy(MethodCheckInfo.msg,"Wend");
+	else if(CmdValue==COM_WHILE)		lstrcpy(MethodCheckInfo.msg,"While judgment");
+	else if(CmdValue==COM_WINDOW)		lstrcpy(MethodCheckInfo.msg,"Window hWnd, OwnerWnd, x, y, width, height, title$, style, [class$], [ID], [callbackfunction], [ExStyle]");
+	else if(CmdValue==COM_WITH)			lstrcpy(MethodCheckInfo.msg,"With object");
+	else if(CmdValue==COM_WRITE)		lstrcpy(MethodCheckInfo.msg,"Write [data, ...]");
+	else return 0;
+	return 1;
+}
+
+void ChangeReturnCode(char *buffer){
+	//改行コードのCRLFをLFに変換
+	int i,i2;
+	for(i=0,i2=0;;i++,i2++){
+		if(buffer[i]=='\r'&&buffer[i+1]=='\n') i++;
+		buffer[i2]=buffer[i];
+		if(buffer[i]=='\0') break;
+	}
+}
+void DeleteComment(char *buffer){	//注釈「'」の取り除き
+	int i,i2,i3,IsStr;
+	char *temporary;
+	temporary=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(buffer)+1);
+	for(i=0,i2=0,i3=0,IsStr=0;;i++,i2++){
+		if(buffer[i]=='\"') IsStr^=1;
+		if(buffer[i]=='\n'||buffer[i]=='\0'){
+			i2--;
+			while(temporary[i2]==' '||temporary[i2]=='\t') i2--;
+			i2++;
+
+			if(i3){
+				//複数行に渡る注釈文の中に改行が存在するとき
+				memset(temporary+i2,'\n',i3);
+				i2+=i3;
+				i3=0;
+			}
+		}
+		if(buffer[i]=='\''&&IsStr==0){
+			//注釈文
+			i2--;
+			while(temporary[i2]==' '||temporary[i2]=='\t') i2--;
+			i2++;
+			while(buffer[i]!='\n'&&buffer[i]!='\0') i++;
+		}
+		if(buffer[i]=='/'&&buffer[i+1]=='*'&&IsStr==0){
+			//注釈文（複数行）
+			i+=2;
+			i3=0;
+			while(!(buffer[i]=='*'&&buffer[i+1]=='/')){
+				if(buffer[i]=='\n') i3++;
+				if(buffer[i]=='\0') break;
+				i++;
+			}
+			if(buffer[i]){
+				i+=2;
+			}
+			i--;
+			i2--;
+			continue;
+		}
+		temporary[i2]=buffer[i];
+		if(buffer[i]=='\0') break;
+	}
+	lstrcpy(buffer,temporary);
+	GlobalFree(temporary);
+}
+
+BOOL GetDefualtFunctionParameter(char *pBuf,char *FuncName,char *Parameter){
+	int i,i2;
+	char temporary[VN_SIZE];
+
+	/////////////////////////////////////////
+	// ソースコードから関数定義位置を取得
+	/////////////////////////////////////////
+
+	for(i=0;;i++){
+		while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+		if(memicmp(pBuf+i,"Class",5)==0&&(pBuf[i+5]==' '||pBuf[i+5]=='\t')||
+			memicmp(pBuf+i,"Interface",9)==0&&(pBuf[i+9]==' '||pBuf[i+9]=='\t')||
+			memicmp(pBuf+i,"Type",4)==0&&(pBuf[i+4]==' '||pBuf[i+4]=='\t')){
+			/* Class ～ End Class
+				Interface ～ End Interface
+				Type ～ End Type
+				は飛び越す */
+
+			while(1){
+				if(pBuf[i]=='\0'){
+					i2=0;
+					break;
+				}
+
+				if(memicmp(pBuf+i,"End",3)==0){
+					/*	End Class
+						End Interface
+						End Type
+						の検出 */
+					i+=3;
+					while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+					if(memicmp(pBuf+i,"Class",5)==0&&(!IsVariableChar(pBuf[i+5]))||
+						memicmp(pBuf+i,"Interface",9)==0&&(!IsVariableChar(pBuf[i+9]))||
+						memicmp(pBuf+i,"Type",4)==0&&(!IsVariableChar(pBuf[i+4]))){
+						i2=0;
+						break;
+					}
+				}
+
+				//次の行をサーチ
+				for(;;i++){
+					if(pBuf[i]=='\0') break;
+					i2=IsCommandDelimitation(pBuf,i);
+					if(i2){
+						i+=i2;
+						break;
+					}
+				}
+				JumpBlank(pBuf,&i);
+			}
+		}
+
+		if(memicmp(pBuf+i,"Declare",7)==0&&(pBuf[i+7]==' '||pBuf[i+7]=='\t')){
+			i+=8;
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+			if(memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')) i+=9;
+			else if(memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')) i+=4;
+			else goto NextCommand;
+
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+			for(i2=0;;i++,i2++){
+				if(!IsVariableChar(pBuf[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=pBuf[i];
+			}
+			if(lstrcmp(temporary,FuncName)==0){
+				//関数名が一致したとき
+				break;
+			}
+		}
+		if(memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')){
+			if(pBuf[i]=='f'||pBuf[i]=='F') i+=9;
+			else i+=4;
+
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+			for(i2=0;;i++,i2++){
+				if(!IsVariableChar(pBuf[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=pBuf[i];
+			}
+			if(lstrcmpi(temporary,"Export")==0){
+				//"Export"を飛び越す
+				while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+				for(i2=0;;i++,i2++){
+					if(!IsVariableChar(pBuf[i])){
+						temporary[i2]=0;
+						break;
+					}
+					temporary[i2]=pBuf[i];
+				}
+			}
+			if(lstrcmp(temporary,FuncName)==0){
+				//関数名が一致したとき
+				break;
+			}
+
+		}
+
+NextCommand:
+		for(;;i++){
+			i2=IsCommandDelimitation(pBuf,i);
+			if(i2){
+				if(i2==2) i++;
+				break;
+			}
+		}
+
+		if(pBuf[i]=='\0') return 0;
+	}
+
+	for(;;i++){
+		if(pBuf[i]=='(') break;
+		if(IsCommandDelimitation(pBuf,i)) return 0;
+	}
+
+	//関数名をコピー
+	lstrcpy(Parameter,FuncName);
+	i2=lstrlen(Parameter);
+
+
+	//////////////////////////////////////////////////////
+	//パラメータをコピー
+	//（コメントの挿入、途中改行などの状況を考慮する）
+	//////////////////////////////////////////////////////
+
+	for(;;i++,i2++){
+		if(IsVariableChar(pBuf[i-1])==0&&pBuf[i-1]!=')'&&IS_BLANK(pBuf[i])||
+			pBuf[i]=='\''||
+			pBuf[i]=='/'&&pBuf[i+1]=='*')
+			JumpBlank(pBuf,&i);
+
+		if(IsCommandDelimitation(pBuf,i)){
+			if(IS_RETURN(pBuf,i)&&
+				pBuf[i-1]=='_'||pBuf[i-1]=='('||pBuf[i-1]==','){
+				//改行を許可
+				i2--;
+				if(Parameter[i2]=='_') i2--;
+
+				i+=2;
+				continue;
+			}
+
+			Parameter[i2]=0;
+			break;
+		}
+		Parameter[i2]=pBuf[i];
+	}
+
+
+	//文法チェック
+	if(!CheckGrammar(Parameter)) return 0;
+
+	
+	return 1;
+}
+BOOL GetClassMemberFunctionParameter(char *pBuf,char *ClassName,char *nest,char *Parameter){
+	extern HANDLE hHeap;
+	extern char *pHeaderBuf;
+	extern char *pUserSource;
+	int i,i2;
+	char temporary[8192];
+	DWORD dwClassType;
+	BOOL bRet;
+
+
+	/////////////////////////////////////////
+	// ソースコードからクラス定義位置を取得
+	/////////////////////////////////////////
+	i=GetClassPos(pBuf,ClassName,&dwClassType);
+	if(pBuf[i]=='\0') return 0;
+
+	//クラス、配列の構成要素を解析する
+	char VarName[VN_SIZE];		//変数名
+	char array[VN_SIZE];		//第1次配列
+	char lpPtrOffset[VN_SIZE];	//第2次配列
+	char NestMember[VN_SIZE];	//入れ子メンバ
+	int RefType;				//"."参照のときは0、"->"参照のときは1
+	lstrcpy(VarName,nest);
+	if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,&RefType)) return 0;
+
+	if(RefType){
+		////////////////////
+		// 入れ子構造の場合
+		////////////////////
+
+		//メンバ変数の型であるクラスの名前を取得
+		char ClassName[VN_SIZE];
+		BOOL bArray;
+		if(!GetClassNameFromClassMember(pBuf,i,VarName,ClassName,&bArray)) return 0;
+
+		//TypeDef宣言を考慮してオリジナルなクラス名を取得
+		GetOriginalClassName(ClassName);
+
+		if(!CheckReferType(ClassName,bArray,array,RefType)) return 0;
+
+		//ユーザーのソースコードをサーチ
+		bRet=GetClassMemberFunctionParameter(pUserSource,ClassName,NestMember,Parameter);
+		if(!bRet){
+			//失敗したときはbasic.sbpをサーチ
+			bRet=GetClassMemberFunctionParameter(pHeaderBuf,ClassName,NestMember,Parameter);
+		}
+		return bRet;
+	}
+
+
+	////////////////////////
+	// メンバ情報を取得
+	////////////////////////
+	DWORD dwProc;
+
+	if(memicmp(pBuf+i,"Inherits",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')){
+		i+=9;
+		while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+		////////////////////////
+		// 継承先クラスをサーチ
+		////////////////////////
+
+		for(i2=0;;i++,i2++){
+			if(!IsVariableChar(pBuf[i])){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=pBuf[i];
+		}
+
+		//ユーザーのソースコードをサーチ
+		bRet=GetClassMemberFunctionParameter(pUserSource,temporary,nest,Parameter);
+		if(!bRet){
+			//失敗したときはbasic.sbpをサーチ
+			bRet=GetClassMemberFunctionParameter(pHeaderBuf,temporary,nest,Parameter);
+		}
+		if(bRet) return 1;
+	}
+
+	//メンバ変数、関数を取得
+	while(1){
+		if(pBuf[i]=='\0') break;
+		if(memicmp(pBuf+i,"End",3)==0){
+			/*	End Class
+				End Interface
+				End Type
+				の検出 */
+			i2=i+3;
+			while(pBuf[i2]==' '||pBuf[i2]=='\t') i2++;
+
+			if(memicmp(pBuf+i2,"Class",5)==0&&(!IsVariableChar(pBuf[i2+5]))||
+				memicmp(pBuf+i2,"Interface",9)==0&&(!IsVariableChar(pBuf[i2+9]))||
+				memicmp(pBuf+i2,"Type",4)==0&&(!IsVariableChar(pBuf[i2+4]))) break;
+		}
+
+		if(memicmp(pBuf+i,"Abstract",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Virtual",7)==0&&(pBuf[i+7]==' '||pBuf[i+7]=='\t')||
+			memicmp(pBuf+i,"Override",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')){
+			//メンバ関数のとき
+			if(pBuf[i]=='a'||pBuf[i]=='A'){
+				i+=9;
+				dwProc=ESC_ABSTRACT;
+
+				while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+				if(memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')) i+=9;
+				else if(memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')) i+=4;
+			}
+			else if(pBuf[i]=='v'||pBuf[i]=='V'){
+				i+=8;
+
+				while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+				if(memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')){
+					i+=9;
+					dwProc=ESC_FUNCTION;
+				}
+				else if(memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')){
+					i+=4;
+					dwProc=ESC_SUB;
+				}
+			}
+			else if(pBuf[i]=='o'||pBuf[i]=='O'){
+				i+=9;
+
+				while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+				if(memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')){
+					i+=9;
+					dwProc=ESC_FUNCTION;
+				}
+				else if(memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')){
+					i+=4;
+					dwProc=ESC_SUB;
+				}
+			}
+			else if(pBuf[i]=='f'||pBuf[i]=='F'){
+				i+=9;
+				dwProc=ESC_FUNCTION;
+			}
+			else if(pBuf[i]=='s'||pBuf[i]=='S'){
+				i+=4;
+				dwProc=ESC_SUB;
+			}
+
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		}
+		else{
+			//メンバ変数のとき
+			dwProc=0;
+		}
+
+		if(dwProc){
+			//変数名または関数名を取得
+			for(i2=0;;i++,i2++){
+				if(!IsVariableChar(pBuf[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=pBuf[i];
+			}
+
+			if(lstrcmp(temporary,nest)==0){
+				//ターゲットとなるメンバ関数が見つかったとき
+				for(;;i++){
+					if(pBuf[i]=='(') break;
+					if(IsCommandDelimitation(pBuf,i)) return 0;
+				}
+
+				lstrcpy(Parameter,nest);
+				i2=lstrlen(Parameter);
+				for(;;i++,i2++){
+					if(IsCommandDelimitation(pBuf,i)){
+						Parameter[i2]=0;
+						break;
+					}
+					Parameter[i2]=pBuf[i];
+				}
+
+				if(!CheckGrammar(Parameter)) return 0;
+
+				return 1;
+			}
+		}
+
+		//次の行をサーチ
+		for(;;i++){
+			if(pBuf[i]=='\0') break;
+			i2=IsCommandDelimitation(pBuf,i);
+			if(i2){
+				i+=i2;
+				break;
+			}
+		}
+		JumpBlank(pBuf,&i);
+
+		if((dwProc==ESC_SUB||dwProc==ESC_FUNCTION)&&dwClassType!=ESC_INTERFACE){
+			//End Sub、End Functionまでジャンプする
+
+			while(1){
+				if(pBuf[i]=='\0'){
+					i2=0;
+					break;
+				}
+
+				if(memicmp(pBuf+i,"End",3)==0){
+					/*	End Sub
+						End Function
+						の検出 */
+					i+=3;
+					while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+					if(memicmp(pBuf+i,"Sub",3)==0&&(!IsVariableChar(pBuf[i+3]))||
+						memicmp(pBuf+i,"Function",8)==0&&(!IsVariableChar(pBuf[i+8]))){
+						i2=1;
+						break;
+					}
+
+					if(memicmp(pBuf+i,"Class",5)==0&&(!IsVariableChar(pBuf[i+5]))||
+						memicmp(pBuf+i,"Interface",9)==0&&(!IsVariableChar(pBuf[i+9]))||
+						memicmp(pBuf+i,"Type",4)==0&&(!IsVariableChar(pBuf[i+4]))){
+						i2=0;
+						break;
+					}
+				}
+
+				//次の行をサーチ
+				for(;;i++){
+					if(pBuf[i]=='\0') break;
+					i2=IsCommandDelimitation(pBuf,i);
+					if(i2){
+						i+=i2;
+						break;
+					}
+				}
+				JumpBlank(pBuf,&i);
+			}
+
+			if(i2==0){
+				//コード解析が不正に終了
+				return 1;
+			}
+
+			//次の行をサーチ
+			for(;;i++){
+				if(pBuf[i]=='\0') break;
+				i2=IsCommandDelimitation(pBuf,i);
+				if(i2){
+					i+=i2;
+					break;
+				}
+			}
+			JumpBlank(pBuf,&i);
+		}
+	}
+
+	return 0;
+}
+BOOL GetParameterString(char *pEditBuf,int iPos,char *FuncName,char *Parameter){
+	extern char *pHeaderBuf;
+	extern char *pUserSource;
+	BOOL bRet;
+
+	//ユーザーソースコードを取得
+	if(pUserSource==0)
+		pUserSource=GetUserSourceCode();
+
+
+	//クラス、配列の構成要素を解析する
+	char VarName[VN_SIZE];		//変数名
+	char array[VN_SIZE];		//第1次配列
+	char lpPtrOffset[VN_SIZE];	//第2次配列
+	char NestMember[VN_SIZE];	//入れ子メンバ
+	int RefType;				//"."参照のときは0、"->"参照のときは1
+	lstrcpy(VarName,FuncName);
+	if(!GetVarFormatString(VarName,array,lpPtrOffset,NestMember,&RefType)) return 0;
+
+	if(RefType==0){
+		// キャレット位置のコード領域を判定（クラス/ローカル/グローバル）
+		int iProcPos;
+		char NowClass[VN_SIZE];
+		GetCodeAreaType(pEditBuf,iPos,&iProcPos,NowClass);
+
+		if(NowClass[0]&&iProcPos!=-1){
+			//クラスメンバ関数領域
+			bRet=GetClassMemberFunctionParameter(pUserSource,NowClass,FuncName,Parameter);
+			if(!bRet){
+				bRet=GetClassMemberFunctionParameter(pHeaderBuf,NowClass,FuncName,Parameter);
+			}
+
+			if(bRet) return 1;
+		}
+
+		//通常関数
+		bRet=GetDefualtFunctionParameter(pUserSource,FuncName,Parameter);
+		if(!bRet){
+			bRet=GetDefualtFunctionParameter(pHeaderBuf,FuncName,Parameter);
+		}
+	}
+	else{
+		//メンバ関数
+		char ClassName[VN_SIZE];
+		BOOL bArray;
+
+		//オブジェクトのクラス名を取得
+		if(!GetVariableClassName(pEditBuf,iPos,VarName,ClassName,&bArray)) return 0;
+
+		//TypeDef宣言を考慮してオリジナルなクラス名を取得
+		GetOriginalClassName(ClassName);
+
+		if(!CheckReferType(ClassName,bArray,array,RefType)) return 0;
+
+		bRet=GetClassMemberFunctionParameter(pUserSource,ClassName,NestMember,Parameter);
+		if(!bRet){
+			bRet=GetClassMemberFunctionParameter(pHeaderBuf,ClassName,NestMember,Parameter);
+		}
+	}
+
+	DeleteComment(Parameter);
+
+	return bRet;
+}
+
+void ShowParameterHint(int WndNum){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern METHODCHECKINFO MethodCheckInfo;
+	int i,i2,i3,IsStr,IsComment,PareNum,iPos;
+	char *pBuf;
+	char temp2[8192];
+
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+	//キャレットが示すバッファインデックスを取得
+	iPos=GetBufferIndexFromCaretPos(
+		pBuf,
+		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+
+	static int Before_StartCaretY;
+	BOOL Before_StartCaretSwitch=0;
+	if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y!=Before_StartCaretY){
+		Before_StartCaretY=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y;
+		Before_StartCaretSwitch=1;
+	}
+
+	if(!MethodCheckInfo.hWnd){
+		////////////////////////////////////////////////
+		// 新規の場合は選択されている行の先頭位置を取得
+		////////////////////////////////////////////////
+
+		for(i=iPos;i>0;i--){
+			if(pBuf[i-1]=='\r'&&pBuf[i]=='\n'){
+				i++;
+				break;
+			}
+		}
+		MethodCheckInfo.HeadPos=i;
+
+		//注釈中かどうかを判定
+		for(i2=0,IsStr=0,IsComment=0;i2<MethodCheckInfo.HeadPos;i2++){
+			if(pBuf[i2]=='\"'){
+				i3=i2;
+				IsStr^=1;
+			}
+
+			//注釈（複数行）
+			if(pBuf[i2]=='/'&&pBuf[i2+1]=='*'&&IsStr==0&&IsComment==0){
+				i2+=2;
+				while(!(pBuf[i2]=='*'&&pBuf[i2+1]=='/')){
+					if(pBuf[i2]=='\0'){
+						i2--;
+						break;
+					}
+					i2++;
+					if(i2>=MethodCheckInfo.HeadPos) break;
+				}
+				if(i2>=MethodCheckInfo.HeadPos){
+					IsComment=1;
+					break;
+				}
+				continue;
+			}
+
+			//注釈（単行）
+			if(pBuf[i2]=='\''&&IsStr==0){
+				while(!(pBuf[i2]=='\r'&&pBuf[i2+1]=='\n')){
+					if(pBuf[i2]=='\0'){
+						i2--;
+						break;
+					}
+					i2++;
+					if(i2>=MethodCheckInfo.HeadPos) break;
+				}
+				if(i2>=MethodCheckInfo.HeadPos){
+					IsComment=1;
+					break;
+				}
+				continue;
+			}
+
+			if(pBuf[i2]=='\r'&&pBuf[i2+1]=='\n'){
+				IsComment=0;
+				IsStr=0;
+			}
+		}
+
+		if(IsComment){
+			//注釈文の位置のときは抜け出す
+			return;
+		}
+	}
+	else{
+		/*既存のパラメータヒントが存在し、
+			以前の先頭位置よりも手前にカーソルが移動されたときは破棄する*/
+		if(iPos<=MethodCheckInfo.HeadPos){
+			DestroyWindow(MethodCheckInfo.hWnd);
+			MethodCheckInfo.hWnd=0;
+		}
+	}
+
+
+	////////////////////////////////////////
+	// ダブルクォートの中かどうかを判別する
+	////////////////////////////////////////
+
+	IsStr=0;
+	IsComment=0;
+	PareNum=0;
+	for(i2=MethodCheckInfo.HeadPos;i2<iPos;i2++){
+		if(pBuf[i2]=='\"'){
+			i3=i2;
+			IsStr^=1;
+		}
+
+		if(pBuf[i2]=='('&&IsStr==0&&IsComment==0) PareNum++;
+		if(pBuf[i2]==')'&&IsStr==0&&IsComment==0) PareNum--;
+
+		//注釈（複数行）
+		if(pBuf[i2]=='/'&&pBuf[i2+1]=='*'&&IsStr==0&&IsComment==0){
+			i2+=2;
+			while(!(pBuf[i2]=='*'&&pBuf[i2+1]=='/')){
+				if(pBuf[i2]=='\0'){
+					i2--;
+					break;
+				}
+				i2++;
+				if(i2>=iPos) break;
+			}
+			if(i2>=iPos){
+				IsComment=1;
+				break;
+			}
+			continue;
+		}
+
+		//注釈（単行）
+		if(pBuf[i2]=='\''&&IsStr==0){
+			while(!(pBuf[i2]=='\r'&&pBuf[i2+1]=='\n')){
+				if(pBuf[i2]=='\0'){
+					i2--;
+					break;
+				}
+				i2++;
+				if(i2>=iPos) break;
+			}
+			if(i2>=iPos){
+				IsComment=1;
+				break;
+			}
+			continue;
+		}
+
+		if(pBuf[i2]=='\r'&&pBuf[i2+1]=='\n'){
+			if(PareNum==0){
+				//複数行にパラメータ記述がなされないとき
+				DestroyWindow(MethodCheckInfo.hWnd);
+				MethodCheckInfo.hWnd=0;
+				return;
+			}
+			IsComment=0;
+			IsStr=0;
+		}
+
+	}
+	if(IsStr){
+		if(!MethodCheckInfo.hWnd){
+			return;
+		}
+		i=i3-1;
+	}
+	else i=iPos-1;
+
+
+	for(PareNum=0;i>=MethodCheckInfo.HeadPos;i--){
+		if(pBuf[i]=='\"'){
+			i--;
+			while(pBuf[i]!='\"'){
+				i--;
+				if(i<MethodCheckInfo.HeadPos) break;
+			}
+			if(i<MethodCheckInfo.HeadPos) break;
+			continue;
+		}
+
+		//文の第一パラメータ時に表示する（すでに表示されている場合は無関係）
+		if((!MethodCheckInfo.hWnd)&&pBuf[i]==',') break;
+
+		if(pBuf[i]==')') PareNum--;
+		if(pBuf[i]=='('){
+			PareNum++;
+			if(PareNum>0){
+				i3=i+1;
+				i--;
+				while(pBuf[i]==' '||pBuf[i]=='\t') i--;
+				for(i2=0;i>=0;i--,i2++){
+					if(!IsVariableChar(pBuf[i])){
+						if(pBuf[i-1]=='-'&&pBuf[i]=='>'){
+							// "->" を含ませる
+							i--;
+							i2++;
+							continue;
+						}
+						break;
+					}
+				}
+				i++;
+				memcpy(temp2,pBuf+i,i2);
+				temp2[i2]=0;
+				if(i3<=iPos){
+					for(i2=0,IsStr=0,PareNum=0;i3<iPos;i3++){
+						if(pBuf[i3]=='\"') IsStr^=1;
+						if(pBuf[i3]=='('&&IsStr==0) PareNum++;
+						if(pBuf[i3]==')'&&IsStr==0){
+							PareNum--;
+							if(PareNum<0) break;
+						}
+						if(pBuf[i3]==','&&IsStr==0&&PareNum==0) i2++;
+					}
+					if(PareNum<0) i2=0x7FFFFFFF;
+				}
+				else i2=0x7FFFFFFF;
+
+				if(temp2[0]==0){
+					PareNum=0;
+					iPos=i;
+					continue;
+				}
+
+				if(lstrcmp(MethodCheckInfo.BeforeMethodName,temp2)!=0){
+					//新規の場合はパラメータ文字列を取得
+					if(!GetParameterString(pBuf,iPos,temp2,MethodCheckInfo.msg)){
+						PareNum=0;
+						iPos=i;
+						continue;
+					}
+				}
+				else if(MethodCheckInfo.ParmNum==i2&&Before_StartCaretSwitch==0){
+					//表示中のパラメータヒントに変更がないとき
+					//※行移動が行われた場合を除く
+					break;
+				}
+
+				//第何パラメータを太字にするかを示す
+				MethodCheckInfo.ParmNum=i2;
+
+				//パラメータヒントを表示
+				ShowCommandMessage();
+
+				lstrcpy(MethodCheckInfo.BeforeMethodName,temp2);
+				break;
+			}
+		}
+		if(i==MethodCheckInfo.HeadPos){
+
+			//行番号を飛び越す
+			while(pBuf[i]>='0'&&pBuf[i]<='9') i++;
+
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+			for(i2=0;;i++,i2++){
+				if(!IsVariableChar(pBuf[i])){
+					temp2[i2]=0;
+					break;
+				}
+				temp2[i2]=pBuf[i];
+			}
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+			if(pBuf[i]=='(') i++;
+			if(i<=iPos){
+				for(i2=0,IsStr=0,PareNum=0;i<iPos;i++){
+					if(pBuf[i]=='\"') IsStr^=1;
+					if(pBuf[i]=='('&&IsStr==0) PareNum++;
+					if(pBuf[i]==')'&&IsStr==0){
+						PareNum--;
+						if(PareNum<0) break;
+					}
+					if(pBuf[i]==','&&IsStr==0&&PareNum==0) i2++;
+				}
+				if(PareNum<0) temp2[0]=0;
+			}
+			else i2=0x7FFFFFFF;
+			if(SetCommandMessageToMethodCheck(temp2)){
+				//第何パラメータを太字にするかを示す
+				MethodCheckInfo.ParmNum=i2;
+
+				//パラメータヒントを表示
+				ShowCommandMessage();
+
+				lstrcpy(MethodCheckInfo.BeforeMethodName,temp2);
+			}
+			else{
+				if(MethodCheckInfo.hWnd){
+					UpdateWindow(MdiInfo[WndNum].pMdiTextEdit->hEdit);	//ちらつき防止
+
+					DestroyWindow(MethodCheckInfo.hWnd);
+					MethodCheckInfo.hWnd=0;
+				}
+			}
+			break;
+		}
+	}
+
+	extern char *pUserSource;
+	if(pUserSource){
+		HeapDefaultFree(pUserSource);
+		pUserSource=0;
+	}
+}
+
+
+//////////////////////////////////////
+// パラメータヒントのインターフェイス
+//////////////////////////////////////
+
+int DrawParam_StartScreenPosX;
+int DrawParam_PosY;
+int DrawParam_TextHeight;
+int DrawParam_MaxX;
+void TextOut_ToParmHint(HDC hdc,HFONT hFont,char *buffer,SIZE *pSize){
+	int i,i2;
+	HFONT hOldFont;
+
+	i=lstrlen(buffer);
+	hOldFont=(HFONT)SelectObject(hdc,hFont);
+
+	i2=pSize->cx;
+	GetTextExtentPoint32(hdc,buffer,i,pSize);
+	if(DrawParam_StartScreenPosX+i2+pSize->cx >= ScreenX){
+		DrawParam_PosY+=DrawParam_TextHeight;
+		i2=10;
+	}
+	TextOut(hdc,i2,DrawParam_PosY,buffer,i);
+	pSize->cx+=i2;
+
+	if(DrawParam_MaxX<pSize->cx) DrawParam_MaxX=pSize->cx;
+
+	SelectObject(hdc,hOldFont);
+}
+void DrawParameterHint(HDC hdc,SIZE *pSize){
+	extern METHODCHECKINFO MethodCheckInfo;
+	int i,i2,i3,counter;
+	char temporary[8192];
+	HFONT hOldFont;
+
+	SetBkMode(hdc,TRANSPARENT);
+
+	DrawParam_PosY=2;
+
+	//命令語、関数の識別名
+	for(i=0;;i++){
+		temporary[i]=MethodCheckInfo.msg[i];
+		if(MethodCheckInfo.msg[i]=='\0') break;
+		if(MethodCheckInfo.msg[i]==' '||MethodCheckInfo.msg[i]=='('){
+			i++;
+			temporary[i]=0;
+			break;
+		}
+	}
+	hOldFont=(HFONT)SelectObject(hdc,MethodCheckInfo.hFont);
+	TextOut(hdc,2,2,temporary,lstrlen(temporary));
+	GetTextExtentPoint32(hdc,temporary,lstrlen(temporary),pSize);
+	SelectObject(hdc,hOldFont);
+	pSize->cx+=2;
+	DrawParam_TextHeight=pSize->cy;
+
+	DrawParam_MaxX=pSize->cx;
+
+	for(i2=0,counter=0;;i++,i2++){
+		if(MethodCheckInfo.msg[i]=='('){
+			i3=GetStringInPare(temporary+i2,MethodCheckInfo.msg+i);
+			i+=i3-1;
+			i2+=i3-1;
+		}
+		if(MethodCheckInfo.msg[i]==','||
+			MethodCheckInfo.msg[i]==')'||
+			MethodCheckInfo.msg[i]=='\0'){
+			temporary[i2]=0;
+			if(MethodCheckInfo.ParmNum==counter){
+				//太字フォントパラメータ
+				TextOut_ToParmHint(hdc,MethodCheckInfo.hBoldFont,temporary,pSize);
+			}
+			else{
+				//通常フォントパラメータ
+				TextOut_ToParmHint(hdc,MethodCheckInfo.hFont,temporary,pSize);
+			}
+			counter++;
+
+			if(MethodCheckInfo.msg[i]==','){
+				temporary[0]=',';
+				temporary[1]=' ';
+				temporary[2]=0;
+
+				TextOut_ToParmHint(hdc,MethodCheckInfo.hFont,temporary,pSize);
+
+				i++;
+				while(MethodCheckInfo.msg[i]==' '||MethodCheckInfo.msg[i]=='\t') i++;
+				i--;
+			}
+			else if(MethodCheckInfo.msg[i]==')'){
+				lstrcpy(temporary,MethodCheckInfo.msg+i);
+
+				TextOut_ToParmHint(hdc,MethodCheckInfo.hFont,temporary,pSize);
+
+				break;
+			}
+			else if(MethodCheckInfo.msg[i]=='\0') break;
+
+			i2=-1;
+			continue;
+		}
+		temporary[i2]=MethodCheckInfo.msg[i];
+	}
+
+	pSize->cx=DrawParam_MaxX+20;
+	pSize->cy=DrawParam_PosY+DrawParam_TextHeight+2;
+}
+void ShowHelp_FromParamHint(void){
+	extern METHODCHECKINFO MethodCheckInfo;
+	int i;
+	char temporary[MAX_PATH],temp2[255];
+	HH_AKLINK ak;
+
+	for(i=0;;i++){
+		if(MethodCheckInfo.msg[i]=='('||MethodCheckInfo.msg[i]==' '||
+			MethodCheckInfo.msg[i]=='\0'){
+			temp2[i]=0;
+			break;
+		}
+		temp2[i]=MethodCheckInfo.msg[i];
+	}
+
+	memset(&ak, 0, sizeof(HH_AKLINK));
+	ak.cbStruct = sizeof(HH_AKLINK);
+	ak.pszKeywords = temp2;
+	ak.fIndexOnFail=1;
+
+	sprintf(temporary,"%sBasicHelp.chm",pj_editor_Dir);
+	HtmlHelp(NULL,temporary,HH_KEYWORD_LOOKUP,(DWORD)&ak);
+}
+LRESULT CALLBACK MethodCheckWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern METHODCHECKINFO MethodCheckInfo;
+	HDC hdc;
+	HPEN hOldPen;
+	HBRUSH hBrush,hOldBrush;
+	PAINTSTRUCT ps;
+	SIZE size;
+	RECT rect;
+	POINT pos;
+
+	switch(message){
+		case WM_CREATE:
+			GetCaretPos(&pos);
+			ClientToScreen(GetWindow(hClient,GW_CHILD),&pos);
+			DrawParam_StartScreenPosX=pos.x;
+
+			SetTimer(hwnd,1,50,0);
+			return 0;
+		case WM_PAINT:
+			hdc=BeginPaint(hwnd,&ps);
+
+			//枠を描画
+			GetClientRect(hwnd,&rect);
+			hBrush=CreateSolidBrush(RGB(255,255,180));
+			hOldPen=(HPEN)SelectObject(hdc,GetStockObject(BLACK_PEN));
+			hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+			Rectangle(hdc,0,0,rect.right,rect.bottom);
+			SelectObject(hdc,hOldPen);
+			SelectObject(hdc,hOldBrush);
+			DeleteObject(hBrush);
+
+			//パラメータヒントを描画
+			DrawParameterHint(hdc,&size);
+
+			//[?]マークを描画
+			HBITMAP hBmp,hOldBmp;
+			HDC memdc;
+			hBmp=(HBITMAP)LoadImage(hResInst,MAKEINTRESOURCE(IDB_PARAMHINT_QUESTION),IMAGE_BITMAP,0,0,LR_DEFAULTSIZE);
+			memdc=CreateCompatibleDC(hdc);
+			hOldBmp=(HBITMAP)SelectObject(memdc,hBmp);
+			GetClientRect(hwnd,&rect);
+			BitBlt(hdc,rect.right-14,rect.bottom-14,13,13,memdc,0,0,SRCCOPY);
+			SelectObject(memdc,hOldBmp);
+			DeleteDC(memdc);
+			DeleteObject(hBmp);
+
+			EndPaint(hwnd,&ps);
+			return 0;
+		case WM_TIMER:
+			//[?]マークを描画
+			static BOOL bOnMouse;
+			GetClientRect(hwnd,&rect);
+			GetCursorPos(&pos);
+			ScreenToClient(hwnd,&pos);
+			if(rect.right-14<=pos.x&&pos.x<=rect.right-1&&
+				rect.bottom-14<=pos.y&&pos.y<=rect.bottom-1){
+				if(bOnMouse) return 0;
+
+				hdc=GetDC(hwnd);
+
+				hBmp=(HBITMAP)LoadImage(hResInst,MAKEINTRESOURCE(IDB_PARAMHINT_QUESTION2),IMAGE_BITMAP,0,0,LR_DEFAULTSIZE);
+				memdc=CreateCompatibleDC(hdc);
+				hOldBmp=(HBITMAP)SelectObject(memdc,hBmp);
+				GetClientRect(hwnd,&rect);
+				BitBlt(hdc,rect.right-14,rect.bottom-14,13,13,memdc,0,0,SRCCOPY);
+				SelectObject(memdc,hOldBmp);
+				DeleteDC(memdc);
+				DeleteObject(hBmp);
+
+				ReleaseDC(hwnd,hdc);
+
+				bOnMouse=1;
+			}
+			else{
+				if(!bOnMouse) return 0;
+
+				hdc=GetDC(hwnd);
+
+				hBmp=(HBITMAP)LoadImage(hResInst,MAKEINTRESOURCE(IDB_PARAMHINT_QUESTION),IMAGE_BITMAP,0,0,LR_DEFAULTSIZE);
+				memdc=CreateCompatibleDC(hdc);
+				hOldBmp=(HBITMAP)SelectObject(memdc,hBmp);
+				GetClientRect(hwnd,&rect);
+				BitBlt(hdc,rect.right-14,rect.bottom-14,13,13,memdc,0,0,SRCCOPY);
+				SelectObject(memdc,hOldBmp);
+				DeleteDC(memdc);
+				DeleteObject(hBmp);
+
+				ReleaseDC(hwnd,hdc);
+				bOnMouse=0;
+			}
+			return 0;
+		case WM_ACTIVATE:
+			if(LOWORD(wParam)==WA_ACTIVE||LOWORD(wParam)==WA_CLICKACTIVE){
+				SetFocus(GetWindow(hClient,GW_CHILD));
+
+				if(LOWORD(wParam)==WA_CLICKACTIVE){
+					GetClientRect(hwnd,&rect);
+					GetCursorPos(&pos);
+					ScreenToClient(hwnd,&pos);
+					if(rect.right-14<=pos.x&&pos.x<=rect.right-1&&
+						rect.bottom-14<=pos.y&&pos.y<=rect.bottom-1){
+						ShowHelp_FromParamHint();
+					}
+				}
+			}
+			return 0;
+		case WM_DESTROY:
+			MethodCheckInfo.BeforeMethodName[0]=0;
+			return 0;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
+void ShowCommandMessage(void){
+	extern METHODCHECKINFO MethodCheckInfo;
+	int i;
+	int sw;
+
+	if(pobj_nv->dwParameterHint==1){
+		//ポップアップ表示
+
+		extern HINSTANCE hInst;
+		extern METHODCHECKINFO MethodCheckInfo;
+		extern MDIINFO MdiInfo[MAX_WNDNUM];
+		HDC hdc,memdc;
+		RECT rect,rc2;
+		SIZE size;
+		POINT pos;
+		if(!MethodCheckInfo.hWnd){
+			MethodCheckInfo.hWnd=CreateWindow("MethodCheckWindow",NULL,WS_POPUP,
+				0,0,0,0,
+				hOwner,NULL,hInst,0);
+			sw=1;
+		}
+		else sw=0;
+		i=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+		hdc=GetDC(MethodCheckInfo.hWnd);
+		memdc=CreateCompatibleDC(hdc);
+		DrawParameterHint(memdc,&size);
+		DeleteDC(memdc);
+		ReleaseDC(MethodCheckInfo.hWnd,hdc);
+
+		GetWindowRect(MdiInfo[i].hwnd,&rect);
+		GetCaretPos(&pos);
+		ClientToScreen(MdiInfo[i].pMdiTextEdit->hEdit,&pos);
+		rect.left=pos.x-20;
+		rect.top=pos.y-pobj_nv->lf.lfHeight;
+		if(sw){
+			MoveWindow(MethodCheckInfo.hWnd,rect.left,rect.top,size.cx,size.cy,1);
+			ShowWindow(MethodCheckInfo.hWnd,SW_SHOWNOACTIVATE);
+		}
+		else{
+			GetWindowRect(MethodCheckInfo.hWnd,&rc2);
+
+			MoveWindow(MethodCheckInfo.hWnd,
+				rc2.left,
+				rect.top,
+				size.cx,
+				size.cy,
+				1);
+
+			InvalidateRect(MethodCheckInfo.hWnd,NULL,0);
+		}
+	}
+
+	//ステータスバーに表示
+	else if(pobj_nv->dwParameterHint==2)
+		SetStatusText(MethodCheckInfo.msg);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/Print.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Print.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Print.cpp	(revision 178)
@@ -0,0 +1,560 @@
+#include "common.h"
+
+
+int iPreviewNowPage;
+int iZoomNowPage;
+
+#define ZOOM_NUM 8
+#define ZOOM_INIT 4
+int array_Zoom[ZOOM_NUM]={
+	500,
+	200,
+	150,
+	100,
+	75,
+	50,
+	25,
+	10
+};
+
+
+CPage obj_Page;
+
+CPage::CPage(){
+	memset(&psd, 0, sizeof(PAGESETUPDLG));
+	psd.lStructSize = sizeof(PAGESETUPDLG);
+	psd.hwndOwner = hOwner;
+	psd.Flags = PSD_MARGINS |PSD_INHUNDREDTHSOFMILLIMETERS|PSD_DISABLEORIENTATION;
+	psd.rtMargin.left=2500;
+	psd.rtMargin.top=2500;
+	psd.rtMargin.right=2500;
+	psd.rtMargin.bottom=2500;
+	psd.ptPaperSize.x=21000;
+	psd.ptPaperSize.y=29700;
+}
+CPage::~CPage(){
+}
+
+BOOL CPage::SetupDlg(void){
+	//ページ設定ダイアログ
+	return PageSetupDlg(&psd);
+}
+
+void DrawPage(HDC memdc,BOOL bPreview,BOOL *lpbLastPage=0){
+	RECT rc;
+
+	//ページの幅、高さ（単位は0.1ミリメートル）
+	int iPageWidth,iPageHeight;
+	iPageWidth=obj_Page.psd.ptPaperSize.x/10;
+	iPageHeight=obj_Page.psd.ptPaperSize.y/10;
+
+	//マッピングモードをセット
+	SetMapMode(memdc,MM_LOMETRIC);
+
+	POINT px_pos;
+	px_pos.x=iPageWidth;
+	px_pos.y=iPageHeight;
+	LPtoDP(memdc,&px_pos,1);
+	px_pos.y=-px_pos.y;
+
+	int WndNum;
+	WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+	//フォント生成
+	LOGFONT lf;
+	lf=pobj_nv->lfPrint;
+	lf.lfHeight=-MulDiv(pobj_nv->iPrintFontPointSize,GetDeviceCaps(memdc, LOGPIXELSY),960);
+	HFONT hFont;
+	hFont=CreateFontIndirect(&lf);
+
+	//フォントをセット
+	HFONT hOldFont;
+	hOldFont=(HFONT)SelectObject(memdc,hFont);
+
+	//マージン（単位は0.1ミリメートル）
+	RECT rcMargin;
+	rcMargin.left=obj_Page.psd.rtMargin.left/10;
+	rcMargin.top=obj_Page.psd.rtMargin.top/10;
+	rcMargin.right=obj_Page.psd.rtMargin.right/10;
+	rcMargin.bottom=obj_Page.psd.rtMargin.bottom/10;
+
+	//タブ文字数
+	DRAWTEXTPARAMS dtp;
+	dtp.cbSize=sizeof(DRAWTEXTPARAMS);
+	dtp.iLeftMargin=0;
+	dtp.iRightMargin=0;
+	dtp.iTabLength=pobj_nv->TabSize;
+	dtp.uiLengthDrawn=0;
+
+	char *temp;
+	temp=(char *)malloc(65535);
+
+	char *buffer;
+	buffer=MdiInfo[WndNum].pMdiTextEdit->buffer;
+	int i=0,i2=0,iPage=0;
+	for(i=0,i2=0;;i++,i2++){
+		if(buffer[i]=='\0'||buffer[i]=='\r'&&buffer[i+1]=='\n'){
+			temp[i2]=0;
+
+			memset(&rc,0,sizeof(RECT));
+			rc.right=iPageWidth-(rcMargin.left + rcMargin.right);
+			DrawTextEx(memdc,temp,-1,&rc,DT_CALCRECT | DT_WORDBREAK|DT_TABSTOP|DT_EXPANDTABS|DT_NOPREFIX,&dtp);
+
+			if(rc.bottom<=-(iPageHeight-(rcMargin.top+rcMargin.bottom)) || buffer[i]=='\0'){
+
+				if(rc.bottom<-(iPageHeight-(rcMargin.top+rcMargin.bottom))){
+					i--;i2--;
+					while(i>0 && (!(buffer[i]=='\r'&&buffer[i+1]=='\n'))){
+						i--;
+						i2--;
+					}
+					temp[i2]=0;
+				}
+
+				rc.left=rcMargin.left;
+				rc.right=iPageWidth-rcMargin.right;
+				rc.top=-rcMargin.top;
+				rc.bottom=-(iPageHeight-rcMargin.bottom);
+
+				char szTempPage[255],*temp2,temp3[255];
+				lstrcpy(temp3,pobj_nv->szPageStr);
+				temp2=strstr(temp3,"&n");
+				if(temp2){
+					temp2[0]='%';
+					temp2[1]='d';
+
+					sprintf(szTempPage,temp3,iPage+1);
+				}
+
+				if(bPreview&&iPage==iPreviewNowPage || bPreview==0){
+					if(bPreview==0) StartPage(memdc);
+
+					DrawTextEx(memdc,temp,-1,&rc,DT_LEFT | DT_WORDBREAK|DT_TABSTOP|DT_EXPANDTABS|DT_NOPREFIX,&dtp);
+
+					if(pobj_nv->bShowPageNum){
+						//ページ番号
+						rc.top=-(iPageHeight-rcMargin.bottom);
+						rc.bottom=-iPageHeight;
+						DrawText(memdc,szTempPage,-1,&rc,DT_CENTER|DT_VCENTER|DT_SINGLELINE|DT_NOPREFIX);
+					}
+
+					if(bPreview==0) EndPage(memdc);
+
+					if(lpbLastPage){
+						if(buffer[i]=='\0'){
+							*lpbLastPage=1;
+						}
+						else *lpbLastPage=0;
+					}
+
+					if(bPreview) break;
+				}
+
+				if(buffer[i]=='\0') break;
+
+				iPage++;
+
+				i++;
+				i2=-1;
+				continue;
+			}
+		}
+		temp[i2]=buffer[i];
+	}
+
+	free(temp);
+
+	SelectObject(memdc,hOldFont);
+}
+
+void CreatePreviewDCAndBmp(HDC *lphDC,HBITMAP *lphBmp,POINT *lpPxPos,BOOL *lpbLastPage){
+
+	//印刷ダイアログ
+	PRINTDLG pd;
+	memset(&pd,0,sizeof(PRINTDLG));
+	pd.lStructSize=sizeof(PRINTDLG);
+	pd.hwndOwner=hOwner;
+	pd.Flags=PD_RETURNDC|PD_RETURNDEFAULT;
+	pd.nFromPage=1;
+	pd.nToPage=1;
+	pd.nMinPage=1;
+	pd.nMaxPage=1;
+	pd.nCopies=1;
+	if(PrintDlg(&pd)==0){
+		return;
+	}
+
+	HDC memdc;
+	memdc=CreateCompatibleDC(pd.hDC);
+
+	//ページの幅、高さ（単位は0.1ミリメートル）
+	int iPageWidth,iPageHeight;
+	iPageWidth=obj_Page.psd.ptPaperSize.x/10;
+	iPageHeight=obj_Page.psd.ptPaperSize.y/10;
+
+	//マッピングモードをセット
+	SetMapMode(memdc,MM_LOMETRIC);
+
+	POINT px_pos;
+	px_pos.x=iPageWidth;
+	px_pos.y=iPageHeight;
+	LPtoDP(memdc,&px_pos,1);
+	px_pos.y=-px_pos.y;
+
+	HBITMAP hMemBmp;
+	hMemBmp=CreateCompatibleBitmap(pd.hDC,px_pos.x,px_pos.y);
+	SelectObject(memdc,hMemBmp);
+
+	//背景を初期化
+	HBRUSH hOldBrush;
+	hOldBrush=(HBRUSH)SelectObject(memdc,GetStockObject(WHITE_BRUSH));
+	PatBlt(memdc,0,0,px_pos.x,-px_pos.y,PATCOPY);
+	SelectObject(memdc,hOldBrush);
+
+	//メモリへ描画
+	DrawPage(memdc,1,lpbLastPage);
+
+	DeleteDC(pd.hDC);
+
+
+	*lphDC=memdc;
+	*lphBmp=hMemBmp;
+	*lpPxPos=px_pos;
+}
+
+void DrawPreview(HWND hPreview,HDC hdc,HDC memdc,POINT *lpPxPos){
+	SetMapMode(memdc,MM_TEXT);
+
+	POINT px_pos;
+	px_pos=*lpPxPos;
+
+	SIZE size;
+	RECT rc;
+	GetClientRect(hPreview,&rc);
+	size.cy=(long)((double)rc.bottom*0.9);
+	size.cx=(long)((double)size.cy*((double)obj_Page.psd.ptPaperSize.x/(double)obj_Page.psd.ptPaperSize.y));
+
+	SIZE size_hori;
+	size_hori.cx=(long)((double)rc.right*0.9);
+	size_hori.cy=(long)((double)size_hori.cx*((double)obj_Page.psd.ptPaperSize.y/(double)obj_Page.psd.ptPaperSize.x));
+
+	if(size.cx>size_hori.cx) size=size_hori;
+	size.cx=px_pos.x;
+	size.cy=px_pos.y;
+
+
+	//////////////////////////////////
+	// スクロールバー情報を取得
+	//////////////////////////////////
+
+	//垂直
+	SCROLLINFO si_vert;
+	si_vert.cbSize=sizeof(SCROLLINFO);
+	si_vert.fMask=SIF_PAGE|SIF_RANGE|SIF_POS;
+	GetScrollInfo(hPreview,SB_VERT,&si_vert);
+
+	//水平
+	SCROLLINFO si_horz;
+	si_horz.cbSize=sizeof(SCROLLINFO);
+	si_horz.fMask=SIF_PAGE|SIF_RANGE|SIF_POS;
+	GetScrollInfo(hPreview,SB_HORZ,&si_horz);
+
+
+
+	//表示率
+	double dblZoomRatio;
+	dblZoomRatio=((double)array_Zoom[iZoomNowPage]/(double)100)*0.18;
+
+
+	///////////////////////////
+	// メモリへ描画
+	///////////////////////////
+
+	HDC memdc2;
+	memdc2=CreateCompatibleDC(hdc);
+
+	HBITMAP hMemBmp;
+	hMemBmp=CreateCompatibleBitmap(hdc,(int)((double)size.cx*dblZoomRatio)+40, (int)((double)size.cy*dblZoomRatio)+40);
+
+	SelectObject(memdc2,hMemBmp);
+	RECT rc2;
+	rc2.left=0;rc2.top=0;
+	rc2.right=(int)((double)size.cx*dblZoomRatio)+40;
+	rc2.bottom=(int)((double)size.cy*dblZoomRatio)+40;
+	FillRect(memdc2,&rc2,(HBRUSH)GetStockObject(GRAY_BRUSH));
+
+	SetStretchBltMode(memdc2,HALFTONE);
+	StretchBlt(memdc2,
+		20, 20,
+		(int)((double)size.cx*dblZoomRatio), (int)((double)size.cy*dblZoomRatio),
+		memdc,0,0,px_pos.x,px_pos.y,SRCCOPY);
+
+	//画面へ描画
+	BitBlt(hdc,-si_horz.nPos,-si_vert.nPos,rc2.right,rc2.bottom,
+		memdc2,0,0,SRCCOPY);
+
+	DeleteDC(memdc2);
+	DeleteObject(hMemBmp);
+
+
+	//////////////////////////////
+	// スクロールバーを設定
+	//////////////////////////////
+	GetClientRect(hPreview,&rc);
+
+	//垂直
+	si_vert.nMin=0;
+	si_vert.nMax=rc2.bottom;
+	si_vert.nPage=rc.bottom;
+	SetScrollInfo(hPreview,SB_VERT,&si_vert,1);
+
+	//水平
+	si_horz.nMin=0;
+	si_horz.nMax=rc2.right;
+	si_horz.nPage=rc.right;
+	SetScrollInfo(hPreview,SB_HORZ,&si_horz,1);
+}
+#define WM_RESETPREVIEW WM_USER+100
+LRESULT CALLBACK PreviewWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	static HDC memdc;
+	static HBITMAP hMemBmp;
+	static POINT px_pos;
+	SCROLLINFO si;
+	int i;
+	RECT rc;
+	switch(message){
+		case WM_CREATE:
+			memdc=0;
+			hMemBmp=0;
+			SendMessage(hwnd,WM_RESETPREVIEW,0,0);
+			return 0;
+		case WM_PAINT:
+			HDC hdc;
+			PAINTSTRUCT ps;
+			hdc=BeginPaint(hwnd,&ps);
+			DrawPreview(hwnd,hdc,memdc,&px_pos);
+			EndPaint(hwnd,&ps);
+			return 0;
+		case WM_RESETPREVIEW:
+			if(memdc) DeleteDC(memdc);
+			if(hMemBmp) DeleteObject(hMemBmp);
+			BOOL bLastPage;
+			CreatePreviewDCAndBmp(&memdc,&hMemBmp,&px_pos,&bLastPage);
+			InvalidateRect(hwnd,NULL,1);
+
+			if(iPreviewNowPage==0) EnableWindow(GetDlgItem(GetParent(hwnd),IDC_PREV),0);
+			else EnableWindow(GetDlgItem(GetParent(hwnd),IDC_PREV),1);
+			if(bLastPage) EnableWindow(GetDlgItem(GetParent(hwnd),IDC_NEXT),0);
+			else EnableWindow(GetDlgItem(GetParent(hwnd),IDC_NEXT),1);
+
+			if(iZoomNowPage<=0) EnableWindow(GetDlgItem(GetParent(hwnd),IDC_ZOOMIN),0);
+			else EnableWindow(GetDlgItem(GetParent(hwnd),IDC_ZOOMIN),1);
+			if(iZoomNowPage>=ZOOM_NUM-1)
+				EnableWindow(GetDlgItem(GetParent(hwnd),IDC_ZOOMOUT),0);
+			else EnableWindow(GetDlgItem(GetParent(hwnd),IDC_ZOOMOUT),1);
+			return 0;
+		case WM_VSCROLL:
+		case WM_HSCROLL:
+			int fnBar;
+			if(message==WM_VSCROLL) fnBar=SB_VERT;
+			else fnBar=SB_HORZ;
+
+			si.cbSize=sizeof(SCROLLINFO);
+			si.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
+
+			GetScrollInfo(hwnd,fnBar,&si);
+			if(LOWORD(wParam)==SB_LINEUP) i=-1;
+			else if(LOWORD(wParam)==SB_LINEDOWN) i=1;
+			else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)si.nPage;
+			else if(LOWORD(wParam)==SB_PAGEDOWN) i=si.nPage;
+			else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-si.nPos;
+			else i=0;
+			GetClientRect(hwnd,&rc);
+			if(message==WM_VSCROLL)
+				i=max(-si.nPos,min(i,si.nMax-rc.bottom-si.nPos));
+			else
+				i=max(-si.nPos,min(i,si.nMax-rc.right-si.nPos));
+			if(i!=0){
+				si.nPos+=i;
+				SetScrollInfo(hwnd,fnBar,&si,1);
+
+				InvalidateRect(hwnd,NULL,0);
+			}
+			return 0;
+		case WM_DESTROY:
+			DeleteDC(memdc);
+			DeleteObject(hMemBmp);
+			return 0;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
+BOOL CALLBACK DlgPreview(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	static HWND hPreview;
+	char temporary[255];
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(GetDesktopWindow(),hwnd);
+
+			hPreview=CreateWindowEx(WS_EX_STATICEDGE,"PreviewWindow",NULL,
+				WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL,
+				0,0,0,0,
+				hwnd,0,hInst,0);
+
+			RECT rc;
+			GetClientRect(hwnd,&rc);
+			SetWindowPos(hwnd,NULL,0,0,rc.right,rc.bottom,SWP_NOMOVE);
+
+			iPreviewNowPage=0;
+
+			SetDlgItemText(hwnd,IDC_FONT,pobj_nv->lfPrint.lfFaceName);
+
+			//ページ番号を表示するかどうか
+			if(pobj_nv->bShowPageNum) SendDlgItemMessage(hwnd,IDC_SHOWPAGENUM,BM_SETCHECK,BST_CHECKED,0);
+			SendMessage(hwnd,WM_COMMAND,IDC_SHOWPAGENUM,0);
+
+			//ページ番号文字列
+			SetDlgItemText(hwnd,IDC_PAGESTR,pobj_nv->szPageStr);
+
+			//拡大・縮小アイコンを表示
+			SendDlgItemMessage(hwnd,IDC_ZOOMOUT,BM_SETIMAGE,IMAGE_ICON ,
+				(LPARAM)LoadImage(hResInst,MAKEINTRESOURCE(IDI_ZOOMOUT),IMAGE_ICON,16,16,LR_SHARED));
+			SendDlgItemMessage(hwnd,IDC_ZOOMIN,BM_SETIMAGE,IMAGE_ICON ,
+				(LPARAM)LoadImage(hResInst,MAKEINTRESOURCE(IDI_ZOOMIN),IMAGE_ICON,16,16,LR_SHARED));
+			iZoomNowPage=ZOOM_INIT;
+
+			sprintf(temporary,"%d%%",array_Zoom[iZoomNowPage]);
+			SetDlgItemText(hwnd,IDC_ZOOMRATIO,temporary);
+
+			SendMessage(hPreview,WM_RESETPREVIEW,0,0);
+
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+
+				case IDC_PREV:
+					iPreviewNowPage--;
+					SendMessage(hPreview,WM_RESETPREVIEW,0,0);
+					return 1;
+				case IDC_NEXT:
+					iPreviewNowPage++;
+					SendMessage(hPreview,WM_RESETPREVIEW,0,0);
+					return 1;
+
+				case IDC_ZOOMOUT:
+				case IDC_ZOOMIN:
+					if(LOWORD(wParam)==IDC_ZOOMOUT)
+						iZoomNowPage++;
+					if(LOWORD(wParam)==IDC_ZOOMIN)
+						iZoomNowPage--;
+					SendMessage(hPreview,WM_RESETPREVIEW,0,0);
+
+					sprintf(temporary,"%d%%",array_Zoom[iZoomNowPage]);
+					SetDlgItemText(hwnd,IDC_ZOOMRATIO,temporary);
+					return 1;
+
+				case IDC_PRINT:
+					Printout();
+					return 1;
+
+				case IDC_PAGESET:
+					if(obj_Page.SetupDlg()){
+						//再描画
+						SendMessage(hPreview,WM_RESETPREVIEW,0,0);
+					}
+					return 1;
+
+				case IDC_FONT:
+					int iPointSize;
+					LOGFONT temp_lf;
+					temp_lf=pobj_nv->lfPrint;
+					if(!SetFontDialog(hwnd,&temp_lf,0,&iPointSize)) return 1;
+					pobj_nv->lfPrint=temp_lf;
+					pobj_nv->iPrintFontPointSize=iPointSize;
+
+					SetDlgItemText(hwnd,IDC_FONT,pobj_nv->lfPrint.lfFaceName);
+
+					//再描画
+					SendMessage(hPreview,WM_RESETPREVIEW,0,0);
+					return 1;
+
+				case IDC_SHOWPAGENUM:
+					//ページ番号を表示するかどうか
+					if(SendDlgItemMessage(hwnd,IDC_SHOWPAGENUM,BM_GETCHECK,0,0)){
+						EnableWindow(GetDlgItem(hwnd,IDC_PAGESTR),1);
+						pobj_nv->bShowPageNum=1;
+					}
+					else{
+						EnableWindow(GetDlgItem(hwnd,IDC_PAGESTR),0);
+						pobj_nv->bShowPageNum=0;
+					}
+					SendMessage(hPreview,WM_RESETPREVIEW,0,0);
+					return 1;
+
+				case IDC_PAGESTR:
+					//ページ番号文字列
+					GetDlgItemText(hwnd,IDC_PAGESTR,pobj_nv->szPageStr,255);
+					return 1;
+			}
+			return 0;
+
+		case WM_SIZE:
+			MoveWindow(hPreview,
+				140,40,
+				LOWORD(lParam)-155,
+				HIWORD(lParam)-55,0);
+			InvalidateRect(hwnd,NULL,0);
+			return 0;
+
+		case WM_DESTROY:
+			DestroyWindow(hPreview);
+			return 0;
+	}
+	return 0;
+}
+
+void Preview(void){
+	DialogBox(hResInst,MAKEINTRESOURCE(IDD_PREVIEW),hOwner,DlgPreview);
+}
+
+
+void Printout(void){
+	int WndNum;
+	WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+	//印刷ダイアログ
+	PRINTDLG pd;
+	memset(&pd,0,sizeof(PRINTDLG));
+	pd.lStructSize=sizeof(PRINTDLG);
+	pd.hwndOwner=hOwner;
+	pd.Flags=PD_ALLPAGES | PD_RETURNDC | PD_USEDEVMODECOPIESANDCOLLATE | PD_NOSELECTION | PD_NOPAGENUMS | PD_HIDEPRINTTOFILE;
+	pd.nFromPage=1;
+	pd.nToPage=1;
+	pd.nMinPage=1;
+	pd.nMaxPage=1;
+	pd.nCopies=1;
+	if(PrintDlg(&pd)==0){
+		return;
+	}
+
+	//印刷ドキュメントをスタート
+	DOCINFO di;
+	memset(&di,0,sizeof(DOCINFO));
+	di.cbSize=sizeof(DOCINFO);
+	di.lpszDocName=MdiInfo[WndNum].title;
+	if(StartDoc(pd.hDC,&di)==0){
+		MessageBox(hOwner,"印刷できません。プリンターの状況を確認してください。",APPLICATION_NAME,MB_OK | MB_ICONEXCLAMATION);
+		return;
+	}
+
+	//紙へ描画
+	DrawPage(pd.hDC,0);
+
+	//印刷ドキュメントを終了
+	EndDoc(pd.hDC);
+
+	DeleteDC(pd.hDC);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/ProjectControl.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/ProjectControl.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/ProjectControl.cpp	(revision 178)
@@ -0,0 +1,2455 @@
+#include "Common.h"
+
+#if defined(JPN)
+//日本語
+#include "pj_msg_jpn.h"
+#else
+//英語
+#include "pj_msg_eng.h"
+#endif
+
+HWND hProjectViewTab;
+HWND hProcedureTreeView,hMaterialTreeView;
+HIMAGELIST hProcedureTreeViewImageList,hMaterialTreeViewImageList;
+WNDPROC OldProcedureTreeViewProc,OldMaterialTreeViewProc;
+WNDPROC OldTabProc;
+
+LRESULT CALLBACK ProcedureTreeViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	if(message==WM_CHAR&&wParam==VK_RETURN){
+		SendMessage(hProjectViewTab,WM_COMMAND,IDM_PROCEDURETREE_SHOW,0);
+		//デフォルトのメッセージ処理をするとビープ音がしてしまうので避ける
+		return 0;
+	}
+	else if(message==WM_LBUTTONDBLCLK){
+		SendMessage(hProjectViewTab,WM_COMMAND,IDM_PROCEDURETREE_SHOW,0);
+		return 0;
+	}
+	return CallWindowProc(OldProcedureTreeViewProc,hwnd,message,wParam,lParam);
+}
+LRESULT CALLBACK MaterialTreeViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	if(message==WM_CHAR&&wParam==VK_RETURN){
+		SendMessage(hProjectViewTab,WM_COMMAND,IDM_MATERIALTREE_OPEN,0);
+		//デフォルトのメッセージ処理をするとビープ音がしてしまうので避ける
+		return 0;
+	}
+	if(message==WM_KEYDOWN&&wParam==VK_DELETE) SendMessage(hProjectViewTab,WM_COMMAND,IDM_MATERIALTREE_DELETE,0);
+	return CallWindowProc(OldMaterialTreeViewProc,hwnd,message,wParam,lParam);
+}
+LRESULT CALLBACK TabProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern LPSTR DefFileFilter;
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,WndNum;
+	char str[MAX_PATH],temporary[MAX_PATH];
+	HWND hTree,hChild;
+	HTREEITEM hTreeItem,hTreeItem2;
+	TV_HITTESTINFO tvHitTestInfo;
+	TVITEM tvItem;
+
+	switch(message){
+		case WM_CONTEXTMENU:
+			i=TabCtrl_GetCurSel(hwnd);
+			if(i==0){
+				//ファイルツリー
+				POINT pos;
+				pos.x=LOWORD(lParam);
+				pos.y=HIWORD(lParam);
+				pobj_FileTree->ContextMenu(&pos);
+				return 0;
+			}
+			else if(i==1) hTree=hProcedureTreeView;
+			else if(i==2) hTree=hMaterialTreeView;
+			tvHitTestInfo.pt.x=LOWORD(lParam);
+			tvHitTestInfo.pt.y=HIWORD(lParam);
+			ScreenToClient(hTree,&tvHitTestInfo.pt);
+			hTreeItem=TreeView_HitTest(hTree,&tvHitTestInfo);
+			if(hTreeItem){
+				TreeView_SelectItem(hTree,hTreeItem);
+				if(i==1){
+					extern HMENU hProcedureTreeMenuBase;
+					if(TreeView_GetRoot(hTree)!=hTreeItem)
+						TrackPopupMenu(GetSubMenu(hProcedureTreeMenuBase,1),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+				}
+				else if(i==2){
+					extern HMENU hMaterialTreeMenuBase;
+					hTreeItem2=TreeView_GetRoot(hTree);
+					for(i2=0;;i2++){
+						if(hTreeItem2==hTreeItem) break;
+						hTreeItem2=TreeView_GetNextSibling(hTree,hTreeItem2);
+						if(!hTreeItem2) break;
+					}
+					if(hTreeItem2){
+						if(i2==0)
+							TrackPopupMenu(GetSubMenu(hMaterialTreeMenuBase,0),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+						else if(i2==1)
+							TrackPopupMenu(GetSubMenu(hMaterialTreeMenuBase,2),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+						else if(i2==2)
+							TrackPopupMenu(GetSubMenu(hMaterialTreeMenuBase,4),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+						else if(i2==3)
+							TrackPopupMenu(GetSubMenu(hMaterialTreeMenuBase,6),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+						else if(i2==4)
+							TrackPopupMenu(GetSubMenu(hMaterialTreeMenuBase,8),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+					}
+					else{
+						hTreeItem=TreeView_GetNextItem(hTree,hTreeItem,TVGN_PARENT);
+						hTreeItem2=TreeView_GetRoot(hTree);
+						for(i2=0;;i2++){
+							if(hTreeItem2==hTreeItem) break;
+							hTreeItem2=TreeView_GetNextSibling(hTree,hTreeItem2);
+							if(!hTreeItem2) break;
+						}
+						if(hTreeItem2){
+							if(i2==0)
+								TrackPopupMenu(GetSubMenu(hMaterialTreeMenuBase,1),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+							else if(i2==1)
+								TrackPopupMenu(GetSubMenu(hMaterialTreeMenuBase,3),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+							else if(i2==2)
+								TrackPopupMenu(GetSubMenu(hMaterialTreeMenuBase,5),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+							else if(i2==3)
+								TrackPopupMenu(GetSubMenu(hMaterialTreeMenuBase,7),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+							else if(i2==4)
+								TrackPopupMenu(GetSubMenu(hMaterialTreeMenuBase,9),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+						}
+					}
+				}
+			}
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+
+				case IDM_PROCEDURETREE_SHOW:
+					extern BOOL bSearchingClasses;
+					if(bSearchingClasses){
+						pobj_ClassTreeView->bShowSwitch=1;
+						break;
+					}
+
+					hTreeItem=TreeView_GetSelection(hProcedureTreeView);
+					for(i=0;i<pobj_ClassTreeView->NumberOfProcedures;i++){
+						if(pobj_ClassTreeView->pProcInfo[i].hTreeItem==hTreeItem){
+
+							if( ProjectInfo.name[0] ){
+								// 対象ファイルを開く
+								lstrcpy(temporary,
+									ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[pobj_ClassTreeView->pProcInfo[i].FileNum]->m_path);
+								GetFullPath(temporary,ProjectInfo.dir);
+								hChild=OpenFileWithExtension(temporary);
+							}
+							else{
+								hChild = GetWindow(hClient,GW_CHILD);
+							}
+
+							//プロシージャの行を選択する
+							//ResetScrollbarが再描画時に呼び出されるので、再描画する
+							WndNum=GetWndNum(hChild);
+							InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->hEdit,NULL,0);
+							UpdateWindow(MdiInfo[WndNum].pMdiTextEdit->hEdit);
+							TextEdit_SelectOneLine(WndNum,pobj_ClassTreeView->pProcInfo[i].code_pos,TRUE);
+
+							//タイマーをセット
+							// ※フォーカスをエディタにセットするため
+							// ※タイミングを遅らせてSetFocusを実行する必要あり
+							SetTimer(hwnd,100,10,NULL);
+
+							break;
+						}
+					}
+
+					break;
+
+				case IDM_MATERIALTREE_INSERTCURSOR:
+					Project_CursorResInsert();
+					break;
+				case IDM_MATERIALTREE_INSERTBITMAP:
+					Project_BitmapResInsert();
+					break;
+				case IDM_MATERIALTREE_INSERTICON:
+					Project_IconResInsert();
+					break;
+				case IDM_MATERIALTREE_INSERTMENU:
+					Project_Menu_Insert();
+					break;
+				case IDM_MATERIALTREE_INSERTWINDOW:
+					Project_Window_Insert();
+					break;
+				case IDM_MATERIALTREE_OPEN:
+					hTreeItem=TreeView_GetSelection(hMaterialTreeView);
+					for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+						if(ProjectInfo.pWindowInfo[i].hTreeItem==hTreeItem){
+							NewRadWindow(i);
+							break;
+						}
+					}
+					for(i=0;i<ProjectInfo.NumberOfMenu;i++){
+						if(ProjectInfo.pMenuInfo[i].hTreeItem==hTreeItem){
+							NewMenuWindow(&ProjectInfo.pMenuInfo[i]);
+							break;
+						}
+					}
+					for(i=0;i<ProjectInfo.res.NumberOfIconRes;i++){
+						if(ProjectInfo.res.pIconResInfo[i].hTreeItem==hTreeItem){
+							lstrcpy(temporary,ProjectInfo.res.pIconResInfo[i].path);
+							GetFullPath(temporary,ProjectInfo.dir);
+							NewIconEditWindow(temporary);
+							break;
+						}
+					}
+					break;
+				case IDM_MATERIALTREE_DELETE:
+					hTreeItem=TreeView_GetSelection(hMaterialTreeView);
+					for(i=0;i<ProjectInfo.res.NumberOfCursorRes;i++){
+						if(ProjectInfo.res.pCursorResInfo[i].hTreeItem==hTreeItem){
+
+							//"%s カーソルをプロジェクトから削除します。よろしいですか？"
+							sprintf(str,STRING_PJ_CHECK_DELETECURSOR,ProjectInfo.res.pCursorResInfo[i].IdName);
+							if(IDCANCEL==MessageBox(hOwner,str,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
+
+							Project_Cursor_Delete(i);
+							break;
+						}
+					}
+					for(i=0;i<ProjectInfo.res.NumberOfBitmapRes;i++){
+						if(ProjectInfo.res.pBitmapResInfo[i].hTreeItem==hTreeItem){
+
+							//"%s ビットマップをプロジェクトから削除します。よろしいですか？"
+							sprintf(str,STRING_PJ_CHECK_DELETEBITMAP,ProjectInfo.res.pBitmapResInfo[i].IdName);
+							if(IDCANCEL==MessageBox(hOwner,str,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
+
+							Project_Bitmap_Delete(i);
+							break;
+						}
+					}
+					for(i=0;i<ProjectInfo.res.NumberOfIconRes;i++){
+						if(ProjectInfo.res.pIconResInfo[i].hTreeItem==hTreeItem){
+
+							//"%s アイコンをプロジェクトから削除します。よろしいですか？"
+							sprintf(str,STRING_PJ_CHECK_DELETEICON,ProjectInfo.res.pIconResInfo[i].IdName);
+							if(IDCANCEL==MessageBox(hOwner,str,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
+
+							Project_Icon_Delete(i);
+							break;
+						}
+					}
+					for(i=0;i<ProjectInfo.NumberOfMenu;i++){
+						if(ProjectInfo.pMenuInfo[i].hTreeItem==hTreeItem){
+
+							//"%s メニューをプロジェクトから削除します。よろしいですか？"
+							sprintf(str,STRING_PJ_CHECK_DELETEMENU,ProjectInfo.pMenuInfo[i].IdName);
+							if(IDCANCEL==MessageBox(hOwner,str,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
+
+							Project_Menu_Delete(i);
+							break;
+						}
+					}
+					for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+						if(ProjectInfo.pWindowInfo[i].hTreeItem==hTreeItem){
+
+							//"%s ウィンドウをプロジェクトから削除します。よろしいですか？"
+							sprintf(str,STRING_PJ_CHECK_DELETEWINDOW,ProjectInfo.pWindowInfo[i].name);
+							if(IDCANCEL==MessageBox(hOwner,str,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
+
+							Project_Window_Delete(i);
+							break;
+						}
+					}
+					break;
+				case IDM_MENUTREE_RENAMEID:
+					extern char NewIdName[MAX_PATH];
+					hTreeItem=TreeView_GetSelection(hMaterialTreeView);
+					for(i=0;i<ProjectInfo.res.NumberOfCursorRes;i++){
+						if(ProjectInfo.res.pCursorResInfo[i].hTreeItem==hTreeItem){
+							Project_Cursor_RenameID(i);
+							break;
+						}
+					}
+					for(i=0;i<ProjectInfo.res.NumberOfBitmapRes;i++){
+						if(ProjectInfo.res.pBitmapResInfo[i].hTreeItem==hTreeItem){
+							Project_Bitmap_RenameID(i);
+							break;
+						}
+					}
+					for(i=0;i<ProjectInfo.res.NumberOfIconRes;i++){
+						if(ProjectInfo.res.pIconResInfo[i].hTreeItem==hTreeItem){
+							Project_Icon_RenameID(i);
+						}
+					}
+					for(i=0;i<ProjectInfo.NumberOfMenu;i++){
+						if(ProjectInfo.pMenuInfo[i].hTreeItem==hTreeItem){
+							if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,DlgProject_MenuID_Input,(long)ProjectInfo.pMenuInfo[i].IdName)) break;
+
+							//重複チェック
+							for(i2=0;i2<ProjectInfo.NumberOfMenu;i2++){
+								if(i2==i) continue;
+								if(lstrcmp(NewIdName,ProjectInfo.pMenuInfo[i2].IdName)==0){
+									//"ID \"%s\" は既にプロジェクト内に存在します。"
+									sprintf(temporary,STRING_DUPLICATIONERROR_ID_IN_PROJECT,NewIdName);
+									MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+									return 0;
+								}
+							}
+
+							HeapDefaultFree(ProjectInfo.pMenuInfo[i].IdName);
+							ProjectInfo.pMenuInfo[i].IdName=(char *)HeapAlloc(hHeap,0,lstrlen(NewIdName)+1);
+							lstrcpy(ProjectInfo.pMenuInfo[i].IdName,NewIdName);
+
+							tvItem.hItem=hTreeItem;
+							tvItem.mask=TVIF_TEXT;
+							tvItem.pszText=ProjectInfo.pMenuInfo[i].IdName;
+							tvItem.cchTextMax=lstrlen(ProjectInfo.pMenuInfo[i].IdName)+1;
+							TreeView_SetItem(hMaterialTreeView,&tvItem);
+
+							ProjectInfo.ModifyOfMaterial=1;
+
+							TreeView_SortChildren(hMaterialTreeView,
+								TreeView_GetParent(hMaterialTreeView,hTreeItem),
+								0);
+							break;
+						}
+					}
+					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){
+							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;
+							tvItem.mask=TVIF_TEXT;
+							tvItem.pszText=ProjectInfo.res.pIconResInfo[1].IdName;
+							tvItem.cchTextMax=lstrlen(ProjectInfo.res.pIconResInfo[1].IdName)+1;
+							TreeView_SetItem(hMaterialTreeView,&tvItem);
+
+							tvItem.hItem=ProjectInfo.res.pIconResInfo[0].hTreeItem;
+							tvItem.mask=TVIF_TEXT;
+							sprintf(temporary,"%s (Main)",ProjectInfo.res.pIconResInfo[0].IdName);
+							tvItem.pszText=temporary;
+							tvItem.cchTextMax=lstrlen(temporary)+1;
+							TreeView_SetItem(hMaterialTreeView,&tvItem);
+
+							ProjectInfo.ModifuOfResource=1;
+							break;
+						}
+					}
+					break;
+			}
+			break;
+		case WM_TIMER:
+			KillTimer(hwnd,wParam);
+
+			//フォーカスをエディタにセット
+			SetFocus(GetWindow(GetWindow(hClient,GW_CHILD),GW_CHILD));
+			break;
+		case WM_NOTIFY:
+			NMHDR *hdr;
+			hdr=(NMHDR *)lParam;
+			if(hdr->code==NM_DBLCLK){
+				if(hdr->hwndFrom==hProcedureTreeView) SendMessage(hwnd,WM_COMMAND,IDM_PROCEDURETREE_SHOW,0);
+				else if(hdr->hwndFrom==hMaterialTreeView) SendMessage(hwnd,WM_COMMAND,IDM_MATERIALTREE_OPEN,0);
+			}
+			if(hdr->code==TVN_ITEMEXPANDEDW||hdr->code==TVN_ITEMEXPANDED){
+				NMTREEVIEW *nmTreeView;
+				TVITEM tvItem;
+				nmTreeView=(NMTREEVIEW *)lParam;
+				tvItem.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+				tvItem.hItem=nmTreeView->itemNew.hItem;
+				TreeView_GetItem(nmTreeView->hdr.hwndFrom,&tvItem);
+				if(tvItem.iImage==0||tvItem.iImage==1){
+					if(nmTreeView->action==TVE_EXPAND){
+						tvItem.iImage=1;
+						tvItem.iSelectedImage=1;
+					}
+					else if(nmTreeView->action==TVE_COLLAPSE){
+						tvItem.iImage=0;
+						tvItem.iSelectedImage=0;
+					}
+					tvItem.hItem=nmTreeView->itemNew.hItem;
+					TreeView_SetItem(nmTreeView->hdr.hwndFrom,&tvItem);
+				}
+			}
+			break;
+	}
+	return CallWindowProc(OldTabProc,hwnd,message,wParam,lParam);
+}
+void ResizeProjectView_ToolWindow(void){
+	extern HWND hProjectView_ToolWindow;
+	RECT rect;
+	GetClientRect(hProjectView_ToolWindow,&rect);
+	SendMessage(hProjectView_ToolWindow,WM_SIZE,0,MAKELONG(rect.right,rect.bottom));
+}
+LRESULT CALLBACK ProjectView_ToolWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HWND hProjectView;
+	switch(message){
+		case WM_SIZE:
+			MoveWindow(hProjectView,0,0,
+				LOWORD(lParam),
+				HIWORD(lParam),1);
+			return 0;
+		case WM_CLOSE:
+			SendMessage(hOwner,WM_COMMAND,IDM_PROJECTVIEW,0);
+			return 0;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
+void ShowFileView(){
+	TabCtrl_SetCurSel(hProjectViewTab,0);
+	ShowWindow(pobj_FileTree->hTree,SW_SHOW);
+	ShowWindow(hProcedureTreeView,SW_HIDE);
+	ShowWindow(hMaterialTreeView,SW_HIDE);
+}
+void ShowClassView(){
+	TabCtrl_SetCurSel(hProjectViewTab,1);
+	ShowWindow(pobj_FileTree->hTree,SW_HIDE);
+	ShowWindow(hMaterialTreeView,SW_HIDE);
+	ShowWindow(hProcedureTreeView,SW_SHOW);
+}
+void ShowMaterialView(){
+	TabCtrl_SetCurSel(hProjectViewTab,2);
+	ShowWindow(pobj_FileTree->hTree,SW_HIDE);
+	ShowWindow(hProcedureTreeView,SW_HIDE);
+	ShowWindow(hMaterialTreeView,SW_SHOW);
+}
+LRESULT CALLBACK ProjectViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HINSTANCE hInst,hResInst;
+	extern PROJECTINFO ProjectInfo;
+	extern HWND hTabOfProjectView;
+	extern HFONT hStatusFont;
+	extern HWND hProjectView_ToolWindow;
+	RECT rect;
+	HWND hButton;
+
+	switch(message){
+		case WM_CREATE:
+			hProjectViewTab=CreateWindow(WC_TABCONTROL,NULL,
+				WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE,
+				0,0,0,0,hwnd,0,hInst,0);
+			SendMessage(hProjectViewTab,WM_SETFONT,(long)hStatusFont,0);
+
+			hButton=CreateWindow("BUTTON","↓",WS_CHILD|WS_VISIBLE,
+				0,0,30,13,
+				hwnd,(HMENU)IDC_CLIP,hInst,0);
+			SendMessage(hButton,WM_SETFONT,(long)hStatusFont,0);
+
+			OldTabProc=(WNDPROC)GetWindowLong(hProjectViewTab,GWL_WNDPROC);
+			SetWindowLong(hProjectViewTab,GWL_WNDPROC,(long)TabProc);
+
+			//タブを設定
+			TC_ITEM tcItem;
+			tcItem.mask=TCIF_TEXT;
+			tcItem.pszText="File";
+			TabCtrl_InsertItem(hProjectViewTab,0,&tcItem);
+			tcItem.mask=TCIF_TEXT;
+			tcItem.pszText="Class";
+			TabCtrl_InsertItem(hProjectViewTab,1,&tcItem);
+			tcItem.mask=TCIF_TEXT;
+			tcItem.pszText="Material";
+			TabCtrl_InsertItem(hProjectViewTab,2,&tcItem);
+
+			//ファイルツリービューを作成
+			pobj_FileTree=new CFileTree(hProjectViewTab);
+
+			//クラスツリービューを作成
+			hProcedureTreeView=CreateWindowEx(WS_EX_CLIENTEDGE,WC_TREEVIEW,"",
+				WS_CHILD|TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT|TVS_SHOWSELALWAYS,
+				0,0,0,0,
+				hProjectViewTab,0,hInst,0);
+			OldProcedureTreeViewProc=(WNDPROC)GetWindowLong(hProcedureTreeView,GWL_WNDPROC);
+			SetWindowLong(hProcedureTreeView,GWL_WNDPROC,(long)ProcedureTreeViewProc);
+			//イメージリスト読み込み、設定
+			hProcedureTreeViewImageList=ImageList_Create(16,16,ILC_COLOR24|ILC_MASK,8,0);
+			ImageList_AddIcon(hProcedureTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FOLDER_CLOSE)));
+			ImageList_AddIcon(hProcedureTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FOLDER_OPEN)));
+			ImageList_AddIcon(hProcedureTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_PROCEDURE)));
+			ImageList_AddIcon(hProcedureTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_PROGRAM_FOLDER)));
+			ImageList_AddIcon(hProcedureTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_MEMBER_PUBLIC_VARIABLE)));
+			ImageList_AddIcon(hProcedureTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_MEMBER_PUBLIC_FUNCTION)));
+			ImageList_AddIcon(hProcedureTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_MEMBER_PRIVATE_VARIABLE)));
+			ImageList_AddIcon(hProcedureTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_MEMBER_PRIVATE_FUNCTION)));
+			TreeView_SetImageList(hProcedureTreeView,hProcedureTreeViewImageList,TVSIL_NORMAL);
+
+			//マテリアルツリービューを作成
+			hMaterialTreeView=CreateWindowEx(WS_EX_CLIENTEDGE,WC_TREEVIEW,"",
+				WS_CHILD|TVS_HASLINES|TVS_HASBUTTONS|TVS_LINESATROOT|TVS_SHOWSELALWAYS,
+				0,0,0,0,
+				hProjectViewTab,0,hInst,0);
+			OldMaterialTreeViewProc=(WNDPROC)GetWindowLong(hMaterialTreeView,GWL_WNDPROC);
+			SetWindowLong(hMaterialTreeView,GWL_WNDPROC,(long)MaterialTreeViewProc);
+			//イメージリスト読み込み、設定
+			hMaterialTreeViewImageList=ImageList_Create(16,16,ILC_COLOR24|ILC_MASK,3,0);
+			ImageList_AddIcon(hMaterialTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FOLDER_CLOSE)));
+			ImageList_AddIcon(hMaterialTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FOLDER_OPEN)));
+			ImageList_AddIcon(hMaterialTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_WINDOW)));
+			ImageList_AddIcon(hMaterialTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_MENU)));
+			ImageList_AddIcon(hMaterialTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FILE_ICON)));
+			ImageList_AddIcon(hMaterialTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FILE_BMP)));
+			ImageList_AddIcon(hMaterialTreeViewImageList,LoadIcon(hResInst,MAKEINTRESOURCE(IDI_FILE_CURSOR)));
+			TreeView_SetImageList(hMaterialTreeView,hMaterialTreeViewImageList,TVSIL_NORMAL);
+
+			ShowWindow(pobj_FileTree->hTree,SW_SHOW);
+			GetClientRect(hwnd,&rect);
+			SendMessage(hwnd,WM_SIZE,0,MAKELONG(rect.right,rect.bottom));
+			return 0;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_CLIP:
+					if(pobj_nv->bClipProjectView==0){
+						pobj_nv->bClipProjectView=1;
+
+						SetWindowLong(hwnd,GWL_EXSTYLE,WS_EX_STATICEDGE);
+						SetParent(hwnd,hOwner);
+						ResizeOwnerWnd();
+
+						ShowWindow(hProjectView_ToolWindow,SW_HIDE);
+					}
+					else{
+						pobj_nv->bClipProjectView=0;
+
+						SetWindowLong(hwnd,GWL_EXSTYLE,0);
+
+						SetParent(hwnd,hProjectView_ToolWindow);
+
+						ResizeOwnerWnd();
+						ResizeProjectView_ToolWindow();
+
+						ShowWindow(hProjectView_ToolWindow,SW_SHOW);
+					}
+					return 0;
+			}
+			break;
+		case WM_NOTIFY:
+			NMHDR *hdr;
+			hdr=(NMHDR *)lParam;
+			if(hdr->hwndFrom==hProjectViewTab&&hdr->code==TCN_SELCHANGE){
+				switch( TabCtrl_GetCurSel(hProjectViewTab) ){
+					case 0:
+						ShowFileView();
+						break;
+					case 1:
+						ShowClassView();
+						break;
+					case 2:
+						ShowMaterialView();
+						break;
+				}
+			}
+			return 0;
+		case WM_PAINT:
+			PAINTSTRUCT ps;
+			HDC hdc;
+			HFONT hOldFont;
+			SIZE size;
+			HBRUSH hBrush,hOldBrush;
+			HPEN hPen,hOldPen;
+			char temporary[MAX_PATH];
+
+			if(pobj_nv->bClipProjectView==0) break;
+
+			hBrush=CreateSolidBrush(GetSysColor(COLOR_3DSHADOW));
+			hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DSHADOW));
+
+			hdc=BeginPaint(hwnd,&ps);
+
+			hOldFont=(HFONT)SelectObject(hdc,hStatusFont);
+			if( ProjectInfo.name[0] ){
+				sprintf(temporary,"%s \'%s\'",STRING_PROJECT,ProjectInfo.name);
+			}
+			else{
+				lstrcpy( temporary, "現在のドキュメント" );
+			}
+
+			GetTextExtentPoint32(hdc,temporary,lstrlen(temporary),&size);
+			GetClientRect(hwnd,&rect);
+			rect.left++;
+			rect.top++;
+			rect.right--;
+			rect.bottom=size.cy+2;
+
+			hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+			hOldPen=(HPEN)SelectObject(hdc,hPen);
+			Rectangle(hdc,rect.left,rect.top,rect.right,rect.bottom);
+			SelectObject(hdc,hOldBrush);
+			SelectObject(hdc,hPen);
+
+			rect.top++;
+			rect.bottom--;
+			SetBkMode(hdc,OPAQUE);
+			SetBkColor(hdc,GetSysColor(COLOR_3DSHADOW));
+			SetTextColor(hdc,GetSysColor(COLOR_3DHILIGHT));
+			DrawText(hdc,temporary,lstrlen(temporary),&rect,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
+
+			EndPaint(hwnd,&ps);
+
+			DeleteObject(hBrush);
+			DeleteObject(hPen);
+			return 0;
+		case WM_SIZE:
+			if(pobj_nv->bClipProjectView){
+				MoveWindow(hProjectViewTab,
+					LEVER_THICK,
+					LEVER_THICK+11,
+					LOWORD(lParam)-LEVER_THICK*2,
+					HIWORD(lParam)-LEVER_THICK*2-21,1);
+
+				GetClientRect(hProjectViewTab,&rect);
+				TabCtrl_AdjustRect(hProjectViewTab,FALSE,&rect);
+				rect.left-=2;
+				rect.right++;
+				rect.bottom++;
+
+				pobj_FileTree->resize(rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top);
+				MoveWindow(hProcedureTreeView,
+					rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,1);
+				MoveWindow(hMaterialTreeView,
+					rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,1);
+
+				GetClientRect(GetDlgItem(hwnd,IDC_CLIP),&rect);
+				MoveWindow(GetDlgItem(hwnd,IDC_CLIP),LOWORD(lParam)-rect.right,HIWORD(lParam)-rect.bottom,rect.right,rect.bottom,1);
+				InvalidateRect(GetDlgItem(hwnd,IDC_CLIP),NULL,0);
+			}
+			else{
+				MoveWindow(hProjectViewTab,0,0,
+					LOWORD(lParam),
+					HIWORD(lParam)-15,1);
+
+				GetClientRect(hProjectViewTab,&rect);
+				TabCtrl_AdjustRect(hProjectViewTab,FALSE,&rect);
+
+				pobj_FileTree->resize(rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top);
+				MoveWindow(hProcedureTreeView,
+					rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,1);
+				MoveWindow(hMaterialTreeView,
+					rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,1);
+
+				GetClientRect(GetDlgItem(hwnd,IDC_CLIP),&rect);
+				MoveWindow(GetDlgItem(hwnd,IDC_CLIP),LOWORD(lParam)-rect.right,HIWORD(lParam)-rect.bottom,rect.right,rect.bottom,1);
+			}
+			return 0;
+		case WM_CLOSE:
+			SendMessage(hOwner,WM_COMMAND,IDM_PROJECTVIEW,0);
+			return 0;
+		case WM_DESTROY:
+			delete pobj_FileTree;
+			ImageList_Destroy(hProcedureTreeViewImageList);
+			ImageList_Destroy(hMaterialTreeViewImageList);
+			return 0;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
+
+void Project_File_Insert(char *path){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	char temporary[MAX_PATH],temp2[MAX_PATH];
+
+	GetRelationalPath(path,ProjectInfo.dir);
+
+	//重複チェック
+	if(ProjectInfo.pobj_DBFileInfo->dupli_check(path)){
+		//"\"%s\" ファイルは既にプロジェクト内に存在します。"
+		sprintf(temporary,STRING_DUPLICATIONERROR_FILE_IN_PROJECT,path);
+		MessageBox(hOwner,temporary,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+		return;
+	}
+
+
+	//////////////////////
+	//ツリービューに追加
+	HTREEITEM hTreeItem;
+	_splitpath(path,0,0,temporary,temp2);
+	lstrcat(temporary,temp2);
+	hTreeItem=pobj_FileTree->insert(temporary);
+
+
+	//ProjectInfo.ppobj_DBFileInfoオブジェクトに追加
+	ProjectInfo.pobj_DBFileInfo->add(path,hTreeItem);
+
+
+	ProjectInfo.modify=1;
+
+	//ファイル操作によるクラスビューの再表示
+	ResetClassTree(-1);
+}
+void Project_File_Delete(HTREEITEM hTreeItem){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+
+	if(ProjectInfo.pobj_DBFileInfo->IsMainFile(hTreeItem)){
+		//"このファイルはプロジェクトのメイン ファイルです。プロジェクト内から削除することはできません。"
+		MessageBox(hOwner,STRING_ERROR_CANT_MAINFILE,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+		return;
+	}
+
+	//ツリービューから削除
+	TreeView_DeleteItem(pobj_FileTree->hTree,hTreeItem);
+
+	//ProjectInfo.pobj_DBFileInfoオブジェクトから削除
+	ProjectInfo.pobj_DBFileInfo->del(hTreeItem);
+
+	ProjectInfo.modify=1;
+
+	//ファイル操作によるクラスビューの再表示
+	ResetClassTree(-1);
+}
+
+void MakeNewProject(){
+	extern HANDLE hHeap;
+	extern NEWPROJECTINFO NewProjectInfo;
+	int i;
+	char buffer[GENERAL_SIZE],dir[MAX_PATH],temporary[MAX_PATH],*pTemp;
+	HANDLE hFind;
+	WIN32_FIND_DATA wfd;
+
+	//既にプロジェクトが開かれている場合は閉じる
+	extern PROJECTINFO ProjectInfo;
+	if(ProjectInfo.name[0]){
+		if(!CloseProject()) return;
+	}
+
+	//ワークディレクトリを作成
+	i=lstrlen(pobj_nv->ProjectSaveDir);
+	if(pobj_nv->ProjectSaveDir[i-1]=='\\'&&pobj_nv->ProjectSaveDir[i-2]!=':') pobj_nv->ProjectSaveDir[i-1]=0;
+	sprintf(dir,"%s\\%s\\",pobj_nv->ProjectSaveDir,NewProjectInfo.name);
+	i=0;
+	while(!(dir[i]==':'||(dir[i-1]=='\\'&&dir[i]=='\\'))) i++;
+	if(dir[i]==':') i++;
+	else{
+		i++;
+		while(dir[i]!='\\') i++;
+	}
+	for(i++;;i++){
+		if(dir[i]=='\\'){
+			lstrcpy(temporary,dir);
+			temporary[i]=0;
+			hFind=FindFirstFile(temporary,&wfd);
+			if(hFind==INVALID_HANDLE_VALUE){
+				if(!CreateDirectory(temporary,NULL)){
+					MessageBox(hOwner,"ディレクトリを作成できませんでした",APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+					return;
+				}
+			}
+			else FindClose(hFind);
+		}
+		if(dir[i]=='\0') break;
+	}
+
+
+	//////////////////////////////////////
+	// プロジェクトファイル（*.pj）を作成
+	//////////////////////////////////////
+
+	//先頭の注釈
+	lstrcpy(buffer,"\' ActiveBasic Project file.\r\n\r\n");
+	i=lstrlen(buffer);
+
+	//プロジェクトのフォーマットバージョン
+	sprintf(buffer+i,"#VERSION=%d\r\n\r\n",PROJECT_VERSION);
+	i+=lstrlen(buffer+i);
+
+	//モジュールタイプ（EXEならば0、DLLならば1）
+	if(NewProjectInfo.dwTypeID==IDC_DLL) lstrcpy(buffer+i,"#MODULETYPE=1\r\n\r\n");
+	else lstrcpy(buffer+i,"#MODULETYPE=0\r\n\r\n");
+	i+=lstrlen(buffer+i);
+
+	//プロジェクト名
+	sprintf(buffer+i,"#NAME=%s\r\n\r\n",NewProjectInfo.name);
+	i+=lstrlen(buffer+i);
+
+	lstrcpy(buffer+i,"#PLATFORM=32\r\n\r\n");
+	i+=lstrlen(buffer+i);
+
+	//RADウィンドウの数
+	if(NewProjectInfo.dwTypeID==IDC_EXE_WINDOWBASE||
+		NewProjectInfo.dwTypeID==IDC_EXE_DIRECTX)
+		lstrcpy(buffer+i,"#USEWINDOW=1\r\n\r\n");
+	else lstrcpy(buffer+i,"#USEWINDOW=0\r\n\r\n");
+	i+=lstrlen(buffer+i);
+
+	//プロジェクトオプション
+	sprintf(buffer+i,"#OPTION=&H%08x\r\n\r\n",NewProjectInfo.dwOption);
+	i+=lstrlen(buffer+i);
+
+	//出力先（Release）
+	if(NewProjectInfo.dwTypeID==IDC_DLL)
+		sprintf(buffer+i,"#OUTPUT_RELEASE=.\\%s.dll\r\n\r\n",NewProjectInfo.name);
+	else sprintf(buffer+i,"#OUTPUT_RELEASE=.\\%s.exe\r\n\r\n",NewProjectInfo.name);
+	i+=lstrlen(buffer+i);
+
+	//出力先（Debug）
+	if(NewProjectInfo.dwTypeID==IDC_DLL)
+		sprintf(buffer+i,"#OUTPUT_DEBUG=.\\%s.dll\r\n\r\n",NewProjectInfo.name);
+	else sprintf(buffer+i,"#OUTPUT_DEBUG=.\\%s_debug.exe\r\n\r\n",NewProjectInfo.name);
+	i+=lstrlen(buffer+i);
+
+	//マニフェスト
+	sprintf(buffer+i,"#MANIFEST=%s.manifest.xml\r\n\r\n",NewProjectInfo.name);
+	i+=lstrlen(buffer+i);
+
+	//デバッグ用（コマンドライン）
+	lstrcpy(buffer+i,"#DEBUG_CMD_LINE=\r\n\r\n");
+	i+=lstrlen(buffer+i);
+
+	//デバッグ用（DLL用の実行ファイル）
+	lstrcpy(buffer+i,"#DEBUG_EXE_PATH=\r\n\r\n");
+	i+=lstrlen(buffer+i);
+
+	//リソースファイル
+	lstrcpy(buffer+i,"#RESOURCE=0\r\n\r\n");
+	i+=lstrlen(buffer+i);
+
+	//ソースファイル
+	sprintf(buffer+i,"#SOURCE\r\n%s.ab\r\n",NewProjectInfo.name);
+	i+=lstrlen(buffer+i);
+	if(NewProjectInfo.dwTypeID==IDC_EXE_WINDOWBASE||
+		NewProjectInfo.dwTypeID==IDC_EXE_DIRECTX){
+		lstrcpy(buffer+i,"MainWnd.ab\r\n");
+		i+=lstrlen(buffer+i);
+	}
+	if(NewProjectInfo.dwTypeID==IDC_EXE_DIRECTX){
+		lstrcpy(buffer+i,"dx_graphics.sbp\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"dx_input.sbp\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"dx_music.sbp\r\n");
+		i+=lstrlen(buffer+i);
+	}
+
+	//保存
+	sprintf(temporary,"%s%s.pj",dir,NewProjectInfo.name);
+	if(hFind=FindFirstFile(temporary,&wfd)){
+		if(hFind!=INVALID_HANDLE_VALUE){
+			FindClose(hFind);
+
+			//"指定したディレクトリにはすでにプロジェクトが存在します。上書きしますか？"
+			if(MessageBox(hOwner,STRING_ERROR_PROJECT_OVERWRITE,APPLICATION_NAME,MB_YESNO|MB_ICONEXCLAMATION)==IDNO) return;
+		}
+	}
+	if(!WriteBuffer(temporary,buffer,i)) return;
+
+
+	///////////////////////////////////////////
+	//メインプログラムファイル（*.ab）を作成
+	if(NewProjectInfo.dwTypeID==IDC_EXE_WINDOWBASE){
+		sprintf(buffer,"#include \"%s.idx\"\r\n\r\n",NewProjectInfo.name);
+		i=lstrlen(buffer);
+		lstrcpy(buffer+i,"'---------------------------\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"'  Window Message Loop\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"'---------------------------\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"Dim msgMain As MSG, iResult As Long\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"Do\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\tiResult=GetMessage(msgMain,0,0,0)\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\tIf iResult=0 or iResult=-1 Then Exit Do\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\tTranslateMessage(msgMain)\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\tDispatchMessage(msgMain)\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"Loop\r\n\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"' Call destructores and exit process\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"End\r\n");
+		i+=lstrlen(buffer+i);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_PROMPTBASE){
+		sprintf(buffer,"#include \"%s.idx\"\r\n\r\n",NewProjectInfo.name);
+		i=lstrlen(buffer);
+		lstrcpy(buffer+i,"#N88BASIC\r\n\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"' ↓ ここからプログラムが実行されます\r\n\r\n");
+		i+=lstrlen(buffer+i);
+		if(NewProjectInfo.ShowHelloWorld){
+			lstrcpy(buffer+i,"Print \"Hello World!\"\r\n");
+			i+=lstrlen(buffer+i);
+		}
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_DOSPROMPTBASE){
+		sprintf(buffer,"#include \"%s.idx\"\r\n\r\n",NewProjectInfo.name);
+		i=lstrlen(buffer);
+		lstrcpy(buffer+i,"#console\r\n\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"' ↓ ここからプログラムが実行されます\r\n\r\n");
+		i+=lstrlen(buffer+i);
+		if(NewProjectInfo.ShowHelloWorld){
+			lstrcpy(buffer+i,"Print \"Hello World!\"\r\n");
+			i+=lstrlen(buffer+i);
+		}
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_NOBASE){
+		sprintf(buffer,"#include \"%s.idx\"\r\n\r\n",NewProjectInfo.name);
+		i=lstrlen(buffer);
+		lstrcpy(buffer+i,"' ↓ ここからプログラムが実行されます\r\n\r\n");
+		i+=lstrlen(buffer+i);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_DIRECTX){
+		sprintf(temporary,"%sSubOperation\\dx\\main_exe_directx.abp",pj_editor_Dir);
+		pTemp=ReadBuffer(temporary);
+
+		//#name#をプロジェクト名に置換
+		pTemp=PermutationWndPgmTemplate(pTemp,NewProjectInfo.name,0,0,0);
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_DLL){
+		sprintf(buffer,"#include \"%s.idx\"\r\n\r\n",NewProjectInfo.name);
+		i=lstrlen(buffer);
+		lstrcpy(buffer+i,"'-------------------------------------------------------------------\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"' メモ - このファイルには、DLLの構成要素を記述します。\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"'        （例：関数定義、グローバル変数、定数定義など）\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"'\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"'        エクスポートが必要な関数には、\"Export\" 修飾子を指定します。\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"'        （例：Function Export FuncName() As Long）\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"'-------------------------------------------------------------------\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"Function Export DllMain(hinstDLL As HINSTANCE, fdwReason As DWord, lpvReserved As VoidPtr) As Long\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\t'DLLエントリポイント\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\tSelect Case fdwReason\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\t\tCase DLL_PROCESS_ATTACH\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\t\t\t'DLLがプロセス空間にロードされた時に実行されます。\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\t\t\t_System_StartupProgram()\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\t\t\tDllMain=1\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\t\tCase DLL_PROCESS_DETACH\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\t\t\t_System_Call_Destructor_of_GlobalObject()\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\tEnd Select\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"End Function\r\n");
+		i+=lstrlen(buffer+i);
+		lstrcpy(buffer+i,"\r\n");
+		i+=lstrlen(buffer+i);
+	}
+
+	//保存
+	if(NewProjectInfo.dwTypeID==IDC_EXE_DIRECTX){
+		sprintf(temporary,"%s%s.ab",dir,NewProjectInfo.name);
+		WriteBuffer(temporary,pTemp,lstrlen(pTemp));
+
+		HeapDefaultFree(pTemp);
+	}
+	else{
+		sprintf(temporary,"%s%s.ab",dir,NewProjectInfo.name);
+		if(!WriteBuffer(temporary,buffer,i)) return;
+	}
+
+
+	/////////////////////
+	// MainWnd.abを作成
+	/////////////////////
+
+	if(NewProjectInfo.dwTypeID==IDC_EXE_WINDOWBASE){
+#if defined(JPN)
+		//日本語ファイル
+		sprintf(temporary,"%sSubOperation\\MainWnd_exe_windowbase.sbp",pj_editor_Dir);
+#else
+		//英語ファイル
+		sprintf(temporary,"%sSubOperation\\MainWnd_exe_windowbase_e.sbp",pj_editor_Dir);
+#endif
+	}
+	else if(NewProjectInfo.dwTypeID==IDC_EXE_DIRECTX)
+		sprintf(temporary,"%sSubOperation\\dx\\MainWnd_exe_directx.sbp",pj_editor_Dir);
+	else
+		temporary[0]=0;
+
+	if(temporary[0]){
+		pTemp=ReadBuffer(temporary);
+
+		//#name#をプロジェクト名に置換
+		pTemp=PermutationWndPgmTemplate(pTemp,
+			NewProjectInfo.name,
+			"MainWnd",
+			"hMainWnd",
+			"MainWndProc");
+
+		if(NewProjectInfo.ShowHelloWorld){
+			//Hello World!表示
+			i=0;
+			lstrcpy(buffer+i,"\r\nSub MainWnd_Paint(hDC As HDC)\r\n");
+			i+=lstrlen(buffer+i);
+			lstrcpy(buffer+i,"\tDim rect As RECT\r\n");
+			i+=lstrlen(buffer+i);
+			lstrcpy(buffer+i,"\tGetClientRect(hMainWnd,rect)\r\n");
+			i+=lstrlen(buffer+i);
+			lstrcpy(buffer+i,"\tDrawText(hDC,\"Hello World!\",-1,rect,DT_CENTER or DT_VCENTER or DT_SINGLELINE)\r\n");
+			i+=lstrlen(buffer+i);
+			lstrcpy(buffer+i,"End Sub\r\n");
+			i+=lstrlen(buffer+i);
+
+			pTemp=(char *)HeapReAlloc(hHeap,0,pTemp,lstrlen(pTemp)+lstrlen(buffer)+1);
+			lstrcat(pTemp,buffer);
+		}
+
+		sprintf(temporary,"%sMainWnd.ab",dir,NewProjectInfo.name);
+		WriteBuffer(temporary,pTemp,lstrlen(pTemp));
+
+		HeapDefaultFree(pTemp);
+	}
+
+
+	if(NewProjectInfo.dwTypeID==IDC_EXE_DIRECTX){
+		///////////////////////////
+		// DirextX対応アプリのとき
+		///////////////////////////
+
+		//dx_graphics.sbpをコピー
+		sprintf(temporary,"%sSubOperation\\dx\\dx_graphics.sbp",pj_editor_Dir);
+		pTemp=ReadBuffer(temporary);
+		sprintf(temporary,"%sdx_graphics.sbp",dir,NewProjectInfo.name);
+		WriteBuffer(temporary,pTemp,lstrlen(pTemp));
+		HeapDefaultFree(pTemp);
+
+		//dx_input.sbpをコピー
+		sprintf(temporary,"%sSubOperation\\dx\\dx_input.sbp",pj_editor_Dir);
+		pTemp=ReadBuffer(temporary);
+		sprintf(temporary,"%sdx_input.sbp",dir,NewProjectInfo.name);
+		WriteBuffer(temporary,pTemp,lstrlen(pTemp));
+		HeapDefaultFree(pTemp);
+
+		//dx_music.sbpをコピー
+		sprintf(temporary,"%sSubOperation\\dx\\dx_music.sbp",pj_editor_Dir);
+		pTemp=ReadBuffer(temporary);
+		sprintf(temporary,"%sdx_music.sbp",dir,NewProjectInfo.name);
+		WriteBuffer(temporary,pTemp,lstrlen(pTemp));
+		HeapDefaultFree(pTemp);
+
+		//dx9abm.dllをコピー
+		sprintf(temporary,"%sRuntime\\dx9abm.dll",pj_editor_Dir);
+		sprintf(buffer,"%sdx9abm.dll",dir,NewProjectInfo.name);
+		CopyFile(temporary,buffer,0);
+	}
+
+
+	if(NewProjectInfo.dwTypeID==IDC_EXE_WINDOWBASE||
+		NewProjectInfo.dwTypeID==IDC_EXE_DIRECTX){
+		/////////////////////////////////////////
+		// ウィンドウ定義ファイル（*.wnd）を作成
+		/////////////////////////////////////////
+		WINDOW_INFO WindowInfo[1];
+		WindowInfo[0].name="MainWnd";
+		WindowInfo[0].HandleName="hMainWnd";
+		WindowInfo[0].pos.x=CW_USEDEFAULT;
+		WindowInfo[0].pos.y=CW_USEDEFAULT;
+		WindowInfo[0].size.cx=480;
+		WindowInfo[0].size.cy=360;
+		WindowInfo[0].caption=NewProjectInfo.name;
+		if(NewProjectInfo.dwTypeID==IDC_EXE_WINDOWBASE)
+			WindowInfo[0].style=WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_VISIBLE;
+		else if(NewProjectInfo.dwTypeID==IDC_EXE_DIRECTX)
+			WindowInfo[0].style=WS_OVERLAPPED|WS_THICKFRAME|WS_SYSMENU;
+		WindowInfo[0].ExStyle=0;
+		WindowInfo[0].MenuID=0;
+		WindowInfo[0].id=0;
+		WindowInfo[0].bgColor=COLOR_3DFACE;
+		GetDefaultWindowFont(&WindowInfo[0].LogFont);
+		WindowInfo[0].IconResName=0;
+		WindowInfo[0].ClassName="NORMAL";
+		WindowInfo[0].CallBackName="MainWndProc";
+		WindowInfo[0].type=WNDTYPE_DEFAULT;
+		WindowInfo[0].filepath="MainWnd.ab";
+		WindowInfo[0].NumberOfChildWindows=0;
+		sprintf(temporary,"%s%s.wnd",dir,NewProjectInfo.name);
+
+		ProjectInfo.NumberOfMenu=0;
+		SaveWindowFile(temporary,WindowInfo,1);
+	}
+
+
+	////////////////////////
+	// ワークファイルを作成
+	////////////////////////
+	lstrcpy(buffer,"case4\r\n\r\n");
+	if(NewProjectInfo.dwTypeID==IDC_EXE_WINDOWBASE){
+		lstrcat(buffer,"rad,MainWnd\r\n\r\n");
+	}
+	else{
+		sprintf(buffer+lstrlen(buffer),"text,\"%s.ab\",0,0,0,0\r\n\r\n",NewProjectInfo.name);
+	}
+	lstrcat(buffer,"0\r\n0\r\n0\r\n0,0");
+	//保存
+	sprintf(temporary,"%s%s.wrk",dir,NewProjectInfo.name);
+	if(!WriteBuffer(temporary,buffer,lstrlen(buffer))) return;
+
+
+	//マニフェストを作成
+	char temp2[MAX_PATH];
+	sprintf(temporary,"%sSubOperation\\manifest_temp.xml",pj_editor_Dir);
+	sprintf(temp2,"%s%s.manifest.xml",dir,NewProjectInfo.name);
+	CopyFile(temporary,temp2,0);
+
+
+	sprintf(temporary,"%s%s.pj",dir,NewProjectInfo.name);
+	OpenProject(temporary);
+	SaveProject();
+}
+void SetTreeViewForProjectInfo(){
+	extern HANDLE hHeap;
+	extern HWND hProjectView;
+	extern PROJECTINFO ProjectInfo;
+	int i;
+	char temporary[MAX_PATH];
+	TV_INSERTSTRUCT tv;
+
+	sprintf(temporary,"%s ",ProjectInfo.name);
+	lstrcat(temporary,STRING_PROJECT);
+	SetWindowText(hProjectView,temporary);
+
+	tv.hInsertAfter=TVI_SORT;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+
+	//ファイル ツリー
+	ProjectInfo.pobj_DBFileInfo->ResetTree();
+
+	//関数ツリー
+	ResetClassTree(-1);
+
+	/////////////////////
+	// マテリアル ツリー
+
+	//Cursorリソース フォルダ
+	sprintf(temporary,"Cursor %s",STRING_RESOURCE);
+	tv.hParent=TVI_ROOT;
+	tv.item.iImage=0;
+	tv.item.iSelectedImage=0;
+	tv.item.pszText=temporary;
+	tv.hParent=TreeView_InsertItem(hMaterialTreeView,&tv);
+	ProjectInfo.res.hCursorTreeItem=tv.hParent;
+	for(i=0;i<ProjectInfo.res.NumberOfCursorRes;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);
+	}
+
+	//Bitmapリソース フォルダ
+	sprintf(temporary,"Bitmap %s",STRING_RESOURCE);
+	tv.hParent=TVI_ROOT;
+	tv.item.iImage=0;
+	tv.item.iSelectedImage=0;
+	tv.item.pszText=temporary;
+	tv.hParent=TreeView_InsertItem(hMaterialTreeView,&tv);
+	ProjectInfo.res.hBitmapTreeItem=tv.hParent;
+	for(i=0;i<ProjectInfo.res.NumberOfBitmapRes;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);
+	}
+
+	//Iconリソース フォルダ
+	sprintf(temporary,"Icon %s",STRING_RESOURCE);
+	tv.hParent=TVI_ROOT;
+	tv.item.iImage=0;
+	tv.item.iSelectedImage=0;
+	tv.item.pszText=temporary;
+	tv.hParent=TreeView_InsertItem(hMaterialTreeView,&tv);
+	ProjectInfo.res.hIconTreeItem=tv.hParent;
+	for(i=0;i<ProjectInfo.res.NumberOfIconRes;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;
+		}
+		else tv.item.pszText=ProjectInfo.res.pIconResInfo[i].IdName;
+		ProjectInfo.res.pIconResInfo[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
+	}
+
+	//Menuフォルダ
+	tv.hParent=TVI_ROOT;
+	tv.item.iImage=0;
+	tv.item.iSelectedImage=0;
+	tv.item.pszText="Menu";
+	tv.hParent=TreeView_InsertItem(hMaterialTreeView,&tv);
+	ProjectInfo.hMenuTreeItem=tv.hParent;
+	for(i=0;i<ProjectInfo.NumberOfMenu;i++){
+		tv.item.iImage=3;
+		tv.item.iSelectedImage=3;
+		tv.item.pszText=ProjectInfo.pMenuInfo[i].IdName;
+		ProjectInfo.pMenuInfo[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
+	}
+
+	//Windowフォルダ
+	tv.hParent=TVI_ROOT;
+	tv.item.iImage=0;
+	tv.item.iSelectedImage=0;
+	tv.item.pszText="Window";
+	tv.hParent=TreeView_InsertItem(hMaterialTreeView,&tv);
+	ProjectInfo.hWindowTreeItem=tv.hParent;
+	for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+		tv.item.iImage=2;
+		tv.item.iSelectedImage=2;
+		tv.item.pszText=ProjectInfo.pWindowInfo[i].name;
+		ProjectInfo.pWindowInfo[i].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
+	}
+}
+void OpenProject(char *path){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	char *buffer,temporary[MAX_PATH],temp2[MAX_PATH];
+
+	//既にプロジェクトが開かれている場合は閉じる
+	if(ProjectInfo.name[0]){
+		if(!CloseProject()) return;
+	}
+	memset(&ProjectInfo,0,sizeof(PROJECTINFO));
+
+	//プロジェクトの作業ディレクトリを取得
+	_splitpath(path,ProjectInfo.dir,temporary,0,0);
+	lstrcat(ProjectInfo.dir,temporary);
+
+	//ファイルを開く、保存の初期ディレクトリをセット
+	lstrcpy(pobj_nv->DefSaveDir,ProjectInfo.dir);
+
+
+	//////////////////////////////////////////
+	// リソースデータ用領域を確保
+	ProjectInfo.res.pCursorResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1);
+	ProjectInfo.res.NumberOfCursorRes=0;
+	ProjectInfo.res.pBitmapResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1);
+	ProjectInfo.res.NumberOfBitmapRes=0;
+	ProjectInfo.res.pIconResInfo=(RESITEMINFO *)HeapAlloc(hHeap,0,1);
+	ProjectInfo.res.NumberOfIconRes=0;
+
+
+	//////////////////////////////////////////
+	//プロジェクトファイル（*.pj）をオープン
+	buffer=ReadBuffer(path);
+	if(!buffer) return;
+
+	//解析
+	ProjectInfo.pobj_DBFileInfo=new CDBFileInfo();
+	for(i=0;;i++){
+		if(buffer[i]=='\0') break;
+		if(buffer[i]=='\r'&&buffer[i+1]=='\n'&&buffer[i+2]=='#'){
+			for(i+=3,i2=0;;i++,i2++){
+				if(!IsVariableChar(buffer[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+			if(lstrcmpi(temporary,"VERSION")==0&&buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temporary[i2]=0;
+						if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+				ProjectInfo.dwVersion=GetValue(temporary);
+			}
+			else if(lstrcmpi(temporary,"MODULETYPE")==0&&buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temporary[i2]=0;
+						if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+				ProjectInfo.dwModuleType=atoi(temporary);
+			}
+			else if(lstrcmpi(temporary,"NAME")==0&&buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						ProjectInfo.name[i2]=0;
+						break;
+					}
+					ProjectInfo.name[i2]=buffer[i];
+				}
+			}
+			else if(lstrcmpi(temporary,"PLATFORM")==0&&buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temporary[i2]=0;
+						if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+				i2=atoi(temporary);
+				extern HWND hSelectCompilerCombo;
+				if(i2==32){
+					//プラットフォームにWin32を選択
+					SendMessage(hSelectCompilerCombo,CB_SETCURSEL,0,0);
+				}
+				else if(i2==64){
+					//プラットフォームにWin64を選択
+					SendMessage(hSelectCompilerCombo,CB_SETCURSEL,1,0);
+				}
+				SendMessage(hSelectCompilerCombo,WM_COMMAND,MAKELONG(0,CBN_SELCHANGE),0);
+			}
+			else if(lstrcmpi(temporary,"USEWINDOW")==0&&buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temporary[i2]=0;
+						if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+				ProjectInfo.NumberOfWindows=atoi(temporary);
+			}
+			else if(lstrcmpi(temporary,"OPTION")==0&&buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temporary[i2]=0;
+						if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+				ProjectInfo.dwOption=GetValue(temporary);
+			}
+			else if(lstrcmpi(temporary,"OUTPUT_RELEASE")==0&&buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temporary[i2]=0;
+						if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+				lstrcpy(ProjectInfo.lpszOutput_Release,temporary);
+			}
+			else if(lstrcmpi(temporary,"OUTPUT_DEBUG")==0&&buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temporary[i2]=0;
+						if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+				lstrcpy(ProjectInfo.lpszOutput_Debug,temporary);
+			}
+			else if(lstrcmpi(temporary,"MANIFEST")==0&&buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temporary[i2]=0;
+						if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+				lstrcpy(ProjectInfo.szManifestPath,temporary);
+			}
+			else if(lstrcmpi(temporary,"DEBUG_CMD_LINE")==0&&buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temporary[i2]=0;
+						if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+				lstrcpy(ProjectInfo.szCmdLine,temporary);
+			}
+			else if(lstrcmpi(temporary,"DEBUG_EXE_PATH")==0&&buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temporary[i2]=0;
+						if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+				lstrcpy(ProjectInfo.szExePath,temporary);
+			}
+			else if(lstrcmpi(temporary,"RESOURCE")==0&&buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temporary[i2]=0;
+						if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;
+						break;
+					}
+					temporary[i2]=buffer[i];
+				}
+				if(temporary[0]!='\0'&&(!(temporary[0]=='0'&&temporary[1]=='\0'))){
+					lstrcpy(ProjectInfo.ResourceFileName,temporary);
+					GetResourceData();
+				}
+				else{
+					sprintf(ProjectInfo.ResourceFileName,"%s.rc",ProjectInfo.name);
+				}
+			}
+			else if(lstrcmpi(temporary,"SOURCE")==0&&buffer[i]=='\r'&&buffer[i+1]=='\n'){
+				while(1){
+					for(i+=2,i2=0;;i++,i2++){
+						if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+							temporary[i2]=0;
+							break;
+						}
+						temporary[i2]=buffer[i];
+					}
+					if(temporary[0]=='\0') break;
+					ProjectInfo.pobj_DBFileInfo->add(temporary,0);
+
+					if(buffer[i]=='\0') break;
+				}
+			}
+			else{
+				//不明なパラメータは無視
+				for(i++;;i++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						if(buffer[i]=='\r'&&buffer[i+1]=='\n') i-=2;
+						break;
+					}
+				}
+			}
+			if(buffer[i]=='\0') break;
+		}
+	}
+	HeapDefaultFree(buffer);
+
+	//古いバージョンファイルを考慮
+	if(ProjectInfo.dwVersion<=4){
+		if(ProjectInfo.dwModuleType==MT_DLL)
+			sprintf(ProjectInfo.lpszOutput_Release,".\\%s.dll",ProjectInfo.name);
+		else sprintf(ProjectInfo.lpszOutput_Release,".\\%s.exe",ProjectInfo.name);
+		sprintf(ProjectInfo.lpszOutput_Debug,".\\%s_debug.exe",ProjectInfo.name);
+	}
+
+	//ブレークポイントを初期化
+	ProjectInfo.pobj_DBBreakPoint=new CDBBreakPoint();
+
+
+	if(ProjectInfo.NumberOfWindows){
+		/////////////////////////////////////////////
+		//ウィンドウ定義ファイル（*.wnd）をオープン
+		sprintf(temp2,"%s%s.wnd",ProjectInfo.dir,ProjectInfo.name);
+		if(!OpenWindowFile(temp2)) return;
+	}
+	else{
+		ProjectInfo.pWindowInfo=(WINDOW_INFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+
+		ProjectInfo.NumberOfMenu=0;
+		ProjectInfo.pMenuInfo=(MENU_INFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+	}
+
+
+	//プロジェクト ビューを設定、表示
+	extern HWND hProjectView;
+	SetTreeViewForProjectInfo();
+	if(!IsWindowVisible(hProjectView)) SendMessage(hOwner,WM_COMMAND,IDM_PROJECTVIEW,0);
+
+
+	//メニュー状態を設定
+	ResetState_DocMenu();
+
+
+	//////////////////////////////////////////
+	//ワークファイル（*.wrk）をオープン
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HTREEITEM hTreeItem;
+	HANDLE hFind;
+	WIN32_FIND_DATA wfd;
+	HWND hChild;
+	int WndNum;
+	sprintf(temp2,"%s%s.wrk",ProjectInfo.dir,ProjectInfo.name);
+	hFind=FindFirstFile(temp2,&wfd);
+	if(hFind!=INVALID_HANDLE_VALUE){
+		FindClose(hFind);
+		buffer=ReadBuffer(temp2);
+		if(!buffer) return;
+
+		//解析、反映
+		memcpy(temporary,buffer,5);
+		temporary[5]=0;
+		if(lstrcmp(temporary,"case4")==0){
+
+			LockWindowUpdate(hOwner);
+			for(i=9,i2=0;;i++,i2++){
+				if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+					if(i2!=0){
+						temporary[i2]=0;
+						for(i3=0;;i3++){
+							if(temporary[i3]==','||temporary[i3]=='\0') break;
+						}
+						if(temporary[i3]=='\0') goto EndToSetWorkFile;
+						lstrcpy(temp2,temporary+i3+1);
+						temporary[i3]=0;
+						if(lstrcmpi(temporary,"text")==0){
+							if(temp2[0]!='\"') goto EndToSetWorkFile;
+
+							//ファイルを開く
+							i2=1;
+							for(i3=0;;i2++,i3++){
+								if(temp2[i2]=='\"'||temp2[i2]=='\0'){
+									temporary[i3]=0;
+									break;
+								}
+								temporary[i3]=temp2[i2];
+							}
+							GetFullPath(temporary,ProjectInfo.dir);
+							hChild=OpenFileWithExtension(temporary);
+							WndNum=GetWndNum(hChild);
+							if(WndNum==-1){
+								goto EndToSetWorkFile;
+							}
+
+							//ResetScrollbarが再描画時に呼び出されるので、再描画する
+							InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->hEdit,NULL,0);
+							UpdateWindow(MdiInfo[WndNum].pMdiTextEdit->hEdit);
+
+							if(temp2[i2]=='\0') goto EndToSetWorkFile;
+							if(temp2[i2+1]!=',') goto EndToSetWorkFile;
+
+							//以前のスクロール位置を復元
+							SCROLLINFO si;
+							POINT pos;
+							for(i2+=2,i3=0;;i2++,i3++){
+								if(temp2[i2]==','||temp2[i2]=='\0'){
+									temporary[i3]=0;
+									break;
+								}
+								temporary[i3]=temp2[i2];
+							}
+							sscanf(temporary,"%d",&pos.x);
+							if(temp2[i2]=='\0') goto EndToSetWorkFile;
+							for(i2++,i3=0;;i2++,i3++){
+								if(temp2[i2]==','||temp2[i2]=='\0'){
+									temporary[i3]=0;
+									break;
+								}
+								temporary[i3]=temp2[i2];
+							}
+							sscanf(temporary,"%d",&pos.y);
+							si.cbSize=sizeof(SCROLLINFO);
+							si.fMask=SIF_POS;
+							si.nPos=pos.x;
+							SetScrollInfo(MdiInfo[WndNum].pMdiTextEdit->hEdit,SB_HORZ,&si,1);
+							si.nPos=pos.y;
+							SetScrollInfo(MdiInfo[WndNum].pMdiTextEdit->hEdit,SB_VERT,&si,1);
+
+							if(temp2[i2]=='\0') goto EndToSetWorkFile;
+
+							//キャレット位置をセット
+							for(i2++,i3=0;;i2++,i3++){
+								if(temp2[i2]==','||temp2[i2]=='\0'){
+									temporary[i3]=0;
+									break;
+								}
+								temporary[i3]=temp2[i2];
+							}
+							sscanf(temporary,"%d",&pos.x);
+							if(temp2[i2]=='\0') goto EndToSetWorkFile;
+							for(i2++,i3=0;;i2++,i3++){
+								if(temp2[i2]==','||temp2[i2]=='\0'){
+									temporary[i3]=0;
+									break;
+								}
+								temporary[i3]=temp2[i2];
+							}
+							sscanf(temporary,"%d",&pos.y);
+							TextEdit_SetSel(WndNum,pos.x,pos.y);
+						}
+						else if(lstrcmpi(temporary,"rad")==0){
+							for(i3=0;i3<ProjectInfo.NumberOfWindows;i3++){
+								if(lstrcmpi(ProjectInfo.pWindowInfo[i3].name,temp2)==0){
+									NewRadWindow(i3);
+									break;
+								}
+							}
+						}
+						else if(lstrcmpi(temporary,"menu")==0){
+							for(i3=0;i3<ProjectInfo.NumberOfMenu;i3++){
+								if(lstrcmpi(ProjectInfo.pMenuInfo[i3].IdName,temp2)==0){
+									NewMenuWindow(&ProjectInfo.pMenuInfo[i3]);
+									break;
+								}
+							}
+						}
+						else if(lstrcmpi(temporary,"icon")==0){
+							for(i3=0;i3<ProjectInfo.res.NumberOfIconRes;i3++){
+								if(lstrcmpi(ProjectInfo.res.pIconResInfo[i3].path,temp2)==0){
+									GetFullPath(temp2,ProjectInfo.dir);
+									NewIconEditWindow(temp2);
+									break;
+								}
+							}
+						}
+						i++;
+						i2=-1;
+						continue;
+					}
+					else break;
+				}
+				temporary[i2]=buffer[i];
+			}
+
+			for(i+=2,i2=0;;i++,i2++){
+				if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+			sscanf(temporary,"%d",&i2);
+
+			switch( i2 ){
+				case 0:
+					ShowFileView();
+					break;
+				case 1:
+					ShowClassView();
+					break;
+				case 2:
+					ShowMaterialView();
+					break;
+			}
+
+			if(buffer[i]=='\0') goto EndToSetWorkFile;
+
+			for(i+=2,i2=0;;i++,i2++){
+				if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+			if(temporary[0]=='1') TreeView_Expand(pobj_FileTree->hTree,TreeView_GetRoot(pobj_FileTree->hTree),TVE_EXPAND);
+
+			for(i+=2,i2=0;;i++,i2++){
+				if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+			if(temporary[0]=='1') TreeView_Expand(hProcedureTreeView,TreeView_GetRoot(hProcedureTreeView),TVE_EXPAND);
+
+			for(i+=2,i2=0;;i++,i2++){
+				if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+			hTreeItem=TreeView_GetRoot(hMaterialTreeView);
+			i2=0;
+			while(hTreeItem){
+				i2=GetOneParameter(temporary,i2,temp2);
+				if(GetValue(temp2)) TreeView_Expand(hMaterialTreeView,hTreeItem,TVE_EXPAND);
+				hTreeItem=TreeView_GetNextSibling(hMaterialTreeView,hTreeItem);
+			}
+		}
+		else if(lstrcmp(temporary,"case3")==0){
+			////////////////////////////////////////
+			// 古いフォーマットのワークファイル
+
+			LockWindowUpdate(hOwner);
+			for(i=9,i2=0;;i++,i2++){
+				if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+					if(i2!=0){
+						temporary[i2]=0;
+						for(i3=0;;i3++){
+							if(temporary[i3]==','||temporary[i3]=='\0') break;
+						}
+						if(temporary[i3]=='\0') goto EndToSetWorkFile;
+						lstrcpy(temp2,temporary+i3+1);
+						temporary[i3]=0;
+						if(lstrcmpi(temporary,"text")==0){
+							for(i3=0;;i3++){
+								if(temp2[i3]==','||temp2[i3]=='\0') break;
+							}
+							if(temp2[i3]=='\0') goto EndToSetWorkFile;
+							lstrcpy(temporary,temp2+i3+1);
+							temp2[i3]=0;
+							GetFullPath(temporary,ProjectInfo.dir);
+							sscanf(temp2,"%d",&i3);
+
+							//ファイルを開く
+							hChild=OpenFileWithExtension(temporary);
+							WndNum=GetWndNum(hChild);
+
+							//キャレット位置をセット
+							TextEdit_SetSel(WndNum,i3,i3);
+						}
+						else if(lstrcmpi(temporary,"rad")==0){
+							for(i3=0;i3<ProjectInfo.NumberOfWindows;i3++){
+								if(lstrcmpi(ProjectInfo.pWindowInfo[i3].name,temp2)==0){
+									NewRadWindow(i3);
+									break;
+								}
+							}
+						}
+						else if(lstrcmpi(temporary,"menu")==0){
+							for(i3=0;i3<ProjectInfo.NumberOfMenu;i3++){
+								if(lstrcmpi(ProjectInfo.pMenuInfo[i3].IdName,temp2)==0){
+									NewMenuWindow(&ProjectInfo.pMenuInfo[i3]);
+									break;
+								}
+							}
+						}
+						else if(lstrcmpi(temporary,"icon")==0){
+							for(i3=0;i3<ProjectInfo.res.NumberOfIconRes;i3++){
+								if(lstrcmpi(ProjectInfo.res.pIconResInfo[i3].path,temp2)==0){
+									GetFullPath(temp2,ProjectInfo.dir);
+									NewIconEditWindow(temp2);
+									break;
+								}
+							}
+						}
+						i++;
+						i2=-1;
+						continue;
+					}
+					else break;
+				}
+				temporary[i2]=buffer[i];
+			}
+
+			for(i+=2,i2=0;;i++,i2++){
+				if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+			sscanf(temporary,"%d",&i2);
+
+			switch( i2 ){
+				case 0:
+					ShowFileView();
+					break;
+				case 1:
+					ShowClassView();
+					break;
+				case 2:
+					ShowMaterialView();
+					break;
+			}
+
+			if(buffer[i]=='\0') goto EndToSetWorkFile;
+
+			for(i+=2,i2=0;;i++,i2++){
+				if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+			if(temporary[0]=='1') TreeView_Expand(pobj_FileTree->hTree,TreeView_GetRoot(pobj_FileTree->hTree),TVE_EXPAND);
+
+			for(i+=2,i2=0;;i++,i2++){
+				if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+			if(temporary[0]=='1') TreeView_Expand(hProcedureTreeView,TreeView_GetRoot(hProcedureTreeView),TVE_EXPAND);
+
+			for(i+=2,i2=0;;i++,i2++){
+				if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+			hTreeItem=TreeView_GetRoot(hMaterialTreeView);
+			i2=0;
+			while(hTreeItem){
+				i2=GetOneParameter(temporary,i2,temp2);
+				if(GetValue(temp2)) TreeView_Expand(hMaterialTreeView,hTreeItem,TVE_EXPAND);
+				hTreeItem=TreeView_GetNextSibling(hMaterialTreeView,hTreeItem);
+			}
+		}
+EndToSetWorkFile:
+		LockWindowUpdate(NULL);
+		HeapDefaultFree(buffer);
+	}
+
+
+	//ウィンドウ タイトルを変更
+	sprintf(temporary,"%s - %s",ProjectInfo.name,APPLICATION_NAME);
+	SetWindowText(hOwner,temporary);
+
+
+	ProjectInfo.modify=0;
+	ProjectInfo.ModifyOfMaterial=0;
+	ProjectInfo.ModifuOfResource=0;
+}
+BOOL ProjectModifyCheck(BOOL bRun){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,WndNum,sw;
+	HWND hChild;
+	char temporary[MAX_PATH];
+	if(ProjectInfo.modify||ProjectInfo.ModifyOfMaterial||ProjectInfo.ModifuOfResource){
+		if(bRun==0||pobj_nv->bSaveCheckProject){
+			//"\"%s\" プロジェクトは変更されています。保存しますか？"
+			sprintf(temporary,STRING_MODIFYCHECK_PROJECT,ProjectInfo.name);
+			i=MessageBox(hOwner,temporary,APPLICATION_NAME,MB_YESNOCANCEL|MB_ICONEXCLAMATION);
+
+			if(i==IDCANCEL) return 0;
+			if(i==IDYES) SaveProject();
+		}
+		else SaveProject();
+		return 1;
+	}
+	hChild=GetWindow(hClient,GW_CHILD);
+	while(hChild){
+		WndNum=GetWndNum(hChild);
+		sw=0;
+		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+			if( MdiInfo[WndNum].pMdiTextEdit->IsModified() ){
+				for(i=0;i<ProjectInfo.pobj_DBFileInfo->iNum;i++){
+					ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
+					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) sw=1;
+				}
+			}
+		}
+		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);
+					GetFullPath(temporary,ProjectInfo.dir);
+					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) sw=1;
+				}
+			}
+		}
+
+		if(sw){
+			if(bRun==0||pobj_nv->bSaveCheckProject){
+				//"\"%s\" プロジェクトは変更されています。保存しますか？"
+				sprintf(temporary,STRING_MODIFYCHECK_PROJECT,ProjectInfo.name);
+				i=MessageBox(hOwner,temporary,APPLICATION_NAME,MB_YESNOCANCEL|MB_ICONEXCLAMATION);
+
+				if(i==IDCANCEL) return 0;
+				if(i==IDYES) SaveProject();
+			}
+			else SaveProject();
+			return 1;
+		}
+		hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+	}
+	return 2;
+}
+_int8 CloseProject(void){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,WndNum;
+	HWND hChild,hCloseChild;
+	char temporary[MAX_PATH];
+
+
+	//保存確認
+	i=ProjectModifyCheck(0);
+	if(i==0) return 0;
+	else if(i==2) MakeWorkFile();
+
+	//プロジェクトに関するMDIウィンドウをすべて閉じる
+	hChild=GetWindow(hClient,GW_CHILD);
+	while(hChild){
+		hCloseChild=hChild;
+		hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+		WndNum=GetWndNum(hCloseChild);
+		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+			for(i=0;i<ProjectInfo.pobj_DBFileInfo->iNum;i++){
+				ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
+				if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
+
+					//変更フラグをオフにする
+					MdiInfo[WndNum].pMdiTextEdit->UnModify();
+
+					SendMessage(hCloseChild,WM_CLOSE,0,0);
+					break;
+				}
+			}
+		}
+		else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){
+			for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+				if(lstrcmp(MdiInfo[WndNum].path,ProjectInfo.pWindowInfo[i].name)==0){
+					SendMessage(hCloseChild,WM_CLOSE,0,0);
+					break;
+				}
+			}
+		}
+		else if(MdiInfo[WndNum].DocType==WNDTYPE_MENU){
+			for(i=0;i<ProjectInfo.NumberOfMenu;i++){
+				if(lstrcmp(MdiInfo[WndNum].path,ProjectInfo.pMenuInfo[i].IdName)==0){
+					SendMessage(hCloseChild,WM_CLOSE,0,0);
+					break;
+				}
+			}
+		}
+		else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+			for(i=0;ProjectInfo.res.NumberOfIconRes;i++){
+				lstrcpy(temporary,ProjectInfo.res.pIconResInfo[i].path);
+				GetFullPath(temporary,ProjectInfo.dir);
+				if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
+					SendMessage(hCloseChild,WM_CLOSE,0,0);
+					break;
+				}
+			}
+		}
+	}
+
+	//ファイル情報のメモリを解放
+	delete ProjectInfo.pobj_DBFileInfo;
+
+	//ブレークポイントのオブジェクトを解放
+	delete ProjectInfo.pobj_DBBreakPoint;
+
+	//ウィンドウ情報のメモリを解放
+	for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+		HeapDefaultFree(ProjectInfo.pWindowInfo[i].name);
+		HeapDefaultFree(ProjectInfo.pWindowInfo[i].HandleName);
+		HeapDefaultFree(ProjectInfo.pWindowInfo[i].caption);
+		HeapDefaultFree(ProjectInfo.pWindowInfo[i].ClassName);
+		HeapDefaultFree(ProjectInfo.pWindowInfo[i].CallBackName);
+		HeapDefaultFree(ProjectInfo.pWindowInfo[i].filepath);
+		if(ProjectInfo.pWindowInfo[i].MenuID)
+			HeapDefaultFree(ProjectInfo.pWindowInfo[i].MenuID);
+		if(ProjectInfo.pWindowInfo[i].IconResName)
+			HeapDefaultFree(ProjectInfo.pWindowInfo[i].IconResName);
+
+		//子ウィンドウのメモリを解放
+		for(i2=0;i2<ProjectInfo.pWindowInfo[i].NumberOfChildWindows;i2++){
+			HeapDefaultFree(ProjectInfo.pWindowInfo[i].pChildInfo[i2].IdName);
+			HeapDefaultFree(ProjectInfo.pWindowInfo[i].pChildInfo[i2].caption);
+			if(ProjectInfo.pWindowInfo[i].pChildInfo[i2].Control==CT_IMAGEBOX){
+				//イメージ ボックスの場合
+				HeapDefaultFree(ProjectInfo.pWindowInfo[i].pChildInfo[i2].ImageCtrlInfo.path);
+			}
+		}
+		HeapDefaultFree(ProjectInfo.pWindowInfo[i].pChildInfo);
+	}
+	HeapDefaultFree(ProjectInfo.pWindowInfo);
+
+	//メニュー情報のメモリを解放
+	HeapMenuDataFree(ProjectInfo.pMenuInfo,ProjectInfo.NumberOfMenu,0);
+	HeapDefaultFree(ProjectInfo.pMenuInfo);
+
+	//リソースのメモリを解放
+	for(i=0;i<ProjectInfo.res.NumberOfCursorRes;i++){
+		HeapDefaultFree(ProjectInfo.res.pCursorResInfo[i].IdName);
+		HeapDefaultFree(ProjectInfo.res.pCursorResInfo[i].path);
+	}
+	HeapDefaultFree(ProjectInfo.res.pCursorResInfo);
+	for(i=0;i<ProjectInfo.res.NumberOfBitmapRes;i++){
+		HeapDefaultFree(ProjectInfo.res.pBitmapResInfo[i].IdName);
+		HeapDefaultFree(ProjectInfo.res.pBitmapResInfo[i].path);
+	}
+	HeapDefaultFree(ProjectInfo.res.pBitmapResInfo);
+	for(i=0;i<ProjectInfo.res.NumberOfIconRes;i++){
+		HeapDefaultFree(ProjectInfo.res.pIconResInfo[i].IdName);
+		HeapDefaultFree(ProjectInfo.res.pIconResInfo[i].path);
+	}
+	HeapDefaultFree(ProjectInfo.res.pIconResInfo);
+
+	//プロジェクト ビューを非表示にする
+	extern HWND hProjectView;
+	if(IsWindowVisible(hProjectView)) SendMessage(hOwner,WM_COMMAND,IDM_PROJECTVIEW,0);
+	SetWindowText(hProjectView,"Project View");
+
+	TreeView_DeleteAllItems(pobj_FileTree->hTree);
+	TreeView_DeleteAllItems(hProcedureTreeView);
+	TreeView_DeleteAllItems(hMaterialTreeView);
+
+	//ウィンドウ タイトルを変更
+	SetWindowText(hOwner,APPLICATION_NAME);
+
+	ProjectInfo.name[0]=0;
+
+	//メニュー状態を設定
+	ResetState_DocMenu();
+
+	return 1;
+}
+void MakeWorkFile(void){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,WndNum;
+	char temporary[MAX_PATH],buffer[32767];
+	HWND hChild;
+	CHARRANGE CharRange;
+
+	//ワークファイル（*.wrk）を作成
+	lstrcpy(buffer,"case4\r\n\r\n");
+	i2=lstrlen(buffer);
+
+
+	///////////////////////
+	//MDIウィンドウの並び
+	hChild=GetWindow(GetWindow(hClient,GW_CHILD),GW_HWNDLAST);
+	while(hChild){
+		WndNum=GetWndNum(hChild);
+		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+			for(i=0;i<ProjectInfo.pobj_DBFileInfo->iNum;i++){
+				ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
+				if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
+					TextEdit_GetSel(WndNum,&CharRange);
+
+					SCROLLINFO si;
+					POINT pos;
+					si.cbSize=sizeof(SCROLLINFO);
+					si.fMask=SIF_POS;
+					GetScrollInfo(MdiInfo[WndNum].pMdiTextEdit->hEdit,SB_HORZ,&si);
+					pos.x=si.nPos;
+					GetScrollInfo(MdiInfo[WndNum].pMdiTextEdit->hEdit,SB_VERT,&si);
+					pos.y=si.nPos;
+
+					sprintf(buffer+i2,"text,\"%s\",%d,%d,%d,%d\r\n",
+						ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->m_path,
+						pos.x,
+						pos.y,
+						CharRange.cpMin,
+						CharRange.cpMax);
+					i2+=lstrlen(buffer+i2);
+					break;
+				}
+			}
+		}
+		else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){
+			for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+				if(lstrcmpi(MdiInfo[WndNum].path,ProjectInfo.pWindowInfo[i].name)==0){
+					sprintf(buffer+i2,"rad,%s\r\n",MdiInfo[WndNum].path);
+					i2+=lstrlen(buffer+i2);
+					break;
+				}
+			}
+		}
+		else if(MdiInfo[WndNum].DocType==WNDTYPE_MENU){
+			for(i=0;i<ProjectInfo.NumberOfMenu;i++){
+				if(lstrcmpi(MdiInfo[WndNum].path,ProjectInfo.pMenuInfo[i].IdName)==0){
+					sprintf(buffer+i2,"menu,%s\r\n",MdiInfo[WndNum].path);
+					i2+=lstrlen(buffer+i2);
+					break;
+				}
+			}
+		}
+		else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+			for(i=0;i<ProjectInfo.res.NumberOfIconRes;i++){
+				lstrcpy(temporary,ProjectInfo.res.pIconResInfo[i].path);
+				GetFullPath(temporary,ProjectInfo.dir);
+				if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
+					sprintf(buffer+i2,"icon,%s\r\n",ProjectInfo.res.pIconResInfo[i].path);
+					i2+=lstrlen(buffer+i2);
+					break;
+				}
+			}
+		}
+		hChild=GetNextWindow(hChild,GW_HWNDPREV);
+	}
+	lstrcpy(buffer+i2,"\r\n");
+	i2+=2;
+
+
+	//////////////////////////
+	//ツリービューの展開状況
+	sprintf(buffer+i2,"%d\r\n",TabCtrl_GetCurSel(hProjectViewTab));
+	i2+=lstrlen(buffer+i2);
+	TVITEM tvItem;
+	memset(&tvItem,0,sizeof(TVITEM));
+	tvItem.mask=TVIF_HANDLE|TVIF_STATE;
+	tvItem.hItem=TreeView_GetRoot(pobj_FileTree->hTree);
+	TreeView_GetItem(pobj_FileTree->hTree,&tvItem);
+	if(tvItem.state&TVIS_EXPANDED) i=1;
+	else i=0;
+	sprintf(buffer+i2,"%d\r\n",i);
+	i2+=lstrlen(buffer+i2);
+
+	tvItem.hItem=TreeView_GetRoot(hProcedureTreeView);
+	TreeView_GetItem(hProcedureTreeView,&tvItem);
+	if(tvItem.state&TVIS_EXPANDED) i=1;
+	else i=0;
+	sprintf(buffer+i2,"%d\r\n",i);
+	i2+=lstrlen(buffer+i2);
+
+	tvItem.hItem=TreeView_GetRoot(hMaterialTreeView);
+	while(tvItem.hItem){
+		TreeView_GetItem(hMaterialTreeView,&tvItem);
+		if(tvItem.state&TVIS_EXPANDED) i=1;
+		else i=0;
+		sprintf(buffer+i2,"%d",i);
+		i2+=lstrlen(buffer+i2);
+
+		tvItem.hItem=TreeView_GetNextSibling(hMaterialTreeView,tvItem.hItem);
+		if(tvItem.hItem){
+			lstrcpy(buffer+i2,",");
+			i2+=lstrlen(buffer+i2);
+		}
+	}
+
+
+	//保存
+	sprintf(temporary,"%s%s.wrk",ProjectInfo.dir,ProjectInfo.name);
+	WriteBuffer(temporary,buffer,i2);
+}
+void SaveProject(void){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3,WndNum;
+	char temporary[MAX_PATH],buffer[32767];
+	HWND hChild;
+
+	//"プロジェクトを保存中..."
+	SetStatusText(STRING_PROJECT_SAVING);
+
+	//プロジェクトファイルのバージョンを設定
+	ProjectInfo.dwVersion=PROJECT_VERSION;
+
+	hChild=GetWindow(hClient,GW_CHILD);
+	while(hChild){
+		WndNum=GetWndNum(hChild);
+		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+			if( MdiInfo[WndNum].pMdiTextEdit->IsModified() ){
+				for(i=0;i<ProjectInfo.pobj_DBFileInfo->iNum;i++){
+					ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
+					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
+						SaveDocument(hChild,NULL);
+						break;
+					}
+				}
+			}
+		}
+		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);
+					GetFullPath(temporary,ProjectInfo.dir);
+					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0){
+						SaveDocument(hChild,NULL);
+						break;
+					}
+				}
+			}
+		}
+		hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+	}
+
+
+	//////////////////////////////////////
+	//プロジェクトファイル（*.pj）を作成
+	lstrcpy(buffer,"\' ActiveBasic Project file.\r\n\r\n");
+	i2=lstrlen(buffer);
+	sprintf(buffer+i2,"#VERSION=%d\r\n\r\n",ProjectInfo.dwVersion);
+	i2+=lstrlen(buffer+i2);
+	sprintf(buffer+i2,"#MODULETYPE=%d\r\n\r\n",ProjectInfo.dwModuleType);
+	i2+=lstrlen(buffer+i2);
+	sprintf(buffer+i2,"#NAME=%s\r\n\r\n",ProjectInfo.name);
+	i2+=lstrlen(buffer+i2);
+	extern HWND hSelectCompilerCombo;
+	if(SendMessage(hSelectCompilerCombo,CB_GETCURSEL,0,0)==0){
+		sprintf(buffer+i2,"#PLATFORM=32\r\n\r\n",ProjectInfo.name);
+		i2+=lstrlen(buffer+i2);
+	}
+	else{
+		sprintf(buffer+i2,"#PLATFORM=64\r\n\r\n",ProjectInfo.name);
+		i2+=lstrlen(buffer+i2);
+	}
+	sprintf(buffer+i2,"#USEWINDOW=%d\r\n\r\n",ProjectInfo.NumberOfWindows);
+	i2+=lstrlen(buffer+i2);
+	sprintf(buffer+i2,"#OPTION=&H%08x\r\n\r\n",ProjectInfo.dwOption);
+	i2+=lstrlen(buffer+i2);
+	sprintf(buffer+i2,"#OUTPUT_RELEASE=%s\r\n\r\n",ProjectInfo.lpszOutput_Release);
+	i2+=lstrlen(buffer+i2);
+	sprintf(buffer+i2,"#OUTPUT_DEBUG=%s\r\n\r\n",ProjectInfo.lpszOutput_Debug);
+	i2+=lstrlen(buffer+i2);
+	sprintf(buffer+i2,"#MANIFEST=%s\r\n\r\n",ProjectInfo.szManifestPath);
+	i2+=lstrlen(buffer+i2);
+	sprintf(buffer+i2,"#DEBUG_CMD_LINE=%s\r\n\r\n",ProjectInfo.szCmdLine);
+	i2+=lstrlen(buffer+i2);
+	sprintf(buffer+i2,"#DEBUG_EXE_PATH=%s\r\n\r\n",ProjectInfo.szExePath);
+	i2+=lstrlen(buffer+i2);
+	if(ProjectInfo.ResourceFileName[0]){
+		sprintf(buffer+i2,"#RESOURCE=%s\r\n\r\n",ProjectInfo.ResourceFileName);
+		i2+=lstrlen(buffer+i2);
+	}
+	else{
+		lstrcpy(buffer+i2,"#RESOURCE=0\r\n\r\n");
+		i2+=lstrlen(buffer+i2);
+	}
+	sprintf(buffer+i2,"#SOURCE\r\n");
+	i2+=lstrlen(buffer+i2);
+	for(i=0;i<ProjectInfo.pobj_DBFileInfo->iNum;i++){
+		sprintf(buffer+i2,"%s\r\n",ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->m_path);
+		i2+=lstrlen(buffer+i2);
+	}
+
+	//保存
+	sprintf(temporary,"%s%s.pj",ProjectInfo.dir,ProjectInfo.name);
+	WriteBuffer(temporary,buffer,i2);
+
+
+	//////////////////////////////////
+	// リソースファイル（*.rc、resource.ab）を作成
+	if(ProjectInfo.ResourceFileName[0]){
+		i2=0;
+		i3=101;
+		for(i=0;i<ProjectInfo.res.NumberOfCursorRes;i++,i3++){
+			sprintf(buffer+i2,"Const %s=%d\r\n",
+				ProjectInfo.res.pCursorResInfo[i].IdName,
+				i3);
+			i2+=lstrlen(buffer+i2);
+		}
+		for(i=0;i<ProjectInfo.res.NumberOfBitmapRes;i++,i3++){
+			sprintf(buffer+i2,"Const %s=%d\r\n",
+				ProjectInfo.res.pBitmapResInfo[i].IdName,
+				i3);
+			i2+=lstrlen(buffer+i2);
+		}
+		for(i=0;i<ProjectInfo.res.NumberOfIconRes;i++,i3++){
+			sprintf(buffer+i2,"Const %s=%d\r\n",
+				ProjectInfo.res.pIconResInfo[i].IdName,
+				i3);
+			i2+=lstrlen(buffer+i2);
+		}
+
+		//保存（resource.ab）
+		lstrcpy(temporary,"resource.ab");
+		GetFullPath(temporary,ProjectInfo.dir);
+		WriteBuffer(temporary,buffer,i2);
+
+		i2=0;
+		for(i=0;i<ProjectInfo.res.NumberOfCursorRes;i++){
+			sprintf(buffer+i2,"%s CURSOR \"%s\"\r\n",
+				ProjectInfo.res.pCursorResInfo[i].IdName,
+				ProjectInfo.res.pCursorResInfo[i].path);
+			i2+=lstrlen(buffer+i2);
+		}
+		for(i=0;i<ProjectInfo.res.NumberOfBitmapRes;i++){
+			sprintf(buffer+i2,"%s BITMAP \"%s\"\r\n",
+				ProjectInfo.res.pBitmapResInfo[i].IdName,
+				ProjectInfo.res.pBitmapResInfo[i].path);
+			i2+=lstrlen(buffer+i2);
+		}
+		for(i=0;i<ProjectInfo.res.NumberOfIconRes;i++){
+			sprintf(buffer+i2,"%s ICON \"%s\"\r\n",
+				ProjectInfo.res.pIconResInfo[i].IdName,
+				ProjectInfo.res.pIconResInfo[i].path);
+			i2+=lstrlen(buffer+i2);
+		}
+
+		//マニフェスト
+		if(ProjectInfo.dwOption&PJ_OP_RC_MANIFEST){
+			sprintf(buffer+i2,"CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST \"%s\"\r\n",
+				ProjectInfo.szManifestPath);
+			i2+=lstrlen(buffer+i2);
+		}
+
+		//保存
+		lstrcpy(temporary,ProjectInfo.ResourceFileName);
+		GetFullPath(temporary,ProjectInfo.dir);
+		WriteBuffer(temporary,buffer,i2);
+	}
+
+
+	///////////////////////////////////////
+	//インデックスファイル（*.idx）を作成
+	buffer[0]=0;
+	lstrcpy(buffer,"' インデックス プログラム\r\n");
+	i2=lstrlen(buffer);
+	if(ProjectInfo.dwOption&PJ_OP_SOURCE_MASK){
+		if(ProjectInfo.dwOption&PJ_OP_STRICT){
+			/* #strictディレクティブは今は使われていない
+			lstrcpy(buffer+i2,"\r\n");
+			i2+=lstrlen(buffer+i2);
+			lstrcpy(buffer+i2,"#strict");
+			i2+=lstrlen(buffer+i2);
+			lstrcpy(buffer+i2,"\r\n");
+			i2+=lstrlen(buffer+i2);
+			*/
+		}
+		lstrcpy(buffer+i2,"\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"'Win32APIの定義ファイル\r\n");
+		i2+=lstrlen(buffer+i2);
+		if(ProjectInfo.dwOption&PJ_OP_MMSYSTEM){
+			lstrcpy(buffer+i2,"#include <api_mmsys.sbp>\r\n");
+			i2+=lstrlen(buffer+i2);
+		}
+		if(ProjectInfo.dwOption&PJ_OP_COMMCTRL){
+			lstrcpy(buffer+i2,"#include <api_commctrl.sbp>\r\n");
+			i2+=lstrlen(buffer+i2);
+		}
+		if(ProjectInfo.dwOption&PJ_OP_RICHEDIT){
+			lstrcpy(buffer+i2,"#include <api_richedit.sbp>\r\n");
+			i2+=lstrlen(buffer+i2);
+		}
+		if(ProjectInfo.dwOption&PJ_OP_WINSOCK){
+			lstrcpy(buffer+i2,"#include <api_winsock2.sbp>\r\n");
+			i2+=lstrlen(buffer+i2);
+		}
+	}
+	if(ProjectInfo.NumberOfWindows){
+		lstrcpy(buffer+i2,"\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"'RADツールが生成するウィンドウ制御プログラム\r\n");
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"#include \"Callback.wbp\"\r\n");
+		i2+=lstrlen(buffer+i2);
+	}
+	if(ProjectInfo.pobj_DBFileInfo->iNum>1){
+		lstrcpy(buffer+i2,"\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"'プロジェクト内のプログラム ファイル\r\n");
+		i2+=lstrlen(buffer+i2);
+		for(i=1;i<ProjectInfo.pobj_DBFileInfo->iNum;i++){
+			//メインファイルは含まない
+			sprintf(buffer+i2,"#include \"%s\"\r\n",ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->m_path);
+			i2+=lstrlen(buffer+i2);
+			lstrcpy(buffer+i2,"_ClearNamespaceImported\r\n");
+			i2+=lstrlen(buffer+i2);
+		}
+	}
+	if(ProjectInfo.NumberOfWindows){
+		lstrcpy(buffer+i2,"\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"'RADツールが生成するウィンドウ生成プログラム\r\n");
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"#include \"MakeWindow.wbp\"\r\n");
+		i2+=lstrlen(buffer+i2);
+	}
+	if(ProjectInfo.ResourceFileName[0]){
+		//リソースファイルが含まれる場合
+		lstrcpy(buffer+i2,"\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"'リソースファイル\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"#include \"resource.ab\"\r\n");
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"#resource \"%s.rc\"\r\n",ProjectInfo.name);
+		i2+=lstrlen(buffer+i2);
+	}
+
+	//保存
+	sprintf(temporary,"%s%s.idx",ProjectInfo.dir,ProjectInfo.name);
+	WriteBuffer(temporary,buffer,i2);
+
+
+	if(ProjectInfo.NumberOfWindows){
+		/////////////////////////////////////////////////////
+		//ウィンドウ関連ファイル（*.wnd）を作成、保存
+		if(ProjectInfo.ModifyOfMaterial){
+			sprintf(temporary,"%s%s.wnd",ProjectInfo.dir,ProjectInfo.name);
+			SaveWindowFile(temporary,ProjectInfo.pWindowInfo,ProjectInfo.NumberOfWindows);
+		}
+
+		//.wbpファイルを生成
+		SaveWindowProgram();
+	}
+
+
+	MakeWorkFile();
+
+	SetStatusText("");
+
+	ProjectInfo.modify=0;
+	ProjectInfo.ModifuOfResource=0;
+}
+
+BOOL SetProjectToRun(void){
+	extern PROJECTINFO ProjectInfo;
+	char temporary[MAX_PATH];
+	HANDLE hFind;
+	WIN32_FIND_DATA wfd;
+
+	if(ProjectInfo.pobj_DBFileInfo->iNum==0){
+		//"プログラム ファイルがプロジェクトに存在しません。"
+		MessageBox(hOwner,STRING_ERROR_NOFILE,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+		return 0;
+	}
+
+	extern char *lpszCompilerName;
+	sprintf(temporary,"%s%s",pj_editor_Dir,lpszCompilerName);
+	hFind=FindFirstFile(temporary,&wfd);
+	if(hFind==INVALID_HANDLE_VALUE){
+		//"BasicCompiler.exe が見つかりません"
+		MessageBox(hOwner,STRING_ERROR_NOBASICCOMPILER,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+		return 0;
+	}
+	FindClose(hFind);
+
+	//プロジェクト構造のバージョンが違う時は、再保存する
+	if(ProjectInfo.dwVersion<PROJECT_VERSION)
+		ProjectInfo.ModifyOfMaterial=1;
+
+	//保存確認
+	if(!ProjectModifyCheck(1)) return 0;
+
+	return 1;
+}
+BOOL IsNeedCompileForProject(BOOL bDebug){
+	extern PROJECTINFO ProjectInfo;
+	int i2;
+	char temporary[MAX_PATH];
+	HANDLE hFind,hFile;
+	WIN32_FIND_DATA wfd;
+	FILETIME SourceTime,ExeTime;
+
+	if(bDebug) lstrcpy(temporary,ProjectInfo.lpszOutput_Debug);
+	else lstrcpy(temporary,ProjectInfo.lpszOutput_Release);
+	GetFullPath(temporary,ProjectInfo.dir);
+
+	hFind=FindFirstFile(temporary,&wfd);
+	if(hFind==INVALID_HANDLE_VALUE) return 1;
+	FindClose(hFind);
+
+	hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	GetFileTime(hFile,NULL,NULL,&ExeTime);
+	CloseHandle(hFile);
+
+	for(i2=0;i2<ProjectInfo.pobj_DBFileInfo->iNum;i2++){
+		ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[i2]->GetFullPath(temporary);
+		hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		GetFileTime(hFile,NULL,NULL,&SourceTime);
+		CloseHandle(hFile);
+
+		if(SourceTime.dwHighDateTime>ExeTime.dwHighDateTime||
+			SourceTime.dwHighDateTime==ExeTime.dwHighDateTime&&
+			SourceTime.dwLowDateTime>ExeTime.dwLowDateTime) return 1;
+	}
+	if(ProjectInfo.NumberOfWindows){
+		//CallBack.wbp
+		lstrcpy(temporary,"CallBack.wbp");
+		GetFullPath(temporary,ProjectInfo.dir);
+		hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		GetFileTime(hFile,NULL,NULL,&SourceTime);
+		CloseHandle(hFile);
+		if(SourceTime.dwHighDateTime>ExeTime.dwHighDateTime||
+			SourceTime.dwHighDateTime==ExeTime.dwHighDateTime&&
+			SourceTime.dwLowDateTime>ExeTime.dwLowDateTime) return 1;
+
+		//MakeWindow.wbp
+		lstrcpy(temporary,"MakeWindow.wbp");
+		GetFullPath(temporary,ProjectInfo.dir);
+		hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		GetFileTime(hFile,NULL,NULL,&SourceTime);
+		CloseHandle(hFile);
+		if(SourceTime.dwHighDateTime>ExeTime.dwHighDateTime||
+			SourceTime.dwHighDateTime==ExeTime.dwHighDateTime&&
+			SourceTime.dwLowDateTime>ExeTime.dwLowDateTime) return 1;
+	}
+	return 0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.cpp	(revision 178)
@@ -0,0 +1,3061 @@
+#include "ProjectEditor.h"
+
+
+#if defined HeapAlloc
+#define MEM_MAX 65536
+LPVOID pCheckMem[MEM_MAX];
+int now;
+#undef HeapAlloc
+#undef HeapReAlloc
+LPVOID CheckHeapAlloc(HANDLE hf,DWORD dwFlags,DWORD dwBytes){
+	LPVOID ret;
+	ret=HeapAlloc(hf,dwFlags,dwBytes);
+	pCheckMem[now]=ret;
+
+	//この部分にnowのチェックを挿入
+
+
+	now++;
+	if(now>=MEM_MAX){
+		MessageBox(0,"pCheckMemの最大値を超えました","Check",0);
+	}
+	return ret;
+}
+LPVOID CheckHeapReAlloc(HANDLE hf,DWORD dwFlags,LPVOID lpMem,DWORD dwBytes){
+	int i;
+	LPVOID ret;
+	for(i=0;;i++){
+		if(lpMem==pCheckMem[i]) break;
+		if(i>=MEM_MAX){
+			MessageBox(0,"エラー","CheckHeapReAlloc",0);
+			break;
+		}
+	}
+	ret=HeapReAlloc(hf,dwFlags,lpMem,dwBytes);
+	pCheckMem[i]=ret;
+	return ret;
+}
+void HeapDefaultFree(LPVOID lpMem){
+	int i;
+	for(i=0;;i++){
+		if(lpMem==pCheckMem[i]) break;
+		if(i>=MEM_MAX){
+			MessageBox(0,"エラー","HeapDefaultFree",0);
+			break;
+		}
+	}
+	pCheckMem[i]=0;
+	HeapFree(hHeap,0,lpMem);
+}
+void CheckHeapCheck(){
+	int i,i2;
+	char temp[100];
+	temp[0]=0;
+	for(i=0,i2=0;i<MEM_MAX;i++){
+		if(pCheckMem[i]){
+			sprintf(temp+lstrlen(temp),"%d\r\n",i);
+			i2++;
+			if(i2==10){
+				lstrcat(temp,"これ以上の未解放が確認されています");
+				break;
+			}
+		}
+	}
+	if(temp[0]) MessageBox(0,temp,"Check - BasicCompiler.exe",0);
+}
+#define HeapAlloc CheckHeapAlloc
+#define HeapReAlloc CheckHeapReAlloc
+#else
+void HeapDefaultFree(LPVOID lpMem){
+	HeapFree(hHeap,0,lpMem);
+}
+#endif
+
+#ifdef DeleteObject
+#undef DeleteObject
+BOOL CheckDeleteObject(HGDIOBJ hObject){
+	BOOL bRet;
+	bRet=DeleteObject(hObject);
+
+	if(bRet==0){
+		MessageBox(0,"DeleteObject Error","Check",0);
+	}
+	return bRet;
+}
+#define DeleteObject CheckDeleteObject
+#endif
+
+
+void ToBigChar(char str[]){
+	int i;
+	for(i=0;TRUE;i++){
+		str[i]=(char)toupper((int)str[i]);
+		if(str[i]=='\0') break;
+	}
+}
+int GetWndNum(HWND hChild){
+	int i;
+	if(!IsWindow(hChild)) return -1;
+	for(i=0;i<MAX_WNDNUM;i++){
+		if(hChild==MdiInfo[i].hwnd) break;
+	}
+	if(i==MAX_WNDNUM) i=-1;
+	return i;
+}
+int GetNowWndNum(void){
+	return GetWndNum(GetWindow(hClient,GW_CHILD));
+}
+int GetFileNum(int WndNum){
+	if( !ProjectInfo.name[0] ){
+		return -1;
+	}
+
+	int i;
+	char temporary[MAX_PATH];
+	for(i=0;i<ProjectInfo.pobj_DBFileInfo->iNum;i++){
+
+		ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[i]->GetFullPath(temporary);
+
+		if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) return i;
+	}
+	return -1;
+}
+
+void SendTextEditResizeEvent(HWND hwnd){
+	RECT rect;
+	GetClientRect(hwnd,&rect);
+	ResizeTextEditWnd(hwnd,rect.right,rect.bottom);
+}
+
+void RedrawAllWindow(void){
+	HWND hChild;
+	hChild=GetWindow(hClient,GW_CHILD);
+	if(hChild) ResetTextEditFont(GetWindow(hChild,GW_CHILD));
+	while(hChild){
+		int WndNum;
+		WndNum=GetWndNum(hChild);
+		if(WndNum==-1) break;
+
+		if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+			//コントロールタブスペースの幅と行番号の文字数を更新
+			MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace=
+				GetControlTabSpace(WndNum,&MdiInfo[WndNum].pMdiTextEdit->iLineNumberTextCount);
+
+			InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->hEdit,NULL,0);
+			InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd,NULL,0);
+
+			SendTextEditResizeEvent(MdiInfo[WndNum].hwnd);
+		}
+		else{
+			HWND hEdit;
+			hEdit=GetWindow(hChild,GW_CHILD);
+			InvalidateRect(hEdit,NULL,0);
+		}
+
+		hChild=GetWindow(hChild,GW_HWNDNEXT);
+	}
+}
+
+int DocumentModifyCheck(HWND hChild){	//終了保存確認
+	int BoxID,WndNum,sw;
+	char str[MAX_PATH],temporary[MAX_PATH];
+
+	WndNum=GetWndNum(hChild);
+	sw=0;
+	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+		if( MdiInfo[WndNum].pMdiTextEdit->IsModified() ) sw=1;
+	}
+	else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+		if(MdiInfo[WndNum].MdiIconEditInfo->bModify) sw=1;
+	}
+
+	if(sw){
+		GetWindowText(hChild,temporary,MAX_PATH);
+
+		//"\"%s\" ファイルは変更されています。保存しますか？"
+		sprintf(str,STRING_MODIFYCHECK_FILE,temporary);
+		BoxID=MessageBox(hOwner,str,APPLICATION_NAME,MB_YESNOCANCEL|MB_ICONINFORMATION);
+
+		if(BoxID==IDYES){
+			if(!SaveDocument(hChild,NULL)) return 0;
+		}
+		else if(BoxID==IDCANCEL) return 0;
+	}
+	return 1;
+}
+void SetStatusText(char *MenuText){
+	//////////////////////////
+	// ステータスバーの更新
+	//////////////////////////
+
+	int WndNum;
+	double BufSize;
+	char temporary[255];
+	HWND hChild;
+
+	if(MenuText){
+		SendMessage(hStatusBar,SB_SETTEXT,0,(long)MenuText);
+		if((char *)MenuText!=(char *)CmdMsg) CmdMsg[0]=0;
+	}
+
+	hChild=GetWindow(hClient,GW_CHILD);
+	WndNum=GetWndNum(hChild);
+	if(WndNum==-1) return;
+	hChild=GetWindow(hChild,GW_CHILD);
+	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+		//////////////////////
+		// テキストエディタ
+		//////////////////////
+
+		//サイズ
+		BufSize=(double)lstrlen(MdiInfo[WndNum].pMdiTextEdit->buffer);
+		if(IsWindow(hChild)){
+			if(BufSize<1024) sprintf(temporary,"%s: %.0fByte",STRING_SIZE,BufSize);
+			else if(BufSize<1024*1024){
+				BufSize/=1024;
+				sprintf(temporary,"%s: %.2fKB",STRING_SIZE,BufSize);
+			}
+			else{
+				BufSize/=1024*1024;
+				sprintf(temporary,"%s: %.2fMB",STRING_SIZE,BufSize);
+			}
+		}
+		else temporary[0]=0;
+		SendMessage(hStatusBar,SB_SETTEXT,1,(LPARAM)temporary);
+
+		//行と桁
+		if(IsWindow(hChild)){
+#if defined(JPN)
+			//日本語
+			sprintf(temporary,"%d 行、%d 列",
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y+1,
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x+1);
+#else
+			//英語
+			sprintf(temporary,"%d : %d",
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y+1,
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x+1);
+#endif
+		}
+		else temporary[0]=0;
+		SendMessage(hStatusBar,SB_SETTEXT,2,(LPARAM)temporary);
+
+		//文字コード
+		nkf.GetCharCodeName(MdiInfo[WndNum].pMdiTextEdit->iCharCode,temporary);
+		SendMessage(hStatusBar,SB_SETTEXT,3,(LPARAM)temporary);
+
+		//文字コード
+		nkf.GetLfCodeName(MdiInfo[WndNum].pMdiTextEdit->iLfCode,temporary);
+		SendMessage(hStatusBar,SB_SETTEXT,4,(LPARAM)temporary);
+	}
+	else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){
+		////////////////
+		// RADツール
+		////////////////
+
+		int WndInfoNum;
+		WndInfoNum=GetWndInfoNum(MdiInfo[WndNum].path);
+		if(RadInfo.NowDragging>=FRAME_CHANGEPOS_START&&RadInfo.NowDragging<=FRAME_CHANGEPOS_END){
+			sprintf(temporary,"pos %d, %d",
+				RadInfo.DraggingRect[0].left-MdiInfo[WndNum].MdiRadInfo->ClientPos.x,
+				RadInfo.DraggingRect[0].top-MdiInfo[WndNum].MdiRadInfo->ClientPos.y);
+			SendMessage(hStatusBar,SB_SETTEXT,1,(LPARAM)temporary);
+			sprintf(temporary,"size %d * %d",
+				RadInfo.DraggingRect[0].right-RadInfo.DraggingRect[0].left,
+				RadInfo.DraggingRect[0].bottom-RadInfo.DraggingRect[0].top);
+			SendMessage(hStatusBar,SB_SETTEXT,2,(LPARAM)temporary);
+		}
+		else if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
+			SendMessage(hStatusBar,SB_SETTEXT,1,(LPARAM)"pos 0, 0");
+			sprintf(temporary,"size %d * %d",ProjectInfo.pWindowInfo[WndInfoNum].size.cx,ProjectInfo.pWindowInfo[WndInfoNum].size.cy);
+			SendMessage(hStatusBar,SB_SETTEXT,2,(LPARAM)temporary);
+		}
+		else{
+			sprintf(temporary,"pos %d, %d",
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].pos.x,
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].pos.y);
+			SendMessage(hStatusBar,SB_SETTEXT,1,(LPARAM)temporary);
+			sprintf(temporary,"size %d * %d",
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].size.cx,
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].size.cy);
+			SendMessage(hStatusBar,SB_SETTEXT,2,(LPARAM)temporary);
+		}
+	}
+	else if(MdiInfo[WndNum].DocType==WNDTYPE_MENU){
+		//////////////////
+		// MENU エディタ
+		//////////////////
+
+		SendMessage(hStatusBar,SB_SETTEXT,1,(LPARAM)"");
+		SendMessage(hStatusBar,SB_SETTEXT,2,(LPARAM)"");
+	}
+	else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+		//////////////////
+		// ICON エディタ
+		//////////////////
+
+		SendMessage(hStatusBar,SB_SETTEXT,1,(LPARAM)"");
+		SendMessage(hStatusBar,SB_SETTEXT,2,(LPARAM)"");
+	}
+}
+void ResetState_UndoMenu(void){				//「元に戻す、やり直し」のメニュー表示制御
+	int i,i2;
+	HWND hChild;
+
+	hChild=GetWindow(hClient,GW_CHILD);
+	i=GetWndNum(hChild);
+	if(i==-1){
+		pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
+		EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
+		pobj_StandardToolbar->EnableItem(IDM_UNDO,0);
+		pobj_MainMenu->EnableItem(IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
+		EnableMenuItem(hEditMenu,IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
+		pobj_StandardToolbar->EnableItem(IDM_REDO,0);
+	}
+	else if(IS_DOCUMENT_TEXT(MdiInfo[i].DocType)){
+		i2=MdiInfo[i].pMdiTextEdit->pTextEditUndoState->NowPos-1;
+		if(i2==-1) i2=MAX_UNDONUM-1;
+		if(!MdiInfo[i].pMdiTextEdit->pTextEditUndoState->Command[i2]){
+			pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
+			EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
+			pobj_StandardToolbar->EnableItem(IDM_UNDO,0);
+		}
+		else{
+			pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_ENABLED);
+			EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_ENABLED);
+			pobj_StandardToolbar->EnableItem(IDM_UNDO,1);
+		}
+		if(!MdiInfo[i].pMdiTextEdit->pTextEditUndoState->Command[MdiInfo[i].pMdiTextEdit->pTextEditUndoState->NowPos]){
+			pobj_MainMenu->EnableItem(IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
+			EnableMenuItem(hEditMenu,IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
+			pobj_StandardToolbar->EnableItem(IDM_REDO,0);
+		}
+		else{
+			pobj_MainMenu->EnableItem(IDM_REDO,MF_BYCOMMAND|MF_ENABLED);
+			EnableMenuItem(hEditMenu,IDM_REDO,MF_BYCOMMAND|MF_ENABLED);
+			pobj_StandardToolbar->EnableItem(IDM_REDO,1);
+		}
+	}
+	else if(MdiInfo[i].DocType==WNDTYPE_RAD){
+		i2=MdiInfo[i].MdiRadInfo->undo.NowPos-1;
+		if(i2==-1) i2=MAX_UNDONUM-1;
+		if(!MdiInfo[i].MdiRadInfo->undo.Command[i2]){
+			pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
+			EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
+			pobj_StandardToolbar->EnableItem(IDM_UNDO,0);
+		}
+		else{
+			pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_ENABLED);
+			EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_ENABLED);
+			pobj_StandardToolbar->EnableItem(IDM_UNDO,1);
+		}
+		if(!MdiInfo[i].MdiRadInfo->undo.Command[MdiInfo[i].MdiRadInfo->undo.NowPos]){
+			pobj_MainMenu->EnableItem(IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
+			EnableMenuItem(hEditMenu,IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
+			pobj_StandardToolbar->EnableItem(IDM_REDO,0);
+		}
+		else{
+			pobj_MainMenu->EnableItem(IDM_REDO,MF_BYCOMMAND|MF_ENABLED);
+			EnableMenuItem(hEditMenu,IDM_REDO,MF_BYCOMMAND|MF_ENABLED);
+			pobj_StandardToolbar->EnableItem(IDM_REDO,1);
+		}
+	}
+	else if(MdiInfo[i].DocType==WNDTYPE_MENU){
+		pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
+		EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
+		pobj_StandardToolbar->EnableItem(IDM_UNDO,0);
+
+		pobj_MainMenu->EnableItem(IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
+		EnableMenuItem(hEditMenu,IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
+		pobj_StandardToolbar->EnableItem(IDM_REDO,0);
+	}
+	else if(MdiInfo[i].DocType==WNDTYPE_ICONEDIT){
+		i2=MdiInfo[i].MdiIconEditInfo->undo[MdiInfo[i].MdiIconEditInfo->SelectIconNum].NowPos-1;
+		if(i2==-1) i2=MAX_ICONEDIT_UNDONUM-1;
+		if(!MdiInfo[i].MdiIconEditInfo->undo[MdiInfo[i].MdiIconEditInfo->SelectIconNum].lpData[i2]){
+			pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
+			EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_GRAYED);
+			pobj_StandardToolbar->EnableItem(IDM_UNDO,0);
+		}
+		else{
+			pobj_MainMenu->EnableItem(IDM_UNDO,MF_BYCOMMAND|MF_ENABLED);
+			EnableMenuItem(hEditMenu,IDM_UNDO,MF_BYCOMMAND|MF_ENABLED);
+			pobj_StandardToolbar->EnableItem(IDM_UNDO,1);
+		}
+		if(!MdiInfo[i].MdiIconEditInfo->undo[MdiInfo[i].MdiIconEditInfo->SelectIconNum].lpData[MdiInfo[i].MdiIconEditInfo->undo[MdiInfo[i].MdiIconEditInfo->SelectIconNum].NowPos]){
+			pobj_MainMenu->EnableItem(IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
+			EnableMenuItem(hEditMenu,IDM_REDO,MF_BYCOMMAND|MF_GRAYED);
+			pobj_StandardToolbar->EnableItem(IDM_REDO,0);
+		}
+		else{
+			pobj_MainMenu->EnableItem(IDM_REDO,MF_BYCOMMAND|MF_ENABLED);
+			EnableMenuItem(hEditMenu,IDM_REDO,MF_BYCOMMAND|MF_ENABLED);
+			pobj_StandardToolbar->EnableItem(IDM_REDO,1);
+		}
+	}
+}
+void ResetState_ConvMenu(BOOL bEnable){
+	int MenuMsg;
+	if(bEnable)
+		MenuMsg=MF_BYCOMMAND|MF_ENABLED;
+	else MenuMsg=MF_BYCOMMAND|MF_GRAYED;
+
+	pobj_MainMenu->EnableItem(IDM_CONV_ALPHA_SMALL,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_CONV_ALPHA_BIG,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_CONV_HALF,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_CONV_MULTI,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_CONV_KATAKANA,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_CONV_HIRAGANA,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_CONV_SPACE,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_CONV_TAB,MenuMsg);
+#ifdef THETEXT
+	pobj_MainMenu->EnableItem(IDM_CONV_HASRETURN,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_CONV_QUOTE,MenuMsg);
+#else
+	pobj_MainMenu->EnableItem(IDM_CODEFORMAT,MenuMsg);
+#endif
+}
+void ResetState_PrintMenu(void);
+void ResetState_EditMenu(void){				//編集メニューの表示制御
+	HWND hChild;
+	int WndNum;
+	long MenuMsg,ToolbarMsg;
+
+	//印刷メニューの状態を設定
+	ResetState_PrintMenu();
+
+	hChild=GetWindow(hClient,GW_CHILD);
+	if(!IsWindow(hChild)){
+		pobj_MainMenu->EnableItem(IDM_FIND,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_PERMUTATION,MF_BYCOMMAND|MF_GRAYED);
+#ifdef THETEXT
+		pobj_MainMenu->EnableItem(IDM_STRING_COUNT,MF_BYCOMMAND|MF_GRAYED);
+#endif
+		pobj_StandardToolbar->EnableItem(IDM_FIND,0);
+
+		pobj_MainMenu->EnableItem(IDM_CUT,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_COPY,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_DELETE,MF_BYCOMMAND|MF_GRAYED);
+		EnableMenuItem(hEditMenu,IDM_CUT,MF_BYCOMMAND|MF_GRAYED);
+		EnableMenuItem(hEditMenu,IDM_COPY,MF_BYCOMMAND|MF_GRAYED);
+		EnableMenuItem(hEditMenu,IDM_DELETE,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_PASTE,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_ALLSELECT,MF_BYCOMMAND|MF_GRAYED);
+		pobj_StandardToolbar->EnableItem(IDM_CUT,0);
+		pobj_StandardToolbar->EnableItem(IDM_COPY,0);
+		pobj_StandardToolbar->EnableItem(IDM_PASTE,0);
+
+		ResetState_ConvMenu(0);
+
+		ResetState_UndoMenu();
+		return;
+	}
+	WndNum=GetWndNum(hChild);
+	if(WndNum==-1) return;
+	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+		pobj_MainMenu->EnableItem(IDM_ALLSELECT,MF_BYCOMMAND|MF_ENABLED);
+		pobj_MainMenu->EnableItem(IDM_FIND,MF_BYCOMMAND|MF_ENABLED);
+		pobj_MainMenu->EnableItem(IDM_PERMUTATION,MF_BYCOMMAND|MF_ENABLED);
+#ifdef THETEXT
+		pobj_MainMenu->EnableItem(IDM_STRING_COUNT,MF_BYCOMMAND|MF_ENABLED);
+#endif
+		pobj_StandardToolbar->EnableItem(IDM_FIND,1);
+
+		BOOL bConvEnable;
+		hChild=GetWindow(hChild,GW_CHILD);
+		if(!(
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y
+			)){
+			MenuMsg=MF_BYCOMMAND|MF_ENABLED;
+			ToolbarMsg=1;
+
+			bConvEnable=1;
+		}
+		else{
+			MenuMsg=MF_BYCOMMAND|MF_GRAYED;
+			ToolbarMsg=0;
+
+			bConvEnable=0;
+		}
+		pobj_MainMenu->EnableItem(IDM_CUT,MenuMsg);
+		pobj_MainMenu->EnableItem(IDM_COPY,MenuMsg);
+		pobj_MainMenu->EnableItem(IDM_DELETE,MenuMsg);
+		EnableMenuItem(hEditMenu,IDM_CUT,MenuMsg);
+		EnableMenuItem(hEditMenu,IDM_COPY,MenuMsg);
+		EnableMenuItem(hEditMenu,IDM_DELETE,MenuMsg);
+		pobj_StandardToolbar->EnableItem(IDM_CUT,ToolbarMsg);
+		pobj_StandardToolbar->EnableItem(IDM_COPY,ToolbarMsg);
+
+		if(IsClipboardFormatAvailable(CF_TEXT)){
+			pobj_MainMenu->EnableItem(IDM_PASTE,MF_BYCOMMAND|MF_ENABLED);
+			pobj_StandardToolbar->EnableItem(IDM_PASTE,1);
+		}
+		else{
+			pobj_MainMenu->EnableItem(IDM_PASTE,MF_BYCOMMAND|MF_GRAYED);
+			pobj_StandardToolbar->EnableItem(IDM_PASTE,0);
+		}
+
+
+		//変換コマンド
+		ResetState_ConvMenu(bConvEnable);
+	}
+	else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){
+		//検索、置換、文字カウントを無効化
+		pobj_MainMenu->EnableItem(IDM_FIND,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_PERMUTATION,MF_BYCOMMAND|MF_GRAYED);
+#ifdef THETEXT
+		pobj_MainMenu->EnableItem(IDM_STRING_COUNT,MF_BYCOMMAND|MF_GRAYED);
+#endif
+		pobj_StandardToolbar->EnableItem(IDM_FIND,0);
+
+		if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
+			//切り取り、コピー、削除を有効化
+			pobj_MainMenu->EnableItem(IDM_CUT,MF_BYCOMMAND|MF_GRAYED);
+			pobj_MainMenu->EnableItem(IDM_COPY,MF_BYCOMMAND|MF_GRAYED);
+			pobj_MainMenu->EnableItem(IDM_DELETE,MF_BYCOMMAND|MF_GRAYED);
+			EnableMenuItem(hEditMenu,IDM_CUT,MF_BYCOMMAND|MF_GRAYED);
+			EnableMenuItem(hEditMenu,IDM_COPY,MF_BYCOMMAND|MF_GRAYED);
+			EnableMenuItem(hEditMenu,IDM_DELETE,MF_BYCOMMAND|MF_GRAYED);
+			pobj_StandardToolbar->EnableItem(IDM_CUT,0);
+			pobj_StandardToolbar->EnableItem(IDM_COPY,0);
+		}
+		else{
+			//切り取り、コピー、削除を無効化
+			pobj_MainMenu->EnableItem(IDM_CUT,MF_BYCOMMAND|MF_ENABLED);
+			pobj_MainMenu->EnableItem(IDM_COPY,MF_BYCOMMAND|MF_ENABLED);
+			pobj_MainMenu->EnableItem(IDM_DELETE,MF_BYCOMMAND|MF_ENABLED);
+			EnableMenuItem(hEditMenu,IDM_CUT,MF_BYCOMMAND|MF_ENABLED);
+			EnableMenuItem(hEditMenu,IDM_COPY,MF_BYCOMMAND|MF_ENABLED);
+			EnableMenuItem(hEditMenu,IDM_DELETE,MF_BYCOMMAND|MF_ENABLED);
+			pobj_StandardToolbar->EnableItem(IDM_CUT,1);
+			pobj_StandardToolbar->EnableItem(IDM_COPY,1);
+		}
+
+		//すべて選択を有効化
+		pobj_MainMenu->EnableItem(IDM_ALLSELECT,MF_BYCOMMAND|MF_ENABLED);
+
+		if(IsClipboardFormatAvailable(dwRadClipboardID)){
+			pobj_MainMenu->EnableItem(IDM_PASTE,MF_BYCOMMAND|MF_ENABLED);
+			pobj_StandardToolbar->EnableItem(IDM_PASTE,1);
+		}
+		else{
+			pobj_MainMenu->EnableItem(IDM_PASTE,MF_BYCOMMAND|MF_GRAYED);
+			pobj_StandardToolbar->EnableItem(IDM_PASTE,0);
+		}
+
+		ResetState_ConvMenu(0);
+	}
+	else if(MdiInfo[WndNum].DocType==WNDTYPE_MENU){
+		//検索、置換、文字カウントを無効化
+		pobj_MainMenu->EnableItem(IDM_FIND,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_PERMUTATION,MF_BYCOMMAND|MF_GRAYED);
+#ifdef THETEXT
+		pobj_MainMenu->EnableItem(IDM_STRING_COUNT,MF_BYCOMMAND|MF_GRAYED);
+#endif
+		pobj_StandardToolbar->EnableItem(IDM_FIND,0);
+
+		pobj_MainMenu->EnableItem(IDM_CUT,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_COPY,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_DELETE,MF_BYCOMMAND|MF_GRAYED);
+		EnableMenuItem(hEditMenu,IDM_CUT,MF_BYCOMMAND|MF_GRAYED);
+		EnableMenuItem(hEditMenu,IDM_COPY,MF_BYCOMMAND|MF_GRAYED);
+		EnableMenuItem(hEditMenu,IDM_DELETE,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_PASTE,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_ALLSELECT,MF_BYCOMMAND|MF_GRAYED);
+		pobj_StandardToolbar->EnableItem(IDM_CUT,0);
+		pobj_StandardToolbar->EnableItem(IDM_COPY,0);
+		pobj_StandardToolbar->EnableItem(IDM_PASTE,0);
+
+		ResetState_ConvMenu(0);
+	}
+	else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+		//検索、置換、文字カウントを無効化
+		pobj_MainMenu->EnableItem(IDM_FIND,MF_BYCOMMAND|MF_GRAYED);
+		pobj_MainMenu->EnableItem(IDM_PERMUTATION,MF_BYCOMMAND|MF_GRAYED);
+#ifdef THETEXT
+		pobj_MainMenu->EnableItem(IDM_STRING_COUNT,MF_BYCOMMAND|MF_GRAYED);
+#endif
+		pobj_StandardToolbar->EnableItem(IDM_FIND,0);
+
+		if(MdiInfo[WndNum].MdiIconEditInfo->SelectLevel==0){
+			//切り取り、コピー、削除を無効化
+			pobj_MainMenu->EnableItem(IDM_CUT,MF_BYCOMMAND|MF_GRAYED);
+			pobj_MainMenu->EnableItem(IDM_COPY,MF_BYCOMMAND|MF_GRAYED);
+			pobj_MainMenu->EnableItem(IDM_DELETE,MF_BYCOMMAND|MF_GRAYED);
+			EnableMenuItem(hEditMenu,IDM_CUT,MF_BYCOMMAND|MF_GRAYED);
+			EnableMenuItem(hEditMenu,IDM_COPY,MF_BYCOMMAND|MF_GRAYED);
+			EnableMenuItem(hEditMenu,IDM_DELETE,MF_BYCOMMAND|MF_GRAYED);
+			pobj_StandardToolbar->EnableItem(IDM_CUT,0);
+			pobj_StandardToolbar->EnableItem(IDM_COPY,0);
+		}
+		else{
+			//切り取り、コピー、削除を有効化
+			pobj_MainMenu->EnableItem(IDM_CUT,MF_BYCOMMAND|MF_ENABLED);
+			pobj_MainMenu->EnableItem(IDM_COPY,MF_BYCOMMAND|MF_ENABLED);
+			pobj_MainMenu->EnableItem(IDM_DELETE,MF_BYCOMMAND|MF_ENABLED);
+			EnableMenuItem(hEditMenu,IDM_CUT,MF_BYCOMMAND|MF_ENABLED);
+			EnableMenuItem(hEditMenu,IDM_COPY,MF_BYCOMMAND|MF_ENABLED);
+			EnableMenuItem(hEditMenu,IDM_DELETE,MF_BYCOMMAND|MF_ENABLED);
+			pobj_StandardToolbar->EnableItem(IDM_CUT,1);
+			pobj_StandardToolbar->EnableItem(IDM_COPY,1);
+		}
+
+		//すべて選択を有効化
+		pobj_MainMenu->EnableItem(IDM_ALLSELECT,MF_BYCOMMAND|MF_ENABLED);
+
+		if(IsClipboardFormatAvailable(CF_BITMAP)){
+			//貼り付けを有効化
+			pobj_MainMenu->EnableItem(IDM_PASTE,MF_BYCOMMAND|MF_ENABLED);
+			pobj_StandardToolbar->EnableItem(IDM_PASTE,1);
+		}
+		else{
+			//貼り付けを無効化
+			pobj_MainMenu->EnableItem(IDM_PASTE,MF_BYCOMMAND|MF_GRAYED);
+			pobj_StandardToolbar->EnableItem(IDM_PASTE,0);
+		}
+
+		ResetState_ConvMenu(0);
+	}
+
+	ResetState_UndoMenu();
+}
+void ResetState_ViewMenu(void){
+	// 表示 メニューの状態を設定
+
+
+#ifdef THETEXT
+	pobj_MainMenu->CheckMenu(IDM_RIGHT_TURN,pobj_nv->bRightTurn);
+#endif
+}
+void ResetState_PrintMenu(void){				//編集メニューの表示制御
+	HWND hChild;
+	int WndNum;
+	hChild=GetWindow(hClient,GW_CHILD);
+	if(!IsWindow(hChild)){
+		pobj_MainMenu->EnableItem(IDM_PAGESET,MF_BYCOMMAND|MF_GRAYED);
+
+		pobj_MainMenu->EnableItem(IDM_PREVIEW,MF_BYCOMMAND|MF_GRAYED);
+
+		pobj_MainMenu->EnableItem(IDM_PRINTOUT,MF_BYCOMMAND|MF_GRAYED);
+		return;
+	}
+	WndNum=GetWndNum(hChild);
+	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+		pobj_MainMenu->EnableItem(IDM_PAGESET,MF_BYCOMMAND|MF_ENABLED);
+
+		pobj_MainMenu->EnableItem(IDM_PREVIEW,MF_BYCOMMAND|MF_ENABLED);
+
+		pobj_MainMenu->EnableItem(IDM_PRINTOUT,MF_BYCOMMAND|MF_ENABLED);
+	}
+	else{
+		pobj_MainMenu->EnableItem(IDM_PAGESET,MF_BYCOMMAND|MF_GRAYED);
+
+		pobj_MainMenu->EnableItem(IDM_PREVIEW,MF_BYCOMMAND|MF_GRAYED);
+
+		pobj_MainMenu->EnableItem(IDM_PRINTOUT,MF_BYCOMMAND|MF_GRAYED);
+	}
+}
+void ResetState_DocMenu(void){
+	long MenuMsg,ToolbarMsg;
+	HWND hChild;
+
+	hChild=GetWindow(hClient,GW_CHILD);
+
+
+	/////////////////////////////////////////
+	// 共通ドキュメント メニューの状態を設定
+	/////////////////////////////////////////
+
+	if(!IsWindow(hChild)){
+		MenuMsg=MF_GRAYED;
+		ToolbarMsg=0;
+	}
+	else{
+		MenuMsg=MF_ENABLED;
+		ToolbarMsg=1;
+	}
+	pobj_MainMenu->EnableItem(IDM_CLOSE,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_SAVE,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_NEWSAVE,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_CODE_SAVE,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_ALLSAVE,MenuMsg);
+
+	pobj_StandardToolbar->EnableItem(IDM_CLOSE,ToolbarMsg);
+	pobj_StandardToolbar->EnableItem(IDM_SAVE,ToolbarMsg);
+	pobj_StandardToolbar->EnableItem(IDM_ALLSAVE,ToolbarMsg);
+
+
+#ifndef THETEXT
+	/////////////////////////////////////////////////
+	// プロジェクトドキュメント メニューの状態を設定
+	/////////////////////////////////////////////////
+
+	if(ProjectInfo.name[0]){
+		pobj_MainMenu->EnableItem(IDM_ALLSAVE,MF_ENABLED);
+		pobj_StandardToolbar->EnableItem(IDM_ALLSAVE,1);
+
+		MenuMsg=MF_ENABLED;
+		ToolbarMsg=TBSTATE_ENABLED;
+	}
+	else{
+		MenuMsg=MF_GRAYED;
+		ToolbarMsg=TBSTATE_INDETERMINATE;
+	}
+	pobj_MainMenu->EnableItem(IDM_PROJECT_SAVE,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_PROJECT_CLOSE,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_PROJECT_FOLDER_OPEN,MenuMsg);
+	pobj_MainMenu->EnableItem(IDM_PROJECT_OPTION,MenuMsg);
+
+	//デバッガ メニューの状態を設定
+	pobj_Debugger->ResetCommandEnabled();
+#endif
+
+
+	//編集メニューの状態を設定
+	ResetState_EditMenu();
+
+	//表示メニューの状態を設定
+	ResetState_ViewMenu();
+}
+void DuplicateTitleCheck(char *lpszTitle){
+	int i;
+	for(i=0;i<MAX_WNDNUM;i++){
+		if(MdiInfo[i].hwnd){
+			if(lstrcmpi(MdiInfo[i].title,lpszTitle)==0){
+				lstrcat(lpszTitle,"_");
+				DuplicateTitleCheck(lpszTitle);
+				return;
+			}
+		}
+	}
+}
+HWND NewTextEditWindow(char *filepath,_int8 DocumentType,COLORREF TabColor){
+	int i;
+	char str[MAX_PATH],str2[32],*buffer;
+	HWND hChild,hEdit;
+	RECT rect;
+	int iCharCode=NKF_SHIFT_JIS;
+	int iLfCode=LFCODE_CRLF;
+
+	if(filepath){
+
+		//すでに指定されたファイルが開かれている場合
+		hChild=GetWindow(hClient,GW_CHILD);
+		while(hChild){
+			i=GetWndNum(hChild);
+			if(IS_DOCUMENT_TEXT(MdiInfo[i].DocType)){
+				if(lstrcmpi(MdiInfo[i].path,filepath)==0) break;
+			}
+			hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+		}
+		if(hChild){
+			//前面に表示して終了
+			BringWindowToTop(hChild);
+			return hChild;
+		}
+
+
+		//////////////////////////////////////////////////////
+		//ファイル読み込み（正常に読み込めるかの確認も含む）
+		//////////////////////////////////////////////////////
+
+		HANDLE hFile;
+		hFile=CreateFile(filepath,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+		if(hFile==INVALID_HANDLE_VALUE){
+			sprintf(str,STRING_ERROR_CANT_FILEOPEN,filepath);
+			MessageBox(hOwner,str,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+			return 0;
+		}
+		int length;
+		length=GetFileSize(hFile,NULL);
+
+		char *temp;
+		temp=(char *)HeapAlloc(hHeap,0,length+1);
+		DWORD dw;
+		ReadFile(hFile,temp,length,&dw,NULL);
+		CloseHandle(hFile);
+		for(i=0;i<length;i++){
+			if(temp[i]=='\0') temp[i]=' ';
+		}
+		temp[length]=0;
+
+
+		///////////////////////
+		// 改行コードを判別
+		///////////////////////
+
+		char *temp2;
+		for(i=0;i<length;i++){
+			if(temp[i]=='\r'){
+				if(temp[i+1]=='\n')
+					iLfCode=LFCODE_CRLF;
+				else
+					iLfCode=LFCODE_CR;
+				break;
+			}
+			if(temp[i]=='\n'){
+				iLfCode=LFCODE_LF;
+				break;
+			}
+		}
+
+		//改行コードを変換
+		if(iLfCode==LFCODE_CR||iLfCode==LFCODE_LF){
+			temp2=nkf.ToCRLF(iLfCode,temp);
+			HeapDefaultFree(temp);
+			temp=temp2;
+
+			length=lstrlen(temp);
+		}
+
+
+		/////////////////////
+		// Shift-JISに変換
+		/////////////////////
+
+		buffer=(char *)HeapAlloc(hHeap,0,length*2+1);
+		nkf.pSetNkfOption("-sx");	//Shift-JISに変換（xは半角カタカナを全角に変換しないオプション）
+		nkf.pNkfConvert(buffer,temp);
+		buffer=(char *)HeapReAlloc(hHeap,0,buffer,lstrlen(buffer)+1);
+		HeapDefaultFree(temp);
+
+		//変換前の文字コードを判別
+		iCharCode=nkf.pNkfGetKanjiCode();
+		if(iCharCode<NKF_CODE_MIN||NKF_CODE_MAX<iCharCode){
+			//判別不能な場合は、Shift-JISにする
+			iCharCode=NKF_SHIFT_JIS;
+		}
+		else if(iCharCode==NKF_EUC||iCharCode==NKF_ISO_2022_JP){
+			//EUC、JISの場合で、判別不能な場合は、Shift-JISを優先
+			for(i=0;;i++){
+				if(buffer[i]=='\0'){
+					//半角コードのみ
+					iCharCode=NKF_SHIFT_JIS;
+					break;
+				}
+				if(IsDBCSLeadByte(buffer[i])) break;
+			}
+		}
+
+
+		//////////////////////////
+		// ファイルパスをセット
+		//////////////////////////
+
+		_splitpath(filepath,NULL,NULL,str,str2);
+		lstrcat(str,str2);
+	}
+	else{
+		buffer=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+		DocumentCounter++;
+		sprintf(str,"Document[%d]",DocumentCounter);
+	}
+
+	MDICREATESTRUCT mdic;
+	mdic.szClass="MDIClientWindow_TextEdit";
+	mdic.hOwner=hInst;
+	mdic.x=CW_USEDEFAULT;
+	mdic.y=CW_USEDEFAULT;
+	mdic.cx=CW_USEDEFAULT;
+	mdic.cy=CW_USEDEFAULT;
+	mdic.szTitle=str;
+
+	hChild=GetWindow(hClient,GW_CHILD);
+	if(IsWindow(hChild)){
+		if(IsZoomed(hChild)) mdic.style=WS_MAXIMIZE;
+		else mdic.style=0;
+	}
+	else{
+		if(pobj_nv->bMDIZoomed) mdic.style=WS_MAXIMIZE;
+		else mdic.style=0;
+	}
+
+	//ファイルアイコンをセット
+	SHFILEINFO shfi;
+	if(filepath)
+		SHGetFileInfo(filepath, FILE_ATTRIBUTE_ARCHIVE, &shfi, sizeof(SHFILEINFO), SHGFI_ICON | SHGFI_SMALLICON );
+	else shfi.hIcon=(HICON)LoadImage(hResInst,MAKEINTRESOURCE(IDI_TEXTDOCUMENT),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);;
+	mdic.lParam=(LPARAM)shfi.hIcon;
+
+	mdic.style|=WS_CLIPCHILDREN;
+	hChild=(HWND)SendMessage(hClient,WM_MDICREATE,0,(long)&mdic);	//ウィンドウ作成
+
+	//TextEditorコントロールを設置
+	GetClientRect(hChild,&rect);
+	hEdit=CreateWindow("TextEditor",NULL,
+		WS_CHILD|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE,
+		0,0,0,0,
+		hChild,NULL,hInst,NULL);
+
+	//ウィンドウのID登録
+	for(i=0;i<MAX_WNDNUM;i++){
+		if(MdiInfo[i].hwnd==0){
+			MdiInfo[i].hwnd=hChild;
+			MdiInfo[i].DocType=DocumentType;
+			DuplicateTitleCheck(str);
+			MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(str)+1);
+			lstrcpy(MdiInfo[i].title,str);
+			if(filepath){
+				MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(filepath)+1);
+				lstrcpy(MdiInfo[i].path,filepath);
+			}
+			else{
+				MdiInfo[i].path=(char *)GlobalAlloc(GPTR,1);
+			}
+
+			MdiInfo[i].pMdiTextEdit = new CMdiTextEdit( &MdiInfo[i] );
+
+			MdiInfo[i].pMdiTextEdit->hEdit=hEdit;
+			MdiInfo[i].pMdiTextEdit->pobj_WebResult=new CWebResult(hChild);
+			MdiInfo[i].pMdiTextEdit->pobj_Ruler=new CRuler(hChild,i);
+			MdiInfo[i].pMdiTextEdit->hIcon=shfi.hIcon;
+			MdiInfo[i].pMdiTextEdit->buffer=buffer;
+			MdiInfo[i].pMdiTextEdit->pColorRef=(COLORREF *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,sizeof(COLORREF)*lstrlen(buffer));
+			MdiInfo[i].pMdiTextEdit->iUnderStart=-1;
+			MdiInfo[i].pMdiTextEdit->iUnderEnd=-1;
+			MdiInfo[i].pMdiTextEdit->StartCaretPos.x=0;
+			MdiInfo[i].pMdiTextEdit->StartCaretPos.y=0;
+			MdiInfo[i].pMdiTextEdit->EndCaretPos.x=0;
+			MdiInfo[i].pMdiTextEdit->EndCaretPos.y=0;
+			MdiInfo[i].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+			MdiInfo[i].pMdiTextEdit->bAutoScroll=0;
+			MdiInfo[i].pMdiTextEdit->iWidth_ControlTabSpace=
+				GetControlTabSpace(i,&MdiInfo[i].pMdiTextEdit->iLineNumberTextCount);
+			MdiInfo[i].pMdiTextEdit->iCharCode=iCharCode;
+			MdiInfo[i].pMdiTextEdit->iLfCode=iLfCode;
+
+			MdiInfo[i].IndentStr=0;
+
+			int flag;
+			if(mdic.style&WS_MAXIMIZE) flag=SIZE_MAXIMIZED;
+			else flag=0;
+			SendTextEditResizeEvent(hChild);
+			break;
+		}
+	}
+
+	//ワードカラーをセット
+	if(IS_DOCUMENT_TEXT(DocumentType)) SetTextEditWordColor(i);
+
+	//Docコンボボックスに追加
+	extern HWND hDocCombo;
+	i=SendMessage(hDocCombo,CB_ADDSTRING,0,(long)str);
+	SendMessage(hDocCombo,CB_SETCURSEL,i,0);
+
+	//タブに追加
+	pobj_MainTab->InsertItem( str, true, TabColor );
+
+	SetFocus(hEdit);
+	SetStatusText(NULL);
+
+	//メニュー状態を設定
+	ResetState_DocMenu();
+
+	if( DocumentType == WNDTYPE_BASIC && ProjectInfo.name[0] == '\0' ){
+		// 単体ソースコードを開いたとき
+		if( !IsWindowVisible( hProjectView ) ){
+			// クラスビューを表示する
+			SendMessage(hOwner,WM_COMMAND,IDM_PROJECTVIEW,0);
+			ShowClassView();
+
+			// クラスビューを更新
+			ResetClassTree(-1);
+		}
+	}
+
+	return hChild;
+}
+void CreateNewFile(void){
+
+#ifdef THETEXT
+	NewTextEditWindow(NULL,WNDTYPE_TEXT);
+	return;
+#else
+	int FileType;
+	BOOL bAddToProject;
+	char temporary[MAX_PATH];
+
+	FileType=DialogBox(hResInst,MAKEINTRESOURCE(IDD_NEWFILE),hOwner,DlgNewFile);
+	if(FileType==-1) return;
+
+	if(FileType&0x00008000){
+		bAddToProject=1;
+		FileType&=0x0FFF;
+		lstrcpy(temporary,NewFileName);
+		if(!strstr(temporary,".")) lstrcat(temporary,".ab");
+		GetFullPath(temporary,ProjectInfo.dir);
+	}
+	else bAddToProject=0;
+
+	switch(FileType){
+		case FT_BASICPROGRAM:		//Basicプログラム
+		case FT_SUBPROGRAM:
+			if(bAddToProject){
+				WriteBuffer(temporary,0,0);
+				NewTextEditWindow(temporary,WNDTYPE_BASIC);
+				Project_File_Insert(temporary);
+			}
+			else NewTextEditWindow(NULL,WNDTYPE_BASIC);
+			break;
+
+		case FT_PROJECT:
+			DlgNewProjectWizard(hOwner);
+			break;
+
+		case FT_TEXT:
+			NewTextEditWindow(NULL,WNDTYPE_TEXT);
+			break;
+
+		case FT_HTML:
+			NewTextEditWindow(NULL,WNDTYPE_HTML);
+			break;
+
+		case FT_ICON:
+			NewIconEditWindow(NULL);
+			break;
+	}
+#endif
+}
+void CloseDocWindow(int WndNum){
+	int i2,i3;
+
+	MdiInfo[WndNum].hwnd=0;
+
+	//ドキュメントコンボボックスから文字列を消去
+	extern HWND hDocCombo;
+	i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[WndNum].title);
+	SendMessage(hDocCombo,CB_DELETESTRING,i2,0);
+
+	//タブコントロールからアイテムを消去
+	if(pobj_MainTab) pobj_MainTab->DeleteItem( MdiInfo[WndNum].title, true );
+
+
+	GlobalFree(MdiInfo[WndNum].title);
+	GlobalFree(MdiInfo[WndNum].path);
+
+	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+		////////////////////////////
+		// テキストエディタを閉じる
+		////////////////////////////
+
+		extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+		if(ComplementWndInfo.hWnd){
+			//コード補完リストを破棄する
+			DestroyWindow(ComplementWndInfo.hWnd);
+			ComplementWndInfo.hWnd=0;
+		}
+
+		HeapDefaultFree(MdiInfo[WndNum].pMdiTextEdit->buffer);
+		HeapDefaultFree(MdiInfo[WndNum].pMdiTextEdit->pColorRef);
+
+		if(MdiInfo[WndNum].IndentStr) HeapDefaultFree(MdiInfo[WndNum].IndentStr);
+
+		//エディットコントロールを破棄
+		DestroyWindow(MdiInfo[WndNum].pMdiTextEdit->hEdit);
+
+		//Web検索ウィンドウを破棄
+		delete MdiInfo[WndNum].pMdiTextEdit->pobj_WebResult;
+		MdiInfo[WndNum].pMdiTextEdit->pobj_WebResult=0;
+
+		//ルーラーウィンドウを破棄
+		delete MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler;
+		MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler=0;
+
+		//アイコンを破棄
+		if(MdiInfo[WndNum].pMdiTextEdit->hIcon) DestroyIcon(MdiInfo[WndNum].pMdiTextEdit->hIcon);
+
+		delete MdiInfo[WndNum].pMdiTextEdit;
+		MdiInfo[WndNum].pMdiTextEdit=0;
+	}
+	else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){
+		/////////////////////
+		// RADツールを閉じる
+		/////////////////////
+
+		for(i2=0;i2<MAX_UNDONUM;i2++){
+			if(MdiInfo[WndNum].MdiRadInfo->undo.Command[i2])
+				Rad_DeleteUndoData(WndNum,i2);
+		}
+		DestroyWindow(MdiInfo[WndNum].MdiRadInfo->hTools);
+		DestroyWindow(MdiInfo[WndNum].MdiRadInfo->hRad);
+		SelectObject(MdiInfo[WndNum].MdiRadInfo->hMemDC,MdiInfo[WndNum].MdiRadInfo->hOldBitmap);
+		DeleteDC(MdiInfo[WndNum].MdiRadInfo->hMemDC);
+		DeleteObject(MdiInfo[WndNum].MdiRadInfo->hBitmap);
+		GlobalFree(MdiInfo[WndNum].MdiRadInfo);
+	}
+	else if(MdiInfo[WndNum].DocType==WNDTYPE_MENU){
+		////////////////////////////
+		// メニューエディタを閉じる
+		////////////////////////////
+
+		DestroyWindow(MdiInfo[WndNum].MdiMenuInfo->hList);
+		GlobalFree(MdiInfo[WndNum].MdiMenuInfo);
+	}
+	else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+		////////////////////////////
+		// アイコンエディタを閉じる
+		////////////////////////////
+
+		for(i2=0;i2<MdiInfo[WndNum].MdiIconEditInfo->num;i2++){
+			for(i3=0;i3<MAX_ICONEDIT_UNDONUM;i3++){
+				if(MdiInfo[WndNum].MdiIconEditInfo->undo[i2].lpData[i3])
+					HeapDefaultFree(MdiInfo[WndNum].MdiIconEditInfo->undo[i2].lpData[i3]);
+			}
+		}
+
+		DeleteDC(MdiInfo[WndNum].MdiIconEditInfo->memdc);
+		DeleteObject(MdiInfo[WndNum].MdiIconEditInfo->hMemBmp);
+		DestroyWindow(MdiInfo[WndNum].MdiIconEditInfo->hMain);
+		for(i2=0;i2<MdiInfo[WndNum].MdiIconEditInfo->num;i2++){
+			HeapDefaultFree(MdiInfo[WndNum].MdiIconEditInfo->pIconImage[i2]);
+		}
+		HeapDefaultFree(MdiInfo[WndNum].MdiIconEditInfo);
+	}
+}
+void ResizeTextEditWnd(HWND hwnd,int cx,int cy){
+	int WndNum;
+	WndNum=GetWndNum(hwnd);
+	if(WndNum==-1) return;
+
+	int WebResultWndHeight;
+	WebResultWndHeight=LINK_ITEM_HEIGHT;
+	//未完成
+	WebResultWndHeight=0;
+
+	int iHeightRuler;
+	if(pobj_nv->bEditor_Ruler){
+		//ルーラー
+		MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->resize(
+			0,
+			0,
+			cx,
+			HEIGHT_RULER);
+
+		iHeightRuler=HEIGHT_RULER;
+
+		ShowWindow(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd,SW_SHOW);
+	}
+	else{
+		iHeightRuler=0;
+
+		ShowWindow(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd,SW_HIDE);
+	}
+
+	//エディットウィンドウ
+	MoveWindow(MdiInfo[WndNum].pMdiTextEdit->hEdit,
+		0,
+		iHeightRuler,
+		cx,
+		cy-WebResultWndHeight-iHeightRuler,
+		1);
+
+	//Web検索ウィンドウ
+	MdiInfo[WndNum].pMdiTextEdit->pobj_WebResult->resize(
+		0,
+		cy-WebResultWndHeight,
+		cx,
+		WebResultWndHeight);
+}
+LRESULT CALLBACK MDIClientWindow_TextEdit(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	int i,i2;
+	HWND hEdit;
+
+	switch(message){
+		case WM_CREATE:
+			CREATESTRUCT *lpcs;
+			lpcs=(CREATESTRUCT *)lParam;
+			MDICREATESTRUCT *lpmcs;
+			lpmcs=(MDICREATESTRUCT *)lpcs->lpCreateParams;
+			SendMessage(hwnd,WM_SETICON,ICON_SMALL,(LPARAM)lpmcs->lParam);
+			break;
+		case WM_MDIACTIVATE:
+			//以前のMDIウィンドウのパラメータ ヒントを破棄する
+			if(MethodCheckInfo.hWnd){
+				DestroyWindow(MethodCheckInfo.hWnd);
+				MethodCheckInfo.hWnd=0;
+			}
+
+			//以前のコード補完リストを破棄する
+			if(ComplementWndInfo.hWnd){
+				DestroyWindow(ComplementWndInfo.hWnd);
+				ComplementWndInfo.hWnd=0;
+			}
+
+			if(!lParam) return 0;
+			i=GetWndNum((HWND)lParam);
+			if(i==-1) return 0;	//ウィンドウが初期状態の場合
+
+#ifndef THETEXT
+			//デバッガ メニューの状態を設定
+			pobj_Debugger->ResetCommandEnabled();
+#endif
+
+			//ドキュメント セレクト コンボボックス
+			extern HWND hDocCombo;
+			i2=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[i].title);
+			SendMessage(hDocCombo,CB_SETCURSEL,i2,0);
+
+			//タブコントロール
+			pobj_MainTab->MdiActiveEvent(MdiInfo[i].title);
+
+			if( !ProjectInfo.name[0] ){
+				ResetClassTree(-1);
+			}
+
+			return 0;
+		case WM_SETFOCUS:
+			hEdit=GetWindow(hwnd,GW_CHILD);
+			SetFocus(hEdit);
+			SetStatusText(CmdMsg);
+			ResetState_EditMenu();
+			ResetState_ViewMenu();
+			break;
+		case WM_SIZE:
+			ResizeTextEditWnd(hwnd,LOWORD(lParam),HIWORD(lParam));
+			break;
+		case WM_CLOSE:
+			if(!DocumentModifyCheck(hwnd)) return 0;
+			CloseDocWindow(GetWndNum(hwnd));
+			pobj_nv->bMDIZoomed=IsZoomed(hwnd);
+			i=DefMDIChildProc(hwnd,message,wParam,lParam);
+
+			//メニュー状態を設定
+			ResetState_DocMenu();
+
+			return i;
+	}
+	return DefMDIChildProc(hwnd,message,wParam,lParam);
+}
+void ResizeOwnerWnd(void){
+	int width_owner,height_owner;
+	int height_Rebar;
+	int height_MdiClient;
+	RECT rect,StatusRect,RebarRect;
+
+	GetClientRect(hOwner,&rect);
+	width_owner=rect.right;
+	height_owner=rect.bottom;
+
+	//Rebar
+	SendMessage(pobj_Rebar->hRebar,WM_SIZE,0,MAKELONG(width_owner,height_owner));
+	UpdateWindow(pobj_Rebar->hRebar);
+
+	//Status bar
+#define STATUSBAR_PARTS_NUM 5
+	int sb_size[STATUSBAR_PARTS_NUM];
+	sb_size[0]=width_owner-340;
+	sb_size[1]=width_owner-220;
+	sb_size[2]=width_owner-120;
+	sb_size[3]=width_owner-50;
+	sb_size[4]=width_owner;
+	SendMessage(hStatusBar,SB_SETPARTS,STATUSBAR_PARTS_NUM,(LPARAM)sb_size);
+	SendMessage(hStatusBar,WM_SIZE,0,MAKELONG(width_owner,height_owner));
+	UpdateWindow(hStatusBar);
+
+	//Status bar
+	int height_Statusbar;
+	SendMessage(hStatusBar,SB_GETRECT,0,(long)&StatusRect);
+	height_Statusbar=StatusRect.bottom;
+
+	GetWindowRect(pobj_Rebar->hRebar,&RebarRect);
+	height_Rebar=RebarRect.bottom-RebarRect.top+2;
+
+	int height_dv;	//Width of Debugger View
+	int height_cv;	//Width of Compiler View
+	height_dv=0;
+	height_cv=0;
+#ifndef THETEXT
+	if(bClipCompileView){
+		if(pobj_Debugger->IsDebuggerView()){
+			//デバッガビューが表示されているとき
+			height_dv=pobj_nv->height_ClipDebuggerView+LEVER_THICK;
+		}
+		if(hCompileView){
+			//コンパイラビューが表示されているとき
+			height_cv=pobj_nv->height_ClipCompileView+LEVER_THICK;
+		}
+	}
+#endif
+
+	int width_pjv=0;	//Width of Project View
+	if(pobj_nv->bClipProjectView){
+		if(IsWindowVisible(hProjectView)){
+			//プロジェクトビューが表示されているとき
+			width_pjv=pobj_nv->width_ClipProjectView+LEVER_THICK;
+		}
+	}
+
+	int width_SideWeb=0;
+	if(pobj_SideWeb->bShow){
+		width_SideWeb=pobj_nv->width_WebSearchView+LEVER_THICK;
+	}
+
+	//MDIクライアントの高さ
+	height_MdiClient=height_owner-(
+		height_Rebar+
+		height_dv+
+		height_cv+
+		height_Statusbar
+		);
+
+	//タブコントロール
+	int tab_height;
+	if(TabCtrl_GetItemCount(pobj_MainTab->hTab)==0) tab_height=0;
+	else{
+		RECT rc;
+		TabCtrl_GetItemRect(pobj_MainTab->hTab,0,&rc);
+		tab_height=rc.bottom-rc.top;
+	}
+	MoveWindow(pobj_MainTab->hTab,
+		width_pjv,
+		height_Rebar,
+		width_owner-width_pjv-width_SideWeb,
+		tab_height,
+		1);
+
+	//MDIクライアント
+	MoveWindow(hClient,
+		width_pjv,
+		height_Rebar+tab_height,
+		width_owner-width_pjv-width_SideWeb,
+		height_MdiClient-tab_height,
+		1);
+
+	if(pobj_SideWeb->bShow){
+		//SideWeb
+		pobj_SideWeb->resize(
+			width_owner - pobj_nv->width_WebSearchView,
+			height_Rebar,
+			pobj_nv->width_WebSearchView,
+			height_MdiClient);
+	}
+	else pobj_SideWeb->resize(0,0,0,0);
+
+	if(width_pjv){
+		//プロジェクトビュー
+		MoveWindow(hProjectView,
+			0,
+			height_Rebar,
+			pobj_nv->width_ClipProjectView,
+			height_MdiClient,
+			1);
+		InvalidateRect(hProjectView,NULL,0);
+	}
+
+	if(height_dv){
+#ifndef THETEXT
+		//デバッガビュー
+		pobj_Debugger->resize(
+			0,
+			height_Rebar+height_MdiClient+LEVER_THICK,
+			width_owner,
+			pobj_nv->height_ClipDebuggerView);
+#endif
+	}
+	if(height_cv){
+		//コンパイラビュー
+		MoveWindow(hCompileView,
+			0,
+			height_Rebar+height_MdiClient+height_dv+LEVER_THICK,
+			width_owner,
+			pobj_nv->height_ClipCompileView,
+			1);
+	}
+}
+LRESULT CALLBACK WindowFunc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	int i,i2,i3,WndNum;
+	char str[MAX_PATH],temporary[1024],temp2[MAX_PATH],temp3[MAX_PATH],*pTemp;
+	HWND hChild,hEdit;
+	RECT rect;
+	POINT pos;
+	LPTOOLTIPTEXT TipText;
+	LPNMHDR lpnmhdr;
+	NMPGCALCSIZE *lpCalcSize;
+	NMPGSCROLL *lpScroll;
+	HDROP hDrop;
+	HGLOBAL hGlobal;
+	CHARRANGE CharRange;
+	HANDLE hFile;
+	BOOL bChecked;
+
+	static COLORREF colorUser=RGB(255,255,255);
+
+	if(message==WM_COMMAND&&IS_FILEHISTORY_COMMAND(LOWORD(wParam))){
+		//「最近使ったファイル」メニューコマンド
+		lstrcpy(str,pobj_nv->pobj_History->lpszPath[LOWORD(wParam)-100]);
+		OpenFileWithExtension(str);
+		return 0;
+	}
+
+	if(message==WM_COMMAND&&200<=LOWORD(wParam)&&LOWORD(wParam)<=299){
+		//「最近使ったプロジェクト」メニューコマンド
+		lstrcpy(str,pobj_nv->pobj_ProjectHistory->lpszPath[LOWORD(wParam)-200]);
+		OpenFileWithExtension(str);
+		return 0;
+	}
+
+	switch(message){
+		case WM_CREATE:
+			SetupWindow(hwnd);
+
+			//テキストエディタフォント設定
+			ResetTextEditFont(hwnd);
+
+			//バックアップ用タイマーを設定（10秒に一回）
+			SetTimer(hwnd,ID_TIMER_BACKUP,10000,NULL);
+
+			return 0;
+
+
+		case WM_TIMER:
+			//Pro版は自動バックアップ及び復元機能を有効にする
+			_beginthread(backup,0,0);
+
+#ifndef THETEXT
+			if(wParam==ID_DEBUGSAFTY){
+				//BasicCompiler.exeが強制終了しているかどうかを検証
+				pobj_Debugger->SaftyCheck();
+			}
+#endif
+
+			return 0;
+
+
+		case WM_DRAWCLIPBOARD:
+			ResetState_EditMenu();
+			return 0;
+
+		case WM_MENUSELECT:
+			MenuAdvice(wParam);
+			return 0;
+		case WM_INITMENU:
+			pobj_nv->pobj_History->ResetFileMenu(pobj_FileHistoryMenu,1);
+#ifndef THETEXT
+			pobj_nv->pobj_ProjectHistory->ResetFileMenu(pobj_ProjectHistoryMenu,0);
+#endif
+			return 0;
+		case WM_MEASUREITEM:
+			LPMEASUREITEMSTRUCT lpMI;
+			lpMI = (LPMEASUREITEMSTRUCT)lParam;
+			if(lpMI->CtlType==ODT_MENU){
+				SIZE size;
+				CMenuItemData *pobj_MenuItemData;
+				pobj_MenuItemData=(CMenuItemData *)lpMI->itemData;
+				if(pobj_MenuItemData->pobj_ThisMenu->hMenu==pobj_MainMenu->hMenu){
+					//メインメニューの親アイテム
+					pobj_MainMenu->GetItemSize(pobj_MenuItemData->item_index,&size);
+					lpMI->itemWidth = size.cx;
+					lpMI->itemHeight = size.cy;
+				}
+				else{
+					//メインメニューにぶらさがるサブメニュー
+					pobj_MenuItemData->pobj_ThisMenu->GetItemSize(pobj_MenuItemData->item_index,&size);
+					lpMI->itemWidth = size.cx;
+					lpMI->itemHeight = size.cy;
+				}
+			}
+			return 0;
+
+		case WM_DRAWITEM:
+			DRAWITEMSTRUCT *pdis;
+			pdis=(DRAWITEMSTRUCT *)lParam;
+
+			if(pdis->CtlType==ODT_MENU){
+				if(!pobj_MainMenu) return 0;
+
+				CMenuItemData *pobj_MenuItemData;
+				pobj_MenuItemData=(CMenuItemData *)pdis->itemData;
+				if(pobj_MainMenu->hMenu==pobj_MenuItemData->pobj_ThisMenu->hMenu){
+					//メインメニューの親アイテム
+					pobj_MainMenu->OwnerDrawMenu(pdis->hDC,
+						&pdis->rcItem,
+						(pdis->itemState&ODS_SELECTED)!=0,
+						pobj_MenuItemData->item_index);
+				}
+				else{
+					//メインメニューにぶらさがるサブメニュー
+					pobj_MainMenu->OwnerDrawSubMenu(pobj_MenuItemData->pobj_ThisMenu->hMenu,
+						pdis->hDC,
+						&pdis->rcItem,
+						(pdis->itemState&ODS_SELECTED)!=0,
+						pobj_MenuItemData->item_index);
+				}
+			}
+			return 0;
+
+		case WM_NOTIFY:
+			if(!lParam) return 0;
+			TipText=(LPTOOLTIPTEXT)lParam;
+			if(TipText->hdr.code==TTN_NEEDTEXT) ShowToolTipText(TipText);
+			lpnmhdr=(LPNMHDR)lParam;
+
+			extern HWND hStandardToolbarPager;
+			extern HWND hDebuggerToolbarPager;
+			if(pobj_Rebar){
+				//レバーオブジェクトが存在するとき
+				if(lpnmhdr->hwndFrom==pobj_Rebar->hRebar&&lpnmhdr->code==RBN_HEIGHTCHANGE){
+					ResizeOwnerWnd();
+					return 0;
+				}
+			}
+			if(lpnmhdr->hwndFrom==hStandardToolbarPager){
+				if(lpnmhdr->code==PGN_CALCSIZE){
+					lpCalcSize=(LPNMPGCALCSIZE)lParam;
+					if(lpCalcSize->dwFlag==PGF_CALCWIDTH)
+						lpCalcSize->iWidth=BMPNUM_STANDARDTOOLBAR*23+SEPNUM_STANDARDTOOLBAR*8;
+				}
+				else if(lpnmhdr->code==PGN_SCROLL){
+					lpScroll=(LPNMPGSCROLL)lParam;
+					lpScroll->iScroll=20;
+				}
+			}
+			else if(lpnmhdr->hwndFrom==hDebuggerToolbarPager){
+				if(lpnmhdr->code==PGN_CALCSIZE){
+					lpCalcSize=(LPNMPGCALCSIZE)lParam;
+					if(lpCalcSize->dwFlag==PGF_CALCWIDTH)
+						lpCalcSize->iWidth=BMPNUM_DEBUGGERTOOLBAR*23+SEPNUM_DEBUGGERTOOLBAR*8;
+				}
+				else if(lpnmhdr->code==PGN_SCROLL){
+					lpScroll=(LPNMPGSCROLL)lParam;
+					lpScroll->iScroll=20;
+				}
+			}
+
+			NMHDR *hdr;
+			hdr=(NMHDR *)lParam;
+			if(pobj_MainTab){
+				if(hdr->hwndFrom==pobj_MainTab->hTab){
+					if(hdr->code==TCN_SELCHANGE)
+						pobj_MainTab->SelChangeEvent();
+
+					if(hdr->code==NM_RCLICK){
+
+						TCHITTESTINFO tcHitTest;
+						GetCursorPos(&tcHitTest.pt);
+						ScreenToClient(pobj_MainTab->hTab,&tcHitTest.pt);
+						i=TabCtrl_HitTest(pobj_MainTab->hTab,&tcHitTest);
+						if(i==-1) return 0;
+
+						TabCtrl_SetCurSel(pobj_MainTab->hTab,i);
+
+						pobj_MainTab->SelChangeEvent();
+
+
+						/////////////////////
+						// メニューを表示
+						/////////////////////
+
+						hChild=GetWindow(hClient,GW_CHILD);
+						WndNum=GetWndNum(hChild);
+
+						//保存コマンドの文字列をセット
+						MENUITEMINFO mii;
+						mii.cbSize=sizeof(MENUITEMINFO);
+						mii.fMask=MIIM_TYPE;
+						mii.dwTypeData=temporary;
+						mii.fType=MFT_STRING;
+						if(MdiInfo[WndNum].path[0]){
+							_splitpath(MdiInfo[WndNum].path,NULL,NULL,temporary,temp2);
+							lstrcat(temporary,temp2);
+							lstrcat(temporary," を保存(&S)");
+						}
+						else{
+							lstrcpy(temporary,"保存(&S)");
+						}
+						SetMenuItemInfo(hTabMenu,IDM_SAVE,FALSE,&mii);
+
+						/*「絶対パスをコピー」「フォルダを開く」「ファイルを削除」
+														コマンドを場合によって無効化にする */
+						if(MdiInfo[WndNum].path[0]){
+							EnableMenuItem(hTabMenu,IDM_PATH_COPY,MF_BYCOMMAND|MF_ENABLED);
+							EnableMenuItem(hTabMenu,IDM_FOLDER_OPEN,MF_BYCOMMAND|MF_ENABLED);
+							EnableMenuItem(hTabMenu,IDM_DELETE_FILE,MF_BYCOMMAND|MF_ENABLED);
+						}
+						else{
+							EnableMenuItem(hTabMenu,IDM_PATH_COPY,MF_BYCOMMAND|MF_GRAYED);
+							EnableMenuItem(hTabMenu,IDM_FOLDER_OPEN,MF_BYCOMMAND|MF_GRAYED);
+							EnableMenuItem(hTabMenu,IDM_DELETE_FILE,MF_BYCOMMAND|MF_GRAYED);
+						}
+
+						POINT MousePos;
+						GetCursorPos(&MousePos);
+						TrackPopupMenu(hTabMenu,TPM_LEFTALIGN|TPM_RIGHTBUTTON,MousePos.x,MousePos.y,0,hOwner,NULL);
+					}
+				}
+			}
+			if(pobj_SideWeb){
+				if(hdr->hwndFrom==pobj_SideWeb->hTab&&hdr->code==TCN_SELCHANGE){
+					pobj_SideWeb->SelChangeEvent();
+				}
+			}
+
+			return 0;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDM_NEW:
+					CreateNewFile();
+					return 0;
+				case IDM_OPEN:
+					//"ファイルを指定してください"
+					if(!GetFilePathDialog(hwnd,str,DefFileFilter,STRING_FILEOPENTITLE_DEFAULT,TRUE)) return 0;
+
+					OpenFileWithExtension(str);
+					return 0;
+				case IDM_CLOSE:
+					hChild=GetWindow(hClient,GW_CHILD);
+					if(IsWindow(hChild)) SendMessage(hChild,WM_CLOSE,0,0);
+					return 0;
+#ifndef THETEXT
+				case IDM_PROJECT_OPEN:
+					//"プロジェクト ファイルを指定して下さい"
+					if(!GetFilePathDialog(hwnd,str,ProjectFileFilter,STRING_FILEOPENTITLE_PROJECT,TRUE)) return 0;
+
+					OpenProject(str);
+					return 0;
+				case IDM_PROJECT_SAVE:
+					SaveProject();
+					return 0;
+				case IDM_PROJECT_CLOSE:
+					CloseProject();
+					return 0;
+				case IDM_PROJECT_FOLDER_OPEN:
+					ShellExecute(hwnd,"explore",ProjectInfo.dir,NULL,NULL,SW_SHOWNORMAL);
+					return 0;
+#endif
+				case IDM_SAVE:
+					SaveDocument(GetWindow(hClient,GW_CHILD),NULL);
+					return 0;
+				case IDM_NEWSAVE:
+					//"保存先のファイルを指定してください"
+					if(!GetFilePathDialog(hwnd,str,DefFileFilter,STRING_FILESAVETITLE_DEFAULT,FALSE)) return 0;
+
+					SaveDocument(GetWindow(hClient,GW_CHILD),str);
+					return 0;
+				case IDM_CODE_SAVE:
+					//文字コードを指定して保存
+					DialogBox(hResInst,MAKEINTRESOURCE(IDD_CODE_SAVE),hOwner,nkfDlgCodeSave);
+					return 0;
+				case IDM_ALLSAVE:
+					for(i=0;i<MAX_WNDNUM;i++){
+						if(MdiInfo[i].hwnd) SaveDocument(MdiInfo[i].hwnd,NULL);
+					}
+					if(ProjectInfo.name[0]) SaveProject();
+					return 0;
+
+				case IDM_PAGESET:
+					//ページ設定
+					obj_Page.SetupDlg();
+					return 0;
+
+				case IDM_PREVIEW:
+					//プレビュー（Pro版のみ）
+					Preview();
+					return 0;
+
+				case IDM_PRINTOUT:
+					//印刷
+					Printout();
+					return 0;
+
+				case IDM_EXIT:
+					SendMessage(hwnd,WM_CLOSE,0,0);
+					return 0;
+				case IDM_UNDO:
+				case (WORD)IDM_ACCEL_UNDO:
+					hChild=GetWindow(hClient,GW_CHILD);
+					if(!hChild) return 0;
+					WndNum=GetWndNum(hChild);
+					if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType))
+						TextEdit_UndoCommand(WndNum);
+					else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD)
+						Rad_UndoCommand(WndNum);
+					else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT)
+						IconEdit_UndoCommand(WndNum);
+					return 0;
+				case IDM_REDO:
+				case (WORD)IDM_ACCEL_REDO:
+					hChild=GetWindow(hClient,GW_CHILD);
+					if(!hChild) return 0;
+					WndNum=GetWndNum(hChild);
+					if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType))
+						TextEdit_RedoCommand(WndNum);
+					else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD)
+						Rad_RedoCommand(WndNum);
+					else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT)
+						IconEdit_RedoCommand(WndNum);
+					return 0;
+				case IDM_CUT:
+					hChild=GetWindow(hClient,GW_CHILD);
+					WndNum=GetWndNum(hChild);
+					if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+						hEdit=GetWindow(hChild,GW_CHILD);
+
+						TextEdit_GetSel(WndNum,&CharRange);
+
+						hGlobal=(char *)GlobalAlloc(GMEM_MOVEABLE,CharRange.cpMax-CharRange.cpMin+1);
+						pTemp=(char *)GlobalLock(hGlobal);
+						memcpy(pTemp,MdiInfo[WndNum].pMdiTextEdit->buffer+CharRange.cpMin,CharRange.cpMax-CharRange.cpMin);
+						pTemp[CharRange.cpMax-CharRange.cpMin]=0;
+						GlobalUnlock(hGlobal);
+
+						//クリップボードに保存
+						OpenClipboard(hwnd);
+						EmptyClipboard();
+						SetClipboardData(CF_TEXT,hGlobal);
+						CloseClipboard();
+
+						//選択文字列を消去
+						SendMessage(hEdit,WM_KEYDOWN,VK_DELETE,0);
+					}
+					else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){
+						i2=GetWndInfoNum(MdiInfo[WndNum].path);
+
+						//クリップボードに格納するためのデータを用意する
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].pos.x-=17;
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].pos.y-=10;
+						hGlobal=Rad_GetChildInfoClipboardData(WndNum,i2);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].pos.x+=17;
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].pos.y+=10;
+
+						OpenClipboard(hwnd);
+						EmptyClipboard();
+						SetClipboardData(dwRadClipboardID,hGlobal);
+						CloseClipboard();
+
+						SendMessage(MdiInfo[WndNum].MdiRadInfo->hRad,WM_COMMAND,IDM_RAD_ITEM_DELETE,0);
+					}
+					else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+						//クリップボードに格納するためのデータを用意する
+						hGlobal=IconEdit_GetChildInfoClipboardData(WndNum);
+						if(hGlobal==0) return 0;
+
+						OpenClipboard(hwnd);
+						EmptyClipboard();
+						SetClipboardData(CF_BITMAP,hGlobal);
+						CloseClipboard();
+
+						DeleteObject(MdiInfo[WndNum].MdiIconEditInfo->hSelectingBmp);
+						MdiInfo[WndNum].MdiIconEditInfo->SelectLevel=0;
+
+						IconEdit_EraseRect(WndNum,&MdiInfo[WndNum].MdiIconEditInfo->DraggingRect);
+					}
+					return 0;
+				case IDM_COPY:
+					hChild=GetWindow(hClient,GW_CHILD);
+					WndNum=GetWndNum(hChild);
+					if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+						hEdit=GetWindow(hChild,GW_CHILD);
+
+						TextEdit_GetSel(WndNum,&CharRange);
+
+						hGlobal=(char *)GlobalAlloc(GMEM_MOVEABLE,CharRange.cpMax-CharRange.cpMin+1);
+						pTemp=(char *)GlobalLock(hGlobal);
+						memcpy(pTemp,MdiInfo[WndNum].pMdiTextEdit->buffer+CharRange.cpMin,CharRange.cpMax-CharRange.cpMin);
+						pTemp[CharRange.cpMax-CharRange.cpMin]=0;
+						GlobalUnlock(hGlobal);
+
+						//クリップボードに保存
+						OpenClipboard(hwnd);
+						EmptyClipboard();
+						SetClipboardData(CF_TEXT,hGlobal);
+						CloseClipboard();
+					}
+					else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){
+						i2=GetWndInfoNum(MdiInfo[WndNum].path);
+
+						//クリップボードに格納するためのデータを用意する
+						hGlobal=Rad_GetChildInfoClipboardData(WndNum,i2);
+
+						OpenClipboard(hwnd);
+						EmptyClipboard();
+						SetClipboardData(dwRadClipboardID,hGlobal);
+						CloseClipboard();
+					}
+					else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+						//クリップボードに格納するためのデータを用意する
+						hGlobal=IconEdit_GetChildInfoClipboardData(WndNum);
+
+						OpenClipboard(hwnd);
+						EmptyClipboard();
+						SetClipboardData(CF_BITMAP,hGlobal);
+						CloseClipboard();
+					}
+					return 0;
+				case IDM_PASTE:
+					hChild=GetWindow(hClient,GW_CHILD);
+					WndNum=GetWndNum(hChild);
+					if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+						hEdit=GetWindow(hChild,GW_CHILD);
+
+						//クリップボードを開く
+						OpenClipboard(hwnd);
+						hGlobal=GetClipboardData(CF_TEXT);
+						if(!hGlobal){
+							CloseClipboard();
+							return 0;
+						}
+
+
+						if(pobj_nv->bPasteIndent){
+							//インデント整形
+							pTemp=CodeFormatter((char *)GlobalLock(hGlobal));
+							GlobalUnlock(hGlobal);
+						}
+						else pTemp=(char *)GlobalLock(hGlobal);
+
+
+						//テキストエディタの文字列をリプレイス
+						TextEdit_ReplaceUpdateUndoData(WndNum,
+							pTemp,
+							1,
+							1);
+
+						if(pobj_nv->bPasteIndent)
+							HeapDefaultFree(pTemp);
+						else
+							GlobalUnlock(hGlobal);
+
+						//クリップボードを閉じる
+						CloseClipboard();
+
+
+						//キャレット位置までスクロールする
+						TextEdit_ScrollCaret(WndNum,0);
+						ResetCaretPos(WndNum);
+					}
+					else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){
+						OpenClipboard(hwnd);
+						hGlobal=GetClipboardData(dwRadClipboardID);
+						if(!hGlobal){
+							CloseClipboard();
+							return 0;
+						}
+						Rad_PasteChildInfoClipboardData(WndNum,hGlobal);
+						CloseClipboard();
+					}
+					else if(MdiInfo[WndNum].DocType==WNDTYPE_ICONEDIT){
+						OpenClipboard(hwnd);
+						hGlobal=GetClipboardData(CF_BITMAP);
+						if(!hGlobal){
+							CloseClipboard();
+							return 0;
+						}
+						IconEdit_PasteChildInfoClipboardData(WndNum,(HBITMAP)hGlobal);
+						CloseClipboard();
+					}
+					return 0;
+				case IDM_DELETE:
+					hChild=GetWindow(hClient,GW_CHILD);
+					WndNum=GetWndNum(hChild);
+					if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+						hEdit=GetWindow(hChild,GW_CHILD);
+						TextEdit_ReplaceUpdateUndoData(WndNum,"",0,1);
+					}
+					else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD)
+						SendMessage(MdiInfo[WndNum].MdiRadInfo->hRad,WM_COMMAND,IDM_RAD_ITEM_DELETE,0);
+					return 0;
+				case IDM_ALLSELECT:
+					hChild=GetWindow(hClient,GW_CHILD);
+					WndNum=GetWndNum(hChild);
+					if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+						hEdit=GetWindow(hChild,GW_CHILD);
+
+						MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x=0;
+						MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y=0;
+
+						GetCaretPosFromBufferIndex(
+							MdiInfo[WndNum].pMdiTextEdit->buffer,
+							lstrlen(MdiInfo[WndNum].pMdiTextEdit->buffer),
+							&MdiInfo[WndNum].pMdiTextEdit->EndCaretPos);
+
+						InvalidateRect(hEdit,NULL,0);
+
+						ResetState_EditMenu();
+					}
+					else if(MdiInfo[WndNum].DocType==WNDTYPE_RAD){
+						i2=GetWndInfoNum(MdiInfo[WndNum].path);
+						for(i3=0;i3<ProjectInfo.pWindowInfo[i2].NumberOfChildWindows;i3++){
+							MdiInfo[WndNum].MdiRadInfo->SelectingItem[i3]=i3;
+						}
+						DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[i2]);
+					}
+					return 0;
+				case IDM_FIND:
+					DialogBox(hResInst,MAKEINTRESOURCE(IDD_FIND),hOwner,DlgFind);
+					return 0;
+				case IDM_PERMUTATION:
+					DialogBox(hResInst,MAKEINTRESOURCE(IDD_PERMUTATION),hOwner,DlgPermutation);
+					return 0;
+
+
+				///////////////////////
+				// 変換メニュー
+				///////////////////////
+				case IDM_CONV_ALPHA_SMALL:
+				case IDM_CONV_ALPHA_BIG:
+				case IDM_CONV_HALF:
+				case IDM_CONV_MULTI:
+				case IDM_CONV_KATAKANA:
+				case IDM_CONV_HIRAGANA:
+				case IDM_CONV_SPACE:
+				case IDM_CONV_TAB:
+#ifdef THETEXT
+				case IDM_CONV_HASRETURN:
+				case IDM_CONV_QUOTE:
+#else
+				case IDM_CODEFORMAT:
+#endif
+					TextEdit_Convert(LOWORD(wParam));
+					return 0;
+
+#ifdef THETEXT
+				///////////////////////
+				// ツールメニュー
+				///////////////////////
+				case IDM_STRING_COUNT:
+					DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_STRING_COUNT),hOwner,DlgStringCount,0);
+					return 0;
+				case IDM_SEL_STRING_COUNT:
+					DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_STRING_COUNT),hOwner,DlgStringCount,1);
+					return 0;
+#endif //THETEXT
+
+				case IDM_PROJECTVIEW:
+					if(pobj_nv->bClipProjectView){
+						if(IsWindowVisible(hProjectView)){
+							ShowWindow(hProjectView,SW_HIDE);
+							bChecked=0;
+						}
+						else{
+							ShowWindow(hProjectView,SW_SHOW);
+							bChecked=1;
+						}
+					}
+					else{
+						if(IsWindowVisible(hProjectView_ToolWindow)){
+							ShowWindow(hProjectView_ToolWindow,SW_HIDE);
+							bChecked=0;
+						}
+						else{
+							ShowWindow(hProjectView_ToolWindow,SW_SHOW);
+							ShowWindow(hProjectView,SW_SHOW);
+							bChecked=1;
+						}
+					}
+					pobj_MainMenu->CheckMenu(IDM_PROJECTVIEW,bChecked);
+
+					//再配置
+					ResizeOwnerWnd();
+
+					ShowWindow(hClient,SW_SHOW);
+					return 0;
+				case IDM_PROJECT_OPTION:
+					DlgProjectOptionSetting(hwnd);
+					return 0;
+				case IDM_TOPMOST:
+					if(pobj_MainMenu->IsCheck(IDM_TOPMOST)){
+						SetWindowPos(hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
+						pobj_MainMenu->CheckMenu(IDM_TOPMOST,0);
+					}
+					else{
+						SetWindowPos(hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
+						pobj_MainMenu->CheckMenu(IDM_TOPMOST,1);
+					}
+					return 0;
+
+#ifdef THETEXT
+				case IDM_RIGHT_TURN:
+					pobj_nv->bRightTurn^=1;
+					ResetState_ViewMenu();
+
+					//トップのウィンドウを再描画
+					RedrawAllWindow();
+
+					return 0;
+#endif
+
+				case IDM_SET:
+					DlgOptionSetting(hwnd);
+					return 0;
+
+#ifndef THETEXT
+				case IDM_DEBUG:
+					if(pobj_Debugger->IsDebugging()){
+						pobj_Debugger->DebugContinue();
+						return 0;
+					}
+
+					hChild=GetWindow(hClient,GW_CHILD);
+					if(ProjectInfo.name[0]){
+						//プロジェクトが開かれている場合
+						if(!SetProjectToRun()) return 0;
+
+						//デバッグ用のコマンドライン及び実行可能ファイル（DLLのみ）
+						sprintf(temporary,"%s\r\n%s",ProjectInfo.szExePath,ProjectInfo.szCmdLine);
+						sprintf(temp2,"%spgm.tmp",pj_editor_Dir);
+						hFile=CreateFile(temp2,GENERIC_WRITE,0,NULL,CREATE_ALWAYS,FILE_ATTRIBUTE_ARCHIVE|FILE_ATTRIBUTE_HIDDEN|FILE_ATTRIBUTE_TEMPORARY,NULL);
+						DWORD dwAccessBytes;
+						WriteFile(hFile,temporary,lstrlen(temporary),&dwAccessBytes,NULL);
+						CloseHandle(hFile);
+
+						//ソースファイル名をtemp2へ
+						ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetFullPath(temp2);
+
+						//出力ファイル名をtemp3へ
+						lstrcpy(temp3,ProjectInfo.lpszOutput_Debug);
+						GetFullPath(temp3,ProjectInfo.dir);
+
+						if(IsNeedCompileForProject(1))
+							sprintf(temporary,"\"%s\" \"%s\" /debug /run /wnd:%08x",temp2,temp3,hwnd);
+						else
+							sprintf(temporary,"\"%s\" \"%s\" /run /wnd:%08x",temp2,temp3,hwnd);
+
+						//DLLオプション
+						if(ProjectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll");
+
+						//Unicodeオプション
+						if(ProjectInfo.dwOption & PJ_OP_UNICODE) lstrcat(temporary," /unicode");
+
+						//ブレークポイントをセーブ
+						ProjectInfo.pobj_DBBreakPoint->SaveToTempFile();
+					}
+					else{
+						//単独ソースコード
+						if(!SetRunning(hChild)) return 0;
+						if(IsNeedCompile(MdiInfo[GetWndNum(hChild)].path,1))
+							sprintf(temporary,"\"%s\" /debug /run /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,hwnd);
+						else
+							sprintf(temporary,"\"%s\" /run /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,hwnd);
+
+						//ブレークポイントをセーブ
+						pobj_DBBreakPoint->SaveToTempFile();
+					}
+
+					//コンパイルビューをクリップするかどうか
+					if(bClipCompileView){
+						lstrcat(temporary," /clip_compile_view");
+
+						//コンパイラビューを閉じる
+						if(hCompileView==(HWND)-1) return 0;
+						if(hCompileView){
+							hChild=hCompileView;
+							hCompileView=(HWND)-1;
+							SendMessage(hChild,WM_COMMAND,IDCANCEL,0);
+						}
+
+						//重複起動防止のため
+						hCompileView=(HWND)-1;
+					}
+
+					//インクルードディレクトリ
+					sprintf(temp2," /include_dir:\"%s\"",pobj_nv->szIncludeDir);
+					lstrcat(temporary,temp2);
+
+					sprintf(str,"%s%s",pj_editor_Dir,lpszCompilerName);
+					ShellExecute(hwnd,"open",str,temporary,NULL,SW_SHOWNORMAL);
+					return 0;
+				case IDM_DEBUGCOMPILE:
+					hChild=GetWindow(hClient,GW_CHILD);
+					if(ProjectInfo.name[0]){
+						//プロジェクトが開かれている場合
+						if(!SetProjectToRun()) return 0;
+
+						//ソースファイル名をtemp2へ
+						ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetFullPath(temp2);
+
+						//出力ファイル名をtemp3へ
+						lstrcpy(temp3,ProjectInfo.lpszOutput_Debug);
+						GetFullPath(temp3,ProjectInfo.dir);
+
+						sprintf(temporary,"\"%s\" \"%s\" /debug /wnd:%08x",temp2,temp3,hwnd);
+
+						//DLLオプション
+						if(ProjectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll");
+
+						//Unicodeオプション
+						if(ProjectInfo.dwOption & PJ_OP_UNICODE) lstrcat(temporary," /unicode");
+					}
+					else{
+						//単独ソースコード
+						if(!SetRunning(hChild)) return 0;
+						sprintf(temporary,"\"%s\" /debug /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,hwnd);
+					}
+
+					//コンパイルビューをクリップするかどうか
+					if(bClipCompileView){
+						lstrcat(temporary," /clip_compile_view");
+
+						//コンパイラビューを閉じる
+						if(hCompileView==(HWND)-1) return 0;
+						if(hCompileView){
+							hChild=hCompileView;
+							hCompileView=(HWND)-1;
+							SendMessage(hChild,WM_COMMAND,IDCANCEL,0);
+						}
+
+						//重複起動防止のため
+						hCompileView=(HWND)-1;	
+					}
+
+					//インクルードディレクトリ
+					sprintf(temp2," /include_dir:\"%s\"",pobj_nv->szIncludeDir);
+					lstrcat(temporary,temp2);
+
+					sprintf(str,"%s%s",pj_editor_Dir,lpszCompilerName);
+					ShellExecute(hwnd,"open",str,temporary,NULL,SW_SHOWNORMAL);
+
+					return 0;
+				case IDM_ATTACH:
+					int idProcess;
+					DWORD dwPlatform;
+					idProcess=DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_ATTACH),hwnd,DlgAttach,(LPARAM)&dwPlatform);
+					if(idProcess==0) return 0;
+
+					sprintf(temporary,"/attach:%08x /wnd:%08x",idProcess,hwnd);
+
+					//コンパイルビューをクリップするかどうか
+					if(bClipCompileView){
+						lstrcat(temporary," /clip_compile_view");
+
+						//コンパイラビューを閉じる
+						if(hCompileView==(HWND)-1) return 0;
+						if(hCompileView){
+							hChild=hCompileView;
+							hCompileView=(HWND)-1;
+							SendMessage(hChild,WM_COMMAND,IDCANCEL,0);
+						}
+
+						//重複起動防止のため
+						hCompileView=(HWND)-1;
+					}
+
+					//インクルードディレクトリ
+					sprintf(temp2," /include_dir:\"%s\"",pobj_nv->szIncludeDir);
+					lstrcat(temporary,temp2);
+
+					if(dwPlatform==IMAGE_FILE_MACHINE_I386)
+						sprintf(str,"%s%s",pj_editor_Dir,WIN32_COMPILER_NAME);
+					else if(dwPlatform==IMAGE_FILE_MACHINE_AMD64)
+						sprintf(str,"%s%s",pj_editor_Dir,WIN64_COMPILER_NAME);
+
+					ShellExecute(hwnd,"open",str,temporary,NULL,SW_SHOWNORMAL);
+					return 0;
+				case IDM_RELEASECOMPILE:
+					hChild=GetWindow(hClient,GW_CHILD);
+					if(ProjectInfo.name[0]){
+						//プロジェクトが開かれている場合
+						if(!SetProjectToRun()) return 0;
+
+						//ソースファイル名をtemp2へ
+						ProjectInfo.pobj_DBFileInfo->ppobj_FileInfo[0]->GetFullPath(temp2);
+
+						//出力ファイル名をtemp3へ
+						lstrcpy(temp3,ProjectInfo.lpszOutput_Release);
+						GetFullPath(temp3,ProjectInfo.dir);
+
+						sprintf(temporary,"\"%s\" \"%s\" /wnd:%08x",temp2,temp3,hwnd);
+
+						//DLLオプション
+						if(ProjectInfo.dwModuleType==MT_DLL) lstrcat(temporary," /dll");
+
+						//Unicodeオプション
+						if(ProjectInfo.dwOption & PJ_OP_UNICODE) lstrcat(temporary," /unicode");
+					}
+					else{
+						//単独ソースコード
+						if(!SetRunning(hChild)) return 0;
+						sprintf(temporary,"\"%s\" /wnd:%08x",MdiInfo[GetWndNum(hChild)].path,hwnd);
+					}
+
+					//コンパイルビューをクリップするかどうか
+					if(bClipCompileView){
+						lstrcat(temporary," /clip_compile_view");
+
+						//コンパイラビューを閉じる
+						if(hCompileView==(HWND)-1) return 0;
+						if(hCompileView){
+							hChild=hCompileView;
+							hCompileView=(HWND)-1;
+							SendMessage(hChild,WM_COMMAND,IDCANCEL,0);
+						}
+
+						//重複起動防止のため
+						hCompileView=(HWND)-1;
+					}
+
+					//インクルードディレクトリ
+					sprintf(temp2," /include_dir:\"%s\"",pobj_nv->szIncludeDir);
+					lstrcat(temporary,temp2);
+
+					sprintf(str,"%s%s",pj_editor_Dir,lpszCompilerName);
+					ShellExecute(hwnd,"open",str,temporary,NULL,SW_SHOWNORMAL);
+					return 0;
+				case IDM_RELEASERUN:
+					hChild=GetWindow(hClient,GW_CHILD);
+					if(ProjectInfo.name[0]){
+/*						//プロジェクトが開かれている場合
+						if(!SetProjectToRun()) return 0;
+
+						//必要であればリリースコンパイル
+						if(IsNeedCompileForProject(0))
+							SendMessage(hwnd,WM_COMMAND,IDM_RELEASECOMPILE,0);*/
+
+						if(ProjectInfo.dwModuleType==MT_DLL){
+							lstrcpy(temporary,ProjectInfo.szExePath);
+						}
+						else{
+							lstrcpy(temporary,ProjectInfo.lpszOutput_Debug);
+							GetFullPath(temporary,ProjectInfo.dir);
+						}
+					}
+					else{
+/*						//必要であればリリースコンパイル
+						if(!SetRunning(hChild)) return 0;
+
+						if(IsNeedCompile(MdiInfo[GetWndNum(hChild)].path,0))
+							SendMessage(hwnd,WM_COMMAND,IDM_RELEASECOMPILE,0);*/
+
+						//単独ソースコード
+						_splitpath(MdiInfo[GetWndNum(hChild)].path,temporary,temp2,temp3,NULL);
+						lstrcat(temporary,temp2);
+						lstrcat(temporary,temp3);
+						lstrcat(temporary,".exe");
+					}
+
+					//インクルードディレクトリ
+					sprintf(temp2," /include_dir:\"%s\"",pobj_nv->szIncludeDir);
+					lstrcat(temporary,temp2);
+
+					ShellExecute(hwnd,"open",temporary,NULL,NULL,SW_SHOWNORMAL);
+					return 0;
+
+
+				////////////////////////
+				// デバッグ コマンド
+				////////////////////////
+
+				case IDM_STEP_IN:
+					pobj_Debugger->StepIn();
+					break;
+				case IDM_STEP_OVER:
+					pobj_Debugger->StepOver();
+					break;
+				case IDM_STEP_CURSOR:
+					pobj_Debugger->StepToCursor();
+					break;
+				case IDM_BREAKPOINT:
+					if(ProjectInfo.name[0]){
+						ProjectInfo.pobj_DBBreakPoint->Event_BreakPoint();
+					}
+					else{
+						pobj_DBBreakPoint->Event_BreakPoint();
+					}
+					break;
+				case IDM_DEBUG_STOP:
+					pobj_Debugger->DebugStop();
+					break;
+				case IDM_DEBUG_PAUSE:
+					pobj_Debugger->DebugPause();
+					break;
+
+
+				case IDM_COMMUNITY:
+					ShellExecute(hwnd,"open","iexplore.exe",
+						"http://www.activebasic.com/forum/",
+						NULL,SW_SHOWNORMAL);
+					return 0;
+				case IDM_COMMU_SEARCH:
+					ShellExecute(hwnd,"open","iexplore.exe",
+						"http://www.activebasic.com/forum/search.php",
+						NULL,SW_SHOWNORMAL);
+					return 0;
+				case IDM_COMMU_PM:
+					ShellExecute(hwnd,"open","iexplore.exe",
+						"http://www.activebasic.com/forum/privmsg.php?folder=inbox",
+						NULL,SW_SHOWNORMAL);
+					return 0;
+				case ID_COMMU_FORUM1:
+					ShellExecute(hwnd,"open","iexplore.exe",
+						"http://www.activebasic.com/forum/viewforum.php?f=1",
+						NULL,SW_SHOWNORMAL);
+					return 0;
+				case ID_COMMU_FORUM2:
+					ShellExecute(hwnd,"open","iexplore.exe",
+						"http://www.activebasic.com/forum/viewforum.php?f=2",
+						NULL,SW_SHOWNORMAL);
+					return 0;
+				case ID_COMMU_FORUM3:
+					ShellExecute(hwnd,"open","iexplore.exe",
+						"http://www.activebasic.com/forum/viewforum.php?f=5",
+						NULL,SW_SHOWNORMAL);
+					return 0;
+				case ID_COMMU_FORUM4:
+					ShellExecute(hwnd,"open","iexplore.exe",
+						"http://www.activebasic.com/forum/viewforum.php?f=3",
+						NULL,SW_SHOWNORMAL);
+					return 0;
+				case ID_COMMU_FORUM5:
+					ShellExecute(hwnd,"open","iexplore.exe",
+						"http://www.activebasic.com/forum/viewforum.php?f=6",
+						NULL,SW_SHOWNORMAL);
+					return 0;
+				case ID_COMMU_FORUM6:
+					ShellExecute(hwnd,"open","iexplore.exe",
+						"http://www.activebasic.com/forum/viewforum.php?f=8",
+						NULL,SW_SHOWNORMAL);
+					return 0;
+				case ID_COMMU_FORUM7:
+					ShellExecute(hwnd,"open","iexplore.exe",
+						"http://www.activebasic.com/forum/viewforum.php?f=4",
+						NULL,SW_SHOWNORMAL);
+					return 0;
+				case ID_COMMU_FORUM8:
+					ShellExecute(hwnd,"open","iexplore.exe",
+						"http://www.activebasic.com/forum/viewforum.php?f=7",
+						NULL,SW_SHOWNORMAL);
+					return 0;
+#endif //THETEXT
+
+
+				case IDM_TOPIC:
+#ifdef THETEXT
+					sprintf(str,"%sTopics\\index.html",pj_editor_Dir);
+					ShellExecute(hwnd,"open",str,NULL,NULL,SW_SHOWNORMAL);
+#else
+					sprintf(str,"%sBasicHelp.chm",pj_editor_Dir);
+					HtmlHelp(NULL,str,HH_DISPLAY_TOPIC,0);
+#endif
+					return 0;
+
+#ifdef THETEXT
+				case IDM_DSHOMEPAGE:
+					ShellExecute(hwnd,"open","http://www.discoversoft.net/",NULL,NULL,SW_SHOWNORMAL);
+					return 0;
+#else
+				case IDM_AB_WEBSITE:
+					ShellExecute(hwnd,"open","http://www.activebasic.com/",NULL,NULL,SW_SHOWNORMAL);
+					return 0;
+				case IDM_ACTBDL:
+					ShellExecute(hwnd,"open","http://www.activebasic.com/activebasic5/download.htm",NULL,NULL,SW_SHOWNORMAL);
+					return 0;
+#endif
+
+				case IDM_ABOUT:
+					DialogBox(hResInst,MAKEINTRESOURCE(IDD_ABOUT),hwnd,DialogAbout);
+					return 0;
+
+				case IDM_WEB_SEARCH:
+					hChild=GetWindow(hClient,GW_CHILD);
+					WndNum=GetWndNum(hChild);
+					if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+						extern HWND hWebSearchCombo;
+						SendMessage(GetWindow(hWebSearchCombo,GW_CHILD),WM_CHAR,VK_RETURN,0);
+					}
+					return 0;
+
+
+
+				//////////////////////////////////////////////////////
+				// レバーコントロールのサブメニューコマンド（レバー追加）
+				//////////////////////////////////////////////////////
+
+				case IDM_DOCSELECTBAND:
+					pobj_Rebar->ChangeRebarBand(ID_DOCCOMBO);
+					return 0;
+				case IDM_STANDARDBAND:
+					pobj_Rebar->ChangeRebarBand(ID_STANDARDTOOLBAR);
+					return 0;
+#ifndef THETEXT
+				case IDM_RELEASEBAND:
+					pobj_Rebar->ChangeRebarBand(ID_RELEASETOOLBAR);
+					return 0;
+				case IDM_DEBUGBAND:
+					pobj_Rebar->ChangeRebarBand(ID_DEBUGGERTOOLBAR);
+					return 0;
+				case IDM_SELECTCOMPILERBAND:
+					pobj_Rebar->ChangeRebarBand(ID_SELECTCOMPILERCOMBO);
+					return 0;
+#endif
+				case IDM_BANDMENU_WEB_SEARCH:
+					pobj_Rebar->ChangeRebarBand(ID_WEB_SEARCH);
+					return 0;
+				case IDM_NOGRIPPER:
+					if(pobj_nv->bNoGripper) pobj_nv->bNoGripper=0;
+					else pobj_nv->bNoGripper=1;
+
+					//レバーコントロールを再生成
+					pobj_Rebar->ResetRebar();
+
+					//メニュー状態を設定
+					ResetState_DocMenu();
+					return 0;
+				case IDM_RESET_REBAR:
+					//"ツールバーの配置をすべて初期状態に戻します。\nよろしいですか？"
+					if(IDCANCEL==MessageBox(hwnd,STRING_TOOLBAR_RESET,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) break;
+
+					//レバーコントロールを再生成
+					pobj_Rebar->ResetInitRebar();
+
+					//メニュー状態を設定
+					ResetState_DocMenu();
+					return 0;
+
+
+
+				////////////////////////////////////////////////////
+				// メイン タブ コントロールのサブメニューコマンド
+				////////////////////////////////////////////////////
+
+				case IDM_ALLCLOSE_OMIT_MYSELF:
+					//このウィンドウ以外をすべて閉じる(&A)
+					hChild=GetWindow(hClient,GW_CHILD);
+					WndNum=GetWndNum(hChild);
+					for(i=0;i<MAX_WNDNUM;i++){
+						if(i==WndNum) continue;
+						if(MdiInfo[i].hwnd) SendMessage(MdiInfo[i].hwnd,WM_CLOSE,0,0);
+					}
+					return 0;
+
+				case IDM_PATH_COPY:
+					hChild=GetWindow(hClient,GW_CHILD);
+					WndNum=GetWndNum(hChild);
+
+					//絶対パスをコピー
+					hGlobal=(char *)GlobalAlloc(GMEM_MOVEABLE,lstrlen(MdiInfo[WndNum].path)+1);
+					pTemp=(char *)GlobalLock(hGlobal);
+					lstrcpy(pTemp,MdiInfo[WndNum].path);
+					GlobalUnlock(hGlobal);
+
+					//クリップボードに保存
+					OpenClipboard(hwnd);
+					EmptyClipboard();
+					SetClipboardData(CF_TEXT,hGlobal);
+					CloseClipboard();
+					return 0;
+
+				case IDM_FOLDER_OPEN:
+					hChild=GetWindow(hClient,GW_CHILD);
+					WndNum=GetWndNum(hChild);
+
+					_splitpath(MdiInfo[WndNum].path,temporary,temp2,NULL,NULL);
+					lstrcat(temporary,temp2);
+
+					ShellExecute(hwnd,"explore",temporary,NULL,NULL,SW_SHOWNORMAL);
+					return 0;
+
+				case IDM_DELETE_FILE:
+					hChild=GetWindow(hClient,GW_CHILD);
+					WndNum=GetWndNum(hChild);
+
+					_splitpath(MdiInfo[WndNum].path,NULL,NULL,temporary,temp2);
+					lstrcat(temporary,temp2);
+
+					lstrcat(temporary," をごみ箱に移動して閉じます。よろしいですか？");
+					if(MessageBox(hwnd,temporary,APPLICATION_NAME,MB_OKCANCEL|MB_ICONQUESTION)==IDCANCEL) return 0;
+
+					//ゴミ箱へ
+					SHFILEOPSTRUCT fo;
+					fo.hwnd=hwnd;
+					fo.wFunc=FO_DELETE;
+					fo.pFrom =MdiInfo[WndNum].path;
+					fo.pTo="\0";
+					fo.fFlags =FOF_ALLOWUNDO|FOF_NOCONFIRMATION;
+					SHFileOperation(&fo);
+
+					//閉じる
+					MdiInfo[WndNum].pMdiTextEdit->UnModify();
+					SendMessage(MdiInfo[WndNum].hwnd,WM_CLOSE,0,0);
+
+					return 0;
+
+				case IDM_USER_COLOR:
+					{
+						CHOOSECOLOR cc;
+						COLORREF CusColors[16]={
+							RGB(255,255,255),
+							RGB(0,0,0),
+							RGB(128,128,128),
+							RGB(192,192,192),
+							RGB(128,0,0),
+							RGB(255,0,0),
+							RGB(128,128,0),
+							RGB(255,255,0),
+							RGB(0,128,0),
+							RGB(0,255,0),
+							RGB(0,128,128),
+							RGB(0,255,255),
+							RGB(0,0,128),
+							RGB(0,0,255),
+							RGB(128,0,128),
+							RGB(255,0,255)};
+						cc.lStructSize=sizeof(CHOOSECOLOR);
+						cc.hwndOwner=hwnd;
+						cc.rgbResult=colorUser;
+						cc.lpCustColors=CusColors;
+						cc.Flags=CC_RGBINIT|CC_FULLOPEN;
+						if(!ChooseColor(&cc)){
+							return 0;
+						}
+						colorUser=cc.rgbResult;
+					}
+				case IDM_GRAY:
+				case IDM_WHITE:
+				case IDM_RED:
+				case IDM_GREEN:
+				case IDM_BLUE:
+				case IDM_YELLOW:
+					hChild=GetWindow(hClient,GW_CHILD);
+					WndNum=GetWndNum(hChild);
+
+					TC_ITEM tcItem;
+					tcItem.mask=TCIF_PARAM;
+					if(LOWORD(wParam)==IDM_GRAY)	tcItem.lParam=TABCOLOR_GRAY;
+					if(LOWORD(wParam)==IDM_WHITE)	tcItem.lParam=TABCOLOR_WHITE;
+					if(LOWORD(wParam)==IDM_RED)		tcItem.lParam=TABCOLOR_RED;
+					if(LOWORD(wParam)==IDM_GREEN)	tcItem.lParam=TABCOLOR_GREEN;
+					if(LOWORD(wParam)==IDM_BLUE)	tcItem.lParam=TABCOLOR_BLUE;
+					if(LOWORD(wParam)==IDM_YELLOW)	tcItem.lParam=TABCOLOR_YELLOW;
+					if(LOWORD(wParam)==IDM_USER_COLOR) tcItem.lParam=colorUser;
+					TabCtrl_SetItem(pobj_MainTab->hTab,
+						TabCtrl_GetCurSel(pobj_MainTab->hTab),
+						&tcItem);
+					InvalidateRect(pobj_MainTab->hTab,NULL,0);
+					return 0;
+
+
+
+				//////////////////////////////////
+				// SideWeb
+				//////////////////////////////////
+
+				case IDC_CLIP:
+					pobj_SideWeb->bShow=0;
+					ResizeOwnerWnd();
+					return 0;
+			}
+			break;
+		case WM_DROPFILES:
+			hDrop=(HDROP)wParam;
+
+			i2=DragQueryFile(hDrop,-1,0,0);
+			for(i=0;i<i2;i++){
+				DragQueryFile(hDrop,i,str,MAX_PATH);
+				OpenFileWithExtension(str);
+			}
+			DragFinish(hDrop);
+			return 0;
+		case WM_SHOWERROR:
+			//エラー部分を反転表示
+			DWORD AccBytes;
+			HANDLE fh;
+			sprintf(temporary,"%spgm.tmp",pj_editor_Dir);
+			fh=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+			ReadFile(fh,temporary,MAX_PATH,&AccBytes,NULL);
+			CloseHandle(fh);
+			temporary[AccBytes]=0;
+			hChild=GetWindow(hClient,GW_CHILD);
+			while(hChild){
+				WndNum=GetWndNum(hChild);
+				if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+					if(lstrcmpi(MdiInfo[WndNum].path,temporary)==0) break;
+				}
+				hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+			}
+			if(!hChild){
+				hChild=OpenFileWithExtension(temporary);
+				WndNum=GetWndNum(hChild);
+			}
+
+			if(WndNum==-1) return 0;
+
+			//ウィンドウを最前面に表示
+			BringWindowToTop(hChild);
+			UpdateWindow(hChild);
+
+			pTemp=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+			//行の先頭インデックスを取得（取得する行の番号はwParamで渡される）
+			for(i=0,i2=0;;i++){
+				if(i2>=(int)wParam) break;
+				if(pTemp[i]=='\0') break;
+				if(pTemp[i]=='\r'&&pTemp[i+1]=='\n'){
+					i++;
+					i2++;
+				}
+			}
+			pos.x=i;
+
+			//行の終端インデックスを取得
+			for(;;i++){
+				if(pTemp[i]=='\0') break;
+				if(pTemp[i]=='\r'&&pTemp[i+1]=='\n') break;
+			}
+			pos.y=i;
+
+			//行を選択する
+			TextEdit_SetSel(WndNum,pos.x,pos.y,TRUE);
+
+			return 0;
+
+#ifndef THETEXT
+		case WM_SETCOMPILEVIEW:
+			//コンパイラウィンドウ（埋め込み型）が表示されたとき
+			hCompileView=(HWND)lParam;
+			ResizeOwnerWnd();
+			return 0;
+		case WM_DESTROYCOMPILEVIEW:
+			//コンパイラウィンドウ（埋め込み型）が破棄されたとき
+			if((int)hCompileView==-1){
+				//すぐに次のコンパイラウィンドウが起動するとき
+				hCompileView=0;
+			}
+			else{
+				//完全にコンパイラウィンドウを閉じたときはリサイズ
+				hCompileView=0;
+				
+				ResizeOwnerWnd();
+			}
+			return 0;
+
+		case WM_SETDEBUGGERBASE:
+			//デバッガベースウィンドウ（埋め込み型）が表示されたとき
+			pobj_Debugger->begin();
+
+			//BasicCompiler.exeの強制終了を考慮
+			SetTimer(hOwner,ID_DEBUGSAFTY,1000,NULL);
+
+			return 0;
+		case WM_DESTROYDEBUGGERBASE:
+			//BasicCompiler.exeの強制終了を考慮
+			KillTimer(hOwner,ID_DEBUGSAFTY);
+
+			//デバッガベースウィンドウ（埋め込み型）が破棄されたとき
+			pobj_Debugger->end();
+
+			return 0;
+
+		case WM_SETDEBUGGERVIEW:
+			//デバッガウィンドウ（埋め込み型）が表示されたとき
+			pobj_Debugger->watch_start((HWND)lParam);
+			ResizeOwnerWnd();
+			return 0;
+		case WM_DESTROYDEBUGGERVIEW:
+			//デバッガウィンドウ（埋め込み型）が破棄されたとき
+			pobj_Debugger->watch_quit();
+			ResizeOwnerWnd();
+			return 0;
+#endif
+
+		case WM_SIZE:
+			ResizeOwnerWnd();
+			return 0;
+
+
+		case WM_MOUSEMOVE:
+			static DWORD dwDragLever;
+			static POINT PrevMousePos;
+			static int start;
+
+			pos.x=(long)(short)LOWORD(lParam);
+			pos.y=(long)(short)HIWORD(lParam);
+			ClientToScreen(hwnd,&pos);
+
+			if(dwDragLever){
+				GetClientRect(hwnd,&rect);
+
+				if(dwDragLever==1){
+					//プロジェクトビューをリサイズ中
+					pobj_nv->width_ClipProjectView=start+pos.x-PrevMousePos.x;
+					if(pobj_nv->width_ClipProjectView<100) pobj_nv->width_ClipProjectView=100;
+					if(rect.right-100<pobj_nv->width_ClipProjectView) pobj_nv->width_ClipProjectView=rect.right-100;
+				}
+				else if(dwDragLever==2){
+					//デバッガビューをリサイズ中
+					pobj_nv->height_ClipDebuggerView=start+PrevMousePos.y-pos.y;
+					if(pobj_nv->height_ClipDebuggerView<60) pobj_nv->height_ClipDebuggerView=60;
+					if(rect.bottom-100<pobj_nv->height_ClipCompileView+pobj_nv->height_ClipDebuggerView)
+						pobj_nv->height_ClipDebuggerView=rect.bottom-100-pobj_nv->height_ClipCompileView;
+				}
+				else if(dwDragLever==3){
+					//コンパイラビューをリサイズ中
+					pobj_nv->height_ClipCompileView=start+PrevMousePos.y-pos.y;
+					if(pobj_nv->height_ClipCompileView<60) pobj_nv->height_ClipCompileView=60;
+					if(rect.bottom-100<pobj_nv->height_ClipCompileView)
+						pobj_nv->height_ClipCompileView=rect.bottom-100;
+				}
+				else if(dwDragLever==4){
+					//SideWebをリサイズ中
+					pobj_nv->width_WebSearchView=start+PrevMousePos.x-pos.x;
+					if(pobj_nv->width_WebSearchView<100) pobj_nv->width_WebSearchView=100;
+					if(rect.right-100<pobj_nv->width_WebSearchView) pobj_nv->width_WebSearchView=rect.right-100;
+				}
+
+				ResizeOwnerWnd();
+				UpdateWindow(hwnd);
+			}
+			if(pobj_nv->bClipProjectView&&IsWindowVisible(hProjectView)){
+				//プロジェクトビューとMDIクライアントの境目のサイズ変更ライン
+				GetWindowRect(hProjectView,&rect);
+				if(rect.top<=pos.y&&pos.y<=rect.bottom&&
+					rect.right<=pos.x&&pos.x<=rect.right+LEVER_THICK){
+					SetCursor(LoadCursor(0,IDC_SIZEWE));
+				}
+			}
+#ifndef THETEXT
+			if(bClipCompileView&&pobj_Debugger->IsDebuggerView()){
+				//デバッガビューとMDIクライアントの境目のサイズ変更ライン
+				GetWindowRect(pobj_Debugger->hwnd,&rect);
+				if(rect.left<=pos.x&&pos.x<=rect.right&&
+					rect.top-LEVER_THICK<=pos.y&&pos.y<=rect.top){
+					SetCursor(LoadCursor(0,IDC_SIZENS));
+				}
+			}
+			if(bClipCompileView&&IsWindowVisible(hCompileView)){
+				//コンパイラビューとMDIクライアントの境目のサイズ変更ライン
+				GetWindowRect(hCompileView,&rect);
+				if(rect.left<=pos.x&&pos.x<=rect.right&&
+					rect.top-LEVER_THICK<=pos.y&&pos.y<=rect.top){
+					SetCursor(LoadCursor(0,IDC_SIZENS));
+				}
+			}
+#endif
+			if(pobj_SideWeb->bShow){
+				//SideWebとMDIクライアントの境目のサイズ変更ライン
+				pobj_SideWeb->GetRect(&rect);
+				ClientToScreen(hwnd,&rect);
+				if(rect.top<=pos.y&&pos.y<=rect.bottom&&
+					rect.left-LEVER_THICK<=pos.x&&pos.x<=rect.left){
+					SetCursor(LoadCursor(0,IDC_SIZEWE));
+				}
+			}
+			return 0;
+		case WM_LBUTTONDOWN:
+			pos.x=LOWORD(lParam);
+			pos.y=HIWORD(lParam);
+			ClientToScreen(hwnd,&pos);
+
+			if(pobj_nv->bClipProjectView&&IsWindowVisible(hProjectView)){
+				//プロジェクトビューとMDIクライアントの境目のサイズ変更ライン
+				GetWindowRect(hProjectView,&rect);
+				if(rect.top<=pos.y&&pos.y<=rect.bottom&&
+					rect.right<=pos.x&&pos.x<=rect.right+LEVER_THICK){
+					SetCursor(LoadCursor(0,IDC_SIZEWE));
+
+					dwDragLever=1;
+					SetCapture(hwnd);
+
+					PrevMousePos=pos;
+					start=pobj_nv->width_ClipProjectView;
+				}
+			}
+#ifndef THETEXT
+			if(bClipCompileView&&pobj_Debugger->IsDebuggerView()){
+				//デバッガビューとMDIクライアントの境目のサイズ変更ライン
+				GetWindowRect(pobj_Debugger->hwnd,&rect);
+				if(rect.left<=pos.x&&pos.x<=rect.right&&
+					rect.top-LEVER_THICK<=pos.y&&pos.y<=rect.top){
+					SetCursor(LoadCursor(0,IDC_SIZENS));
+
+					dwDragLever=2;
+					SetCapture(hwnd);
+
+					PrevMousePos=pos;
+					start=pobj_nv->height_ClipDebuggerView;
+				}
+			}
+			if(bClipCompileView&&IsWindowVisible(hCompileView)){
+				//コンパイラビューとMDIクライアントの境目のサイズ変更ライン
+				GetWindowRect(hCompileView,&rect);
+				if(rect.left<=pos.x&&pos.x<=rect.right&&
+					rect.top-LEVER_THICK<=pos.y&&pos.y<=rect.top){
+					SetCursor(LoadCursor(0,IDC_SIZENS));
+
+					dwDragLever=3;
+					SetCapture(hwnd);
+
+					PrevMousePos=pos;
+					start=pobj_nv->height_ClipCompileView;
+				}
+			}
+#endif
+			if(pobj_SideWeb->bShow){
+				//SideWebとMDIクライアントの境目のサイズ変更ライン
+				pobj_SideWeb->GetRect(&rect);
+				ClientToScreen(hwnd,&rect);
+				if(rect.top<=pos.y&&pos.y<=rect.bottom&&
+					rect.left-LEVER_THICK<=pos.x&&pos.x<=rect.left){
+					SetCursor(LoadCursor(0,IDC_SIZENS));
+
+					dwDragLever=4;
+					SetCapture(hwnd);
+
+					PrevMousePos=pos;
+					start=pobj_nv->width_WebSearchView;
+				}
+			}
+			return 0;
+		case WM_LBUTTONUP:
+			if(dwDragLever){
+				dwDragLever=0;
+				ReleaseCapture();
+			}
+			return 0;
+
+
+		case WM_SYSCOMMAND:
+			//ウィンドウの最小化前にウィンドウ位置を保存
+			if(wParam==SC_MINIMIZE){
+				if(IsZoomed(hwnd)) pobj_nv->bWindowMax=1;
+				else if(!IsIconic(hwnd)){
+					pobj_nv->bWindowMax=0;
+					GetWindowRect(hwnd,&pobj_nv->StartupWindowRect);
+				}
+			}
+			break;	//処理をDefFrameProcへ
+		case WM_QUERYENDSESSION:
+		case WM_CLOSE:
+			extern BOOL bSearchingClasses;
+			if(bSearchingClasses){
+				pobj_ClassTreeView->bCloseSwitch=1;
+				return 0;
+			}
+
+			//コンパイラビューを閉じる
+			if(hCompileView)
+				SendMessage(hCompileView,WM_COMMAND,IDCANCEL,0);
+
+			//次回起動時にMDIウィンドウを最大化させるかを判定
+			hChild=GetWindow(hClient,GW_CHILD);
+			pobj_nv->bMDIZoomed=IsZoomed(hChild);
+
+			//プロジェクトを閉じる
+			if(ProjectInfo.name[0]){
+				if(!CloseProject()) return 0;
+			}
+
+			//MDIウィンドウの保存確認
+			hChild=GetWindow(hClient,GW_CHILD);
+			while(hChild){
+				i=GetWndNum(hChild);
+				if(!DocumentModifyCheck(hChild)) return 0;
+				hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+			}
+
+
+			KillTimer(hwnd,ID_TIMER_BACKUP);
+
+
+			//ProjectViewの位置を保存、ProjectViewを破棄
+			GetWindowRect(hProjectView_ToolWindow,&pobj_nv->rectProjectView);
+			DestroyWindow(hProjectView);
+			DestroyWindow(hProjectView_ToolWindow);
+
+			//Rebarの位置を保存、Rebarを破棄
+			delete pobj_Rebar;
+			pobj_Rebar=0;
+
+			//タブコントロールを破棄
+			delete pobj_MainTab;
+			pobj_MainTab=0;
+
+			//SideWebを破棄
+			delete pobj_SideWeb;
+			pobj_SideWeb=0;
+
+			//メインウィンドウの最大化有無、座標を保存
+			if(IsZoomed(hwnd)) pobj_nv->bWindowMax=1;
+			else if(!IsIconic(hwnd)){
+				pobj_nv->bWindowMax=0;
+				GetWindowRect(hwnd,&pobj_nv->StartupWindowRect);
+			}
+
+			hChild=GetWindow(hClient,GW_CHILD);
+			while(hChild){
+				CloseDocWindow(GetWndNum(hChild));
+				DestroyWindow(hChild);
+				hChild=GetWindow(hClient,GW_CHILD);
+			}
+
+			EndProjectEditor();		//ProjectEditorの情報を保存
+
+			//エディタ用フォントを破棄
+			extern HFONT hFont_TextEdit,hFont_HyperLink_TextEdit;
+			if(hFont_TextEdit) DeleteObject(hFont_TextEdit);
+			if(hFont_HyperLink_TextEdit) DeleteObject(hFont_HyperLink_TextEdit);
+
+			DestroyWindow(hwnd);
+			return 0;
+
+		case WM_DESTROY:
+			PostQuitMessage(0);
+			return 0;
+	}
+	return DefFrameProc(hwnd,hClient,message,wParam,lParam);
+}
+
+int RegWndClass(WNDPROC WndProc,char *lpClassName,HBRUSH hBackBrush,DWORD dwFlag){
+	WNDCLASSEX wcl;
+
+	wcl.cbSize=sizeof(WNDCLASSEX);
+	wcl.hInstance=hInst;
+	wcl.lpszClassName=lpClassName;
+	wcl.lpfnWndProc=WndProc;
+
+	if(dwFlag&FLAG_DBLCLK) wcl.style=CS_DBLCLKS;
+	else wcl.style=0;
+
+	wcl.hIcon=LoadIcon(NULL,IDI_APPLICATION);
+	wcl.hIconSm=LoadIcon(NULL,IDI_WINLOGO);
+
+	if(dwFlag&FLAG_BEAMCURSOR) wcl.hCursor=LoadCursor(NULL,IDC_IBEAM);
+	else wcl.hCursor=LoadCursor(NULL,IDC_ARROW);
+
+	wcl.lpszMenuName=NULL;
+	wcl.cbClsExtra=0;
+	wcl.cbWndExtra=0;
+	wcl.hbrBackground=hBackBrush;
+
+	return RegisterClassEx(&wcl);
+}
+int PASCAL WinMain(HINSTANCE hThisInst,HINSTANCE hPrevInst,LPSTR lpCmdLine,int ShowCmd){
+	int i,i2,IsStr;
+	char str[MAX_PATH],str2[MAX_PATH],dummy[1024];
+	MSG msg;
+	HACCEL hAccel;
+
+	hInst=hThisInst;
+	if(!SetupProjectEditor()) return 0;
+
+	HBRUSH hGrayBrush_LineNumber;
+	hGrayBrush_LineNumber=CreateSolidBrush(RGB(220,220,220));
+
+	if(!RegWndClass(WindowFunc,"ProjectEditor",(HBRUSH)COLOR_APPWORKSPACE+1,FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(MDIClientWindow_TextEdit,"MDIClientWindow_TextEdit",(HBRUSH)GetStockObject(WHITE_BRUSH),FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(MethodCheckWindow,"MethodCheckWindow",(HBRUSH)GetStockObject(WHITE_BRUSH),FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(MDIClientWindow_Rad,"MDIClientWindow_Rad",(HBRUSH)GetStockObject(WHITE_BRUSH),FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(RadToolsWindow,"RadToolsWindow",h3DFaceBackBrush,FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(RadPropertyWindow,"RadPropertyWindow",h3DFaceBackBrush,FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(RadWindow,"RadWindow",(HBRUSH)GetStockObject(NULL_BRUSH),FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(TestWindowProc,"TestWindow",h3DFaceBackBrush,FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(MDIClientWindow_Menu,"MDIClientWindow_Menu",(HBRUSH)GetStockObject(WHITE_BRUSH),FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(MenuEditWindow,"MenuEditWindow",h3DFaceBackBrush,FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(MDIClientWindow_IconEdit,"MDIClientWindow_IconEdit",h3DFaceBackBrush,FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(IconEditWindowProc,"IconEditWindowProc",(HBRUSH)GetStockObject(WHITE_BRUSH),0)) return 0;
+	if(!RegWndClass(ProjectViewProc,"ProjectView",h3DFaceBackBrush,FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(ProjectView_ToolWindowProc,"ProjectView_ToolWindow",h3DFaceBackBrush,FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(TextEditProc,"TextEditor",(HBRUSH)GetStockObject(NULL_BRUSH),FLAG_DBLCLK|FLAG_BEAMCURSOR)) return 0;
+	if(!RegWndClass(ComplementWindow,"ComplementWindow",(HBRUSH)GetStockObject(BLACK_BRUSH),FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(PreviewWndProc,"PreviewWindow",(HBRUSH)GetStockObject(GRAY_BRUSH),FLAG_DBLCLK)) return 0;
+
+	//Web検索用のウィンドウクラス
+	if(!RegWndClass(WebResultWndProc,"WebResult",(HBRUSH)COLOR_APPWORKSPACE+1,FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(OneTabProc,"OneTab",(HBRUSH)COLOR_APPWORKSPACE+1,FLAG_DBLCLK)) return 0;
+	if(!RegWndClass(ResultListProc,"ResultList",(HBRUSH)COLOR_APPWORKSPACE+1,FLAG_DBLCLK)) return 0;
+
+	//ルーラーのウィンドウクラス
+	if(!RegWndClass(RulerProc,"Ruler",(HBRUSH)COLOR_APPWORKSPACE+1,FLAG_DBLCLK)) return 0;
+
+	//SideWebのウィンドウクラス
+	if(!RegWndClass(SideWebProc,"SideWeb",(HBRUSH)COLOR_APPWORKSPACE+1,FLAG_DBLCLK)) return 0;
+
+
+
+	hAccel=LoadAccelerators(hResInst,MAKEINTRESOURCE(IDR_ACCELERATOR1));
+
+	//メインウィンドウ
+	RECT *prc;
+	prc=&pobj_nv->StartupWindowRect;
+	hOwner=CreateWindowEx(WS_EX_ACCEPTFILES,"ProjectEditor",APPLICATION_NAME,
+		WS_OVERLAPPEDWINDOW|WS_CLIPCHILDREN,
+		prc->left, prc->top,
+		prc->right-prc->left, prc->bottom-prc->top,
+		HWND_DESKTOP,pobj_MainMenu->hMenu,hInst,NULL);
+
+	SendMessage(hOwner,WM_SETICON,ICON_SMALL,(long)hOwnerIcon);
+	SetClipboardViewer(hOwner);
+
+	if(pobj_nv->bWindowMax) ShowWindow(hOwner,SW_MAXIMIZE);
+	else ShowWindow(hOwner,ShowCmd);
+	UpdateWindow(hOwner);
+
+	int open_sw=0;
+	if(lstrlen(lpCmdLine)>0){
+		lstrcpy(dummy,lpCmdLine);
+		for(i=0,i2=0,IsStr=0;;i++,i2++){
+			if(dummy[i]=='\"'){
+				if(IsStr==0) IsStr=1;
+				else IsStr=0;
+				i++;
+			}
+			if((dummy[i]==' '&&IsStr==0)||dummy[i]=='\0'){
+				str[i2]=0;
+				if(!(strstr(str,":")||strstr(str,"\\\\"))){
+					lstrcpy(str2,str);
+					GetCurrentDirectory(MAX_PATH,str);
+					lstrcat(str,"\\");
+					lstrcat(str,str2);
+				}
+				ShortPathToLongPath(str,str2);
+				OpenFileWithExtension(str2);
+				open_sw=1;
+				if(dummy[i]=='\0') break;
+				i2=-1;
+				continue;
+			}
+			str[i2]=dummy[i];
+		}
+	}
+
+	BOOL bRestore=0;
+
+
+	{
+		//自動バックアップ及び復元機能
+
+		//必要であれば復元
+		bRestore=restore();
+	}
+
+
+#ifdef THETEXT
+	if(open_sw==0&&bRestore==0){
+		//ファイルが開かれなかったとき
+		NewTextEditWindow(NULL,WNDTYPE_TEXT);
+	}
+#endif
+
+
+	while(GetMessage(&msg,NULL,0,0)){
+
+		if(!TranslateAccelerator(hOwner,hAccel,&msg)){
+			if(ProjectInfo.name[0]){
+				for(i=0,i2=0;i<MAX_WNDNUM;i++){
+					if(MdiInfo[i].hwnd&&MdiInfo[i].DocType==WNDTYPE_RAD){
+						if(IsDialogMessage(MdiInfo[i].MdiRadInfo->hProp_Dlg,&msg)) i2=1;
+					}
+				}
+				if(i2==0){
+					if(!TranslateMDISysAccel(hClient,&msg)){
+						TranslateMessage(&msg);
+						DispatchMessage(&msg);
+					}
+				}
+			}
+			else{
+				if(!TranslateMDISysAccel(hClient,&msg)){
+					TranslateMessage(&msg);
+					DispatchMessage(&msg);
+				}
+			}
+		}
+	}
+
+	DeleteObject(hGrayBrush_LineNumber);
+
+#if defined HeapAlloc
+	CheckHeapCheck();
+#endif
+
+	return msg.wParam;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.h	(revision 178)
@@ -0,0 +1,104 @@
+#include "Common.h"
+
+#ifdef JPN
+//日本語
+
+#ifdef THETEXT
+LPSTR DefFileFilter="テキスト ファイル(*.txt)\0*.txt\0HTMLファイル(*.htm;*html)\0*.htm;*html\0CGIファイル(*.cgi;*.pl)\0*.cgi;*.pl\0PHPファイル(*.php)\0*.php\0テンプレート ファイル(*.tpl)\0*.tpl\0すべてのファイル(*.*)\0*\0\0";
+#else
+LPSTR DefFileFilter="プログラム ファイル(*.ab;*.abp;*.bas;*.sbp)\0*.ab;*.abp;*.bas;*sbp\0プロジェクト(*.pj)\0*.pj\0テキスト ファイル(*.txt)\0*.txt\0すべてのファイル(*.*)\0*\0\0";
+#endif
+
+LPSTR HtmlFileFilter="HTMLファイル(*.html;*.htm)\0*.html;*.htm\0すべてのファイル(*.*)\0*\0\0";
+LPSTR TextFileFilter="テキスト ファイル(*.txt)\0*.txt\0すべてのファイル(*.*)\0*\0\0";
+
+LPSTR ProjectFileFilter="プロジェクト(*.pj)\0*.pj\0\0";
+LPSTR BitmapFileFilter="ビットマップ(*.bmp)\0*.bmp\0\0";
+LPSTR IconFileFilter="アイコン(*.ico)\0*.ico\0\0";
+LPSTR CursorFileFilter="カーソル(*.cur)\0*.cur\0\0";
+
+LPSTR ExeFileFilter="実行可能ファイル(*.exe)\0*.exe\0\0";
+
+#else
+//英語
+LPSTR DefFileFilter="Program files (*.ab;*.abp;*.bas;*.sbp)\0*.ab;*.abp;*.bas;*sbp\0Project templates (*.pj)\0*.pj\0Text files (*.txt)\0*.txt\0All files(*.*)\0*\0\0";
+LPSTR ProjectFileFilter="Project templates (*.pj)\0*.pj\0\0";
+LPSTR BitmapFileFilter="Bitmap files (*.bmp)\0*.bmp\0\0";
+LPSTR IconFileFilter="Icon files (*.ico)\0*.ico\0\0";
+LPSTR CursorFileFilter="Cursor files (*.cur)\0*.cur\0\0";
+#endif
+
+HINSTANCE hInst,hResInst,hIconResInst;
+HANDLE hHeap;
+HFONT hStatusFont;
+HFONT hHyperLinkFont;
+HFONT hFont_LineNumber;
+HFONT hRulerFont;
+SIZE sizeLineNumberFont;
+HICON hOwnerIcon,hBasicProgramIcon,hTextDocumentIcon,hWindowDocumentIcon;
+HBRUSH h3DFaceBackBrush;
+DWORD dwRadClipboardID;
+char *lpszCompilerName;
+
+FWINLAYER pSetLayeredWindowAttributes;
+HINSTANCE hUser32Lib;
+
+/* 各ウィンドウ */
+HWND hOwner;					//オーナーウィンドウ
+HWND hClient;					//MDIクライアントウィンドウ
+HWND hStatusBar;				//ステータスバー
+MDIINFO MdiInfo[MAX_WNDNUM];	//MDIドキュメントウィンドウ情報
+
+/* メニュー */
+HMENU hFirstMainMenu;
+HMENU hEditMenuBase,hEditMenu;
+HMENU hRebarMenuBase,hRebarMenu;
+HMENU hTabMenuBase,hTabMenu,hTabColorMenu;
+HMENU hFileTreeMenuBase;
+HMENU hProcedureTreeMenuBase;
+HMENU hMaterialTreeMenuBase;
+HMENU hRadMenuBase;
+CSubMenuEx *pobj_FileHistoryMenu;
+#ifndef THETEXT
+CSubMenuEx *pobj_ProjectHistoryMenu;
+#endif
+
+
+//エディタ文字情報
+METHODCHECKINFO MethodCheckInfo;
+COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+
+//プロジェクト情報
+NEWPROJECTINFO NewProjectInfo;
+PROJECTINFO ProjectInfo;
+HWND hProjectView;		//プロジェクト ビュー
+HWND hProjectView_ToolWindow;
+
+//コンパイラビュー情報
+HWND hCompileView;
+BOOL bClipCompileView=1;
+
+//RADツール情報
+RADINFO RadInfo;
+HWND hTools;			//コントロール挿入用のツールウィンドウ
+
+//不揮発性データ（レジストリに保存される）
+CNonVolatile *pobj_nv;
+
+TEXTEDIT_COLOR_INFO tci;
+
+int ScreenX,ScreenY;
+int DocumentCounter;
+_int8 IsCheckLineColor;
+
+char pj_editor_Dir[MAX_PATH];
+char CmdMsg[255];
+char NewIdName[MAX_PATH];
+char NewFileName[MAX_PATH];	//新規作成ダイアログのプロジェクト追加用
+char *pHeaderBuf;
+char *pUserSource=0;
+
+
+
+//Break point
+CDBBreakPoint *pobj_DBBreakPoint;
Index: tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.rc
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.rc	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.rc	(revision 178)
@@ -0,0 +1,97 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// 日本語 resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
+#ifdef _WIN32
+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
+#pragma code_page(932)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+#if defined(APSTUDIO_INVOKED) || defined(PROJECTEDITOR)
+#if defined(APSTUDIO_INVOKED)
+IDI_MAIN$(PROJECTEDITOR) ICON    DISCARDABLE     "icon1.ico"
+#else
+IDI_MAIN                ICON    DISCARDABLE     "icon1.ico"
+#endif
+#endif
+IDI_BASICPROGRAM        ICON    DISCARDABLE     "BasicProgram.ico"
+IDI_TEXTDOCUMENT        ICON    DISCARDABLE     "TextDocument.ico"
+IDI_FOLDER_CLOSE        ICON    DISCARDABLE     "folder_close.ico"
+IDI_FOLDER_OPEN         ICON    DISCARDABLE     "folder_open.ico"
+IDI_WINDOW              ICON    DISCARDABLE     "Window.ico"
+IDI_PROCEDURE           ICON    DISCARDABLE     "Procedure.ico"
+IDI_FILE_PJ             ICON    DISCARDABLE     "file_pj.ico"
+IDI_FILE_BAS            ICON    DISCARDABLE     "file_bas.ico"
+IDI_FILE_SBP            ICON    DISCARDABLE     "file_sbp.ico"
+IDI_FILE_ICON           ICON    DISCARDABLE     "file_icon.ico"
+IDI_FILE_BMP            ICON    DISCARDABLE     "file_bmp.ico"
+IDI_FILE_CURSOR         ICON    DISCARDABLE     "ico00001.ico"
+#if defined(APSTUDIO_INVOKED) || defined(THETEXT)
+#if defined(APSTUDIO_INVOKED)
+IDI_MAIN$(THETEXT)      ICON    DISCARDABLE     "main.ico"
+#else
+IDI_MAIN                ICON    DISCARDABLE     "main.ico"
+#endif
+#endif
+#endif    // 日本語 resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
Index: tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.sln
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.sln	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.sln	(revision 178)
@@ -0,0 +1,29 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ProjectEditor", "ProjectEditor.vcproj", "{DC1B787E-510F-4F7D-8F9A-182600904D83}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		AB_Debug|Win32 = AB_Debug|Win32
+		AB_Release|Win32 = AB_Release|Win32
+		English_Rel|Win32 = English_Rel|Win32
+		TheText_Debug|Win32 = TheText_Debug|Win32
+		TheText_Release|Win32 = TheText_Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{DC1B787E-510F-4F7D-8F9A-182600904D83}.AB_Debug|Win32.ActiveCfg = AB_Debug|Win32
+		{DC1B787E-510F-4F7D-8F9A-182600904D83}.AB_Debug|Win32.Build.0 = AB_Debug|Win32
+		{DC1B787E-510F-4F7D-8F9A-182600904D83}.AB_Release|Win32.ActiveCfg = AB_Release|Win32
+		{DC1B787E-510F-4F7D-8F9A-182600904D83}.AB_Release|Win32.Build.0 = AB_Release|Win32
+		{DC1B787E-510F-4F7D-8F9A-182600904D83}.English_Rel|Win32.ActiveCfg = English_Rel|Win32
+		{DC1B787E-510F-4F7D-8F9A-182600904D83}.English_Rel|Win32.Build.0 = English_Rel|Win32
+		{DC1B787E-510F-4F7D-8F9A-182600904D83}.TheText_Debug|Win32.ActiveCfg = TheText_Debug|Win32
+		{DC1B787E-510F-4F7D-8F9A-182600904D83}.TheText_Debug|Win32.Build.0 = TheText_Debug|Win32
+		{DC1B787E-510F-4F7D-8F9A-182600904D83}.TheText_Release|Win32.ActiveCfg = TheText_Release|Win32
+		{DC1B787E-510F-4F7D-8F9A-182600904D83}.TheText_Release|Win32.Build.0 = TheText_Release|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.vcproj
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.vcproj	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/ProjectEditor.vcproj	(revision 178)
@@ -0,0 +1,4467 @@
+<?xml version="1.0" encoding="shift_jis"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="8.00"
+	Name="ProjectEditor"
+	ProjectGUID="{DC1B787E-510F-4F7D-8F9A-182600904D83}"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="English_Rel|Win32"
+			OutputDirectory=".\English_Rel"
+			IntermediateDirectory=".\English_Rel"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\English_Rel/ProjectEditor.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="WIN32;ENGLISH_REL;_WINDOWS"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\English_Rel/ProjectEditor.pch"
+				AssemblerListingLocation=".\English_Rel/"
+				ObjectFile=".\English_Rel/"
+				ProgramDataBaseFileName=".\English_Rel/"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="ENG,PROJECTEDITOR"
+				Culture="1033"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib"
+				OutputFile="../ActiveBasic/ProjectEditor.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\English_Rel/ProjectEditor.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				AdditionalManifestFiles="$(ProjectDir)\manifest.xml"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\English_Rel/ProjectEditor.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="TheText_Share_Debug|Win32"
+			OutputDirectory=".\ProjectEditor___Win32_TheText_Share_Debug"
+			IntermediateDirectory=".\ProjectEditor___Win32_TheText_Share_Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\ProjectEditor___Win32_TheText_Share_Debug/ProjectEditor.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;JPN;THETEXT;SHAREWARE"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\ProjectEditor___Win32_TheText_Share_Debug/ProjectEditor.pch"
+				AssemblerListingLocation=".\ProjectEditor___Win32_TheText_Share_Debug/"
+				ObjectFile=".\ProjectEditor___Win32_TheText_Share_Debug/"
+				ProgramDataBaseFileName=".\ProjectEditor___Win32_TheText_Share_Debug/"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="JPN,THETEXT"
+				Culture="1041"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib"
+				OutputFile="../TheText/TheText.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\ProjectEditor___Win32_TheText_Share_Debug/TheText.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				AdditionalManifestFiles="$(ProjectDir)\manifest.xml"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\ProjectEditor___Win32_TheText_Share_Debug/ProjectEditor.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="TheText_Release|Win32"
+			OutputDirectory=".\ProjectEditor___Win32_TheText_Release"
+			IntermediateDirectory=".\ProjectEditor___Win32_TheText_Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\ProjectEditor___Win32_TheText_Release/ProjectEditor.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;THETEXT"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\ProjectEditor___Win32_TheText_Release/ProjectEditor.pch"
+				AssemblerListingLocation=".\ProjectEditor___Win32_TheText_Release/"
+				ObjectFile=".\ProjectEditor___Win32_TheText_Release/"
+				ProgramDataBaseFileName=".\ProjectEditor___Win32_TheText_Release/"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="JPN,THETEXT"
+				Culture="1041"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib libcp.lib"
+				OutputFile="../TheText/TheText.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\ProjectEditor___Win32_TheText_Release/TheText.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				AdditionalManifestFiles="$(ProjectDir)\manifest.xml"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\ProjectEditor___Win32_TheText_Release/ProjectEditor.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="AB_Debug|Win32"
+			OutputDirectory=".\ProjectEditor___Win32_AB_Debug"
+			IntermediateDirectory=".\ProjectEditor___Win32_AB_Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\ProjectEditor___Win32_AB_Debug/ProjectEditor.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;JPN"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\ProjectEditor___Win32_AB_Debug/ProjectEditor.pch"
+				AssemblerListingLocation=".\ProjectEditor___Win32_AB_Debug/"
+				ObjectFile=".\ProjectEditor___Win32_AB_Debug/"
+				ProgramDataBaseFileName=".\ProjectEditor___Win32_AB_Debug/"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="JPN,PROJECTEDITOR"
+				Culture="1041"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib"
+				OutputFile="../ActiveBasic/abdev.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\ProjectEditor___Win32_AB_Debug/abdev.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				AdditionalManifestFiles="$(ProjectDir)\manifest.xml"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\ProjectEditor___Win32_AB_Debug/ProjectEditor.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="TheText_Share_Release|Win32"
+			OutputDirectory=".\ProjectEditor___Win32_TheText_Share_Release"
+			IntermediateDirectory=".\ProjectEditor___Win32_TheText_Share_Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\ProjectEditor___Win32_TheText_Share_Release/ProjectEditor.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN;THETEXT;SHAREWARE"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\ProjectEditor___Win32_TheText_Share_Release/ProjectEditor.pch"
+				AssemblerListingLocation=".\ProjectEditor___Win32_TheText_Share_Release/"
+				ObjectFile=".\ProjectEditor___Win32_TheText_Share_Release/"
+				ProgramDataBaseFileName=".\ProjectEditor___Win32_TheText_Share_Release/"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="JPN,THETEXT"
+				Culture="1041"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib"
+				OutputFile="../TheText/TheText.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\ProjectEditor___Win32_TheText_Share_Release/TheText.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				AdditionalManifestFiles="$(ProjectDir)\manifest.xml"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\ProjectEditor___Win32_TheText_Share_Release/ProjectEditor.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="AB_Release|Win32"
+			OutputDirectory=".\ProjectEditor___Win32_AB_Release"
+			IntermediateDirectory=".\ProjectEditor___Win32_AB_Release"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="NDEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\ProjectEditor___Win32_AB_Release/ProjectEditor.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				InlineFunctionExpansion="1"
+				PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;JPN"
+				StringPooling="true"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				PrecompiledHeaderFile=".\ProjectEditor___Win32_AB_Release/ProjectEditor.pch"
+				AssemblerListingLocation=".\ProjectEditor___Win32_AB_Release/"
+				ObjectFile=".\ProjectEditor___Win32_AB_Release/"
+				ProgramDataBaseFileName=".\ProjectEditor___Win32_AB_Release/"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="JPN,PROJECTEDITOR"
+				Culture="1041"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib libcp.lib"
+				OutputFile="../ActiveBasic/abdev.exe"
+				LinkIncremental="1"
+				SuppressStartupBanner="true"
+				ProgramDatabaseFile=".\ProjectEditor___Win32_AB_Release/abdev.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				AdditionalManifestFiles="$(ProjectDir)\manifest.xml"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\ProjectEditor___Win32_AB_Release/ProjectEditor.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="TheText_Debug|Win32"
+			OutputDirectory=".\ProjectEditor___Win32_TheText_Debug"
+			IntermediateDirectory=".\ProjectEditor___Win32_TheText_Debug"
+			ConfigurationType="1"
+			InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+			UseOfMFC="0"
+			ATLMinimizesCRunTimeLibraryUsage="false"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				PreprocessorDefinitions="_DEBUG"
+				MkTypLibCompatible="true"
+				SuppressStartupBanner="true"
+				TargetEnvironment="1"
+				TypeLibraryName=".\ProjectEditor___Win32_TheText_Debug/ProjectEditor.tlb"
+				HeaderFileName=""
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;JPN;THETEXT"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				PrecompiledHeaderFile=".\ProjectEditor___Win32_TheText_Debug/ProjectEditor.pch"
+				AssemblerListingLocation=".\ProjectEditor___Win32_TheText_Debug/"
+				ObjectFile=".\ProjectEditor___Win32_TheText_Debug/"
+				ProgramDataBaseFileName=".\ProjectEditor___Win32_TheText_Debug/"
+				BrowseInformation="1"
+				WarningLevel="3"
+				SuppressStartupBanner="true"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+				PreprocessorDefinitions="JPN,THETEXT"
+				Culture="1041"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="odbc32.lib odbccp32.lib comctl32.lib imm32.lib htmlhelp.lib rpcrt4.lib"
+				OutputFile="../TheText/TheText.exe"
+				LinkIncremental="2"
+				SuppressStartupBanner="true"
+				GenerateDebugInformation="true"
+				ProgramDatabaseFile=".\ProjectEditor___Win32_TheText_Debug/TheText.pdb"
+				SubSystem="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				AdditionalManifestFiles="$(ProjectDir)\manifest.xml"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+				SuppressStartupBanner="true"
+				OutputFile=".\ProjectEditor___Win32_TheText_Debug/ProjectEditor.bsc"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCWebDeploymentTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+			>
+			<File
+				RelativePath="Backup.cpp"
+				>
+				<FileConfiguration
+					Name="English_Rel|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="DialogBoxes.cpp"
+				>
+				<FileConfiguration
+					Name="English_Rel|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="DocumentAdvice.cpp"
+				>
+				<FileConfiguration
+					Name="English_Rel|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="FileOperation.cpp"
+				>
+				<FileConfiguration
+					Name="English_Rel|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="History.cpp"
+				>
+				<FileConfiguration
+					Name="English_Rel|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="ProjectEditor.cpp"
+				>
+				<FileConfiguration
+					Name="English_Rel|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="ProjectEditor.rc"
+				>
+				<FileConfiguration
+					Name="English_Rel|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Debug|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Release|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Debug|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Release|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Release|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Debug|Win32"
+					>
+					<Tool
+						Name="VCResourceCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="SubOperation.cpp"
+				>
+				<FileConfiguration
+					Name="English_Rel|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Share_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="AB_Release|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="TheText_Debug|Win32"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+						PreprocessorDefinitions=""
+					/>
+				</FileConfiguration>
+			</File>
+			<Filter
+				Name="コンパイラ・デバッガ通信"
+				>
+				<File
+					RelativePath="Attach.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="Attach.h"
+					>
+				</File>
+				<File
+					RelativePath="Debugger.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="Debugger.h"
+					>
+				</File>
+			</Filter>
+			<Filter
+				Name="プロジェクト解析"
+				>
+				<File
+					RelativePath="ProjectControl.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="Resource.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="WindowControl.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<Filter
+					Name="クラスビュー"
+					>
+					<File
+						RelativePath="CClassInfo.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="ClassTree.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="ファイルビュー"
+					>
+					<File
+						RelativePath="CFileInfo.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="FileTree.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="FileTree.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="RADエディタ"
+				>
+				<File
+					RelativePath="DrawWindow.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="MessageCallOperation.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="Rad_UndoRedo.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="RadProc.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="RadSupport.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="RadToolsAndPropertyProc.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+			</Filter>
+			<Filter
+				Name="メニューエディタ"
+				>
+				<File
+					RelativePath="MenuProc.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+			</Filter>
+			<Filter
+				Name="アイコンエディタ"
+				>
+				<File
+					RelativePath="IconEditor.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="IconEditor_Color.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="IconEditor_Main.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="IconEditor_Tool.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="IconEditor_UndoRedo.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+			</Filter>
+			<Filter
+				Name="テキストエディタ"
+				>
+				<File
+					RelativePath="Caret.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="DrawBuffer.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="Print.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="Replace.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="Search.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="TextEditor.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<File
+					RelativePath="TextEditor_UndoRedo.cpp"
+					>
+					<FileConfiguration
+						Name="English_Rel|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Share_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="AB_Release|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+					<FileConfiguration
+						Name="TheText_Debug|Win32"
+						>
+						<Tool
+							Name="VCCLCompilerTool"
+							PreprocessorDefinitions=""
+						/>
+					</FileConfiguration>
+				</File>
+				<Filter
+					Name="イベントプロシージャ"
+					>
+					<File
+						RelativePath="TextEditor_EventProc.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="TextEditor_ImeEvent.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="TextEditor_KeyEvent.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="TextEditor_MouseEvent.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="コード解析(Basic)"
+					>
+					<File
+						RelativePath="analysis.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath=".\CodeFormatter.cpp"
+						>
+					</File>
+					<File
+						RelativePath="Complement.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="EndPairCommandComplement.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="ParameterHint.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="コード解析(HTML)"
+					>
+					<File
+						RelativePath="HtmlAnalysis.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="HtmlAnalysis.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="文字コード変換"
+					>
+					<File
+						RelativePath="nkf_class.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="nkf_class.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="Web検索"
+					>
+					<File
+						RelativePath="CIEsink.h"
+						>
+					</File>
+					<File
+						RelativePath="WebSearch.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="WebSearch.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="文字カウント"
+					>
+					<File
+						RelativePath="StringCount.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="ルーラー"
+					>
+					<File
+						RelativePath="Ruler.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="Ruler.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="正規表現"
+					>
+					<File
+						RelativePath="BREGEXP.H"
+						>
+					</File>
+					<File
+						RelativePath="reg_exp.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="MDIクライアント管理クラス"
+					>
+					<File
+						RelativePath=".\MdiTextEdit.cpp"
+						>
+					</File>
+					<File
+						RelativePath=".\MdiTextEdit.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
+			<Filter
+				Name="全般"
+				>
+				<Filter
+					Name="デザイン テーマ"
+					>
+					<File
+						RelativePath="DesignTheme.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="DesignTheme.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="関連付け"
+					>
+					<File
+						RelativePath="ExtensionLink.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="ExtensionLink.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="タブコントロール"
+					>
+					<File
+						RelativePath="TabCtrl.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="TabCtrl.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="レバーコントロール"
+					>
+					<File
+						RelativePath="ChildWndOnRebar.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="rebar.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+				</Filter>
+				<Filter
+					Name="メニューコントロール"
+					>
+					<File
+						RelativePath="menu.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="menu.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="LuxCtrl"
+					>
+					<File
+						RelativePath="LuxCtrl.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="LuxCtrl.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="ユーザーデータ"
+					>
+					<File
+						RelativePath="NonVolatile.cpp"
+						>
+						<FileConfiguration
+							Name="English_Rel|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Share_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="AB_Release|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+						<FileConfiguration
+							Name="TheText_Debug|Win32"
+							>
+							<Tool
+								Name="VCCLCompilerTool"
+								PreprocessorDefinitions=""
+							/>
+						</FileConfiguration>
+					</File>
+					<File
+						RelativePath="NonVolatile.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl"
+			>
+			<File
+				RelativePath="Common.h"
+				>
+			</File>
+			<File
+				RelativePath="ProjectEditor.h"
+				>
+			</File>
+			<Filter
+				Name="言語対応文字列"
+				>
+				<Filter
+					Name="RAD"
+					>
+					<File
+						RelativePath="rad_msg_eng.h"
+						>
+					</File>
+					<File
+						RelativePath="rad_msg_jpn.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="一般"
+					>
+					<File
+						RelativePath="common_msg_eng.h"
+						>
+					</File>
+					<File
+						RelativePath="common_msg_jpn.h"
+						>
+					</File>
+				</Filter>
+				<Filter
+					Name="プロジェクト管理"
+					>
+					<File
+						RelativePath="pj_msg_eng.h"
+						>
+					</File>
+					<File
+						RelativePath="pj_msg_jpn.h"
+						>
+					</File>
+				</Filter>
+			</Filter>
+		</Filter>
+		<Filter
+			Name="リソースファイル"
+			>
+			<File
+				RelativePath="BasicProgram.ico"
+				>
+			</File>
+			<File
+				RelativePath="file_bas.ico"
+				>
+			</File>
+			<File
+				RelativePath="file_bmp.ico"
+				>
+			</File>
+			<File
+				RelativePath="file_icon.ico"
+				>
+			</File>
+			<File
+				RelativePath="file_pj.ico"
+				>
+			</File>
+			<File
+				RelativePath="file_sbp.ico"
+				>
+			</File>
+			<File
+				RelativePath="folder_close.ico"
+				>
+			</File>
+			<File
+				RelativePath="folder_open.ico"
+				>
+			</File>
+			<File
+				RelativePath="ico00001.ico"
+				>
+			</File>
+			<File
+				RelativePath="icon1.ico"
+				>
+			</File>
+			<File
+				RelativePath="Procedure.ico"
+				>
+			</File>
+			<File
+				RelativePath="TextDocument.ico"
+				>
+			</File>
+			<File
+				RelativePath="Window.ico"
+				>
+			</File>
+		</Filter>
+		<File
+			RelativePath="main.ico"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
Index: tag/abdev(2007.06.20)/ProjectEditor/RadProc.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/RadProc.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/RadProc.cpp	(revision 178)
@@ -0,0 +1,1783 @@
+
+#include "common.h"
+
+void NewRadWindow(int WndInfoNum){
+	extern HINSTANCE hInst,hResInst;
+	extern HWND hDocCombo;
+	extern PROJECTINFO ProjectInfo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2;
+	HWND hChild;
+	RECT rect;
+	MDICREATESTRUCT mdic;
+	WINDOW_INFO *pWindowInfo;
+
+	pWindowInfo=&ProjectInfo.pWindowInfo[WndInfoNum];
+
+	//すでに指定されたファイルが開かれている場合
+	hChild=GetWindow(hClient,GW_CHILD);
+	while(hChild){
+		i=GetWndNum(hChild);
+		if(MdiInfo[i].DocType==WNDTYPE_RAD){
+			if(lstrcmpi(MdiInfo[i].path,pWindowInfo->name)==0) break;
+		}
+		hChild=GetNextWindow(hChild,GW_HWNDNEXT);
+	}
+	if(hChild){
+		BringWindowToTop(hChild);
+		return;
+	}
+
+	mdic.szTitle=pWindowInfo->name;
+	mdic.szClass="MDIClientWindow_Rad";
+	mdic.hOwner=hInst;
+	mdic.x=CW_USEDEFAULT;
+	mdic.y=CW_USEDEFAULT;
+	mdic.cx=CW_USEDEFAULT;
+	mdic.cy=CW_USEDEFAULT;
+
+	hChild=GetWindow(hClient,GW_CHILD);
+	if(IsWindow(hChild)){
+		if(IsZoomed(hChild)) mdic.style=WS_MAXIMIZE|WS_CLIPCHILDREN;
+		else mdic.style=0;
+	}
+	else{
+		if(pobj_nv->bMDIZoomed) mdic.style=WS_MAXIMIZE|WS_CLIPCHILDREN;
+		else mdic.style=0;
+	}
+
+	mdic.lParam=0;
+	hChild=(HWND)SendMessage(hClient,WM_MDICREATE,0,(long)&mdic);	//ウィンドウ作成
+
+
+	//////////////////////
+	// 子ウィンドウを作成
+	//////////////////////
+
+	//ツールウィンドウを作成
+	HWND hTools;
+	hTools=CreateWindow("RadToolsWindow",NULL,
+		WS_CHILD|WS_VSCROLL|WS_VISIBLE|WS_CLIPCHILDREN,
+		0,0,0,0,
+		hChild,NULL,hInst,NULL);
+
+	//プロパティウィンドウを作成
+	HWND hProperty;
+	hProperty=CreateWindowEx(WS_EX_CLIENTEDGE,"RadPropertyWindow",NULL,
+		WS_CHILD|WS_VSCROLL|WS_VISIBLE|WS_CLIPCHILDREN,
+		0,0,0,0,
+		hChild,NULL,hInst,NULL);
+
+	//内部RADウィンドウを作成
+	HWND hRad;
+	hRad=CreateWindowEx(WS_EX_CLIENTEDGE,"RadWindow",NULL,
+		WS_CHILD|WS_HSCROLL|WS_VSCROLL|WS_VISIBLE|WS_CLIPCHILDREN,
+		0,0,0,0,
+		hChild,NULL,hInst,NULL);
+
+	//サポートウィンドウを作成
+	HWND hSupport;
+	hSupport=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_SUPPORT),hChild,DlgRadSupport);
+
+	//ウィンドウのID登録
+	HDC hdc;
+	for(i=0;i<MAX_WNDNUM;i++){
+		if(MdiInfo[i].hwnd==0){
+			MdiInfo[i].hwnd=hChild;
+			MdiInfo[i].DocType=WNDTYPE_RAD;
+			MdiInfo[i].title=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(pWindowInfo->name)+1);
+			lstrcpy(MdiInfo[i].title,pWindowInfo->name);
+			MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(pWindowInfo->name)+1);
+			lstrcpy(MdiInfo[i].path,pWindowInfo->name);
+
+
+			////////////////////////////
+			// MDIRADINFO構造体をセット
+			////////////////////////////
+
+			MdiInfo[i].MdiRadInfo=(MDIRADINFO *)GlobalAlloc(GPTR,sizeof(MDIRADINFO));
+
+			MdiInfo[i].MdiRadInfo->hTools=hTools;
+			MdiInfo[i].MdiRadInfo->hProperty=hProperty;
+			MdiInfo[i].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW),hProperty,RadProperty_WindowProc);
+
+			SCROLLINFO ScrollInfo;
+			ScrollInfo.cbSize=sizeof(SCROLLINFO);
+			ScrollInfo.fMask=SIF_POS;
+			ScrollInfo.nPos=0;
+			SetScrollInfo(MdiInfo[i].MdiRadInfo->hProperty,SB_VERT,&ScrollInfo,1);
+
+			MdiInfo[i].MdiRadInfo->hRad=hRad;
+
+			MdiInfo[i].MdiRadInfo->hSupport=hSupport;
+
+			hdc=GetDC(hRad);
+			MdiInfo[i].MdiRadInfo->hBitmap=CreateCompatibleBitmap(hdc,ScreenX*2,ScreenY*2);
+			MdiInfo[i].MdiRadInfo->hMemDC=CreateCompatibleDC(hdc);
+			MdiInfo[i].MdiRadInfo->hOldBitmap=
+				(HBITMAP)SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,MdiInfo[i].MdiRadInfo->hBitmap);
+			ReleaseDC(hRad,hdc);
+
+			for(i2=0;i2<MAX_RAD_SELITEM;i2++) MdiInfo[i].MdiRadInfo->SelectingItem[i2]=-1;
+			MdiInfo[i].MdiRadInfo->ButtonSelect=IDC_TOOL_MOUSE;
+
+			//変更情報を初期化
+			MdiInfo[i].MdiRadInfo->undo.NowPos=0;
+			memset(MdiInfo[i].MdiRadInfo->undo.Command,0,sizeof(int)*MAX_UNDONUM);
+
+
+			DrawRadWindow(i,pWindowInfo);
+
+			//サポートダイアログの内容をセット
+			SetSupportDlgData(i,WndInfoNum);
+
+			break;
+		}
+	}
+
+	ShowWindow(hSupport,SW_SHOW);
+
+	//ウィンドウ位置を初期化
+	GetClientRect(hChild,&rect);
+	ResizeToRadToolWindows(i,rect.right,rect.bottom);
+
+	i=SendMessage(hDocCombo,CB_ADDSTRING,0,(long)pWindowInfo->name);	//Docコンボボックスに追加
+	SendMessage(hDocCombo,CB_SETCURSEL,i,0);
+
+	//タブに追加
+	pobj_MainTab->InsertItem( pWindowInfo->name, true );
+
+	//メニュー状態を設定
+	ResetState_DocMenu();
+
+	SetFocus(hRad);
+}
+
+int InsertDlgItem(int WndNum,int WndInfoNum,int ItemNum,POINT *pPos,SIZE *pSize,char *IdName,char *caption,DWORD style_or_WndNum,DWORD ExStyle,int Control,int ImageType,char *ImagePath,DWORD dwInsertType){
+	//dwInsertType
+	//0 … 元に戻す、やり直し
+	//1 … 通常の挿入
+	//2 … 貼り付け
+
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,NewItemNum;
+	char temporary[MAX_PATH];
+	CHILDINFO *pChildInfo;
+
+	ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo=(CHILDINFO *)HeapReAlloc(hHeap,0,ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo,(ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows+1)*sizeof(WINDOW_INFO));
+	if(ItemNum==-1)
+		NewItemNum=ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows;
+	else{
+		for(i=ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows;i>ItemNum;i--)
+			ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i]=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i-1];
+		NewItemNum=ItemNum;
+	}
+	pChildInfo=&ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[NewItemNum];
+
+	//ID
+	if(ItemNum==-1){
+		for(i=lstrlen(IdName)-1;i>=0;i--){
+			if(!('0'<=IdName[i]&&IdName[i]<='9')) break;
+		}
+		i++;
+
+		if(IdName[i]!='\0'){
+			i2=atoi(IdName+i)+1;
+			if(dwInsertType==2) i2--;
+			IdName[i]=0;
+		}
+		else{
+			if(dwInsertType==2) i2=0;
+			else i2=1;
+		}
+
+		if(i2==0) lstrcpy(temporary,IdName);
+		else sprintf(temporary,"%s%d",IdName,i2);
+SearchStart:
+		for(i=0;i<ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows;i++){
+			if(i!=NewItemNum){
+				if(lstrcmp(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].IdName,temporary)==0){
+					i2++;
+					sprintf(temporary,"%s%d",IdName,i2);
+					goto SearchStart;
+				}
+			}
+		}
+	}
+	else lstrcpy(temporary,IdName);
+	pChildInfo->IdName=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+	lstrcpy(pChildInfo->IdName,temporary);
+
+	//位置
+	pChildInfo->pos=*pPos;
+	pChildInfo->size=*pSize;
+	//小さすぎる場合は、最小の大きさに調整
+	if(pChildInfo->size.cx<MIN_ITEM_X) pChildInfo->size.cx=MIN_ITEM_X;
+	if(pChildInfo->size.cy<MIN_ITEM_Y) pChildInfo->size.cy=MIN_ITEM_Y;
+
+	//テキスト
+	if(ItemNum==-1){
+		if(dwInsertType==1){
+			if(caption[0]) sprintf(temporary,"%s%d",caption,i2);
+			else temporary[0]=0;
+		}
+		else lstrcpy(temporary,caption);
+	}
+	else lstrcpy(temporary,caption);
+	pChildInfo->caption=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+	lstrcpy(pChildInfo->caption,temporary);
+
+	//スタイル
+	pChildInfo->style=style_or_WndNum;
+
+	//拡張スタイル
+	pChildInfo->ExStyle=ExStyle;
+
+	//クラス名
+	pChildInfo->Control=Control;
+
+	if(Control==CT_IMAGEBOX){
+		//イメージ ボックスの場合
+		pChildInfo->ImageCtrlInfo.type=ImageType;
+		if(!ImagePath)
+			pChildInfo->ImageCtrlInfo.path=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+		else{
+			pChildInfo->ImageCtrlInfo.path=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,lstrlen(ImagePath)+1);
+			lstrcpy(pChildInfo->ImageCtrlInfo.path,ImagePath);
+		}
+	}
+
+	//変更情報
+	if(dwInsertType!=0)
+		Rad_NoticeChanging(WndNum,RAD_UNDO_INSERTITEM,NewItemNum,(DWORD)pChildInfo);
+
+	ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows++;
+
+	DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+	return NewItemNum;
+}
+void DeleteDlgItem(int WndNum,int WndInfoNum,int ItemNum,BOOL bNoticeChanging){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i;
+
+	//変更情報
+	if(bNoticeChanging)
+		Rad_NoticeChanging(WndNum,RAD_UNDO_DELETEITEM,ItemNum,(DWORD)&ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[ItemNum]);
+
+	//子ウィンドウのメモリを解放
+	HeapDefaultFree(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[ItemNum].IdName);
+	HeapDefaultFree(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[ItemNum].caption);
+	if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[ItemNum].Control==CT_IMAGEBOX){
+		//イメージ ボックスの場合
+		HeapDefaultFree(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[ItemNum].ImageCtrlInfo.path);
+	}
+
+	ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows--;
+	for(i=ItemNum;i<ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows;i++)
+		ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i]=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i+1];
+	if(ProjectInfo.NumberOfWindows==0) ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo=(CHILDINFO *)HeapReAlloc(hHeap,0,ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo,1);
+	else ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo=(CHILDINFO *)HeapReAlloc(hHeap,0,ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo,ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows*sizeof(CHILDINFO));
+
+	DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+
+
+	//////////////////////////////
+	//プロパティウィンドウを設定
+	DestroyWindow(MdiInfo[WndNum].MdiRadInfo->hProp_Dlg);
+	MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_WindowProc);
+
+	SCROLLINFO ScrollInfo;
+	ScrollInfo.cbSize=sizeof(SCROLLINFO);
+	ScrollInfo.fMask=SIF_POS;
+	ScrollInfo.nPos=0;
+	SetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hProperty,SB_VERT,&ScrollInfo,1);
+
+	RECT rect;
+	GetClientRect(MdiInfo[WndNum].MdiRadInfo->hProperty,&rect);
+	SendMessage(MdiInfo[WndNum].MdiRadInfo->hProperty,WM_SIZE,0,MAKELONG(rect.right,rect.bottom));
+}
+
+void CursorPos_GlobalToLocal(HWND hwnd,long *x,long *y){
+	SCROLLINFO VertScrollInfo,HorzScrollInfo;
+
+	VertScrollInfo.cbSize=sizeof(SCROLLINFO);
+	VertScrollInfo.fMask=SIF_RANGE|SIF_POS;
+	GetScrollInfo(hwnd,SB_VERT,&VertScrollInfo);
+	HorzScrollInfo.cbSize=sizeof(SCROLLINFO);
+	HorzScrollInfo.fMask=SIF_RANGE|SIF_POS;
+	GetScrollInfo(hwnd,SB_HORZ,&HorzScrollInfo);
+
+	*x-=HorzScrollInfo.nPos;
+	*y-=VertScrollInfo.nPos;
+}
+void CursorPos_LocalToGlobal(HWND hwnd,long *x,long *y){
+	SCROLLINFO VertScrollInfo,HorzScrollInfo;
+
+	VertScrollInfo.cbSize=sizeof(SCROLLINFO);
+	VertScrollInfo.fMask=SIF_RANGE|SIF_POS;
+	GetScrollInfo(hwnd,SB_VERT,&VertScrollInfo);
+	HorzScrollInfo.cbSize=sizeof(SCROLLINFO);
+	HorzScrollInfo.fMask=SIF_RANGE|SIF_POS;
+	GetScrollInfo(hwnd,SB_HORZ,&HorzScrollInfo);
+
+	*x+=HorzScrollInfo.nPos;
+	*y+=VertScrollInfo.nPos;
+}
+void DrawFrame(HWND hwnd,int WndNum,int WndInfoNum,RECT *NewRect,RECT *OldRect,BOOL bLA){
+	extern PROJECTINFO ProjectInfo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	static int swLineStop;
+	int i,sw;
+	int x,y;
+	HDC hdc;
+	HPEN hPen,hOldPen;
+	HBRUSH hOldBrush;
+	RECT rect;
+
+	hdc=GetDC(hwnd);
+
+	sw=0;
+	if(pobj_nv->bLineAdjust&&bLA){
+		for(i=0;i<ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows;i++){
+			if(i==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]) continue;
+			if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].Control !=
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control) continue;
+
+			if(NewRect->left<OldRect->left){
+				if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x
+											>
+					NewRect->left - MdiInfo[WndNum].MdiRadInfo->ClientPos.x
+					&&
+					ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x-10
+											<
+					NewRect->left - MdiInfo[WndNum].MdiRadInfo->ClientPos.x){
+
+					//左側をストップする
+					x=NewRect->right-NewRect->left;
+					NewRect->left=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x + MdiInfo[WndNum].MdiRadInfo->ClientPos.x;
+					NewRect->right=NewRect->left+x;
+
+					hPen=CreatePen(PS_SOLID,0,RGB(100,100,100));
+					hOldPen=(HPEN)SelectObject(hdc,hPen);
+					MoveToEx(hdc,NewRect->left,0,NULL);
+					LineTo(hdc,NewRect->left,ScreenX);
+					SelectObject(hdc,hOldPen);
+					DeleteObject(hPen);
+
+					swLineStop=1;
+					sw=1;
+				}
+			}
+			if(NewRect->top<OldRect->top){
+				if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y
+											>
+					NewRect->top - MdiInfo[WndNum].MdiRadInfo->ClientPos.y
+					&&
+					ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y-10
+											<
+					NewRect->top - MdiInfo[WndNum].MdiRadInfo->ClientPos.y){
+
+					//左側をストップする
+					y=NewRect->bottom-NewRect->top;
+					NewRect->top=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y + MdiInfo[WndNum].MdiRadInfo->ClientPos.y;
+					NewRect->bottom=NewRect->top+y;
+
+					hPen=CreatePen(PS_SOLID,0,RGB(100,100,100));
+					hOldPen=(HPEN)SelectObject(hdc,hPen);
+					MoveToEx(hdc,0,NewRect->top,NULL);
+					LineTo(hdc,ScreenY,NewRect->top);
+					SelectObject(hdc,hOldPen);
+					DeleteObject(hPen);
+
+					swLineStop=1;
+					sw=1;
+				}
+			}
+		}
+	}
+
+	//以前の選択フレームを消去
+	RectNaturalFormat(OldRect,&rect);
+	x=rect.left;
+	y=rect.top;
+	CursorPos_GlobalToLocal(hwnd,&rect.left,&rect.top);
+	CursorPos_GlobalToLocal(hwnd,&rect.right,&rect.bottom);
+	if(swLineStop&&sw==0){
+		BitBlt(hdc,0,0,ScreenX*2,ScreenY*2,
+			MdiInfo[WndNum].MdiRadInfo->hMemDC,0,0,SRCCOPY);
+		swLineStop=0;
+	}
+	else{
+		BitBlt(hdc,rect.left-LEVER_THICK, rect.top-LEVER_THICK,
+			rect.right-rect.left+LEVER_THICK*2, rect.bottom-rect.top+LEVER_THICK*2,
+			MdiInfo[WndNum].MdiRadInfo->hMemDC,x-LEVER_THICK,y-LEVER_THICK,SRCCOPY);
+	}
+
+	//新しい選択フレームを描画
+	RectNaturalFormat(NewRect,&rect);
+	CursorPos_GlobalToLocal(hwnd,&rect.left,&rect.top);
+	CursorPos_GlobalToLocal(hwnd,&rect.right,&rect.bottom);
+
+	hPen=CreatePen(PS_DOT,0,RGB(0,0,0));
+	SetBkMode(hdc,TRANSPARENT);
+	hOldPen=(HPEN)SelectObject(hdc,hPen);
+	hOldBrush=(HBRUSH)SelectObject(hdc,GetStockObject(NULL_BRUSH));
+	Rectangle(hdc,rect.left,rect.top,rect.right,rect.bottom);
+	SelectObject(hdc,hOldBrush);
+	SelectObject(hdc,hOldPen);
+	DeleteObject(hPen);
+
+	ReleaseDC(hwnd,hdc);
+
+	*OldRect=*NewRect;
+}
+void GetSelectingRect(int WndNum,int WndInfoNum,int num,RECT *rect){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]==SELECT_WINDOW){
+		//ウィンドウ軸を選択
+		rect->left=0;
+		rect->top=0;
+		rect->right=ProjectInfo.pWindowInfo[WndInfoNum].size.cx+(LEVER_THICK*2);
+		rect->bottom=ProjectInfo.pWindowInfo[WndInfoNum].size.cy+(LEVER_THICK*2);
+	}
+	else{
+		//子ウィンドウを選択
+		rect->left=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]].pos.x-LEVER_THICK;
+		rect->top=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]].pos.y-LEVER_THICK;
+		rect->right=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]].pos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]].size.cx+LEVER_THICK;
+		rect->bottom=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]].pos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[num]].size.cy+LEVER_THICK;
+	}
+}
+void DrawSelectingRect(HWND hwnd,int WndNum,int WndInfoNum,int ButtonSelect){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern RADINFO RadInfo;
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	HDC hdc;
+	HPEN hPen,hOldPen;
+	HBRUSH hOldBrush;
+	COLORREF rgb;
+	RECT rect,tempRect;
+
+	hdc=GetDC(hwnd);
+	if(ButtonSelect==IDC_TOOL_MOUSE) rgb=RGB(255,60,30);
+	else if(ButtonSelect==NON_TOOL) rgb=RGB(100,100,100);
+	hPen=CreatePen(PS_SOLID,0,rgb);
+	SetBkMode(hdc,TRANSPARENT);
+	hOldPen=(HPEN)SelectObject(hdc,hPen);
+
+	i=0;
+	while(MdiInfo[WndNum].MdiRadInfo->SelectingItem[i]!=-1||i==0){
+		GetSelectingRect(WndNum,WndInfoNum,i,&tempRect);
+		RectNaturalFormat(&tempRect,&rect);
+		CursorPos_GlobalToLocal(hwnd,&rect.left,&rect.top);
+		CursorPos_GlobalToLocal(hwnd,&rect.right,&rect.bottom);
+
+		//主線
+		hOldBrush=(HBRUSH)SelectObject(hdc,GetStockObject(NULL_BRUSH));
+		Rectangle(hdc,
+			rect.left+2, rect.top+2,
+			rect.right-2, rect.bottom-2);
+		SelectObject(hdc,hOldBrush);
+
+
+		hOldBrush=(HBRUSH)SelectObject(hdc,GetStockObject(WHITE_BRUSH));
+
+		Rectangle(hdc,
+			rect.left,rect.top,
+			rect.left+5,rect.top+5);
+		Rectangle(hdc,
+			rect.left,rect.bottom-5,
+			rect.left+5,rect.bottom);
+		Rectangle(hdc,
+			rect.right-5,rect.top,
+			rect.right,rect.top+5);
+		Rectangle(hdc,
+			rect.right-5,rect.bottom-5,
+			rect.right,rect.bottom);
+
+		i2=(rect.right-rect.left)/2;
+		i3=(rect.bottom-rect.top)/2;
+		Rectangle(hdc,
+			rect.left+i2-2,rect.top,
+			rect.left+i2+3,rect.top+5);
+		Rectangle(hdc,
+			rect.left+i2-2,rect.bottom-5,
+			rect.left+i2+3,rect.bottom);
+		Rectangle(hdc,
+			rect.left,rect.top+i3-2,
+			rect.left+5,rect.top+i3+3);
+		Rectangle(hdc,
+			rect.right-5,rect.top+i3-2,
+			rect.right,rect.top+i3+3);
+
+		SelectObject(hdc,hOldBrush);
+
+		//移動時の選択フレームの消去用範囲
+		RadInfo.OldDraggingRect[i]=rect;
+
+		i++;
+	}
+
+	SelectObject(hdc,hOldPen);
+	DeleteObject(hPen);
+
+	ReleaseDC(hwnd,hdc);
+}
+void ChangePropertyWindow(int WndNum,int WndInfoNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	RECT rect;
+	SCROLLINFO ScrollInfo;
+
+	DestroyWindow(MdiInfo[WndNum].MdiRadInfo->hProp_Dlg);
+	if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
+		MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_WindowProc);
+
+		ScrollInfo.cbSize=sizeof(SCROLLINFO);
+		ScrollInfo.fMask=SIF_POS;
+		ScrollInfo.nPos=0;
+		SetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hProperty,SB_VERT,&ScrollInfo,1);
+
+		GetClientRect(MdiInfo[WndNum].MdiRadInfo->hProperty,&rect);
+		SendMessage(MdiInfo[WndNum].MdiRadInfo->hProperty,WM_SIZE,0,MAKELONG(rect.right,rect.bottom));
+	}
+	else{
+		if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_BUTTON)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_BUTTON),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_ButtonProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_CHECKBOX)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_CHECKBOX),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_CheckBoxProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_COMBOBOX)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_COMBOBOX),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_ComboBoxProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_EDIT)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_EDIT),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_EditProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_GROUPBOX)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_GROUPBOX),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_GroupBoxProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_HSCROLLBAR)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_SCROLLBAR),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_ScrollBarProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_IMAGEBOX)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_IMAGEBOX),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_ImageBoxProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_LISTBOX)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_LISTBOX),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_ListBoxProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_LISTVIEW)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_LISTVIEW),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_ListViewProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_PROGRESSBAR)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_PROGRESSBAR),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_ProgressBarProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_RADIOBUTTON)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_RADIOBUTTON),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_RadioButtonProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_STATIC)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_STATIC),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_StaticProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_TRACKBAR)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_TRACKBAR),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_TrackBarProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_TREEVIEW)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_TREEVIEW),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_TreeViewProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_UPDOWN)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_UPDOWN),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_UpDownProc);
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_VSCROLLBAR)
+			MdiInfo[WndNum].MdiRadInfo->hProp_Dlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_SCROLLBAR),MdiInfo[WndNum].MdiRadInfo->hProperty,RadProperty_ScrollBarProc);
+
+		ScrollInfo.cbSize=sizeof(SCROLLINFO);
+		ScrollInfo.fMask=SIF_POS;
+		ScrollInfo.nPos=0;
+		SetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hProperty,SB_VERT,&ScrollInfo,1);
+
+		GetClientRect(MdiInfo[WndNum].MdiRadInfo->hProperty,&rect);
+		SendMessage(MdiInfo[WndNum].MdiRadInfo->hProperty,WM_SIZE,0,MAKELONG(rect.right,rect.bottom));
+	}
+}
+int GetItemNumOnMouse(int WndNum,int WndInfoNum,int x,int y){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i;
+
+	for(i=ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows-1;i>=0;i--){
+		if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].Control==CT_COMBOBOX&&
+			(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].style&0x000F)!=CBS_SIMPLE){
+			//コンボ ボックスの場合は表示部分をターゲットに選択する（高さ20pixel）
+			if(x>=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x&&
+				x<=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].size.cx&&
+				y>=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y&&
+				y<=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y+20){
+				break;
+			}
+		}
+		else if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].Control==CT_GROUPBOX){
+			//グループ ボックスの場合は中央をあける
+			if((
+				x>=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x&&
+				x<=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].size.cx&&
+				y>=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y&&
+				y<=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].size.cy
+				)&&
+				(!(
+				x>=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x+LEVER_THICK*2&&
+				x<=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].size.cx-LEVER_THICK*2&&
+				y>=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y+LEVER_THICK*3&&
+				y<=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].size.cy-LEVER_THICK*2
+				))
+				){
+				break;
+			}
+		}
+		else if(x>=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x&&
+			x<=MdiInfo[WndNum].MdiRadInfo->ClientPos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].size.cx&&
+			y>=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y&&
+			y<=MdiInfo[WndNum].MdiRadInfo->ClientPos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].size.cy){
+			break;
+		}
+	}
+	return i;
+}
+void SelectItemNumOnMouse(int WndNum,int WndInfoNum,int x,int y){
+	//マウス座標をもとにコントロールアイテムを選択
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i;
+
+	for(i=1;i<MAX_RAD_SELITEM;i++) MdiInfo[WndNum].MdiRadInfo->SelectingItem[i]=-1;
+	i=GetItemNumOnMouse(WndNum,WndInfoNum,x,y);
+
+	if(i==-1){
+		if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW){
+			MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]=SELECT_WINDOW;
+			ChangePropertyWindow(WndNum,WndInfoNum);
+		}
+	}
+	else{
+		MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]=i;
+		ChangePropertyWindow(WndNum,WndInfoNum);
+	}
+
+	SetStatusText(NULL);
+
+	//サポートダイアログの内容をセット
+	SetSupportDlgData(WndNum,WndInfoNum);
+}
+void SetItemNumOnFrame(int WndNum,int WndInfoNum,RECT *pRect){
+	extern PROJECTINFO ProjectInfo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2,sw;
+	RECT rect;
+
+	for(i=1;i<MAX_RAD_SELITEM;i++) MdiInfo[WndNum].MdiRadInfo->SelectingItem[i]=-1;
+	RectNaturalFormat(pRect,&rect);
+	if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW) sw=0;
+	else sw=1;
+	for(i=ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows-1,i2=0;i>=0;i--){
+		if(rect.left <= ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x+MdiInfo[WndNum].MdiRadInfo->ClientPos.x&&
+			rect.top <= ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y+MdiInfo[WndNum].MdiRadInfo->ClientPos.y&&
+			rect.right >= ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.x+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].size.cx+MdiInfo[WndNum].MdiRadInfo->ClientPos.x&&
+			rect.bottom >= ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].pos.y+ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].size.cy+MdiInfo[WndNum].MdiRadInfo->ClientPos.y){
+			MdiInfo[WndNum].MdiRadInfo->SelectingItem[i2]=i;
+			i2++;
+		}
+	}
+	if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW||
+		(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW&&sw)){
+		ChangePropertyWindow(WndNum,WndInfoNum);
+	}
+}
+int GetStateOfDraggingFrame(int WndNum,int WndInfoNum,int x,int y){
+	extern PROJECTINFO ProjectInfo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	RECT rect;
+
+	if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[1]!=-1){
+		i=0;
+		while(MdiInfo[WndNum].MdiRadInfo->SelectingItem[i]!=-1||i==0){
+			GetSelectingRect(WndNum,WndInfoNum,i,&rect);
+
+			if(x>=rect.left+LEVER_THICK&&x<=rect.right-LEVER_THICK&&
+				y>=rect.top+LEVER_THICK&&y<=rect.bottom-LEVER_THICK){
+				if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[i]].Control==CT_GROUPBOX){
+					//グループボックスの場合は中央をあける
+					if(!(x>=rect.left+LEVER_THICK*2&&x<=rect.right-LEVER_THICK*2&&
+						y>=rect.top+LEVER_THICK*3&&y<=rect.bottom-LEVER_THICK*2)){
+						return FRAME_INSIDE;
+					}
+				}
+				else return FRAME_INSIDE;
+			}
+			i++;
+		}
+	}
+	else{
+		GetSelectingRect(WndNum,WndInfoNum,0,&rect);
+
+		if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW){
+			if(x>=rect.left+LEVER_THICK&&x<=rect.right-LEVER_THICK&&
+				y>=rect.top+LEVER_THICK&&y<=rect.bottom-LEVER_THICK){
+				if(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].Control==CT_GROUPBOX){
+					//グループ ボックスの場合は中央をあける
+					if(!(x>=rect.left+LEVER_THICK*3&&x<=rect.right-LEVER_THICK*3&&
+						y>=rect.top+LEVER_THICK*4&&y<=rect.bottom-LEVER_THICK*3)){
+						return FRAME_INSIDE;
+					}
+				}
+				else return FRAME_INSIDE;
+			}
+			else if(x>=rect.left&&x<=rect.left+LEVER_THICK&&
+				y>=rect.top&&y<=rect.top+LEVER_THICK)				return FRAME_UPPER_LEFT;
+			else if(x>=rect.right-LEVER_THICK&&x<=rect.right&&
+				y>=rect.top&&y<=rect.top+LEVER_THICK)				return FRAME_UPPER_RIGHT;
+			else if(x>=rect.left&&x<=rect.left+LEVER_THICK&&
+				y>=rect.bottom-LEVER_THICK&&y<=rect.bottom)			return FRAME_LOWER_LEFT;
+			else if(x>=rect.left&&x<=rect.left+LEVER_THICK&&
+				y>=rect.top+LEVER_THICK&&y<=rect.bottom-LEVER_THICK)return FRAME_LEFT;
+			else if(x>=rect.left+LEVER_THICK&&x<=rect.right-LEVER_THICK&&
+				y>=rect.top&&y<=rect.top+LEVER_THICK)				return FRAME_UPPER;
+		}
+		if(x>=rect.right-LEVER_THICK&&x<=rect.right&&
+			y>=rect.bottom-LEVER_THICK&&y<=rect.bottom)				return FRAME_LOWER_RIGHT;
+		else if(x>=rect.right-LEVER_THICK&&x<=rect.right&&
+			y>=rect.top+LEVER_THICK&&y<=rect.bottom-LEVER_THICK)	return FRAME_RIGHT;
+		else if(x>=rect.left+LEVER_THICK&&x<=rect.right-LEVER_THICK&&
+			y>=rect.bottom-LEVER_THICK&&y<=rect.bottom)				return FRAME_LOWER;
+	}
+	return 0;
+}
+void ResetScrollbarOfRadEditor(int WndNum,int weight,int height){
+	extern PROJECTINFO ProjectInfo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int WndInfoNum;
+	SCROLLINFO ScrollInfo;
+	SIZE NeedSize;
+
+	WndInfoNum=GetWndInfoNum(MdiInfo[WndNum].path);
+
+	//必要な幅、高さを共に100ピクセル余裕を持たせる
+	NeedSize.cx=ProjectInfo.pWindowInfo[WndInfoNum].size.cx+(LEVER_THICK*2)+100;
+	NeedSize.cy=ProjectInfo.pWindowInfo[WndInfoNum].size.cy+(LEVER_THICK*2)+100;
+
+	ScrollInfo.cbSize=sizeof(SCROLLINFO);
+	ScrollInfo.fMask=SIF_PAGE|SIF_RANGE|SIF_POS|SIF_DISABLENOSCROLL;
+
+	//垂直スクロールバーの設定
+	GetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hRad,SB_VERT,&ScrollInfo);
+	ScrollInfo.nMin=0;
+	if(height>NeedSize.cy) ScrollInfo.nMax=0;
+	else{
+		ScrollInfo.nMax=NeedSize.cy;
+		ScrollInfo.nPage=height;
+	}
+	SetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hRad,SB_VERT,&ScrollInfo,1);
+
+	//水平スクロールバーの設定
+	GetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hRad,SB_VERT,&ScrollInfo);
+	ScrollInfo.nMin=0;
+	if(weight>NeedSize.cx) ScrollInfo.nMax=0;
+	else{
+		ScrollInfo.nMax=NeedSize.cx;
+		ScrollInfo.nPage=weight;
+	}
+	SetScrollInfo(MdiInfo[WndNum].MdiRadInfo->hRad,SB_HORZ,&ScrollInfo,1);
+}
+LRESULT CALLBACK RadWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	extern RADINFO RadInfo;
+	int i,i2,i3,i4;
+	char temporary[MAX_PATH],temp2[MAX_PATH];
+	HWND hParent;
+	HDC hdc;
+	RECT rect;
+	POINT mouse,pos;
+	SIZE size;
+	SCROLLINFO ScrollInfo,si2;
+	PAINTSTRUCT ps;
+	POINTANDSIZE PointAndSize;
+
+	switch(message){
+		case WM_LBUTTONDOWN:
+			SetCapture(hwnd);
+
+			SetFocus(hwnd);
+			mouse.x=LOWORD(lParam);
+			mouse.y=HIWORD(lParam);
+			CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
+
+			i=GetWndNum(GetParent(hwnd));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
+				if(((wParam&MK_CONTROL)||(wParam&MK_SHIFT))&&
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW){
+
+					//Shiftキー、Ctrlキーによる複数選択
+					for(i3=0;;i3++){
+						if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1){
+							MdiInfo[i].MdiRadInfo->SelectingItem[i3]=GetItemNumOnMouse(i,i2,mouse.x,mouse.y);
+							InvalidateRect(hwnd,NULL,0);
+
+							//サポートダイアログの内容をセット
+							SetSupportDlgData(i,i2);
+							break;
+						}
+					}
+				}
+				else{
+					RadInfo.NowDragging=GetStateOfDraggingFrame(i,i2,mouse.x,mouse.y);
+					if(!RadInfo.NowDragging){
+						SelectItemNumOnMouse(i,i2,mouse.x,mouse.y);
+						InvalidateRect(hwnd,NULL,0);
+						RadInfo.NowDragging=GetStateOfDraggingFrame(i,i2,mouse.x,mouse.y);
+					}
+					if(RadInfo.NowDragging){
+						//アイテム選択中。サイズ、位置変更開始
+
+						if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
+							RadInfo.DraggingRect[0].left=LEVER_THICK;
+							RadInfo.DraggingRect[0].top=LEVER_THICK;
+							RadInfo.DraggingRect[0].right=ProjectInfo.pWindowInfo[i2].size.cx+LEVER_THICK;
+							RadInfo.DraggingRect[0].bottom=ProjectInfo.pWindowInfo[i2].size.cy+LEVER_THICK;
+							RadInfo.DragStartRect[0]=RadInfo.DraggingRect[0];
+						}
+						else{
+							i3=0;
+							while(MdiInfo[i].MdiRadInfo->SelectingItem[i3]!=-1){
+								RadInfo.DraggingRect[i3].left=MdiInfo[i].MdiRadInfo->ClientPos.x+ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos.x;
+								RadInfo.DraggingRect[i3].top=MdiInfo[i].MdiRadInfo->ClientPos.y+ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos.y;
+								RadInfo.DraggingRect[i3].right=MdiInfo[i].MdiRadInfo->ClientPos.x+ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos.x+ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].size.cx;
+								RadInfo.DraggingRect[i3].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos.y+ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].size.cy;
+								RadInfo.DragStartRect[i3]=RadInfo.DraggingRect[i3];
+								i3++;
+							}
+						}
+					}
+					else{
+						//範囲選択
+
+						RadInfo.NowDragging=SELECTING_FRAME;
+						RadInfo.OldDraggingRect[0].left=LEVER_THICK;
+						RadInfo.OldDraggingRect[0].top=LEVER_THICK;
+						RadInfo.OldDraggingRect[0].right=ProjectInfo.pWindowInfo[i2].size.cx+LEVER_THICK;
+						RadInfo.OldDraggingRect[0].bottom=ProjectInfo.pWindowInfo[i2].size.cy+LEVER_THICK;
+					}
+					RadInfo.DragStartPos.x=mouse.x;
+					RadInfo.DragStartPos.y=mouse.y;
+				}
+				SetCursorByState(RadInfo.NowDragging);
+			}
+			else{
+				RadInfo.DraggingRect[0].left=mouse.x;
+				RadInfo.DraggingRect[0].top=mouse.y;
+				RadInfo.NowDragging=ITEM_MAKING;
+			}
+			return 0;
+		case WM_LBUTTONUP:
+			ReleaseCapture();
+
+			SetFocus(hwnd);
+			mouse.x=(int)(short)LOWORD(lParam);
+			mouse.y=(int)(short)HIWORD(lParam);
+			CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
+
+			hParent=GetParent(hwnd);
+			i=GetWndNum(hParent);
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
+				if(RadInfo.NowDragging){
+					if(RadInfo.DragStartPos.x==mouse.x&&RadInfo.DragStartPos.y==mouse.y){
+						RadInfo.NowDragging=0;
+						InvalidateRect(hwnd,NULL,0);
+						ResetState_EditMenu();
+						return 0;
+					}
+
+					if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
+						if(RadInfo.NowDragging==SELECTING_FRAME){
+							SetItemNumOnFrame(i,i2,&RadInfo.DraggingRect[0]);
+							InvalidateRect(hwnd,NULL,1);
+						}
+						else{
+							//ウィンドウ枠の調整完了
+							PointAndSize.size=ProjectInfo.pWindowInfo[i2].size;
+							Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
+							ProjectInfo.pWindowInfo[i2].size.cx=RadInfo.DraggingRect[0].right-LEVER_THICK;
+							ProjectInfo.pWindowInfo[i2].size.cy=RadInfo.DraggingRect[0].bottom-LEVER_THICK;
+							DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+							InvalidateRect(hwnd,NULL,1);
+
+							GetClientRect(hwnd,&rect);
+							ResetScrollbarOfRadEditor(i,rect.right,rect.bottom);
+						}
+					}
+					else{
+						i3=0;
+						while(MdiInfo[i].MdiRadInfo->SelectingItem[i3]!=-1){
+							//アイテム枠の調整完了
+							PointAndSize.pos=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos;
+							PointAndSize.size=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].size;
+							Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[i3],(DWORD)&PointAndSize);
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos.x=RadInfo.DraggingRect[i3].left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos.y=RadInfo.DraggingRect[i3].top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].size.cx=RadInfo.DraggingRect[i3].right-RadInfo.DraggingRect[i3].left;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].size.cy=RadInfo.DraggingRect[i3].bottom-RadInfo.DraggingRect[i3].top;
+							DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+							i3++;
+						}
+					}
+
+					SetStatusText(NULL);
+
+					//サポートダイアログの内容をセット
+					SetSupportDlgData(i,i2);
+				}
+			}
+			else if(RadInfo.NowDragging==ITEM_MAKING){
+				if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_BUTTON){
+					//ボタン コントロール作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=44;
+						RadInfo.DraggingRect[0].right=mouse.x+44;
+						RadInfo.DraggingRect[0].top-=10;
+						RadInfo.DraggingRect[0].bottom=mouse.y+11;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"CommandButton","Button",WS_CHILD|WS_VISIBLE,0,CT_BUTTON,0,0,1);
+				}
+				if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_CHECKBOX){
+					//チェック ボックス作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=33;
+						RadInfo.DraggingRect[0].right=mouse.x+34;
+						RadInfo.DraggingRect[0].top-=7;
+						RadInfo.DraggingRect[0].bottom=mouse.y+8;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"CheckBox","Check",WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX,0,CT_CHECKBOX,0,0,1);
+				}
+				if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_COMBOBOX){
+					//コンボ ボックス作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=42;
+						RadInfo.DraggingRect[0].right=mouse.x+42;
+						RadInfo.DraggingRect[0].top-=42;
+						RadInfo.DraggingRect[0].bottom=mouse.y+42;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"ComboBox","",WS_CHILD|WS_VISIBLE|CBS_DROPDOWN|CBS_SORT|WS_VSCROLL,0,CT_COMBOBOX,0,0,1);
+				}
+				else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_EDIT){
+					//エディット コントロール作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=35;
+						RadInfo.DraggingRect[0].right=mouse.x+35;
+						RadInfo.DraggingRect[0].top-=10;
+						RadInfo.DraggingRect[0].bottom=mouse.y+11;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"EditBox","",WS_CHILD|WS_VISIBLE,WS_EX_CLIENTEDGE,CT_EDIT,0,0,1);
+				}
+				else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_GROUPBOX){
+					//グループ ボックス作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=42;
+						RadInfo.DraggingRect[0].right=mouse.x+42;
+						RadInfo.DraggingRect[0].top-=30;
+						RadInfo.DraggingRect[0].bottom=mouse.y+30;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"GroupBox","Group",WS_CHILD|WS_VISIBLE|BS_GROUPBOX,0,CT_GROUPBOX,0,0,1);
+				}
+				else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_HSCROLLBAR){
+					//水平スクロールバー作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=35;
+						RadInfo.DraggingRect[0].right=mouse.x+35;
+						RadInfo.DraggingRect[0].top-=8;
+						RadInfo.DraggingRect[0].bottom=mouse.y+9;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"HScrollBar","",WS_CHILD|WS_VISIBLE|SBS_HORZ,0,CT_HSCROLLBAR,0,0,1);
+				}
+				else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_IMAGEBOX){
+					//イメージ ボックス作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=16;
+						RadInfo.DraggingRect[0].right=mouse.x+16;
+						RadInfo.DraggingRect[0].top-=16;
+						RadInfo.DraggingRect[0].bottom=mouse.y+16;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"ImageBox","",WS_CHILD|WS_VISIBLE|SS_BLACKFRAME,0,CT_IMAGEBOX,IMGTYPE_FILE,0,1);
+				}
+				else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_LISTBOX){
+					//リスト ボックス作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=42;
+						RadInfo.DraggingRect[0].right=mouse.x+42;
+						RadInfo.DraggingRect[0].top-=30;
+						RadInfo.DraggingRect[0].bottom=mouse.y+30;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"ListBox","",WS_CHILD|WS_VISIBLE|WS_VSCROLL|LBS_SORT|LBS_NOTIFY,WS_EX_CLIENTEDGE,CT_LISTBOX,0,0,1);
+				}
+				else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_LISTVIEW){
+					//リスト ビュー作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=52;
+						RadInfo.DraggingRect[0].right=mouse.x+53;
+						RadInfo.DraggingRect[0].top-=37;
+						RadInfo.DraggingRect[0].bottom=mouse.y+38;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"ListView","",WS_CHILD|WS_VISIBLE,WS_EX_CLIENTEDGE,CT_LISTVIEW,0,0,1);
+				}
+				if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_PROGRESSBAR){
+					//プロバレス バー作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=70;
+						RadInfo.DraggingRect[0].right=mouse.x+70;
+						RadInfo.DraggingRect[0].top-=10;
+						RadInfo.DraggingRect[0].bottom=mouse.y+11;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"ProgressBar","",WS_CHILD|WS_VISIBLE,WS_EX_STATICEDGE,CT_PROGRESSBAR,0,0,1);
+				}
+				if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_RADIOBUTTON){
+					//ラジオ ボタン作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=31;
+						RadInfo.DraggingRect[0].right=mouse.x+32;
+						RadInfo.DraggingRect[0].top-=7;
+						RadInfo.DraggingRect[0].bottom=mouse.y+8;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"RadioButton","radio",WS_CHILD|WS_VISIBLE|BS_AUTORADIOBUTTON,0,CT_RADIOBUTTON,0,0,1);
+				}
+				else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_STATIC){
+					//スタティック コントロール作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=25;
+						RadInfo.DraggingRect[0].right=mouse.x+25;
+						RadInfo.DraggingRect[0].top-=6;
+						RadInfo.DraggingRect[0].bottom=mouse.y+6;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"Static","Text",WS_CHILD|WS_VISIBLE,0,CT_STATIC,0,0,1);
+				}
+				else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_TRACKBAR){
+					//トラック バー作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=87;
+						RadInfo.DraggingRect[0].right=mouse.x+88;
+						RadInfo.DraggingRect[0].top-=11;
+						RadInfo.DraggingRect[0].bottom=mouse.y+12;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"TrackBar","",WS_CHILD|WS_VISIBLE|TBS_BOTH|TBS_NOTICKS,0,CT_TRACKBAR,0,0,1);
+				}
+				else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_TREEVIEW){
+					//ツリー ビュー作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=52;
+						RadInfo.DraggingRect[0].right=mouse.x+53;
+						RadInfo.DraggingRect[0].top-=37;
+						RadInfo.DraggingRect[0].bottom=mouse.y+38;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"TreeView","",WS_CHILD|WS_VISIBLE,WS_EX_CLIENTEDGE,CT_TREEVIEW,0,0,1);
+				}
+				else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_UPDOWN){
+					//アップ ダウン コントロール作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=8;
+						RadInfo.DraggingRect[0].right=mouse.x+8;
+						RadInfo.DraggingRect[0].top-=10;
+						RadInfo.DraggingRect[0].bottom=mouse.y+11;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"UpDown","",WS_CHILD|WS_VISIBLE,0,CT_UPDOWN,0,0,1);
+				}
+				else if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_VSCROLLBAR){
+					//垂直スクロールバー作成
+					if(RadInfo.DraggingRect[0].left==mouse.x&&RadInfo.DraggingRect[0].top==mouse.y){
+						RadInfo.DraggingRect[0].left-=9;
+						RadInfo.DraggingRect[0].right=mouse.x+9;
+						RadInfo.DraggingRect[0].top-=30;
+						RadInfo.DraggingRect[0].bottom=mouse.y+30;
+					}
+					else{
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+					}
+					RectNaturalFormat(&RadInfo.DraggingRect[0],&rect);
+					pos.x=rect.left-MdiInfo[i].MdiRadInfo->ClientPos.x;
+					pos.y=rect.top-MdiInfo[i].MdiRadInfo->ClientPos.y;
+					size.cx=rect.right-rect.left;
+					size.cy=rect.bottom-rect.top;
+					MdiInfo[i].MdiRadInfo->SelectingItem[0]=InsertDlgItem(i,i2,-1,&pos,&size,"VScrollBar","",WS_CHILD|WS_VISIBLE|SBS_VERT,0,CT_VSCROLLBAR,0,0,1);
+				}
+				SendMessage(GetWindow(MdiInfo[i].MdiRadInfo->hTools,GW_CHILD),WM_COMMAND,IDC_TOOL_MOUSE,0);
+				SendMessage(GetWindow(GetWindow(MdiInfo[i].MdiRadInfo->hTools,GW_CHILD),GW_CHILD),TB_CHECKBUTTON,IDC_TOOL_MOUSE,TRUE);
+				ChangePropertyWindow(i,i2);
+
+				//複数選択を解除
+				MdiInfo[i].MdiRadInfo->SelectingItem[1]=-1;
+			}
+
+			RadInfo.NowDragging=0;
+
+			ResetState_EditMenu();
+			return 0;
+		case WM_MOUSEMOVE:
+			mouse.x=(int)(short)LOWORD(lParam);
+			mouse.y=(int)(short)HIWORD(lParam);
+			CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
+
+			hParent=GetParent(hwnd);
+			i=GetWndNum(hParent);
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
+				if(wParam&MK_LBUTTON&&RadInfo.NowDragging){
+					////////////////////////////////////////////////
+					// ドラッグ中の場合（コントロールのサイズ変更）
+
+					if(RadInfo.NowDragging==FRAME_UPPER_LEFT){
+						if(RadInfo.DraggingRect[0].right-MIN_ITEM_X<=(mouse.x+LEVER_THICK))
+							RadInfo.DraggingRect[0].left=RadInfo.DraggingRect[0].right-MIN_ITEM_X;
+						else if(mouse.x+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.x)
+							RadInfo.DraggingRect[0].left=MdiInfo[i].MdiRadInfo->ClientPos.x;
+						else RadInfo.DraggingRect[0].left=mouse.x+LEVER_THICK;
+
+						if(RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y<=(mouse.y+LEVER_THICK))
+							RadInfo.DraggingRect[0].top=RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y;
+						else if(mouse.y+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.y)
+							RadInfo.DraggingRect[0].top=MdiInfo[i].MdiRadInfo->ClientPos.y;
+						else RadInfo.DraggingRect[0].top=mouse.y+LEVER_THICK;
+						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+					}
+					else if(RadInfo.NowDragging==FRAME_UPPER_RIGHT){
+						if(mouse.x-LEVER_THICK-MIN_ITEM_X<=RadInfo.DraggingRect[0].left)
+							RadInfo.DraggingRect[0].right=RadInfo.DraggingRect[0].left+MIN_ITEM_X;
+						else if(mouse.x>MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx)
+							RadInfo.DraggingRect[0].right=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
+						else RadInfo.DraggingRect[0].right=mouse.x-LEVER_THICK;
+
+						if(RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y<=(mouse.y+LEVER_THICK)) RadInfo.DraggingRect[0].top=RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y;
+						else if(mouse.y+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.y)
+							RadInfo.DraggingRect[0].top=MdiInfo[i].MdiRadInfo->ClientPos.y;
+						else RadInfo.DraggingRect[0].top=mouse.y+LEVER_THICK;
+						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+					}
+					else if(RadInfo.NowDragging==FRAME_LOWER_LEFT){
+						if(RadInfo.DraggingRect[0].right-MIN_ITEM_X<=(mouse.x+LEVER_THICK))
+							RadInfo.DraggingRect[0].left=RadInfo.DraggingRect[0].right-MIN_ITEM_X;
+						else if(mouse.x+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.x)
+							RadInfo.DraggingRect[0].left=MdiInfo[i].MdiRadInfo->ClientPos.x;
+						else RadInfo.DraggingRect[0].left=mouse.x+LEVER_THICK;
+
+						if(mouse.y-LEVER_THICK-MIN_ITEM_Y<=RadInfo.DraggingRect[0].top)
+							RadInfo.DraggingRect[0].bottom=RadInfo.DraggingRect[0].top+MIN_ITEM_Y;
+						else if(mouse.y>MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy)
+							RadInfo.DraggingRect[0].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
+						else RadInfo.DraggingRect[0].bottom=mouse.y-LEVER_THICK;
+						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+					}
+					else if(RadInfo.NowDragging==FRAME_LOWER_RIGHT){
+						if(mouse.x-LEVER_THICK-MIN_ITEM_X<=RadInfo.DraggingRect[0].left)
+							RadInfo.DraggingRect[0].right=RadInfo.DraggingRect[0].left+MIN_ITEM_X;
+						else if((mouse.x>MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
+							RadInfo.DraggingRect[0].right=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
+						else RadInfo.DraggingRect[0].right=mouse.x-LEVER_THICK;
+
+						if(mouse.y-LEVER_THICK-MIN_ITEM_Y<=RadInfo.DraggingRect[0].top)
+							RadInfo.DraggingRect[0].bottom=RadInfo.DraggingRect[0].top+MIN_ITEM_Y;
+						else if((mouse.y>MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
+							RadInfo.DraggingRect[0].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
+						else RadInfo.DraggingRect[0].bottom=mouse.y-LEVER_THICK;
+						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+					}
+					else if(RadInfo.NowDragging==FRAME_LEFT){
+						if(RadInfo.DraggingRect[0].right-MIN_ITEM_X<=(mouse.x+LEVER_THICK))
+							RadInfo.DraggingRect[0].left=RadInfo.DraggingRect[0].right-MIN_ITEM_X;
+						else if(mouse.x+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.x)
+							RadInfo.DraggingRect[0].left=MdiInfo[i].MdiRadInfo->ClientPos.x;
+						else RadInfo.DraggingRect[0].left=mouse.x+LEVER_THICK;
+						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+					}
+					else if(RadInfo.NowDragging==FRAME_RIGHT){
+						if(mouse.x-LEVER_THICK-MIN_ITEM_X<=RadInfo.DraggingRect[0].left)
+							RadInfo.DraggingRect[0].right=RadInfo.DraggingRect[0].left+MIN_ITEM_X;
+						else if((mouse.x>MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
+							RadInfo.DraggingRect[0].right=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
+						else RadInfo.DraggingRect[0].right=mouse.x-LEVER_THICK;
+						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+					}
+					else if(RadInfo.NowDragging==FRAME_UPPER){
+						if(RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y<=(mouse.y+LEVER_THICK))
+							RadInfo.DraggingRect[0].top=RadInfo.DraggingRect[0].bottom-MIN_ITEM_Y;
+						else if(mouse.y+LEVER_THICK<MdiInfo[i].MdiRadInfo->ClientPos.y)
+							RadInfo.DraggingRect[0].top=MdiInfo[i].MdiRadInfo->ClientPos.y;
+						else RadInfo.DraggingRect[0].top=mouse.y+LEVER_THICK;
+						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+					}
+					else if(RadInfo.NowDragging==FRAME_LOWER){
+						if(mouse.y-LEVER_THICK-MIN_ITEM_Y<=RadInfo.DraggingRect[0].top) 
+							RadInfo.DraggingRect[0].bottom=RadInfo.DraggingRect[0].top+MIN_ITEM_Y;
+						else if((mouse.y>MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy)&&MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW)
+							RadInfo.DraggingRect[0].bottom=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
+						else RadInfo.DraggingRect[0].bottom=mouse.y-LEVER_THICK;
+						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+					}
+					else if(RadInfo.NowDragging==FRAME_INSIDE){
+						i3=0;
+						while(MdiInfo[i].MdiRadInfo->SelectingItem[i3]!=-1){
+							i4=RadInfo.DragStartRect[i3].left+mouse.x-RadInfo.DragStartPos.x;
+
+							if(i4>MdiInfo[i].MdiRadInfo->ClientPos.x){
+								i4=RadInfo.DragStartRect[i3].right+mouse.x-RadInfo.DragStartPos.x;
+								if(i4<MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx) i4=0;
+								else i4-=MdiInfo[i].MdiRadInfo->ClientPos.x+MdiInfo[i].MdiRadInfo->ClientSize.cx;
+							}
+							else i4-=MdiInfo[i].MdiRadInfo->ClientPos.x;
+							//i4は枠外に出たときのポインタと壁にあたったコントロールとの差
+							RadInfo.DraggingRect[i3].left=RadInfo.DragStartRect[i3].left+mouse.x-RadInfo.DragStartPos.x-i4;
+							RadInfo.DraggingRect[i3].right=RadInfo.DragStartRect[i3].right+mouse.x-RadInfo.DragStartPos.x-i4;
+
+							i4=RadInfo.DragStartRect[i3].top+mouse.y-RadInfo.DragStartPos.y;
+							if(i4>MdiInfo[i].MdiRadInfo->ClientPos.y){
+								i4=RadInfo.DragStartRect[i3].bottom+mouse.y-RadInfo.DragStartPos.y;
+								if(i4<MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy) i4=0;
+								else i4-=MdiInfo[i].MdiRadInfo->ClientPos.y+MdiInfo[i].MdiRadInfo->ClientSize.cy;
+							}
+							else i4-=MdiInfo[i].MdiRadInfo->ClientPos.y;
+							RadInfo.DraggingRect[i3].top=RadInfo.DragStartRect[i3].top+mouse.y-RadInfo.DragStartPos.y-i4;
+							RadInfo.DraggingRect[i3].bottom=RadInfo.DragStartRect[i3].bottom+mouse.y-RadInfo.DragStartPos.y-i4;
+
+							if(MdiInfo[i].MdiRadInfo->SelectingItem[1]==-1) i4=1;
+							else i4=0;
+							DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[i3],&RadInfo.OldDraggingRect[i3],i4);
+							i3++;
+						}
+					}
+					else if(RadInfo.NowDragging==SELECTING_FRAME){
+						RadInfo.DraggingRect[0].left=RadInfo.DragStartPos.x;
+						RadInfo.DraggingRect[0].top=RadInfo.DragStartPos.y;
+						RadInfo.DraggingRect[0].right=mouse.x;
+						RadInfo.DraggingRect[0].bottom=mouse.y;
+						DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+					}
+					SetCursorByState(RadInfo.NowDragging);
+
+					SetStatusText(NULL);
+
+					//サポートダイアログの内容をセット
+					SetSupportDlgData(i,i2);
+				}
+				else{
+					//ドラッグ中でないとき
+					SetCursorByState(GetStateOfDraggingFrame(i,i2,mouse.x,mouse.y));
+				}
+			}
+			else{
+				//アイテム（子ウィンドウ作成中）
+				if(wParam&MK_LBUTTON&&RadInfo.NowDragging==ITEM_MAKING){
+					//ドラッグ中の場合
+
+					RadInfo.DraggingRect[0].right=mouse.x;
+					RadInfo.DraggingRect[0].bottom=mouse.y;
+					DrawFrame(hwnd,i,i2,&RadInfo.DraggingRect[0],&RadInfo.OldDraggingRect[0],0);
+				}
+			}
+			return 0;
+		case WM_LBUTTONDBLCLK:
+			mouse.x=LOWORD(lParam);
+			mouse.y=HIWORD(lParam);
+			CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
+
+			hParent=GetParent(hwnd);
+			i=GetWndNum(hParent);
+			i2=GetWndInfoNum(MdiInfo[i].path);
+			if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
+				if(MdiInfo[i].MdiRadInfo->SelectingItem[0]!=SELECT_WINDOW){
+					temp2[0]=0;
+					if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].Control==CT_BUTTON||
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].Control==CT_CHECKBOX||
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].Control==CT_IMAGEBOX||
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].Control==CT_RADIOBUTTON||
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].Control==CT_STATIC){
+						sprintf(temporary,"%s_%s_Click",ProjectInfo.pWindowInfo[i2].name,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+					}
+					else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].Control==CT_COMBOBOX)
+						sprintf(temporary,"%s_%s_EditChange",ProjectInfo.pWindowInfo[i2].name,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+					else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].Control==CT_EDIT)
+						sprintf(temporary,"%s_%s_Change",ProjectInfo.pWindowInfo[i2].name,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+					else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].Control==CT_LISTBOX)
+						sprintf(temporary,"%s_%s_SelChange",ProjectInfo.pWindowInfo[i2].name,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+					else temporary[0]=0;
+					if(temporary[0]) SelectProcedureOfMessageCall(i2,temporary,temp2);
+				}
+			}
+			return 0;
+		case WM_KEYDOWN:
+			hParent=GetParent(hwnd);
+			i=GetWndNum(hParent);
+			i2=GetWndInfoNum(MdiInfo[i].path);
+			if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
+				if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
+					PointAndSize.pos=ProjectInfo.pWindowInfo[i2].pos;
+					PointAndSize.size=ProjectInfo.pWindowInfo[i2].size;
+					if(GetKeyState(VK_SHIFT)&0x8000){
+						if(wParam==VK_RIGHT||wParam==VK_LEFT||wParam==VK_DOWN||wParam==VK_UP)
+							Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
+
+						if(wParam==VK_RIGHT)
+							ProjectInfo.pWindowInfo[i2].size.cx++;
+						else if(wParam==VK_LEFT)
+							ProjectInfo.pWindowInfo[i2].size.cx--;
+						else if(wParam==VK_DOWN)
+							ProjectInfo.pWindowInfo[i2].size.cy++;
+						else if(wParam==VK_UP)
+							ProjectInfo.pWindowInfo[i2].size.cy--;
+
+						if(wParam==VK_RIGHT||wParam==VK_LEFT||wParam==VK_DOWN||wParam==VK_UP){
+							DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+
+							SetStatusText(NULL);
+
+							//サポートダイアログの内容をセット
+							SetSupportDlgData(i,i2);
+						}
+					}
+				}
+				else{
+					PointAndSize.pos=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].pos;
+					PointAndSize.size=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size;
+					if(wParam==VK_RIGHT){
+						if(GetKeyState(VK_SHIFT)&0x8000){
+							Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size.cx++;
+						}
+						else{
+							for(i3=0;;i3++){
+								if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
+								PointAndSize.pos=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos;
+								PointAndSize.size=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].size;
+								Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[i3],(DWORD)&PointAndSize);
+
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos.x++;
+							}
+						}
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						SetStatusText(NULL);
+
+						//サポートダイアログの内容をセット
+						SetSupportDlgData(i,i2);
+					}
+					else if(wParam==VK_LEFT){
+						if(GetKeyState(VK_SHIFT)&0x8000){
+							Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size.cx--;
+						}
+						else{
+							for(i3=0;;i3++){
+								if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
+								PointAndSize.pos=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos;
+								PointAndSize.size=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].size;
+								Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[i3],(DWORD)&PointAndSize);
+
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos.x--;
+							}
+						}
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						SetStatusText(NULL);
+
+						//サポートダイアログの内容をセット
+						SetSupportDlgData(i,i2);
+					}
+					else if(wParam==VK_UP){
+						if(GetKeyState(VK_SHIFT)&0x8000){
+							Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size.cy--;
+						}
+						else{
+							for(i3=0;;i3++){
+								if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
+								PointAndSize.pos=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos;
+								PointAndSize.size=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].size;
+								Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[i3],(DWORD)&PointAndSize);
+
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos.y--;
+							}
+						}
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						SetStatusText(NULL);
+
+						//サポートダイアログの内容をセット
+						SetSupportDlgData(i,i2);
+					}
+					else if(wParam==VK_DOWN){
+						if(GetKeyState(VK_SHIFT)&0x8000){
+							Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size.cy++;
+						}
+						else{
+							for(i3=0;;i3++){
+								if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
+								PointAndSize.pos=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos;
+								PointAndSize.size=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].size;
+								Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[i3],(DWORD)&PointAndSize);
+
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos.y++;
+							}
+						}
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						SetStatusText(NULL);
+
+						//サポートダイアログの内容をセット
+						SetSupportDlgData(i,i2);
+					}
+					else if(wParam==VK_DELETE)
+						SendMessage(hwnd,WM_COMMAND,IDM_RAD_ITEM_DELETE,0);
+				}
+			}
+			return 0;
+		case WM_SETFOCUS:
+			i=GetWndNum(GetParent(hwnd));
+			if(MdiInfo[i].MdiRadInfo->ButtonSelect==NON_TOOL)
+				MdiInfo[i].MdiRadInfo->ButtonSelect=IDC_TOOL_MOUSE;
+			InvalidateRect(hwnd,NULL,0);
+			return 0;
+		case WM_KILLFOCUS:
+			i=GetWndNum(GetParent(hwnd));
+			if(i==-1) return 0;	//ウィンドウが破棄された場合
+			if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE)
+				MdiInfo[i].MdiRadInfo->ButtonSelect=NON_TOOL;
+			InvalidateRect(hwnd,NULL,0);
+			return 0;
+		case WM_PAINT:
+			i=GetWndNum(GetParent(hwnd));
+			if(i==-1) return 0;	//ウィンドウが初期状態の場合
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			ScrollInfo.cbSize=sizeof(SCROLLINFO);
+			ScrollInfo.fMask=SIF_RANGE|SIF_POS;
+			GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
+			si2.cbSize=sizeof(SCROLLINFO);
+			si2.fMask=SIF_RANGE|SIF_POS;
+			GetScrollInfo(hwnd,SB_HORZ,&si2);
+
+			hdc=BeginPaint(hwnd,&ps);
+			BitBlt(hdc,0,0,ScreenX*2,ScreenY*2,
+				MdiInfo[i].MdiRadInfo->hMemDC,si2.nPos,ScrollInfo.nPos,SRCCOPY);
+			EndPaint(hwnd,&ps);
+
+			if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE||MdiInfo[i].MdiRadInfo->ButtonSelect==NON_TOOL)
+				DrawSelectingRect(hwnd,i,i2,MdiInfo[i].MdiRadInfo->ButtonSelect);
+			return 0;
+		case WM_CONTEXTMENU:
+			if(RadInfo.NowDragging) return 0;
+
+			hParent=GetParent(hwnd);
+			BringWindowToTop(hParent);
+			SetFocus(hwnd);
+			i=GetWndNum(hParent);
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			if(MdiInfo[i].MdiRadInfo->ButtonSelect==IDC_TOOL_MOUSE){
+				mouse.x=LOWORD(lParam);
+				mouse.y=HIWORD(lParam);
+				ScreenToClient(hwnd,&mouse);
+				CursorPos_LocalToGlobal(hwnd,&mouse.x,&mouse.y);
+				SelectItemNumOnMouse(i,i2,mouse.x,mouse.y);
+				InvalidateRect(hwnd,NULL,0);
+				extern HMENU hRadMenuBase;
+				if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
+					TrackPopupMenu(GetSubMenu(hRadMenuBase,0),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+				else TrackPopupMenu(GetSubMenu(hRadMenuBase,1),TPM_LEFTALIGN,LOWORD(lParam),HIWORD(lParam),0,hwnd,0);
+			}
+			return 0;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDM_RAD_WINDOW_EVENTCODE:
+					i=GetWndNum(GetParent(hwnd));
+					DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_RAD_EVENTCODE),hwnd,DlgEventCode,0);
+					break;
+				case IDM_RAD_WINDOW_MENUEVENTCODE:
+					i=GetWndNum(GetParent(hwnd));
+					DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_RAD_EVENTCODE),hwnd,DlgEventCode,1);
+					break;
+				case IDM_RAD_ITEM_DELETE:
+					hParent=GetParent(hwnd);
+					i=GetWndNum(hParent);
+					i2=GetWndInfoNum(MdiInfo[i].path);
+
+					//削除順序を考慮しなければならないので、バブルソートを行う
+					int i5,i6;
+					for(i5=0;;i5++){
+						if(MdiInfo[i].MdiRadInfo->SelectingItem[i5]==-1) break;
+					}
+					for(i3=0;i3<i5-1;i3++){
+						for(i4=i5-1;i4>i3;i4--){
+							if(MdiInfo[i].MdiRadInfo->SelectingItem[i4] >
+								MdiInfo[i].MdiRadInfo->SelectingItem[i4-1]){
+								i6=MdiInfo[i].MdiRadInfo->SelectingItem[i4];
+								MdiInfo[i].MdiRadInfo->SelectingItem[i4]=
+									MdiInfo[i].MdiRadInfo->SelectingItem[i4-1];
+								MdiInfo[i].MdiRadInfo->SelectingItem[i4-1]=i6;
+							}
+						}
+					}
+
+
+					for(i3=0;;i3++){
+						if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
+						DeleteDlgItem(i,i2,MdiInfo[i].MdiRadInfo->SelectingItem[i3],1);
+					}
+					for(i3=0;i3<MAX_RAD_SELITEM;i3++) MdiInfo[i].MdiRadInfo->SelectingItem[i3]=-1;
+
+					ResetState_EditMenu();
+					break;
+			}
+			return 0;
+		case WM_VSCROLL:
+			ScrollInfo.cbSize=sizeof(SCROLLINFO);
+			ScrollInfo.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
+			GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
+			if(LOWORD(wParam)==SB_LINEUP) i=-20;
+			else if(LOWORD(wParam)==SB_LINEDOWN) i=20;
+			else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)ScrollInfo.nPage;
+			else if(LOWORD(wParam)==SB_PAGEDOWN) i=ScrollInfo.nPage;
+			else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-ScrollInfo.nPos;
+			else i=0;
+			GetClientRect(hwnd,&rect);
+			i=max(-ScrollInfo.nPos,min(i,ScrollInfo.nMax-rect.bottom-ScrollInfo.nPos));
+			if(i!=0){
+				ScrollInfo.nPos+=i;
+				SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1);
+				ScrollWindow(hwnd,0,-i,NULL,NULL);
+				UpdateWindow(hwnd);
+			}
+			return 0;
+		case WM_HSCROLL:
+			ScrollInfo.cbSize=sizeof(SCROLLINFO);
+			ScrollInfo.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
+			GetScrollInfo(hwnd,SB_HORZ,&ScrollInfo);
+			if(LOWORD(wParam)==SB_LINEUP) i=-20;
+			else if(LOWORD(wParam)==SB_LINEDOWN) i=20;
+			else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)ScrollInfo.nPage;
+			else if(LOWORD(wParam)==SB_PAGEDOWN) i=ScrollInfo.nPage;
+			else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-ScrollInfo.nPos;
+			else i=0;
+			GetClientRect(hwnd,&rect);
+			i=max(-ScrollInfo.nPos,min(i,ScrollInfo.nMax-rect.right-ScrollInfo.nPos));
+			if(i!=0){
+				ScrollInfo.nPos+=i;
+				SetScrollInfo(hwnd,SB_HORZ,&ScrollInfo,1);
+				ScrollWindow(hwnd,-i,0,NULL,NULL);
+				UpdateWindow(hwnd);
+			}
+			return 0;
+		case WM_SIZE:
+			i=GetWndNum(GetParent(hwnd));
+			if(i==-1) break;	//ウィンドウが初期状態の場合
+			ResetScrollbarOfRadEditor(i,LOWORD(lParam),HIWORD(lParam));
+			return 0;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
+void ResizeToRadToolWindows(int WndNum,int weight,int height){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2;
+	RECT rect;
+
+	if(height<200){
+		i=100;
+		i2=100;
+	}
+	else{
+		//ツールボタンウィンドウ(長さ、i)
+		GetClientRect(GetWindow(MdiInfo[WndNum].MdiRadInfo->hTools,GW_CHILD),&rect);
+		if(height>rect.bottom+1) i=rect.bottom+1;
+		else i=height;
+
+		//プロパティウィンドウ(長さ、i2)
+		GetClientRect(GetWindow(MdiInfo[WndNum].MdiRadInfo->hProperty,GW_CHILD),&rect);
+		i2=height-i;
+
+		if(i2<100){
+			i=height-100;
+			i2=100;
+		}
+	}
+	MoveWindow(MdiInfo[WndNum].MdiRadInfo->hTools,weight-172,0,172,i,1);
+	MoveWindow(MdiInfo[WndNum].MdiRadInfo->hProperty,weight-172,i,172,i2,1);
+
+	GetWindowRect(MdiInfo[WndNum].MdiRadInfo->hSupport,&rect);
+	rect.right-=rect.left;
+	rect.bottom-=rect.top;
+
+	//RADウィンドウ
+	MoveWindow(MdiInfo[WndNum].MdiRadInfo->hRad,0,0,weight-172,height-rect.bottom,1);
+
+	//サポートウィンドウ
+	MoveWindow(MdiInfo[WndNum].MdiRadInfo->hSupport,0,height-rect.bottom,weight-172,rect.bottom,1);
+}
+LRESULT CALLBACK MDIClientWindow_Rad(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HWND hDocCombo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,WndNum;
+
+	switch(message){
+		case WM_CREATE:
+			extern HICON hWindowDocumentIcon;
+			SendMessage(hwnd,WM_SETICON,ICON_SMALL,(long)hWindowDocumentIcon);
+			break;
+		case WM_MDIACTIVATE:
+			if(!lParam) return 0;
+			i=GetWndNum((HWND)lParam);
+			if(i==-1) return 0;	//ウィンドウが初期状態の場合
+
+			i=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[i].title);
+			SendMessage(hDocCombo,CB_SETCURSEL,i,0);
+			SetStatusText(NULL);
+			ResetState_EditMenu();
+			return 0;
+		case WM_SIZE:
+			WndNum=GetWndNum(hwnd);
+			if(WndNum==-1) break;
+			ResizeToRadToolWindows(WndNum,LOWORD(lParam),HIWORD(lParam));
+			break;
+		case WM_CLOSE:
+			CloseDocWindow(GetWndNum(hwnd));
+			pobj_nv->bMDIZoomed=IsZoomed(hwnd);
+			i=DefMDIChildProc(hwnd,message,wParam,lParam);
+
+			//メニュー状態を設定
+			ResetState_DocMenu();
+
+			return i;
+	}
+	return DefMDIChildProc(hwnd,message,wParam,lParam);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/RadSupport.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/RadSupport.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/RadSupport.cpp	(revision 178)
@@ -0,0 +1,364 @@
+#include "common.h"
+
+#if defined(JPN)
+//日本語
+#include "rad_msg_jpn.h"
+#else
+//英語
+#include "rad_msg_eng.h"
+#endif
+
+int bSupportDlg_NoChange;
+
+LRESULT CALLBACK TestWindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	switch(message){
+		case WM_CREATE:
+			SetPosCenter(hwnd);
+			break;
+		case WM_KEYDOWN:
+			if(wParam==VK_ESCAPE) DestroyWindow(hwnd);
+			break;
+		case WM_PAINT:
+			break;
+		case WM_CLOSE:
+			DestroyWindow(hwnd);
+			break;
+		case WM_DESTROY:
+			PostQuitMessage(0);
+			break;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
+
+void ShowTestWindow(int WndInfoNum){
+	extern HINSTANCE hInst;
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	static HWND hWnd;
+	WINDOW_INFO *pWindowInfo;
+	HWND hChild;
+	HFONT *lphFont;
+	HANDLE *lphImage;
+	int i2,i3;
+	char temporary[MAX_PATH];
+
+	if(hWnd){
+		OpenIcon(hWnd);
+
+		_endthread();
+		return;
+	}
+
+	pWindowInfo=&ProjectInfo.pWindowInfo[WndInfoNum];
+
+	if(pWindowInfo->style&WS_CHILD){
+		//"チャイルドウィンドウをテスト表示することはできません"
+		MessageBox(hOwner,STRING_RAD_ERROR_CANT_CHILDTEST,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+
+		_endthread();
+		return;
+	}
+
+	lphFont=(HFONT *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,pWindowInfo->NumberOfChildWindows*sizeof(DWORD));
+	lphImage=(HANDLE *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,pWindowInfo->NumberOfChildWindows*sizeof(DWORD));
+
+	//テスト用のメインウィンドウを作成
+	hWnd=CreateWindowEx(pWindowInfo->ExStyle,
+		"TestWindow",
+		pWindowInfo->name,
+		pWindowInfo->style|WS_VISIBLE,
+		CW_USEDEFAULT,CW_USEDEFAULT,
+		pWindowInfo->size.cx,pWindowInfo->size.cy,
+		hOwner,NULL,hInst,NULL);
+
+	//子ウィンドウ作成
+	for(i2=0;i2<pWindowInfo->NumberOfChildWindows;i2++){
+		if(pWindowInfo->pChildInfo[i2].Control==CT_UPDOWN){
+			CreateUpDownControl(
+				pWindowInfo->pChildInfo[i2].style,
+				pWindowInfo->pChildInfo[i2].pos.x,pWindowInfo->pChildInfo[i2].pos.y,
+				pWindowInfo->pChildInfo[i2].size.cx,pWindowInfo->pChildInfo[i2].size.cy,
+				hWnd,0,hInst,
+				0,0,100,0);
+		}
+		else{
+			GetItemClassName(temporary,pWindowInfo->pChildInfo[i2].Control);
+			hChild=CreateWindowEx(
+				pWindowInfo->pChildInfo[i2].ExStyle,
+				temporary,
+				pWindowInfo->pChildInfo[i2].caption,
+				pWindowInfo->pChildInfo[i2].style,
+				pWindowInfo->pChildInfo[i2].pos.x,
+				pWindowInfo->pChildInfo[i2].pos.y,
+				pWindowInfo->pChildInfo[i2].size.cx,
+				pWindowInfo->pChildInfo[i2].size.cy,
+				hWnd,0,hInst,0);
+
+			lphFont[i2]=CreateFontIndirect(&pWindowInfo->LogFont);
+			SendMessage(hChild,WM_SETFONT,(long)lphFont[i2],0);
+
+			if(pWindowInfo->pChildInfo[i2].Control==CT_IMAGEBOX){
+				///////////////////////////
+				// イメージ ボックスの場合
+				///////////////////////////
+				if((pWindowInfo->pChildInfo[i2].style&0x000F)==SS_ICON){
+					if(pWindowInfo->pChildInfo[i2].ImageCtrlInfo.type==IMGTYPE_FILE)
+						lstrcpy(temporary,pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path);
+					else{
+						for(i3=0;i3<ProjectInfo.res.NumberOfIconRes;i3++){
+							if(lstrcmp(pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path,
+								ProjectInfo.res.pIconResInfo[i3].IdName)==0) break;
+						}
+						if(i3==ProjectInfo.res.NumberOfIconRes) temporary[0]=0;
+						else lstrcpy(temporary,ProjectInfo.res.pIconResInfo[i3].path);
+					}
+					if(temporary[0]){
+						GetFullPath(temporary,ProjectInfo.dir);
+						lphImage[i2]=LoadImage(hInst,temporary,IMAGE_ICON,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE);
+
+						SendMessage(hChild,STM_SETICON,(long)lphImage[i2],0);
+					}
+				}
+				else if((pWindowInfo->pChildInfo[i2].style&0x000F)==SS_BITMAP){
+					if(pWindowInfo->pChildInfo[i2].ImageCtrlInfo.type==IMGTYPE_FILE)
+						lstrcpy(temporary,pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path);
+					else{
+						for(i3=0;i3<ProjectInfo.res.NumberOfBitmapRes;i3++){
+							if(lstrcmp(pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path,
+								ProjectInfo.res.pBitmapResInfo[i3].IdName)==0) break;
+						}
+						if(i3==ProjectInfo.res.NumberOfBitmapRes) temporary[0]=0;
+						else lstrcpy(temporary,ProjectInfo.res.pBitmapResInfo[i3].path);
+					}
+					if(temporary[0]){
+						GetFullPath(temporary,ProjectInfo.dir);
+						lphImage[i2]=LoadImage(hInst,temporary,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE|LR_LOADFROMFILE);
+
+						SendMessage(hChild,STM_SETIMAGE,IMAGE_BITMAP,(long)lphImage[i2]);
+					}
+				}
+			}
+		}
+	}
+
+	MSG msg;
+	while(GetMessage(&msg,NULL,0,0)){
+		if(IsDialogMessage(hWnd,&msg)) continue;
+		TranslateMessage(&msg);
+		DispatchMessage(&msg);
+	}
+
+	//フォントハンドルを破棄
+	for(i2=0;i2<pWindowInfo->NumberOfChildWindows;i2++){
+		if(lphFont[i2]) DeleteObject(lphFont[i2]);
+	}
+	HeapDefaultFree(lphFont);
+
+	//イメージハンドルを破棄
+	for(i2=0;i2<pWindowInfo->NumberOfChildWindows;i2++){
+		if(lphImage[i2]){
+			if((pWindowInfo->pChildInfo[i2].style&0x000F)==SS_ICON)
+				DestroyIcon((HICON)lphImage[i2]);
+			else if((pWindowInfo->pChildInfo[i2].style&0x000F)==SS_BITMAP)
+				DeleteObject(lphImage[i2]);
+		}
+	}
+	HeapDefaultFree(lphImage);
+
+	hWnd=0;
+
+	_endthread();
+}
+
+void SetSupportDlgData(int WndNum,int WndInfoNum){
+	////////////////////////////////////
+	// サポートダイアログの内容をセット
+	////////////////////////////////////
+	extern PROJECTINFO ProjectInfo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern RADINFO RadInfo;
+	char temporary[255];
+	HWND hSupport;
+
+	bSupportDlg_NoChange=1;
+
+	hSupport=MdiInfo[WndNum].MdiRadInfo->hSupport;
+
+	if(RadInfo.NowDragging>=FRAME_CHANGEPOS_START&&RadInfo.NowDragging<=FRAME_CHANGEPOS_END&&
+		(!(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]!=-1&&MdiInfo[WndNum].MdiRadInfo->SelectingItem[1]!=-1))){
+		sprintf(temporary,"%d",RadInfo.DraggingRect[0].left-MdiInfo[WndNum].MdiRadInfo->ClientPos.x);
+		SetDlgItemText(hSupport,IDC_XPOS,temporary);
+
+		sprintf(temporary,"%d",RadInfo.DraggingRect[0].top-MdiInfo[WndNum].MdiRadInfo->ClientPos.y);
+		SetDlgItemText(hSupport,IDC_YPOS,temporary);
+
+		sprintf(temporary,"%d",RadInfo.DraggingRect[0].right-RadInfo.DraggingRect[0].left);
+		SetDlgItemText(hSupport,IDC_WIDTH,temporary);
+
+		sprintf(temporary,"%d",RadInfo.DraggingRect[0].bottom-RadInfo.DraggingRect[0].top);
+		SetDlgItemText(hSupport,IDC_HEIGHT,temporary);
+	}
+	else if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
+		EnableWindow(GetDlgItem(hSupport,IDC_XPOS),0);
+		EnableWindow(GetDlgItem(hSupport,IDC_YPOS),0);
+		EnableWindow(GetDlgItem(hSupport,IDC_SPIN1),0);
+		EnableWindow(GetDlgItem(hSupport,IDC_SPIN2),0);
+		EnableWindow(GetDlgItem(hSupport,IDC_SPIN3),1);
+		EnableWindow(GetDlgItem(hSupport,IDC_SPIN4),1);
+
+		SetDlgItemText(hSupport,IDC_XPOS,"");
+		SetDlgItemText(hSupport,IDC_YPOS,"");
+
+		sprintf(temporary,"%d",ProjectInfo.pWindowInfo[WndInfoNum].size.cx);
+		SetDlgItemText(hSupport,IDC_WIDTH,temporary);
+
+		sprintf(temporary,"%d",ProjectInfo.pWindowInfo[WndInfoNum].size.cy);
+		SetDlgItemText(hSupport,IDC_HEIGHT,temporary);
+	}
+	else{
+		EnableWindow(GetDlgItem(hSupport,IDC_XPOS),1);
+		EnableWindow(GetDlgItem(hSupport,IDC_YPOS),1);
+
+		if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[1]!=-1){
+			EnableWindow(GetDlgItem(hSupport,IDC_SPIN1),0);
+			EnableWindow(GetDlgItem(hSupport,IDC_SPIN2),0);
+			EnableWindow(GetDlgItem(hSupport,IDC_SPIN3),0);
+			EnableWindow(GetDlgItem(hSupport,IDC_SPIN4),0);
+
+			SetDlgItemText(hSupport,IDC_XPOS,"");
+			SetDlgItemText(hSupport,IDC_YPOS,"");
+			SetDlgItemText(hSupport,IDC_WIDTH,"");
+			SetDlgItemText(hSupport,IDC_HEIGHT,"");
+		}
+		else{
+			EnableWindow(GetDlgItem(hSupport,IDC_SPIN1),1);
+			EnableWindow(GetDlgItem(hSupport,IDC_SPIN2),1);
+			EnableWindow(GetDlgItem(hSupport,IDC_SPIN3),1);
+			EnableWindow(GetDlgItem(hSupport,IDC_SPIN4),1);
+
+			sprintf(temporary,"%d",ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].pos.x);
+			SetDlgItemText(hSupport,IDC_XPOS,temporary);
+
+			sprintf(temporary,"%d",ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].pos.y);
+			SetDlgItemText(hSupport,IDC_YPOS,temporary);
+
+			sprintf(temporary,"%d",ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].size.cx);
+			SetDlgItemText(hSupport,IDC_WIDTH,temporary);
+
+			sprintf(temporary,"%d",ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].size.cy);
+			SetDlgItemText(hSupport,IDC_HEIGHT,temporary);
+		}
+	}
+
+	bSupportDlg_NoChange=0;
+}
+
+BOOL CALLBACK DlgRadSupport(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern PROJECTINFO ProjectInfo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	static BOOL bTimer;
+	int i,i2,i3;
+	char temporary[255];
+	POINTANDSIZE PointAndSize;
+	RECT rect;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SendDlgItemMessage(hwnd,IDC_SPIN1,UDM_SETBUDDY,(long)GetDlgItem(hwnd,IDC_XPOS),0);
+			SendDlgItemMessage(hwnd,IDC_SPIN2,UDM_SETBUDDY,(long)GetDlgItem(hwnd,IDC_YPOS),0);
+			SendDlgItemMessage(hwnd,IDC_SPIN3,UDM_SETBUDDY,(long)GetDlgItem(hwnd,IDC_WIDTH),0);
+			SendDlgItemMessage(hwnd,IDC_SPIN4,UDM_SETBUDDY,(long)GetDlgItem(hwnd,IDC_HEIGHT),0);
+
+			SendDlgItemMessage(hwnd,IDC_SPIN1,UDM_SETRANGE32,0,0x7FFF);
+			SendDlgItemMessage(hwnd,IDC_SPIN2,UDM_SETRANGE32,0,0x7FFF);
+			SendDlgItemMessage(hwnd,IDC_SPIN3,UDM_SETRANGE32,0,0x7FFF);
+			SendDlgItemMessage(hwnd,IDC_SPIN4,UDM_SETRANGE32,0,0x7FFF);
+			return 0;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_TEST:
+					_beginthread(
+						(void (__cdecl *)(void *))ShowTestWindow,
+						0,
+						(void *)GetWndInfoNum(MdiInfo[GetWndNum(GetParent(hwnd))].path));
+					return 1;
+				case IDC_XPOS:
+				case IDC_YPOS:
+				case IDC_WIDTH:
+				case IDC_HEIGHT:
+					if(HIWORD(wParam)==EN_UPDATE){
+						if(bSupportDlg_NoChange) return 1;
+
+						if(bTimer) KillTimer(hwnd,0);
+
+						bTimer=1;
+						SetTimer(hwnd,0,650,NULL);
+					}
+					return 1;
+			}
+			break;
+		case WM_TIMER:
+			KillTimer(hwnd,0);
+			bTimer=0;
+
+			i=GetWndNum(GetParent(hwnd));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			for(i3=0;;i3++){
+				if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
+				PointAndSize.pos=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos;
+				PointAndSize.size=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].size;
+				Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[i3],(DWORD)&PointAndSize);
+			}
+
+			GetDlgItemText(hwnd,IDC_XPOS,temporary,255);
+			if(temporary[0]){
+				for(i3=0;;i3++){
+					if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
+					ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos.x=atol(temporary);
+				}
+			}
+
+			GetDlgItemText(hwnd,IDC_YPOS,temporary,255);
+			if(temporary[0]){
+				for(i3=0;;i3++){
+					if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
+					ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].pos.y=atol(temporary);
+				}
+			}
+
+			GetDlgItemText(hwnd,IDC_WIDTH,temporary,255);
+			if(temporary[0]){
+				if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
+					ProjectInfo.pWindowInfo[i2].size.cx=atol(temporary);
+				else{
+					for(i3=0;;i3++){
+						if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].size.cx=atol(temporary);
+					}
+				}
+			}
+
+			GetDlgItemText(hwnd,IDC_HEIGHT,temporary,255);
+			if(temporary[0]){
+				if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
+					ProjectInfo.pWindowInfo[i2].size.cy=atol(temporary);
+				else{
+					for(i3=0;;i3++){
+						if(MdiInfo[i].MdiRadInfo->SelectingItem[i3]==-1) break;
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[i3]].size.cy=atol(temporary);
+					}
+				}
+			}
+
+			//描画
+			DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+
+			//スクロールバーをリセット
+			GetClientRect(MdiInfo[i].MdiRadInfo->hRad,&rect);
+			ResetScrollbarOfRadEditor(i,rect.right,rect.bottom);
+
+			return 1;
+	}
+	return 0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/RadToolsAndPropertyProc.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/RadToolsAndPropertyProc.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/RadToolsAndPropertyProc.cpp	(revision 178)
@@ -0,0 +1,4624 @@
+#include "Common.h"
+
+#if defined(JPN)
+//日本語
+#include "rad_msg_jpn.h"
+#else
+//英語
+#include "rad_msg_eng.h"
+#endif
+
+void ShowControlAdvice(int Control){
+	if(Control==IDC_TOOL_MOUSE) SetStatusText("");
+
+#if defined(JPN)
+	//日本語
+	else if(Control==IDC_TOOL_BUTTON) SetStatusText("[ボタン] クリックすることができるボタンです。");
+	else if(Control==IDC_TOOL_CHECKBOX) SetStatusText("[チェック ボックス] ON/OFFの設定ができるボタンです。");
+	else if(Control==IDC_TOOL_COMBOBOX) SetStatusText("[コンボ ボックス] ドロップダウン リストの中から項目を選択することができます。");
+	else if(Control==IDC_TOOL_EDIT) SetStatusText("[エディット ボックス] ユーザーが文字列の編集操作を行うことができます。");
+	else if(Control==IDC_TOOL_GROUPBOX) SetStatusText("[グループ ボックス] 複数のコントロールを囲むことができます。");
+	else if(Control==IDC_TOOL_HSCROLLBAR) SetStatusText("[水平スクロールバー] 現在位置を表示、設定します。");
+	else if(Control==IDC_TOOL_IMAGEBOX) SetStatusText("[イメージ ボックス] 四角形やビットマップ、アイコンを表示します。");
+	else if(Control==IDC_TOOL_LISTBOX) SetStatusText("[リスト ボックス] 複数の項目を表示、選択できるリストです。");
+	else if(Control==IDC_TOOL_LISTVIEW) SetStatusText("[リスト ビュー] リスト ボックス内にアイコンやテキストを並べて表示するビューです。");
+	else if(Control==IDC_TOOL_PROGRESSBAR) SetStatusText("[プログレス バー] 進行状況を表示するバー。");
+	else if(Control==IDC_TOOL_RADIOBUTTON) SetStatusText("[ラジオ ボタン] 複数の項目から１つを選択するボタンです。");
+	else if(Control==IDC_TOOL_STATIC) SetStatusText("[スタティック テキスト] テキストを表示します。");
+	else if(Control==IDC_TOOL_TRACKBAR) SetStatusText("[トラック バー] 目盛が付いた移動バー。");
+	else if(Control==IDC_TOOL_TREEVIEW) SetStatusText("[ツリー ビュー] リストを階層構造で表示します。");
+	else if(Control==IDC_TOOL_UPDOWN) SetStatusText("[アップ ダウン コントロール] 上下のボタンで数値を設定します。");
+	else if(Control==IDC_TOOL_VSCROLLBAR) SetStatusText("[垂直スクロールバー] 現在位置を表示、設定します。");
+#else
+	//英語
+	else if(Control==IDC_TOOL_BUTTON) SetStatusText("[Button] The button which can be clicked");
+	else if(Control==IDC_TOOL_CHECKBOX) SetStatusText("[CheckBox] The button which can switch on/off");
+	else if(Control==IDC_TOOL_COMBOBOX) SetStatusText("[ComboBox] Choose an item from drop down lists");
+	else if(Control==IDC_TOOL_EDIT) SetStatusText("[EditBox] A user can edit a character sequence");
+	else if(Control==IDC_TOOL_GROUPBOX) SetStatusText("[GroupBox] Two or more control can be packed");
+	else if(Control==IDC_TOOL_HSCROLLBAR) SetStatusText("[Horizontal Scrollbar] The present position is displayed and setup");
+	else if(Control==IDC_TOOL_IMAGEBOX) SetStatusText("[ImageBox] A rectangle, a bitmap, and an icon are displayed.");
+	else if(Control==IDC_TOOL_LISTBOX) SetStatusText("[ListBox] The list which can display and choose two or more items");
+	else if(Control==IDC_TOOL_LISTVIEW) SetStatusText("[ListView] The view which displays an icon and a text in a list box");
+	else if(Control==IDC_TOOL_PROGRESSBAR) SetStatusText("[Progressbar] The bar which displays an advance situation");
+	else if(Control==IDC_TOOL_RADIOBUTTON) SetStatusText("[RadioButton] The button which chooses one from two or more items");
+	else if(Control==IDC_TOOL_STATIC) SetStatusText("[StaticText] Display the text messages");
+	else if(Control==IDC_TOOL_TRACKBAR) SetStatusText("[Trackbar] The bar to which the scale was attached");
+	else if(Control==IDC_TOOL_TREEVIEW) SetStatusText("[TreeView] Lists are displayed by the layered structure");
+	else if(Control==IDC_TOOL_UPDOWN) SetStatusText("[Up/Down Control] A numerical value is set up with a up/down button");
+	else if(Control==IDC_TOOL_VSCROLLBAR) SetStatusText("[Vertical Scrollbar] The present position is displayed and setup");
+#endif
+}
+
+char *GetControlName(DWORD id){
+	char *pTemp;
+	pTemp="";
+
+#if defined(JPN)
+	//日本語
+	if(id==IDC_TOOL_MOUSE) pTemp="選択";
+	else if(id==IDC_TOOL_STATIC) pTemp="スタティック テキスト";
+	else if(id==IDC_TOOL_EDIT) pTemp="エディット ボックス";
+	else if(id==IDC_TOOL_GROUPBOX) pTemp="グループ ボックス";
+	else if(id==IDC_TOOL_COMBOBOX) pTemp="コンボ ボックス";
+	else if(id==IDC_TOOL_LISTBOX) pTemp="リスト ボックス";
+	else if(id==IDC_TOOL_BUTTON) pTemp="ボタン";
+	else if(id==IDC_TOOL_CHECKBOX) pTemp="チェック ボックス";
+	else if(id==IDC_TOOL_RADIOBUTTON) pTemp="ラジオ ボタン";
+	else if(id==IDC_TOOL_LISTVIEW) pTemp="リスト ビュー";
+	else if(id==IDC_TOOL_TREEVIEW) pTemp="ツリー ビュー";
+	else if(id==IDC_TOOL_HSCROLLBAR) pTemp="水平スクロール バー";
+	else if(id==IDC_TOOL_VSCROLLBAR) pTemp="垂直スクロール バー";
+	else if(id==IDC_TOOL_UPDOWN) pTemp="アップ ダウン コントロール";
+	else if(id==IDC_TOOL_IMAGEBOX) pTemp="イメージ ボックス";
+	else if(id==IDC_TOOL_TRACKBAR) pTemp="トラック バー";
+	else if(id==IDC_TOOL_PROGRESSBAR) pTemp="プログレス バー";
+#else
+	//英語
+	if(id==IDC_TOOL_MOUSE) pTemp="Tool";
+	else if(id==IDC_TOOL_STATIC) pTemp="StaticText";
+	else if(id==IDC_TOOL_EDIT) pTemp="EditBox";
+	else if(id==IDC_TOOL_GROUPBOX) pTemp="GroupBox";
+	else if(id==IDC_TOOL_COMBOBOX) pTemp="ComboBox";
+	else if(id==IDC_TOOL_LISTBOX) pTemp="ListBox";
+	else if(id==IDC_TOOL_BUTTON) pTemp="Button";
+	else if(id==IDC_TOOL_CHECKBOX) pTemp="CheckBox";
+	else if(id==IDC_TOOL_RADIOBUTTON) pTemp="RadioButton";
+	else if(id==IDC_TOOL_LISTVIEW) pTemp="ListView";
+	else if(id==IDC_TOOL_TREEVIEW) pTemp="TreeView";
+	else if(id==IDC_TOOL_HSCROLLBAR) pTemp="Horizontal Scrollbar";
+	else if(id==IDC_TOOL_VSCROLLBAR) pTemp="Vertical Scrollbar";
+	else if(id==IDC_TOOL_UPDOWN) pTemp="Up/Down Control";
+	else if(id==IDC_TOOL_IMAGEBOX) pTemp="ImageBox";
+	else if(id==IDC_TOOL_TRACKBAR) pTemp="Trackbar";
+	else if(id==IDC_TOOL_PROGRESSBAR) pTemp="Progressbar";
+#endif
+
+	return pTemp;
+}
+BOOL CALLBACK RadToolButtonsProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,WndNum;
+	HWND hParent;
+	HWND hToolBar;
+	RECT rect;
+	TBBUTTON CtrlToolBar[]={
+		{0,IDC_TOOL_MOUSE,TBSTATE_ENABLED|TBSTATE_WRAP|TBSTATE_CHECKED,TBSTYLE_CHECKGROUP,0,0},
+		{1,IDC_TOOL_STATIC,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{2,IDC_TOOL_EDIT,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{3,IDC_TOOL_GROUPBOX,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{BMPNUM_RADTOOLBAR-1,0,TBSTATE_INDETERMINATE,TBSTYLE_CHECKGROUP,0,0},
+		{4,IDC_TOOL_COMBOBOX,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{5,IDC_TOOL_LISTBOX,TBSTATE_ENABLED|TBSTATE_WRAP,TBSTYLE_CHECKGROUP,0,0},
+		{6,IDC_TOOL_BUTTON,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{7,IDC_TOOL_CHECKBOX,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{8,IDC_TOOL_RADIOBUTTON,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{BMPNUM_RADTOOLBAR-1,0,TBSTATE_INDETERMINATE,TBSTYLE_CHECKGROUP,0,0},
+		{9,IDC_TOOL_LISTVIEW,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{10,IDC_TOOL_TREEVIEW,TBSTATE_ENABLED|TBSTATE_WRAP,TBSTYLE_CHECKGROUP,0,0},
+		{11,IDC_TOOL_HSCROLLBAR,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{12,IDC_TOOL_VSCROLLBAR,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{13,IDC_TOOL_UPDOWN,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{BMPNUM_RADTOOLBAR-1,0,TBSTATE_INDETERMINATE,TBSTYLE_CHECKGROUP,0,0},
+		{14,IDC_TOOL_IMAGEBOX,TBSTATE_ENABLED|TBSTATE_WRAP,TBSTYLE_CHECKGROUP,0,0},
+		{15,IDC_TOOL_TRACKBAR,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+		{16,IDC_TOOL_PROGRESSBAR,TBSTATE_ENABLED,TBSTYLE_CHECKGROUP,0,0},
+	};
+	TOOLTIPTEXT *pTipText;
+
+	switch(message){
+		case WM_INITDIALOG:
+			hToolBar=CreateToolbarEx(hwnd,WS_CHILD|WS_VISIBLE|CCS_NODIVIDER|TBSTYLE_FLAT|TBSTYLE_TOOLTIPS,
+				NULL,
+				BMPNUM_RADTOOLBAR,	/*ビットマップの個数*/
+				hResInst,(unsigned int)MAKEINTRESOURCE(IDR_CONTROL),CtrlToolBar,
+				(BMPNUM_RADTOOLBAR-1)+SEPNUM_RADTOOLBAR,	/*アイテムの個数*/
+				0,0,16,15,sizeof(TBBUTTON));
+
+			//Windows9x系OSでの不具合を防ぐため
+			PostMessage(hwnd,WM_USER+120,0,0);
+
+			break;
+		case WM_USER+120:
+			GetClientRect(hwnd,&rect);
+			MoveWindow(hwnd,5,22,rect.right,rect.bottom,1);
+			MoveWindow(GetWindow(hwnd,GW_CHILD),0,0,rect.right,rect.bottom,1);
+			return 1;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_TOOL_MOUSE:
+					ShowControlAdvice(LOWORD(wParam));
+					hParent=GetParent(GetParent(hwnd));
+					BringWindowToTop(hParent);
+					i=GetWndNum(hParent);
+					i2=GetWndInfoNum(MdiInfo[i].path);
+					MdiInfo[i].MdiRadInfo->ButtonSelect=IDC_TOOL_MOUSE;
+					DrawSelectingRect(MdiInfo[i].MdiRadInfo->hRad,i,i2,IDC_TOOL_MOUSE);
+					SetFocus(MdiInfo[i].MdiRadInfo->hRad);
+					return 1;
+				case IDC_TOOL_BUTTON:
+				case IDC_TOOL_CHECKBOX:
+				case IDC_TOOL_COMBOBOX:
+				case IDC_TOOL_EDIT:
+				case IDC_TOOL_GROUPBOX:
+				case IDC_TOOL_HSCROLLBAR:
+				case IDC_TOOL_IMAGEBOX:
+				case IDC_TOOL_LISTBOX:
+				case IDC_TOOL_LISTVIEW:
+				case IDC_TOOL_PROGRESSBAR:
+				case IDC_TOOL_RADIOBUTTON:
+				case IDC_TOOL_STATIC:
+				case IDC_TOOL_TRACKBAR:
+				case IDC_TOOL_TREEVIEW:
+				case IDC_TOOL_UPDOWN:
+				case IDC_TOOL_VSCROLLBAR:
+					ShowControlAdvice(LOWORD(wParam));
+					hParent=GetParent(GetParent(hwnd));
+					BringWindowToTop(hParent);
+					WndNum=GetWndNum(hParent);
+					MdiInfo[WndNum].MdiRadInfo->ButtonSelect=LOWORD(wParam);
+					InvalidateRect(MdiInfo[WndNum].MdiRadInfo->hRad,NULL,0);
+					return 1;
+			}
+			break;
+		case WM_NOTIFY:
+			pTipText=(TOOLTIPTEXT *)lParam;
+			if(pTipText->hdr.code==TTN_NEEDTEXT){
+				//ステータスバーに説明文を表示
+				ShowControlAdvice(pTipText->hdr.idFrom);
+
+				//コントロール名を取得し、ツールヒントとして表示する
+				pTipText->lpszText=GetControlName(pTipText->hdr.idFrom);
+			}
+			break;
+	}
+	return 0;
+}
+LRESULT CALLBACK RadToolsWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	extern HFONT hStatusFont;
+	int i;
+	RECT rect;
+	SCROLLINFO ScrollInfo;
+	HDC hdc;
+	PAINTSTRUCT ps;
+	HFONT hOldFont;
+	POINT pos;
+
+	switch(message){
+		case WM_CREATE:
+			CreateDialog(hResInst,MAKEINTRESOURCE(IDD_RAD_CTRLBUTTONS),hwnd,(DLGPROC)RadToolButtonsProc);
+			return 0;
+		case WM_VSCROLL:
+			ScrollInfo.cbSize=sizeof(SCROLLINFO);
+			ScrollInfo.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
+			GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
+			if(LOWORD(wParam)==SB_LINEUP) i=-20;
+			else if(LOWORD(wParam)==SB_LINEDOWN) i=20;
+			else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)ScrollInfo.nPage;
+			else if(LOWORD(wParam)==SB_PAGEDOWN) i=ScrollInfo.nPage;
+			else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-ScrollInfo.nPos;
+			else i=0;
+			GetClientRect(hwnd,&rect);
+			i=max(-ScrollInfo.nPos,min(i,ScrollInfo.nMax-rect.bottom-ScrollInfo.nPos));
+			if(i!=0){
+				ScrollInfo.nPos+=i;
+				SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1);
+				ScrollWindow(hwnd,0,-i,NULL,NULL);
+				UpdateWindow(hwnd);
+			}
+			return 0;
+		case WM_SIZE:
+			GetClientRect(GetWindow(hwnd,GW_CHILD),&rect);
+			ScrollInfo.cbSize=sizeof(SCROLLINFO);
+			ScrollInfo.fMask=SIF_PAGE|SIF_RANGE|SIF_POS;
+
+			//垂直スクロールバーの設定
+			GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
+			ScrollInfo.nMin=0;
+			ScrollInfo.nMax=rect.bottom;
+			ScrollInfo.nPage=HIWORD(lParam);
+			SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1);
+
+			i=ScrollInfo.nPos;
+			ScrollInfo.fMask=SIF_POS;
+			GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
+			if(i>ScrollInfo.nPos){
+				ScrollWindow(hwnd,0,i-ScrollInfo.nPos,NULL,NULL);
+				UpdateWindow(hwnd);
+			}
+			return 0;
+		case WM_PAINT:
+			hdc=BeginPaint(hwnd,&ps);
+			hOldFont=(HFONT)SelectObject(hdc,hStatusFont);
+			SetBkMode(hdc,TRANSPARENT);
+			pos.x=30;
+			pos.y=3;
+			CursorPos_GlobalToLocal(hwnd,&pos.x,&pos.y);
+#if defined(JPN)
+			//日本語
+			TextOut(hdc,pos.x,pos.y,"- コントロール -",lstrlen("- コントロール -"));
+#else
+			//英語
+			TextOut(hdc,pos.x,pos.y,"-   Control   -",lstrlen("-   Control   -"));
+#endif
+			SelectObject(hdc,hOldFont);
+			EndPaint(hwnd,&ps);
+			return 0;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
+
+
+/////////////////////////
+//ウィンドウ プロパティ
+
+void RadProperty_Window_Caption_StylingOrder(HWND hwnd,DWORD *style){
+	if((*style&WS_CAPTION)==WS_CAPTION){
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_SYSMENU),1);
+		if(!(*style&WS_CHILD)){
+			EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),1);
+			EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),1);
+		}
+		if(SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_GETCURSEL,0,0)==0){
+			if(*style&WS_THICKFRAME) SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,1,0);
+		}
+	}
+	else{
+		*style&=~(WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX);
+		SendDlgItemMessage(hwnd,IDC_STYLE_SYSMENU,BM_SETCHECK,BST_UNCHECKED,0);
+		SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZEBOX,BM_SETCHECK,BST_UNCHECKED,0);
+		SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZEBOX,BM_SETCHECK,BST_UNCHECKED,0);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_SYSMENU),0);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),0);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),0);
+	}
+}
+void RadProperty_Window_Border_StylingOrder(HWND hwnd,DWORD *style){
+	if(*style&(WS_BORDER|WS_THICKFRAME)){
+		if(*style&(WS_POPUP|WS_CHILD)) EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),1);
+		else{
+			*style|=WS_CAPTION;
+			SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_SETCHECK,BST_CHECKED,0);
+			EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),0);
+		}
+	}
+	else{
+		*style&=~WS_CAPTION;
+		SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_SETCHECK,BST_UNCHECKED,0);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),0);
+	}
+	RadProperty_Window_Caption_StylingOrder(hwnd,style);
+}
+void RadProperty_Window_Window_StylingOrder(HWND hwnd,DWORD *style){
+	if(*style&WS_POPUP){
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),1);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),1);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),1);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZE),1);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZE),1);
+	}
+	else if(*style&WS_CHILD){
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),1);
+
+		*style&=~(WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_MINIMIZE|WS_MAXIMIZE);
+		SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZEBOX,BM_SETCHECK,BST_UNCHECKED,0);
+		SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZEBOX,BM_SETCHECK,BST_UNCHECKED,0);
+		SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZE,BM_SETCHECK,BST_UNCHECKED,0);
+		SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZE,BM_SETCHECK,BST_UNCHECKED,0);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),0);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),0);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZE),0);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZE),0);
+	}
+	else{
+		if(*style&WS_BORDER){
+			*style|=WS_CAPTION;
+			SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_SETCHECK,BST_CHECKED,0);
+			EnableWindow(GetDlgItem(hwnd,IDC_STYLE_CAPTION),0);
+
+			EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZEBOX),1);
+			EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZEBOX),1);
+			EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MINIMIZE),1);
+			EnableWindow(GetDlgItem(hwnd,IDC_STYLE_MAXIMIZE),1);
+		}
+	}
+	RadProperty_Window_Border_StylingOrder(hwnd,style);
+}
+BOOL CALLBACK DlgRadProperty_Window_Rename(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern HWND hClient,hOwner;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	char temporary[MAX_PATH],temp2[MAX_PATH];
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+			i=GetWndNum(GetWindow(hClient,GW_CHILD));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+			sprintf(temporary,"h%s",ProjectInfo.pWindowInfo[i2].name);
+			sprintf(temp2,"%sProc",ProjectInfo.pWindowInfo[i2].name);
+			if(lstrcmp(temporary,ProjectInfo.pWindowInfo[i2].HandleName)==0&&
+				lstrcmp(temp2,ProjectInfo.pWindowInfo[i2].CallBackName)==0){
+				SendDlgItemMessage(hwnd,IDC_AUTOSET,BM_SETCHECK,BST_CHECKED,0);
+				SendMessage(hwnd,WM_COMMAND,IDC_AUTOSET,0);
+			}
+			SetDlgItemText(hwnd,IDC_WINDOWNAME,ProjectInfo.pWindowInfo[i2].name);
+			SetDlgItemText(hwnd,IDC_WINDOWHANDLE,ProjectInfo.pWindowInfo[i2].HandleName);
+			SetDlgItemText(hwnd,IDC_WINDOWPROC,ProjectInfo.pWindowInfo[i2].CallBackName);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					if(GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWNAME))==0){
+						//MsgBox "ウィンドウ識別名を入力して下さい。"
+						MessageBox(hOwner,STRING_WINDOW_RENAME_MUST_WINDOWNAME,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+						break;
+					}
+					if(GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWHANDLE))==0){
+						//MsgBox "ハンドル名を入力して下さい。"
+						MessageBox(hOwner,STRING_WINDOW_RENAME_MUST_HANDLENAME,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+						break;
+					}
+					if(GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWPROC))==0){
+						//MsgBox "プロシージャ名を入力して下さい。"
+						MessageBox(hOwner,STRING_WINDOW_RENAME_MUST_PROCEDURENAME,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+						break;
+					}
+
+					i=GetWndNum(GetWindow(hClient,GW_CHILD));
+					i2=GetWndInfoNum(MdiInfo[i].path);
+
+					RAD_UNDOSTATE_NAME names,NoticeNames;
+					i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWNAME))+1;
+					names.name=(char *)HeapAlloc(hHeap,0,i3);
+					GetDlgItemText(hwnd,IDC_WINDOWNAME,names.name,i3);
+
+					i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWHANDLE))+1;
+					names.HandleName=(char *)HeapAlloc(hHeap,0,i3);
+					GetDlgItemText(hwnd,IDC_WINDOWHANDLE,names.HandleName,i3);
+
+					i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_WINDOWPROC))+1;
+					names.CallBackName=(char *)HeapAlloc(hHeap,0,i3);
+					GetDlgItemText(hwnd,IDC_WINDOWPROC,names.CallBackName,i3);
+
+					if(lstrcmp(names.name,ProjectInfo.pWindowInfo[i2].name)==0&&
+						lstrcmp(names.HandleName,ProjectInfo.pWindowInfo[i2].HandleName)==0&&
+						lstrcmp(names.CallBackName,ProjectInfo.pWindowInfo[i2].CallBackName)==0){
+						HeapDefaultFree(names.name);
+						HeapDefaultFree(names.HandleName);
+						HeapDefaultFree(names.CallBackName);
+						SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
+						return 1;
+					}
+
+					//MsgBox "これらのウィンドウ識別名を変更すると、ソースコード内の識別子は手動で変換する必要があります。変更しますか？"
+					if(IDCANCEL==MessageBox(hwnd,STRING_WINDOW_RENAME_CHECK,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) return 1;
+
+					//変更情報を更新
+					NoticeNames.name=ProjectInfo.pWindowInfo[i2].name;
+					NoticeNames.HandleName=ProjectInfo.pWindowInfo[i2].HandleName;
+					NoticeNames.CallBackName=ProjectInfo.pWindowInfo[i2].CallBackName;
+					Rad_NoticeChanging(i,RAD_UNDO_NAME,SELECT_WINDOW,(DWORD)&NoticeNames);
+
+					HeapDefaultFree(ProjectInfo.pWindowInfo[i2].name);
+					ProjectInfo.pWindowInfo[i2].name=names.name;
+					GlobalFree(MdiInfo[i].path);
+					MdiInfo[i].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(names.name));
+					lstrcpy(MdiInfo[i].path,names.name);
+
+					HeapDefaultFree(ProjectInfo.pWindowInfo[i2].HandleName);
+					ProjectInfo.pWindowInfo[i2].HandleName=names.HandleName;
+
+					HeapDefaultFree(ProjectInfo.pWindowInfo[i2].CallBackName);
+					ProjectInfo.pWindowInfo[i2].CallBackName=names.CallBackName;
+
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+				case IDC_WINDOWNAME:
+					if(HIWORD(wParam)==EN_CHANGE) SendMessage(hwnd,WM_COMMAND,IDC_AUTOSET,0);
+					return 1;
+				case IDC_AUTOSET:
+					if(SendDlgItemMessage(hwnd,IDC_AUTOSET,BM_GETCHECK,0,0)){
+						SendDlgItemMessage(hwnd,IDC_WINDOWHANDLE,EM_SETREADONLY,1,0);
+						SendDlgItemMessage(hwnd,IDC_WINDOWPROC,EM_SETREADONLY,1,0);
+						GetDlgItemText(hwnd,IDC_WINDOWNAME,temporary,MAX_PATH);
+						if(temporary[0]){
+							sprintf(temp2,"h%s",temporary);
+							SetDlgItemText(hwnd,IDC_WINDOWHANDLE,temp2);
+							sprintf(temp2,"%sProc",temporary);
+							SetDlgItemText(hwnd,IDC_WINDOWPROC,temp2);
+						}
+						else{
+							SetDlgItemText(hwnd,IDC_WINDOWHANDLE,"");
+							SetDlgItemText(hwnd,IDC_WINDOWPROC,"");
+						}
+					}
+					else{
+						SendDlgItemMessage(hwnd,IDC_WINDOWHANDLE,EM_SETREADONLY,0,0);
+						SendDlgItemMessage(hwnd,IDC_WINDOWPROC,EM_SETREADONLY,0,0);
+					}
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+BOOL CALLBACK DlgRadProperty_Window_ExStyle(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+			i=GetWndNum(GetWindow(hClient,GW_CHILD));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+			if(ProjectInfo.pWindowInfo[i2].ExStyle&WS_EX_TOPMOST) SendDlgItemMessage(hwnd,IDC_EXSTYLE_TOPMOST,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].ExStyle&WS_EX_ACCEPTFILES) SendDlgItemMessage(hwnd,IDC_EXSTYLE_ACCEPTFILES,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].ExStyle&WS_EX_TRANSPARENT) SendDlgItemMessage(hwnd,IDC_EXSTYLE_TRANSPARENT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].ExStyle&WS_EX_TOOLWINDOW) SendDlgItemMessage(hwnd,IDC_EXSTYLE_TOOLWINDOW,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].ExStyle&WS_EX_CLIENTEDGE) SendDlgItemMessage(hwnd,IDC_EXSTYLE_CLIENTEDGE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].ExStyle&WS_EX_STATICEDGE) SendDlgItemMessage(hwnd,IDC_EXSTYLE_STATICEDGE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].ExStyle&WS_EX_NOPARENTNOTIFY) SendDlgItemMessage(hwnd,IDC_EXSTYLE_NOPARENTNOTIFY,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].ExStyle&WS_EX_CONTEXTHELP) SendDlgItemMessage(hwnd,IDC_EXSTYLE_CONTEXTHELP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].ExStyle&WS_EX_CONTROLPARENT) SendDlgItemMessage(hwnd,IDC_EXSTYLE_CONTROLPARENT,BM_SETCHECK,BST_CHECKED,0);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					i=GetWndNum(GetWindow(hClient,GW_CHILD));
+					i2=GetWndInfoNum(MdiInfo[i].path);
+
+					DWORD style;
+					style=0;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_TOPMOST,BM_GETCHECK,0,0))
+						style|=WS_EX_TOPMOST;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_ACCEPTFILES,BM_GETCHECK,0,0))
+						style|=WS_EX_ACCEPTFILES;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_TRANSPARENT,BM_GETCHECK,0,0))
+						style|=WS_EX_TRANSPARENT;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_TOOLWINDOW,BM_GETCHECK,0,0))
+						style|=WS_EX_TOOLWINDOW;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_CLIENTEDGE,BM_GETCHECK,0,0))
+						style|=WS_EX_CLIENTEDGE;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_STATICEDGE,BM_GETCHECK,0,0))
+						style|=WS_EX_STATICEDGE;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_NOPARENTNOTIFY,BM_GETCHECK,0,0))
+						style|=WS_EX_NOPARENTNOTIFY;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_CONTEXTHELP,BM_GETCHECK,0,0))
+						style|=WS_EX_CONTEXTHELP;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_CONTROLPARENT,BM_GETCHECK,0,0))
+						style|=WS_EX_CONTROLPARENT;
+
+					if(style==ProjectInfo.pWindowInfo[i2].ExStyle){
+						SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
+						return 1;
+					}
+
+					//変更情報
+					Rad_NoticeChanging(i,RAD_UNDO_EXSTYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].ExStyle);
+
+					ProjectInfo.pWindowInfo[i2].ExStyle=style;
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+BOOL CALLBACK RadProperty_WindowProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3,i4;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_WINDOWNAME,ProjectInfo.pWindowInfo[i2].name);
+			SetDlgItemText(hwnd,IDC_HANDLE,ProjectInfo.pWindowInfo[i2].HandleName);
+			SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[i2].caption);
+
+			//"3D FACE（標準）"
+			SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_BGCOLOR1);
+			//"色指定"
+			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);
+			if(ProjectInfo.pWindowInfo[i2].type==WNDTYPE_MODALDLG||
+				ProjectInfo.pWindowInfo[i2].type==WNDTYPE_MODELESSDLG){
+				SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,0,0);
+				EnableWindow(GetDlgItem(hwnd,IDC_BGCOLOR),0);
+			}
+			else{
+				if(ProjectInfo.pWindowInfo[i2].bgColor==COLOR_3DFACE){
+					//3DFACE
+					SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,0,0);
+				}
+				else if(ProjectInfo.pWindowInfo[i2].bgColor<=0){
+					//色指定
+					SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,1,0);
+				}
+				else if(ProjectInfo.pWindowInfo[i2].bgColor>=0x1000){
+					//ビットマップ指定
+					SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,2+ProjectInfo.pWindowInfo[i2].bgColor-0x1000,0);
+				}
+			}
+
+
+			////////////
+			// メニュー
+			////////////
+
+			//"なし"
+			SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_ADDSTRING,0,(long)STRING_NONE_);
+
+			for(i3=0,i4=0;i3<ProjectInfo.NumberOfMenu;i3++){
+				if(ProjectInfo.pWindowInfo[i2].MenuID){
+					if(lstrcmpi(ProjectInfo.pMenuInfo[i3].IdName,ProjectInfo.pWindowInfo[i2].MenuID)==0)
+						i4=i3+1;
+				}
+				SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_ADDSTRING,0,(long)ProjectInfo.pMenuInfo[i3].IdName);
+			}
+			if(i4==0&&ProjectInfo.pWindowInfo[i2].MenuID){
+				//メニューが存在しない場合、無効にする
+				HeapDefaultFree(ProjectInfo.pWindowInfo[i2].MenuID);
+				ProjectInfo.pWindowInfo[i2].MenuID=0;
+				DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+			}
+			SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_SETCURSEL,i4,0);
+
+
+			////////////
+			// アイコン
+			////////////
+
+			//"Windowsロゴ（標準）"
+			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(ProjectInfo.pWindowInfo[i2].IconResName,ProjectInfo.res.pIconResInfo[i3].IdName)==0)
+					i4=i3+1;
+			}
+			if(i4==0&&ProjectInfo.pWindowInfo[i2].IconResName){
+				//アイコンが存在しない場合、無効にする
+				HeapDefaultFree(ProjectInfo.pWindowInfo[i2].IconResName);
+				ProjectInfo.pWindowInfo[i2].IconResName=0;
+				DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+			}
+			SendDlgItemMessage(hwnd,IDC_ICONRES,CB_SETCURSEL,i4,0);
+
+
+			////////////
+			// スタイル
+			////////////
+
+			//"オーバーラップ"
+			SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_STYLE_OVERLAPPED);
+			//"ポップアップ"
+			SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_STYLE_POPUP);
+			//"チャイルド"
+			SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_STYLE_CHILD);
+
+			if(ProjectInfo.pWindowInfo[i2].style&WS_POPUP) SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].style&WS_CHILD) SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_SETCURSEL,0,0);
+
+			//"枠なし"
+			SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_STYLE_FRAME_NONE);
+			//"細枠"
+			SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_STYLE_FRAME_THICK);
+			//"サイズ変更枠"
+			SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_ADDSTRING,0,(long)STRING_WINDOWPROP_STYLE_FRAME_BORDER);
+
+			//WS_CAPTION（WS_BORDER含む）を考慮してWS_THICKFRAMEを最初に比較する
+			if(ProjectInfo.pWindowInfo[i2].style&WS_THICKFRAME) SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,2,0);
+			else if(ProjectInfo.pWindowInfo[i2].style&WS_BORDER) SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,1,0);
+			else SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_SETCURSEL,0,0);
+
+			if(ProjectInfo.pWindowInfo[i2].style&WS_CAPTION) SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].style&WS_SYSMENU) SendDlgItemMessage(hwnd,IDC_STYLE_SYSMENU,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].style&WS_MINIMIZEBOX) SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZEBOX,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].style&WS_MAXIMIZEBOX) SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZEBOX,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].style&WS_MINIMIZE) SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].style&WS_MAXIMIZE) SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].style&WS_HSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLLBAR,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].style&WS_VSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLLBAR,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].style&WS_CLIPSIBLINGS) SendDlgItemMessage(hwnd,IDC_STYLE_CLIPSIBLINGS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].style&WS_CLIPCHILDREN) SendDlgItemMessage(hwnd,IDC_STYLE_CLIPCHILDREN,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+
+			SetDlgItemText(hwnd,IDC_SETFONT,ProjectInfo.pWindowInfo[i2].LogFont.lfFaceName);
+
+			RadProperty_Window_Window_StylingOrder(hwnd,&ProjectInfo.pWindowInfo[i2].style);
+
+
+			//////////
+			//タイプ
+			switch(ProjectInfo.pWindowInfo[i2].type){
+				case WNDTYPE_DEFAULT:
+					SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_SETCHECK,BST_CHECKED,0);
+					break;
+				case WNDTYPE_MODALDLG:
+					SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_SETCHECK,BST_CHECKED,0);
+					break;
+				case WNDTYPE_MODELESSDLG:
+					SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_SETCHECK,BST_CHECKED,0);
+					break;
+			}
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_RENAMEWINDOW:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW_RENAME),hwnd,DlgRadProperty_Window_Rename)) return 1;
+					i=GetWndNum(GetParent(GetParent(hwnd)));
+					i2=GetWndInfoNum(MdiInfo[i].path);
+					SetDlgItemText(hwnd,IDC_WINDOWNAME,ProjectInfo.pWindowInfo[i2].name);
+					SetDlgItemText(hwnd,IDC_HANDLE,ProjectInfo.pWindowInfo[i2].HandleName);
+					return 1;
+				case IDC_RENAMECAPTION:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_RENAMECAPTION),hwnd,DlgRadProperty_Item_RenameCaption)) return 1;
+					i=GetWndNum(GetParent(GetParent(hwnd)));
+					i2=GetWndInfoNum(MdiInfo[i].path);
+					SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[i2].caption);
+					return 1;
+				case IDC_SETFONT:
+					i=GetWndNum(GetParent(GetParent(hwnd)));
+					i2=GetWndInfoNum(MdiInfo[i].path);
+					LOGFONT lf;
+					lf=ProjectInfo.pWindowInfo[i2].LogFont;
+					if(!SetFontDialog(hwnd,&ProjectInfo.pWindowInfo[i2].LogFont,0)) return 1;
+
+					//変更情報
+					Rad_NoticeChanging(i,RAD_UNDO_FONT,SELECT_WINDOW,(DWORD)&lf);
+
+					SetDlgItemText(hwnd,IDC_SETFONT,ProjectInfo.pWindowInfo[i2].LogFont.lfFaceName);
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+				case IDC_BGCOLOR:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						i3=SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_GETCURSEL,0,0);
+						if(i3==0){
+							//3DFACE
+
+							//変更情報
+							Rad_NoticeChanging(i,RAD_UNDO_BGCOLOR,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].bgColor);
+
+							ProjectInfo.pWindowInfo[i2].bgColor=COLOR_3DFACE;
+						}
+						else if(i3==1){
+							//色指定
+							CHOOSECOLOR cc;
+							COLORREF CusColors[16]={
+								RGB(255,255,255),
+								RGB(0,0,0),
+								RGB(128,128,128),
+								RGB(192,192,192),
+								RGB(128,0,0),
+								RGB(255,0,0),
+								RGB(128,128,0),
+								RGB(255,255,0),
+								RGB(0,128,0),
+								RGB(0,255,0),
+								RGB(0,128,128),
+								RGB(0,255,255),
+								RGB(0,0,128),
+								RGB(0,0,255),
+								RGB(128,0,128),
+								RGB(255,0,255)};
+							cc.lStructSize=sizeof(CHOOSECOLOR);
+							cc.hwndOwner=hwnd;
+							if(ProjectInfo.pWindowInfo[i2].bgColor<=0)
+								cc.rgbResult=-ProjectInfo.pWindowInfo[i2].bgColor;
+							else cc.rgbResult=RGB(255,255,255);
+							cc.lpCustColors=CusColors;
+							cc.Flags=CC_RGBINIT|CC_FULLOPEN;
+							if(!ChooseColor(&cc)){
+								//キャンセル動作
+								if(ProjectInfo.pWindowInfo[i2].bgColor==COLOR_3DFACE){
+									//3DFACE
+									SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,0,0);
+								}
+								else if(ProjectInfo.pWindowInfo[i2].bgColor<=0){
+									//色指定
+									SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,1,0);
+								}
+								else if(ProjectInfo.pWindowInfo[i2].bgColor>=0x1000){
+									//ビットマップ指定
+									SendDlgItemMessage(hwnd,IDC_BGCOLOR,CB_SETCURSEL,2+ProjectInfo.pWindowInfo[i2].bgColor-0x1000,0);
+								}
+								return 1;
+							}
+
+							//変更情報
+							Rad_NoticeChanging(i,RAD_UNDO_BGCOLOR,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].bgColor);
+
+							ProjectInfo.pWindowInfo[i2].bgColor=-(int)cc.rgbResult;
+						}
+						else{
+							//ビットマップ
+							i3-=2;
+
+							//変更情報
+							Rad_NoticeChanging(i,RAD_UNDO_BGCOLOR,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].bgColor);
+
+							ProjectInfo.pWindowInfo[i2].bgColor=0x1000+i3;
+						}
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_WINDOWMENU:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_WINDOWMENU,SELECT_WINDOW,(long)ProjectInfo.pWindowInfo[i2].MenuID);
+
+						i3=SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_GETCURSEL,0,0);
+						if(ProjectInfo.pWindowInfo[i2].MenuID)
+							HeapDefaultFree(ProjectInfo.pWindowInfo[i2].MenuID);
+						if(i3==0) ProjectInfo.pWindowInfo[i2].MenuID=0;
+						else{
+							ProjectInfo.pWindowInfo[i2].MenuID=(char *)HeapAlloc(hHeap,0,SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_GETLBTEXTLEN,i3,0)+1);
+							SendDlgItemMessage(hwnd,IDC_WINDOWMENU,CB_GETLBTEXT,i3,(long)ProjectInfo.pWindowInfo[i2].MenuID);
+						}
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_ICONRES:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_ICONRES,SELECT_WINDOW,(long)ProjectInfo.pWindowInfo[i2].IconResName);
+
+						i3=SendDlgItemMessage(hwnd,IDC_ICONRES,CB_GETCURSEL,0,0);
+						if(ProjectInfo.pWindowInfo[i2].IconResName)
+							HeapDefaultFree(ProjectInfo.pWindowInfo[i2].IconResName);
+						if(i3==0) ProjectInfo.pWindowInfo[i2].IconResName=0;
+						else{
+							ProjectInfo.pWindowInfo[i2].IconResName=(char *)HeapAlloc(hHeap,0,SendDlgItemMessage(hwnd,IDC_ICONRES,CB_GETLBTEXTLEN,i3,0)+1);
+							SendDlgItemMessage(hwnd,IDC_ICONRES,CB_GETLBTEXT,i3,(long)ProjectInfo.pWindowInfo[i2].IconResName);
+						}
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_WINDOWSTYLE:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_WINDOWSTYLE,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].style&=0x3FFFFFFF;
+						if(i3==1) ProjectInfo.pWindowInfo[i2].style|=WS_POPUP;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].style|=WS_CHILD;
+						RadProperty_Window_Window_StylingOrder(hwnd,&ProjectInfo.pWindowInfo[i2].style);
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BORDERSTYLE:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_BORDERSTYLE,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].style&=~(WS_BORDER|WS_THICKFRAME);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].style|=WS_BORDER;
+						else if(i3==2){
+							ProjectInfo.pWindowInfo[i2].style|=WS_BORDER;
+							ProjectInfo.pWindowInfo[i2].style|=WS_THICKFRAME;
+						}
+						RadProperty_Window_Border_StylingOrder(hwnd,&ProjectInfo.pWindowInfo[i2].style);
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_STYLE_CAPTION:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_CAPTION,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].style|=WS_CAPTION;
+						else
+							ProjectInfo.pWindowInfo[i2].style&=~WS_CAPTION;
+						RadProperty_Window_Caption_StylingOrder(hwnd,&ProjectInfo.pWindowInfo[i2].style);
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_STYLE_SYSMENU:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_SYSMENU,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].style|=WS_SYSMENU;
+						else
+							ProjectInfo.pWindowInfo[i2].style&=~WS_SYSMENU;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_STYLE_MINIMIZEBOX:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZEBOX,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].style|=WS_MINIMIZEBOX;
+						else
+							ProjectInfo.pWindowInfo[i2].style&=~WS_MINIMIZEBOX;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_STYLE_MAXIMIZEBOX:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZEBOX,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].style|=WS_MAXIMIZEBOX;
+						else
+							ProjectInfo.pWindowInfo[i2].style&=~WS_MAXIMIZEBOX;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_STYLE_MINIMIZE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_MINIMIZE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].style|=WS_MINIMIZE;
+						else
+							ProjectInfo.pWindowInfo[i2].style&=~WS_MINIMIZE;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_STYLE_MAXIMIZE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_MAXIMIZE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].style|=WS_MAXIMIZE;
+						else
+							ProjectInfo.pWindowInfo[i2].style&=~WS_MAXIMIZE;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+				case IDC_STYLE_HSCROLLBAR:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLLBAR,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].style|=WS_HSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].style&=~WS_HSCROLL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+				case IDC_STYLE_VSCROLLBAR:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLLBAR,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].style|=WS_VSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].style&=~WS_VSCROLL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_STYLE_DISABLED:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].style|=WS_DISABLED;
+						else
+							ProjectInfo.pWindowInfo[i2].style&=~WS_DISABLED;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_STYLE_CLIPSIBLINGS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_CLIPSIBLINGS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].style|=WS_CLIPSIBLINGS;
+						else
+							ProjectInfo.pWindowInfo[i2].style&=~WS_CLIPSIBLINGS;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_STYLE_CLIPCHILDREN:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_CLIPCHILDREN,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].style|=WS_CLIPCHILDREN;
+						else
+							ProjectInfo.pWindowInfo[i2].style&=~WS_CLIPCHILDREN;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_STYLE_VISIBLE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].style|=WS_VISIBLE;
+						else
+							ProjectInfo.pWindowInfo[i2].style&=~WS_VISIBLE;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_WINDOW_EXSTYLE),hwnd,DlgRadProperty_Window_ExStyle)) return 1;
+					i=GetWndNum(GetParent(GetParent(hwnd)));
+					i2=GetWndInfoNum(MdiInfo[i].path);
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+
+				case IDC_DEFWINDOW:
+				case IDC_MODALDLG:
+				case IDC_MODELESSDLG:
+					if(HIWORD(wParam)==BN_CLICKED){
+						i=GetWndNum(GetParent(GetParent(hwnd)));
+						i2=GetWndInfoNum(MdiInfo[i].path);
+
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_TYPE,SELECT_WINDOW,ProjectInfo.pWindowInfo[i2].type);
+
+						if(SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].type=WNDTYPE_DEFAULT;
+						else if(SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].type=WNDTYPE_MODALDLG;
+						else if(SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].type=WNDTYPE_MODELESSDLG;
+						return 1;
+					}
+					break;
+			}
+			break;
+	}
+	return 0;
+}
+
+BOOL CALLBACK DlgRadProperty_Item_RenameCaption(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	char *temporary;
+	POINTANDSIZE PointAndSize;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+			i=GetWndNum(GetWindow(hClient,GW_CHILD));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+			if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
+				SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[i2].caption);
+			else
+				SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					i=GetWndNum(GetWindow(hClient,GW_CHILD));
+					i2=GetWndInfoNum(MdiInfo[i].path);
+
+					i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_CAPTION))+1;
+					temporary=(char *)HeapAlloc(hHeap,0,i3);
+					GetDlgItemText(hwnd,IDC_CAPTION,temporary,i3);
+					if(MdiInfo[i].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW){
+						if(lstrcmp(temporary,ProjectInfo.pWindowInfo[i2].caption)==0){
+							HeapDefaultFree(temporary);
+							SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
+							return 1;
+						}
+
+						//変更情報を更新
+						Rad_NoticeChanging(i,RAD_UNDO_CAPTION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)ProjectInfo.pWindowInfo[i2].caption);
+
+						HeapDefaultFree(ProjectInfo.pWindowInfo[i2].caption);
+						ProjectInfo.pWindowInfo[i2].caption=temporary;
+					}
+					else{
+						if(lstrcmp(temporary,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption)==0){
+							HeapDefaultFree(temporary);
+							SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
+							return 1;
+						}
+
+						//変更情報を更新
+						Rad_NoticeChanging(i,RAD_UNDO_CAPTION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption);
+
+						HeapDefaultFree(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption=temporary;
+
+						if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].Control==CT_STATIC){
+							//スタティック テキスト
+							//テキストが表示できるようにサイズを拡大する
+
+							PointAndSize.pos=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].pos;
+							PointAndSize.size=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size;
+							Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
+
+							HFONT hFont,hOldFont;
+							hFont=CreateFontIndirect(&ProjectInfo.pWindowInfo[i2].LogFont);
+							hOldFont=(HFONT)SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,hFont);
+							GetTextExtentPoint32(MdiInfo[i].MdiRadInfo->hMemDC,temporary,lstrlen(temporary),&PointAndSize.size);
+							SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,hOldFont);
+							DeleteObject(hFont);
+
+							//テキストの終端に余裕を持たせる
+							PointAndSize.size.cx+=5;
+
+							if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size.cx<PointAndSize.size.cx)
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size.cx=PointAndSize.size.cx;
+						}
+						if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].Control==CT_CHECKBOX){
+							//チェック ボックス
+							//テキストが表示できるようにサイズを拡大する
+
+							PointAndSize.pos=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].pos;
+							PointAndSize.size=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size;
+							Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
+
+							HFONT hFont,hOldFont;
+							hFont=CreateFontIndirect(&ProjectInfo.pWindowInfo[i2].LogFont);
+							hOldFont=(HFONT)SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,hFont);
+							GetTextExtentPoint32(MdiInfo[i].MdiRadInfo->hMemDC,temporary,lstrlen(temporary),&PointAndSize.size);
+							SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,hOldFont);
+							DeleteObject(hFont);
+
+							//テキストの終端に余裕を持たせる
+							PointAndSize.size.cx+=21;
+
+							if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size.cx<PointAndSize.size.cx)
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size.cx=PointAndSize.size.cx;
+						}
+						if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].Control==CT_RADIOBUTTON){
+							//ラジオ ボックス
+							//テキストが表示できるようにサイズを拡大する
+
+							PointAndSize.pos=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].pos;
+							PointAndSize.size=ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size;
+							Rad_NoticeChanging(i,RAD_UNDO_POSITION,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&PointAndSize);
+
+							HFONT hFont,hOldFont;
+							hFont=CreateFontIndirect(&ProjectInfo.pWindowInfo[i2].LogFont);
+							hOldFont=(HFONT)SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,hFont);
+							GetTextExtentPoint32(MdiInfo[i].MdiRadInfo->hMemDC,temporary,lstrlen(temporary),&PointAndSize.size);
+							SelectObject(MdiInfo[i].MdiRadInfo->hMemDC,hOldFont);
+							DeleteObject(hFont);
+
+							//テキストの終端に余裕を持たせる
+							PointAndSize.size.cx+=20;
+
+							if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size.cx<PointAndSize.size.cx)
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].size.cx=PointAndSize.size.cx;
+						}
+					}
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+BOOL CALLBACK DlgRadProperty_Item_RenameID(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern HWND hClient,hOwner;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	char *temporary;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+			i=GetWndNum(GetWindow(hClient,GW_CHILD));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					i=GetWndNum(GetWindow(hClient,GW_CHILD));
+					i2=GetWndInfoNum(MdiInfo[i].path);
+
+					i3=GetWindowTextLength(GetDlgItem(hwnd,IDC_IDNAME))+1;
+					if(i3==1){
+						//MsgBox "ID名を入力して下さい。"
+						MessageBox(hOwner,STRING_ITEM_RENAME_MUST_ID,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+						break;
+					}
+					temporary=(char *)HeapAlloc(hHeap,0,i3);
+					GetDlgItemText(hwnd,IDC_IDNAME,temporary,i3);
+					if(lstrcmp(temporary,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName)==0){
+						HeapDefaultFree(temporary);
+						SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
+						return 1;
+					}
+
+					//MsgBox "アイテムのID名を変更すると、ソースコード内のID名は手動で変換する必要があります。変更しますか？"
+					if(IDCANCEL==MessageBox(hwnd,STRING_ITEM_RENAME_CHECK,APPLICATION_NAME,MB_OKCANCEL|MB_ICONEXCLAMATION)) return 1;
+
+					//変更情報を更新
+					Rad_NoticeChanging(i,RAD_UNDO_NAME,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+
+					HeapDefaultFree(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+					ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName=temporary;
+
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+BOOL DefaultItemStyles(HWND hwnd,int WndNum,int WndInfoNum,WPARAM wParam){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+
+	switch(LOWORD(wParam)){
+		case IDC_RENAMEID:
+			if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_RENAMEID),hwnd,DlgRadProperty_Item_RenameID)) return 1;
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].IdName);
+			return 1;
+		case IDC_RENAMECAPTION:
+			if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_RENAMECAPTION),hwnd,DlgRadProperty_Item_RenameCaption)) return 1;
+			SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].caption);
+			return 1;
+		case IDC_STYLE_DISABLED:
+			if(HIWORD(wParam)==BN_CLICKED){
+				//変更情報
+				Rad_NoticeChanging(WndNum,RAD_UNDO_STYLE,MdiInfo[WndNum].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].style);
+
+				if(SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_GETCHECK,0,0))
+					ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].style|=WS_DISABLED;
+				else
+					ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].style&=~WS_DISABLED;
+				DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+				return 1;
+			}
+			break;
+		case IDC_STYLE_VISIBLE:
+			if(HIWORD(wParam)==BN_CLICKED){
+				//変更情報
+				Rad_NoticeChanging(WndNum,RAD_UNDO_STYLE,MdiInfo[WndNum].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].style);
+
+				if(SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_GETCHECK,0,0))
+					ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].style|=WS_VISIBLE;
+				else
+					ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].style&=~WS_VISIBLE;
+				return 1;
+			}
+			break;
+		case IDC_STYLE_GROUP:
+			if(HIWORD(wParam)==BN_CLICKED){
+				//変更情報
+				Rad_NoticeChanging(WndNum,RAD_UNDO_STYLE,MdiInfo[WndNum].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].style);
+
+				if(SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_GETCHECK,0,0))
+					ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].style|=WS_GROUP;
+				else
+					ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].style&=~WS_GROUP;
+				return 1;
+			}
+			break;
+		case IDC_STYLE_TABSTOP:
+			if(HIWORD(wParam)==BN_CLICKED){
+				//変更情報
+				Rad_NoticeChanging(WndNum,RAD_UNDO_STYLE,MdiInfo[WndNum].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].style);
+
+				if(SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_GETCHECK,0,0))
+					ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].style|=WS_TABSTOP;
+				else
+					ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]].style&=~WS_TABSTOP;
+				return 1;
+			}
+			break;
+	}
+	return 0;
+}
+BOOL CALLBACK DlgRadProperty_Item_ExStyle(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+			i=GetWndNum(GetWindow(hClient,GW_CHILD));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ExStyle&WS_EX_ACCEPTFILES) SendDlgItemMessage(hwnd,IDC_EXSTYLE_ACCEPTFILES,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ExStyle&WS_EX_TRANSPARENT) SendDlgItemMessage(hwnd,IDC_EXSTYLE_TRANSPARENT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ExStyle&WS_EX_DLGMODALFRAME) SendDlgItemMessage(hwnd,IDC_EXSTYLE_DLGMODALFRAME,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ExStyle&WS_EX_CLIENTEDGE) SendDlgItemMessage(hwnd,IDC_EXSTYLE_CLIENTEDGE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ExStyle&WS_EX_STATICEDGE) SendDlgItemMessage(hwnd,IDC_EXSTYLE_STATICEDGE,BM_SETCHECK,BST_CHECKED,0);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					i=GetWndNum(GetWindow(hClient,GW_CHILD));
+					i2=GetWndInfoNum(MdiInfo[i].path);
+
+					DWORD style;
+					style=0;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_ACCEPTFILES,BM_GETCHECK,0,0))
+						style|=WS_EX_ACCEPTFILES;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_TRANSPARENT,BM_GETCHECK,0,0))
+						style|=WS_EX_TRANSPARENT;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_DLGMODALFRAME,BM_GETCHECK,0,0))
+						style|=WS_EX_DLGMODALFRAME;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_CLIENTEDGE,BM_GETCHECK,0,0))
+						style|=WS_EX_CLIENTEDGE;
+					if(SendDlgItemMessage(hwnd,IDC_EXSTYLE_STATICEDGE,BM_GETCHECK,0,0))
+						style|=WS_EX_STATICEDGE;
+
+					if(style==ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ExStyle){
+						SendMessage(hwnd,WM_COMMAND,IDCANCEL,0);
+						return 1;
+					}
+
+					//変更情報
+					Rad_NoticeChanging(i,RAD_UNDO_EXSTYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ExStyle);
+
+					ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ExStyle=style;
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+/////////////////////
+// BUTTON プロパティ
+
+BOOL CALLBACK RadProperty_ButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+			SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption);
+
+
+			////////////
+			//スタイル
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_OWNERDRAW)==BS_OWNERDRAW) SendDlgItemMessage(hwnd,IDC_BS_OWNERDRAW,BM_SETCHECK,BST_CHECKED,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_DEFPUSHBUTTON) SendDlgItemMessage(hwnd,IDC_BS_DEFPUSHBUTTON,BM_SETCHECK,BST_CHECKED,0);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_ICON) SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_BITMAP) SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_MULTILINE) SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_NOTIFY) SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_SETCHECK,BST_CHECKED,0);
+
+
+			//////////////////
+			// 水平方向の配置
+			//////////////////
+
+			//"デフォルト"
+			SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_DEFAULT);
+			//"左端"
+			SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_LEFT);
+			//"右端"
+			SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_RIGHT);
+			//"中央"
+			SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
+
+			//ビットを考慮してBS_CENTERを最初に比較する
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_CENTER)==BS_CENTER) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,3,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_LEFT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_RIGHT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,0,0);
+
+
+			//////////////////
+			// 垂直方向の配置
+			//////////////////
+
+			//"デフォルト"
+			SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_DEFAULT);
+			//"上端"
+			SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_TOP);
+			//"下端"
+			SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_BOTTOM);
+			//"中央"
+			SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
+
+			//ビットを考慮してBS_VCENTERを最初に比較する
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_VCENTER)==BS_VCENTER) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,3,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_TOP) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_BOTTOM) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,0,0);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_BS_DEFPUSHBUTTON:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_DEFPUSHBUTTON,BM_GETCHECK,0,0)){
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_OWNERDRAW;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_DEFPUSHBUTTON;
+							SendDlgItemMessage(hwnd,IDC_BS_OWNERDRAW,BM_SETCHECK,BST_UNCHECKED,0);
+						}
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_DEFPUSHBUTTON;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_OWNERDRAW:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_OWNERDRAW,BM_GETCHECK,0,0)){
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_DEFPUSHBUTTON;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_OWNERDRAW;
+							SendDlgItemMessage(hwnd,IDC_BS_DEFPUSHBUTTON,BM_SETCHECK,BST_UNCHECKED,0);
+						}
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_OWNERDRAW;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_ICON:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_GETCHECK,0,0)){
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_ICON;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_BITMAP;
+							SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_UNCHECKED,0);
+						}
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_ICON;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_BITMAP:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_GETCHECK,0,0)){
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_BITMAP;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_ICON;
+							SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_UNCHECKED,0);
+						}
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_BITMAP;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_MULTILINE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_MULTILINE;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_MULTILINE;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_NOTIFY:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_NOTIFY;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_NOTIFY;
+						return 1;
+					}
+					break;
+
+				case IDC_BS_HPOS:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(BS_LEFT|BS_RIGHT|BS_CENTER);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_LEFT;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_RIGHT;
+						else if(i3==3) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_CENTER;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_VPOS:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(BS_TOP|BS_BOTTOM|BS_VCENTER);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_TOP;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_BOTTOM;
+						else if(i3==3) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_VCENTER;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+////////////////////////
+// CHECKBOX プロパティ
+BOOL CALLBACK RadProperty_CheckBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+			SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption);
+
+
+			////////////
+			//スタイル
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_AUTOCHECKBOX)==BS_AUTOCHECKBOX) SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_SETCHECK,BST_CHECKED,0);
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_AUTO3STATE)==BS_AUTO3STATE){
+				SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_SETCHECK,BST_CHECKED,0);
+				SendDlgItemMessage(hwnd,IDC_BS_3STATE,BM_SETCHECK,BST_CHECKED,0);
+			}
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_3STATE)==BS_3STATE) SendDlgItemMessage(hwnd,IDC_BS_3STATE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_PUSHLIKE) SendDlgItemMessage(hwnd,IDC_BS_PUSHLIKE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_LEFTTEXT) SendDlgItemMessage(hwnd,IDC_BS_LEFTTEXT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_ICON) SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_BITMAP) SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_MULTILINE) SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_NOTIFY) SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_SETCHECK,BST_CHECKED,0);
+
+
+			//////////////////
+			// 水平方向の配置
+			//////////////////
+
+			//"デフォルト"
+			SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_DEFAULT);
+			//"左端"
+			SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_LEFT);
+			//"右端"
+			SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_RIGHT);
+			//"中央"
+			SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
+
+			//ビットを考慮してBS_CENTERを最初に比較する
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_CENTER)==BS_CENTER) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,3,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_LEFT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_RIGHT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,0,0);
+
+
+			//////////////////
+			// 垂直方向の配置
+			//////////////////
+
+			//"デフォルト"
+			SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_DEFAULT);
+			//"上端"
+			SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_TOP);
+			//"下端"
+			SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_BOTTOM);
+			//"中央"
+			SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
+
+			//ビットを考慮してBS_VCENTERを最初に比較する
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_VCENTER)==BS_VCENTER) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,3,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_TOP) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_BOTTOM) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,0,0);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_BS_AUTO:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_GETCHECK,0,0)){
+							if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x04){
+								//3state
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=0xFFFFFFF0;
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_AUTO3STATE;
+							}
+							else{
+								//2state
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=0xFFFFFFF0;
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_AUTOCHECKBOX;
+							}
+						}
+						else{
+							if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x04){
+								//3state
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=0xFFFFFFF0;
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_3STATE;
+							}
+							else{
+								//2state
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=0xFFFFFFF0;
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_CHECKBOX;
+							}
+						}
+						return 1;
+					}
+					break;
+				case IDC_BS_3STATE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_3STATE,BM_GETCHECK,0,0)){
+							if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0F)==BS_CHECKBOX){
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=0xFFFFFFF0;
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_3STATE;
+							}
+							else if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0F)==BS_AUTOCHECKBOX){
+								//自動チェック
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=0xFFFFFFF0;
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_AUTO3STATE;
+							}
+						}
+						else{
+							if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0F)==BS_3STATE){
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=0xFFFFFFF0;
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_CHECKBOX;
+							}
+							else if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0F)==BS_AUTO3STATE){
+								//自動チェック
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=0xFFFFFFF0;
+								ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_AUTOCHECKBOX;
+							}
+						}
+						return 1;
+					}
+					break;
+				case IDC_BS_PUSHLIKE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_PUSHLIKE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_PUSHLIKE;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_PUSHLIKE;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_LEFTTEXT:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_LEFTTEXT,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_LEFTTEXT;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_LEFTTEXT;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_ICON:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_GETCHECK,0,0)){
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_ICON;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_BITMAP;
+							SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_UNCHECKED,0);
+						}
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_ICON;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_BITMAP:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_GETCHECK,0,0)){
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_BITMAP;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_ICON;
+							SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_UNCHECKED,0);
+						}
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_BITMAP;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_MULTILINE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_MULTILINE;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_MULTILINE;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_NOTIFY:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_NOTIFY;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_NOTIFY;
+						return 1;
+					}
+					break;
+
+				case IDC_BS_HPOS:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(BS_LEFT|BS_RIGHT|BS_CENTER);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_LEFT;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_RIGHT;
+						else if(i3==3) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_CENTER;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_VPOS:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(BS_TOP|BS_BOTTOM|BS_VCENTER);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_TOP;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_BOTTOM;
+						else if(i3==3) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_VCENTER;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+	}
+	return 0;
+}
+
+
+///////////////////////
+// COMBOBOX プロパティ
+
+void RadProperty_ComboBox_StylingOrder(HWND hwnd,DWORD *style){
+	if(!(*style&(CBS_OWNERDRAWFIXED|CBS_OWNERDRAWVARIABLE))){
+		*style&=~(CBS_HASSTRINGS);
+		SendDlgItemMessage(hwnd,IDC_CBS_HASSTRINGS,BM_SETCHECK,BST_UNCHECKED,0);
+		EnableWindow(GetDlgItem(hwnd,IDC_CBS_HASSTRINGS),0);
+	}
+	else EnableWindow(GetDlgItem(hwnd,IDC_CBS_HASSTRINGS),1);
+}
+BOOL CALLBACK RadProperty_ComboBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+
+
+			/////////////////////////////////
+			// スタイル
+			////////////
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+			////////
+			// 選択
+			////////
+
+			//"デフォルト"
+			SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_ADDSTRING,0,(long)STRING_DEFAULT);
+			//"ドロップ ダウン"
+			SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_ADDSTRING,0,(long)STRING_COMBOBOXPROP_STYLE_DROPDOWN);
+			//"ドロップ ダウン リスト"
+			SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_ADDSTRING,0,(long)STRING_COMBOBOXPROP_STYLE_DROPDOWNLIST);
+
+			//ビットを考慮してCBS_DROPDOWNLISTを最初に比較する
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_DROPDOWNLIST)==CBS_DROPDOWNLIST) SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_SETCURSEL,2,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_SIMPLE) SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_SETCURSEL,0,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_DROPDOWN) SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_SETCURSEL,1,0);
+
+
+			////////////////
+			// オーナー描画
+			////////////////
+
+			//"なし"
+			SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_ADDSTRING,0,(long)STRING_NONE_);
+			//"固定"
+			SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_ADDSTRING,0,(long)STRING_OWNERDRAW_FIXED);
+			//"可変"
+			SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_ADDSTRING,0,(long)STRING_OWNERDRAW_VARIABLE);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_OWNERDRAWFIXED) SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_OWNERDRAWVARIABLE) SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_SETCURSEL,0,0);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_HASSTRINGS) SendDlgItemMessage(hwnd,IDC_CBS_HASSTRINGS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_SORT) SendDlgItemMessage(hwnd,IDC_CBS_SORT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_NOINTEGRALHEIGHT) SendDlgItemMessage(hwnd,IDC_CBS_NOINTEGRALHEIGHT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_OEMCONVERT) SendDlgItemMessage(hwnd,IDC_CBS_OEMCONVERT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_AUTOHSCROLL) SendDlgItemMessage(hwnd,IDC_CBS_AUTOHSCROLL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_DISABLENOSCROLL) SendDlgItemMessage(hwnd,IDC_CBS_DISABLENOSCROLL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_UPPERCASE) SendDlgItemMessage(hwnd,IDC_CBS_UPPERCASE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&CBS_LOWERCASE) SendDlgItemMessage(hwnd,IDC_CBS_LOWERCASE,BM_SETCHECK,BST_CHECKED,0);
+
+			RadProperty_ComboBox_StylingOrder(hwnd,&ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_CBS_TYPE:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_CBS_TYPE,CB_GETCURSEL,0,0);
+						//CBS_DROPDOWNLIST=CBS_SIMPLE | CBS_DROPDOWN
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(CBS_DROPDOWNLIST);
+						if(i3==0) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_SIMPLE;
+						else if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_DROPDOWN;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_DROPDOWNLIST;
+
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_CBS_OWNERDRAW:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_CBS_OWNERDRAW,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(CBS_OWNERDRAWFIXED|CBS_OWNERDRAWVARIABLE);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_OWNERDRAWFIXED;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_OWNERDRAWVARIABLE;
+
+						RadProperty_ComboBox_StylingOrder(hwnd,&ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+						return 1;
+					}
+					break;
+
+				case IDC_CBS_HASSTRINGS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_CBS_HASSTRINGS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_HASSTRINGS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~CBS_HASSTRINGS;
+						return 1;
+					}
+					break;
+				case IDC_CBS_SORT:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_CBS_SORT,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_SORT;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~CBS_SORT;
+						return 1;
+					}
+					break;
+				case IDC_CBS_NOINTEGRALHEIGHT:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_CBS_NOINTEGRALHEIGHT,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_NOINTEGRALHEIGHT;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~CBS_NOINTEGRALHEIGHT;
+						return 1;
+					}
+					break;
+				case IDC_CBS_OEMCONVERT:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_CBS_OEMCONVERT,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_OEMCONVERT;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~CBS_OEMCONVERT;
+						return 1;
+					}
+					break;
+				case IDC_STYLE_VSCROLL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=WS_VSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~WS_VSCROLL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_CBS_AUTOHSCROLL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_CBS_AUTOHSCROLL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_AUTOHSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~CBS_AUTOHSCROLL;
+						return 1;
+					}
+					break;
+				case IDC_CBS_DISABLENOSCROLL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_CBS_DISABLENOSCROLL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_DISABLENOSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~CBS_DISABLENOSCROLL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_CBS_UPPERCASE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_CBS_UPPERCASE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_UPPERCASE;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~CBS_UPPERCASE;
+						return 1;
+					}
+					break;
+				case IDC_CBS_LOWERCASE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_CBS_LOWERCASE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=CBS_LOWERCASE;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~CBS_LOWERCASE;
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+/////////////////////
+// EDIT プロパティ
+
+void RadProperty_Edit_StylingOrder(HWND hwnd,DWORD *style){
+	if(*style&ES_MULTILINE){
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_HSCROLL),1);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_VSCROLL),1);
+		EnableWindow(GetDlgItem(hwnd,IDC_ES_AUTOVSCROLL),1);
+
+		*style&=~(ES_PASSWORD);
+		SendDlgItemMessage(hwnd,IDC_ES_PASSWORD,BM_SETCHECK,BST_UNCHECKED,0);
+		EnableWindow(GetDlgItem(hwnd,IDC_ES_PASSWORD),0);
+	}
+	else{
+		EnableWindow(GetDlgItem(hwnd,IDC_ES_PASSWORD),1);
+
+		*style&=~(WS_HSCROLL|WS_VSCROLL|ES_AUTOVSCROLL);
+		SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_SETCHECK,BST_UNCHECKED,0);
+		SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_SETCHECK,BST_UNCHECKED,0);
+		SendDlgItemMessage(hwnd,IDC_ES_AUTOVSCROLL,BM_SETCHECK,BST_UNCHECKED,0);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_HSCROLL),0);
+		EnableWindow(GetDlgItem(hwnd,IDC_STYLE_VSCROLL),0);
+		EnableWindow(GetDlgItem(hwnd,IDC_ES_AUTOVSCROLL),0);
+	}
+}
+BOOL CALLBACK RadProperty_EditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+			SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption);
+
+
+			////////////
+			// スタイル
+			////////////
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_MULTILINE) SendDlgItemMessage(hwnd,IDC_ES_MULTILINE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_NUMBER) SendDlgItemMessage(hwnd,IDC_ES_NUMBER,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_HSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_AUTOHSCROLL) SendDlgItemMessage(hwnd,IDC_ES_AUTOHSCROLL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_AUTOVSCROLL) SendDlgItemMessage(hwnd,IDC_ES_AUTOVSCROLL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_PASSWORD) SendDlgItemMessage(hwnd,IDC_ES_PASSWORD,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_NOHIDESEL) SendDlgItemMessage(hwnd,IDC_ES_NOHIDESEL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_OEMCONVERT) SendDlgItemMessage(hwnd,IDC_ES_OEMCONVERT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_WANTRETURN) SendDlgItemMessage(hwnd,IDC_ES_WANTRETURN,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_UPPERCASE) SendDlgItemMessage(hwnd,IDC_ES_UPPERCASE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_LOWERCASE) SendDlgItemMessage(hwnd,IDC_ES_LOWERCASE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_READONLY) SendDlgItemMessage(hwnd,IDC_ES_READONLY,BM_SETCHECK,BST_CHECKED,0);
+
+
+			//////////////////
+			// テキストの配置
+			//////////////////
+
+			//"左端"
+			SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_ADDSTRING,0,(long)STRING_LEFT);
+			//"中央"
+			SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
+			//"右端"
+			SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_ADDSTRING,0,(long)STRING_RIGHT);
+
+			//ビットを考慮してES_LEFTを最後に検討する
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_CENTER) SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&ES_RIGHT) SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_SETCURSEL,0,0);
+
+			RadProperty_Edit_StylingOrder(hwnd,&ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_ES_MULTILINE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_ES_MULTILINE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_MULTILINE;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_MULTILINE;
+						RadProperty_Edit_StylingOrder(hwnd,&ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_ES_NUMBER:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_ES_NUMBER,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_NUMBER;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_NUMBER;
+						return 1;
+					}
+					break;
+				case IDC_STYLE_HSCROLL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=WS_HSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~WS_HSCROLL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_ES_AUTOHSCROLL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_ES_AUTOHSCROLL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_AUTOHSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_AUTOHSCROLL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_STYLE_VSCROLL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=WS_VSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~WS_VSCROLL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_ES_AUTOVSCROLL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_ES_AUTOVSCROLL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_AUTOVSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_AUTOVSCROLL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_ES_PASSWORD:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_ES_PASSWORD,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_PASSWORD;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_PASSWORD;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_ES_NOHIDESEL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_ES_NOHIDESEL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_NOHIDESEL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_NOHIDESEL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_ES_OEMCONVERT:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_ES_OEMCONVERT,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_OEMCONVERT;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_OEMCONVERT;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_ES_WANTRETURN:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_ES_WANTRETURN,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_WANTRETURN;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_WANTRETURN;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_ES_UPPERCASE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_ES_UPPERCASE,BM_GETCHECK,0,0)){
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_LOWERCASE;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_UPPERCASE;
+							SendDlgItemMessage(hwnd,IDC_ES_LOWERCASE,BM_SETCHECK,BST_UNCHECKED,0);
+						}
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_UPPERCASE;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_ES_LOWERCASE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_ES_LOWERCASE,BM_GETCHECK,0,0)){
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_UPPERCASE;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_LOWERCASE;
+							SendDlgItemMessage(hwnd,IDC_ES_UPPERCASE,BM_SETCHECK,BST_UNCHECKED,0);
+						}
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_LOWERCASE;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_ES_READONLY:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_ES_READONLY,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_READONLY;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~ES_READONLY;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_ES_TEXTPOS:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_ES_TEXTPOS,CB_GETCURSEL,0,0);
+						//ES_LEFT=0
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(ES_CENTER|ES_RIGHT);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_CENTER;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=ES_RIGHT;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+////////////////////////
+// GROUPBOX プロパティ
+
+BOOL CALLBACK RadProperty_GroupBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+			SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption);
+
+
+			/////////////////////////////
+			// スタイル
+			////////////
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+
+			//////////////////
+			// 水平方向の配置
+			//////////////////
+
+			//"デフォルト"
+			SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_ADDSTRING,0,(long)STRING_DEFAULT);
+			//"左端"
+			SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_ADDSTRING,0,(long)STRING_LEFT);
+			//"右端"
+			SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_ADDSTRING,0,(long)STRING_RIGHT);
+			//"中央"
+			SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_ADDSTRING,0,(long)STRING_CENTER);
+
+			//ビットを考慮してBS_CENTERを最初に検討する
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_CENTER)==BS_CENTER) SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_SETCURSEL,3,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_LEFT) SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_RIGHT) SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_SETCURSEL,0,0);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_ICON) SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_BITMAP) SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_NOTIFY) SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_SETCHECK,BST_CHECKED,0);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_BS_POSITION:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_BS_POSITION,CB_GETCURSEL,0,0);
+						//BS_CENTER=BS_LEFT | BS_RIGHT
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(BS_CENTER);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_LEFT;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_RIGHT;
+						else if(i3==3) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_CENTER;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_BS_ICON:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_ICON;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_ICON;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_BITMAP:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_BITMAP;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_BITMAP;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_NOTIFY:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_NOTIFY;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_NOTIFY;
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+////////////////////////
+// IMAGEBOX プロパティ
+
+void RadProperty_ImageBox_StylingOrder(HWND hwnd,DWORD *style){
+	if((*style&0x000F)==SS_ICON||
+		(*style&0x000F)==SS_BITMAP){
+		EnableWindow(GetDlgItem(hwnd,IDC_PATH),1);
+		EnableWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),1);
+		EnableWindow(GetDlgItem(hwnd,IDC_SS_CENTERIMAGE),1);
+		EnableWindow(GetDlgItem(hwnd,IDC_SS_RIGHTJUST),1);
+	}
+	else{
+		EnableWindow(GetDlgItem(hwnd,IDC_PATH),0);
+		EnableWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),0);
+		EnableWindow(GetDlgItem(hwnd,IDC_SS_CENTERIMAGE),0);
+		EnableWindow(GetDlgItem(hwnd,IDC_SS_RIGHTJUST),0);
+	}
+}
+BOOL CALLBACK RadProperty_ImageBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	char temporary[MAX_PATH];
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+
+
+			/////////////////////////////
+			// スタイル
+			////////////
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+			//////////
+			// タイプ
+			//////////
+
+			//"フレーム（黒）"
+			SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_FRAME_BLACK);
+			//"フレーム（灰色）"
+			SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_FRAME_GRAY);
+			//"フレーム（白）"
+			SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_FRAME_WHITE);
+			//"フレーム（縁取り）"
+			SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_FRAME_ETCHED);
+			//"四角形（黒）"
+			SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_RECT_BLACK);
+			//"四角形（灰色）"
+			SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_RECT_GRAY);
+			//"四角形（白）"
+			SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_RECT_WHITE);
+			//"アイコン"
+			SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_ICON);
+			//"ビットマップ"
+			SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_ADDSTRING,0,(long)STRING_IMAGEBOXPROP_STYLE_BITMAP);
+
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000000F)==SS_BLACKFRAME) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,0,0);
+			else if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000000F)==SS_GRAYFRAME) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,1,0);
+			else if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000000F)==SS_WHITEFRAME) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,2,0);
+			else if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000001F)==SS_ETCHEDFRAME) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,3,0);
+			else if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000000F)==SS_BLACKRECT) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,4,0);
+			else if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000000F)==SS_GRAYRECT) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,5,0);
+			else if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000000F)==SS_WHITERECT) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,6,0);
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000000F)==SS_ICON||
+				(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000000F)==SS_BITMAP){
+				if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000000F)==SS_ICON) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,7,0);
+				else if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000000F)==SS_BITMAP) SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_SETCURSEL,8,0);
+
+				//リソース／ファイル スイッチチェックを表示
+				ShowWindow(GetDlgItem(hwnd,IDC_FILE),SW_SHOW);
+				ShowWindow(GetDlgItem(hwnd,IDC_RESOURCE),SW_SHOW);
+				
+				//イメージ状態テキストを表示
+				ShowWindow(GetDlgItem(hwnd,IDC_IMAGE_SITUATION),SW_SHOW);
+
+				if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.type==IMGTYPE_FILE){
+					//ファイル指定を表示
+					ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_SHOW);
+					ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_SHOW);
+					SetDlgItemText(hwnd,IDC_PATH,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.path);
+
+					//イメージ状態テキスト
+					//"ファイル指定:"
+					SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMFILE);
+
+					SendDlgItemMessage(hwnd,IDC_FILE,BM_SETCHECK,BST_CHECKED,0);
+				}
+				else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.type==IMGTYPE_RES){
+					//リソース指定を表示
+					ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_SHOW);
+
+					//イメージ状態テキスト
+					//"リソース指定:"
+					SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMRESOURCE);
+
+					SendDlgItemMessage(hwnd,IDC_RESOURCE,BM_SETCHECK,BST_CHECKED,0);
+
+					SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_RESETCONTENT,0,0);
+
+					if((ProjectInfo.pWindowInfo[i2].pChildInfo[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);
+					}
+					else if((ProjectInfo.pWindowInfo[i2].pChildInfo[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);
+					}
+
+					//リストから選択
+					i3=SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_FINDSTRING,0,(long)ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.path);
+					SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_SETCURSEL,i3,0);
+				}
+			}
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&SS_NOTIFY) SendDlgItemMessage(hwnd,IDC_SS_NOTIFY,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&SS_CENTERIMAGE) SendDlgItemMessage(hwnd,IDC_SS_CENTERIMAGE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&SS_RIGHTJUST) SendDlgItemMessage(hwnd,IDC_SS_RIGHTJUST,BM_SETCHECK,BST_CHECKED,0);
+
+			RadProperty_ImageBox_StylingOrder(hwnd,&ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_IMAGE_TYPE:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_IMAGE_TYPE,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(0x0000001F);
+						if(i3==0) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_BLACKFRAME;
+						else if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_GRAYFRAME;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_WHITEFRAME;
+						else if(i3==3) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_ETCHEDFRAME;
+						else if(i3==4) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_BLACKRECT;
+						else if(i3==5) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_GRAYRECT;
+						else if(i3==6) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_WHITERECT;
+						else if(i3==7) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_ICON;
+						else if(i3==8) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_BITMAP;
+
+						if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000000F)==SS_ICON||
+							(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x0000000F)==SS_BITMAP){
+							//リソース／ファイル スイッチチェックを表示
+							ShowWindow(GetDlgItem(hwnd,IDC_FILE),SW_SHOW);
+							ShowWindow(GetDlgItem(hwnd,IDC_RESOURCE),SW_SHOW);
+
+							//イメージ状態テキストを表示
+							ShowWindow(GetDlgItem(hwnd,IDC_IMAGE_SITUATION),SW_SHOW);
+
+							if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.type==IMGTYPE_FILE){
+								//ファイル指定を表示
+								ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_SHOW);
+								ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_SHOW);
+								SetDlgItemText(hwnd,IDC_PATH,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.path);
+
+								//イメージ状態テキスト
+								//"ファイル指定:"
+								SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMFILE);
+
+								SendDlgItemMessage(hwnd,IDC_FILE,BM_SETCHECK,BST_CHECKED,0);
+							}
+							else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.type==IMGTYPE_RES){
+								//リソース指定を表示
+								ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_SHOW);
+
+								//イメージ状態テキスト
+								//"リソース指定:"
+								SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMRESOURCE);
+
+								SendDlgItemMessage(hwnd,IDC_RESOURCE,BM_SETCHECK,BST_CHECKED,0);
+
+								SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_RESETCONTENT,0,0);
+
+								if((ProjectInfo.pWindowInfo[i2].pChildInfo[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(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.path,ProjectInfo.res.pIconResInfo[i3].IdName)==0)
+											SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_SETCURSEL,i3,0);
+									}
+								}
+								else if((ProjectInfo.pWindowInfo[i2].pChildInfo[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(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.path,ProjectInfo.res.pBitmapResInfo[i3].IdName)==0)
+											SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_SETCURSEL,i3,0);
+									}
+								}
+							}
+						}
+						else{
+							//リソース／ファイル スイッチチェックを非表示
+							ShowWindow(GetDlgItem(hwnd,IDC_FILE),SW_HIDE);
+							ShowWindow(GetDlgItem(hwnd,IDC_RESOURCE),SW_HIDE);
+
+							//イメージ状態テキストを非表示
+							ShowWindow(GetDlgItem(hwnd,IDC_IMAGE_SITUATION),SW_HIDE);
+
+							//ファイル指定を非表示
+							ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_HIDE);
+							ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_HIDE);
+
+							//リソース指定を非表示
+							ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_HIDE);
+						}
+
+						RadProperty_ImageBox_StylingOrder(hwnd,&ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_FILE:
+					if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.type==IMGTYPE_FILE){
+						//変更無し
+						break;
+					}
+
+					//変更情報
+					Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo);
+
+					ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.type=IMGTYPE_FILE;
+
+					//ファイル指定を表示
+					ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_SHOW);
+					ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_SHOW);
+					SetDlgItemText(hwnd,IDC_PATH,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.path);
+
+					//リソース指定を非表示
+					ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_HIDE);
+
+					//イメージ状態テキスト
+					//"ファイル指定:"
+					SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMFILE);
+
+					SendDlgItemMessage(hwnd,IDC_FILE,BM_SETCHECK,BST_CHECKED,0);
+					break;
+
+				case IDC_RESOURCE:
+					if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.type==IMGTYPE_RES){
+						//変更無し
+						break;
+					}
+
+					//変更情報
+					Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo);
+
+					ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.type=IMGTYPE_RES;
+
+					//ファイル指定を非表示
+					ShowWindow(GetDlgItem(hwnd,IDC_PATH),SW_HIDE);
+					ShowWindow(GetDlgItem(hwnd,IDC_CHANGEPATH),SW_HIDE);
+
+					//リソース指定を表示
+					ShowWindow(GetDlgItem(hwnd,IDC_RESCOMBO),SW_SHOW);
+
+					//イメージ状態テキスト
+					//"リソース指定:"
+					SetDlgItemText(hwnd,IDC_IMAGE_SITUATION,STRING_IMAGEBOXPROP_STYLE_FROMRESOURCE);
+
+					SendDlgItemMessage(hwnd,IDC_RESOURCE,BM_SETCHECK,BST_CHECKED,0);
+
+					SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_RESETCONTENT,0,0);
+
+					if((ProjectInfo.pWindowInfo[i2].pChildInfo[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);
+					}
+					else if((ProjectInfo.pWindowInfo[i2].pChildInfo[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);
+					}
+					break;
+
+				case IDC_RESCOMBO:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo);
+
+						i3=SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_GETCURSEL,0,0);
+						SendDlgItemMessage(hwnd,IDC_RESCOMBO,CB_GETLBTEXT,i3,(long)temporary);
+
+						HeapDefaultFree(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.path);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.path=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+						lstrcpy(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.path,temporary);
+
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					}
+					break;
+
+				case IDC_CHANGEPATH:
+					if(HIWORD(wParam)==BN_CLICKED){
+						if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.type==IMGTYPE_FILE){
+							if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x000F)==SS_ICON){
+								extern LPSTR IconFileFilter;
+								//"アイコン ファイルを指定して下さい"
+								if(!GetFilePathDialog(hwnd,temporary,IconFileFilter,STRING_IMAGEBOXPROP_GETPATH_ICON,1)) return 1;
+							}
+							else if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&0x000F)==SS_BITMAP){
+								extern LPSTR BitmapFileFilter;
+								//"ビットマップ ファイルを指定して下さい"
+								if(!GetFilePathDialog(hwnd,temporary,BitmapFileFilter,STRING_IMAGEBOXPROP_GETPATH_BITMAP,1)) return 1;
+							}
+
+							//変更情報
+							Rad_NoticeChanging(i,RAD_UNDO_IMAGESTATE,MdiInfo[i].MdiRadInfo->SelectingItem[0],(DWORD)&ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo);
+
+							GetRelationalPath(temporary,ProjectInfo.dir);
+							HeapDefaultFree(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.path);
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.path=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+							lstrcpy(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].ImageCtrlInfo.path,temporary);
+
+							SetDlgItemText(hwnd,IDC_PATH,temporary);
+							DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						}
+						return 1;
+					}
+					break;
+
+				case IDC_SS_NOTIFY:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_SS_NOTIFY,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_NOTIFY;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~SS_NOTIFY;
+						return 1;
+					}
+					break;
+				case IDC_SS_CENTERIMAGE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_SS_CENTERIMAGE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_CENTERIMAGE;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~SS_CENTERIMAGE;
+						return 1;
+					}
+					break;
+				case IDC_SS_RIGHTJUST:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_SS_RIGHTJUST,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_RIGHTJUST;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~SS_RIGHTJUST;
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+////////////////////////
+// LISTVIEW プロパティ
+BOOL CALLBACK RadProperty_ListViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+
+
+			/////////////////////////
+			// スタイル
+			////////////
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+			////////
+			// 表示
+			////////
+
+			//"アイコン"
+			SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_ADDSTRING,0,(long)STRING_LISTVIEWPROP_STYLE_ICON);
+			//"小さいアイコン"
+			SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_ADDSTRING,0,(long)STRING_LISTVIEWPROP_STYLE_SMALLICON);
+			//"リスト"
+			SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_ADDSTRING,0,(long)STRING_LISTVIEWPROP_STYLE_LIST);
+			//"レポート"
+			SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_ADDSTRING,0,(long)STRING_LISTVIEWPROP_STYLE_REPORT);
+
+			//ビットを考慮してLVS_LISTを最初に比較する
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_LIST)==LVS_LIST) SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_SETCURSEL,2,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_SMALLICON) SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_REPORT) SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_SETCURSEL,3,0);
+			else SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_SETCURSEL,0,0);
+
+
+			////////
+			// 配置
+			////////
+
+			//"上端"
+			SendDlgItemMessage(hwnd,IDC_LVS_POSITION,CB_ADDSTRING,0,(long)STRING_TOP);
+			//"左端"
+			SendDlgItemMessage(hwnd,IDC_LVS_POSITION,CB_ADDSTRING,0,(long)STRING_LEFT);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_ALIGNLEFT) SendDlgItemMessage(hwnd,IDC_LVS_POSITION,CB_SETCURSEL,1,0);
+			else SendDlgItemMessage(hwnd,IDC_LVS_POSITION,CB_SETCURSEL,0,0);
+
+
+			//////////
+			// ソート
+			//////////
+
+			//"なし"
+			SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_ADDSTRING,0,(long)STRING_NONE_);
+			//"昇順"
+			SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_ADDSTRING,0,(long)STRING_SORT_ASCENDING);
+			//"降順"
+			SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_ADDSTRING,0,(long)STRING_SORT_DESCENDING);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_SORTASCENDING) SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_SORTDESCENDING) SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_SETCURSEL,0,0);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_SINGLESEL) SendDlgItemMessage(hwnd,IDC_LVS_SINGLESEL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_AUTOARRANGE) SendDlgItemMessage(hwnd,IDC_LVS_AUTOARRANGE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_NOLABELWRAP) SendDlgItemMessage(hwnd,IDC_LVS_NOLABELWRAP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_EDITLABELS) SendDlgItemMessage(hwnd,IDC_LVS_EDITLABELS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_NOSCROLL) SendDlgItemMessage(hwnd,IDC_LVS_NOSCROLL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_NOCOLUMNHEADER) SendDlgItemMessage(hwnd,IDC_LVS_NOCOLUMNHEADER,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_NOSORTHEADER) SendDlgItemMessage(hwnd,IDC_LVS_NOSORTHEADER,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_SHOWSELALWAYS) SendDlgItemMessage(hwnd,IDC_LVS_SHOWSELALWAYS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_OWNERDRAWFIXED) SendDlgItemMessage(hwnd,IDC_LVS_OWNERDRAWFIXED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LVS_SHAREIMAGELISTS) SendDlgItemMessage(hwnd,IDC_LVS_SHAREIMAGELISTS,BM_SETCHECK,BST_CHECKED,0);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_LVS_VIEW:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_LVS_VIEW,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(LVS_SMALLICON|LVS_LIST|LVS_REPORT);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_SMALLICON;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_LIST;
+						else if(i3==3) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_REPORT;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_LVS_POSITION:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_LVS_POSITION,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(LVS_ALIGNLEFT);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_ALIGNLEFT;
+						return 1;
+					}
+					break;
+				case IDC_LVS_SORT:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_LVS_SORT,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(LVS_SORTASCENDING|LVS_SORTDESCENDING);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_SORTASCENDING;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_SORTDESCENDING;
+						return 1;
+					}
+					break;
+
+				case IDC_LVS_SINGLESEL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LVS_SINGLESEL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_SINGLESEL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LVS_SINGLESEL;
+						return 1;
+					}
+					break;
+				case IDC_LVS_AUTOARRANGE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LVS_AUTOARRANGE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_AUTOARRANGE;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LVS_AUTOARRANGE;
+						return 1;
+					}
+					break;
+				case IDC_LVS_NOLABELWRAP:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LVS_NOLABELWRAP,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_NOLABELWRAP;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LVS_NOLABELWRAP;
+						return 1;
+					}
+					break;
+				case IDC_LVS_EDITLABELS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LVS_EDITLABELS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_EDITLABELS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LVS_EDITLABELS;
+						return 1;
+					}
+					break;
+				case IDC_LVS_NOSCROLL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LVS_NOSCROLL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_NOSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LVS_NOSCROLL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_LVS_NOCOLUMNHEADER:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LVS_NOCOLUMNHEADER,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_NOCOLUMNHEADER;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LVS_NOCOLUMNHEADER;
+						return 1;
+					}
+					break;
+				case IDC_LVS_NOSORTHEADER:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LVS_NOSORTHEADER,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_NOSORTHEADER;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LVS_NOSORTHEADER;
+						return 1;
+					}
+					break;
+				case IDC_LVS_SHOWSELALWAYS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LVS_SHOWSELALWAYS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_SHOWSELALWAYS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LVS_SHOWSELALWAYS;
+						return 1;
+					}
+					break;
+				case IDC_LVS_OWNERDRAWFIXED:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LVS_OWNERDRAWFIXED,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_OWNERDRAWFIXED;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LVS_OWNERDRAWFIXED;
+						return 1;
+					}
+					break;
+				case IDC_LVS_SHAREIMAGELISTS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LVS_SHAREIMAGELISTS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LVS_SHAREIMAGELISTS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LVS_SHAREIMAGELISTS;
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+///////////////////////
+// LISTBOX プロパティ
+
+void RadProperty_ListBox_StylingOrder(HWND hwnd,DWORD *style){
+	if(*style&LBS_OWNERDRAWVARIABLE){
+		*style&=~(LBS_MULTICOLUMN);
+		SendDlgItemMessage(hwnd,IDC_LBS_MULTICOLUMN,BM_SETCHECK,BST_UNCHECKED,0);
+		EnableWindow(GetDlgItem(hwnd,IDC_LBS_MULTICOLUMN),0);
+	}
+	else
+		EnableWindow(GetDlgItem(hwnd,IDC_LBS_MULTICOLUMN),1);
+
+	if(!(*style&(LBS_OWNERDRAWFIXED|LBS_OWNERDRAWVARIABLE))){
+		*style&=~(LBS_HASSTRINGS);
+		SendDlgItemMessage(hwnd,IDC_LBS_HASSTRINGS,BM_SETCHECK,BST_UNCHECKED,0);
+		EnableWindow(GetDlgItem(hwnd,IDC_LBS_HASSTRINGS),0);
+	}
+	else
+		EnableWindow(GetDlgItem(hwnd,IDC_LBS_HASSTRINGS),1);
+}
+BOOL CALLBACK RadProperty_ListBoxProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+
+
+			////////////////////////
+			// スタイル
+			////////////
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+			////////
+			// 選択
+			////////
+
+			//"シングル"
+			SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_ADDSTRING,0,(long)STRING_LISTBOXPROP_STYLE_SEL_SINGLE);
+			//"マルチ"
+			SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_ADDSTRING,0,(long)STRING_LISTBOXPROP_STYLE_SEL_MULTI);
+			//"拡張"
+			SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_ADDSTRING,0,(long)STRING_LISTBOXPROP_STYLE_SEL_EXTENDED);
+			//"なし"
+			SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_ADDSTRING,0,(long)STRING_NONE_);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_MULTIPLESEL) SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_EXTENDEDSEL) SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_SETCURSEL,2,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_NOSEL) SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_SETCURSEL,3,0);
+			else SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_SETCURSEL,0,0);
+
+
+			////////////////
+			// オーナー描画
+			////////////////
+
+			//"なし"
+			SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_ADDSTRING,0,(long)STRING_NONE_);
+			//"固定"
+			SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_ADDSTRING,0,(long)STRING_OWNERDRAW_FIXED);
+			//"可変"
+			SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_ADDSTRING,0,(long)STRING_OWNERDRAW_VARIABLE);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_OWNERDRAWFIXED) SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_OWNERDRAWVARIABLE) SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_SETCURSEL,0,0);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_HASSTRINGS) SendDlgItemMessage(hwnd,IDC_LBS_HASSTRINGS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_SORT) SendDlgItemMessage(hwnd,IDC_LBS_SORT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_NOTIFY) SendDlgItemMessage(hwnd,IDC_LBS_NOTIFY,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_MULTICOLUMN) SendDlgItemMessage(hwnd,IDC_LBS_MULTICOLUMN,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_HSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VSCROLL) SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_DISABLENOSCROLL) SendDlgItemMessage(hwnd,IDC_LBS_DISABLENOSCROLL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_NOREDRAW) SendDlgItemMessage(hwnd,IDC_LBS_NOREDRAW,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_USETABSTOPS) SendDlgItemMessage(hwnd,IDC_LBS_USETABSTOPS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&LBS_WANTKEYBOARDINPUT) SendDlgItemMessage(hwnd,IDC_LBS_WANTKEYBOARDINPUT,BM_SETCHECK,BST_CHECKED,0);
+
+			RadProperty_ListBox_StylingOrder(hwnd,&ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_LBS_SELECT:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_LBS_SELECT,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(LBS_MULTIPLESEL|LBS_EXTENDEDSEL|LBS_NOSEL);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_MULTIPLESEL;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_EXTENDEDSEL;
+						else if(i3==3) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_NOSEL;
+						return 1;
+					}
+					break;
+				case IDC_LBS_OWNERDRAW:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_LBS_OWNERDRAW,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(LBS_OWNERDRAWFIXED|LBS_OWNERDRAWVARIABLE);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_OWNERDRAWFIXED;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_OWNERDRAWVARIABLE;
+
+						RadProperty_ListBox_StylingOrder(hwnd,&ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+						return 1;
+					}
+					break;
+
+				case IDC_LBS_HASSTRINGS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LBS_HASSTRINGS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_HASSTRINGS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LBS_HASSTRINGS;
+						return 1;
+					}
+					break;
+				case IDC_LBS_SORT:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LBS_SORT,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_SORT;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LBS_SORT;
+						return 1;
+					}
+					break;
+				case IDC_LBS_NOTIFY:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LBS_NOTIFY,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_NOTIFY;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LBS_NOTIFY;
+						return 1;
+					}
+					break;
+				case IDC_LBS_MULTICOLUMN:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LBS_MULTICOLUMN,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_MULTICOLUMN;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LBS_MULTICOLUMN;
+						return 1;
+					}
+					break;
+				case IDC_STYLE_HSCROLL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_HSCROLL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=WS_HSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~WS_HSCROLL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_STYLE_VSCROLL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_STYLE_VSCROLL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=WS_VSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~WS_VSCROLL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_LBS_DISABLENOSCROLL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LBS_DISABLENOSCROLL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_DISABLENOSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LBS_DISABLENOSCROLL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_LBS_NOREDRAW:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LBS_NOREDRAW,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_NOREDRAW;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LBS_NOREDRAW;
+						return 1;
+					}
+					break;
+				case IDC_LBS_USETABSTOPS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LBS_USETABSTOPS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_USETABSTOPS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LBS_USETABSTOPS;
+						return 1;
+					}
+					break;
+				case IDC_LBS_WANTKEYBOARDINPUT:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_LBS_WANTKEYBOARDINPUT,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=LBS_WANTKEYBOARDINPUT;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~LBS_WANTKEYBOARDINPUT;
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+///////////////////////////
+// PROGRESSBAR プロパティ
+BOOL CALLBACK RadProperty_ProgressBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+			SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption);
+
+
+			////////////
+			//スタイル
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&PBS_VERTICAL) SendDlgItemMessage(hwnd,IDC_PBS_VERTICAL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&PBS_SMOOTH) SendDlgItemMessage(hwnd,IDC_PBS_SMOOTH,BM_SETCHECK,BST_CHECKED,0);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_PBS_VERTICAL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_PBS_VERTICAL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=PBS_VERTICAL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~PBS_VERTICAL;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_PBS_SMOOTH:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_PBS_SMOOTH,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=PBS_SMOOTH;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~PBS_SMOOTH;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+	}
+	return 0;
+}
+
+
+///////////////////////////
+// RADIOBUTTON プロパティ
+
+BOOL CALLBACK RadProperty_RadioButtonProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+			SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption);
+
+
+			/////////////////////////
+			// スタイル
+			////////////
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_AUTORADIOBUTTON)==BS_AUTORADIOBUTTON) SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_PUSHLIKE) SendDlgItemMessage(hwnd,IDC_BS_PUSHLIKE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_LEFTTEXT) SendDlgItemMessage(hwnd,IDC_BS_LEFTTEXT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_ICON) SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_BITMAP) SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_MULTILINE) SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_NOTIFY) SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_SETCHECK,BST_CHECKED,0);
+
+
+			//////////////////
+			// 水平方向の配置
+			//////////////////
+
+			//"デフォルト"
+			SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_DEFAULT);
+			//"左端"
+			SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_LEFT);
+			//"右端"
+			SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_RIGHT);
+			//"中央"
+			SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
+
+			//ビットを考慮してBS_CENTERを最初に比較する
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_CENTER)==BS_CENTER) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,3,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_LEFT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_RIGHT) SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_SETCURSEL,0,0);
+
+
+			//////////////////
+			// 垂直方向の配置
+			//////////////////
+
+			//"デフォルト"
+			SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_DEFAULT);
+			//"上端"
+			SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_TOP);
+			//"下端"
+			SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_BOTTOM);
+			//"中央"
+			SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
+
+			//ビットを考慮してBS_VCENTERを最初に比較する
+			if((ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_VCENTER)==BS_VCENTER) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,3,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_TOP) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&BS_BOTTOM) SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_SETCURSEL,0,0);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_BS_AUTO:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_AUTO,BM_GETCHECK,0,0)){
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=0xFFFFFFF0;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_AUTORADIOBUTTON;
+						}
+						else{
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=0xFFFFFFF0;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_RADIOBUTTON;
+						}
+						return 1;
+					}
+					break;
+				case IDC_BS_PUSHLIKE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_PUSHLIKE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_PUSHLIKE;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_PUSHLIKE;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_LEFTTEXT:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_LEFTTEXT,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_LEFTTEXT;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_LEFTTEXT;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_ICON:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_GETCHECK,0,0)){
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_ICON;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_BITMAP;
+							SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_SETCHECK,BST_UNCHECKED,0);
+						}
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_ICON;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_BITMAP:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_BITMAP,BM_GETCHECK,0,0)){
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_BITMAP;
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_ICON;
+							SendDlgItemMessage(hwnd,IDC_BS_ICON,BM_SETCHECK,BST_UNCHECKED,0);
+						}
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_BITMAP;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_MULTILINE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_MULTILINE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_MULTILINE;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_MULTILINE;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_NOTIFY:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_BS_NOTIFY,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_NOTIFY;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~BS_NOTIFY;
+						return 1;
+					}
+					break;
+
+				case IDC_BS_HPOS:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_BS_HPOS,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(BS_LEFT|BS_RIGHT|BS_CENTER);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_LEFT;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_RIGHT;
+						else if(i3==3) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_CENTER;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_BS_VPOS:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_BS_VPOS,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(BS_TOP|BS_BOTTOM|BS_VCENTER);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_TOP;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_BOTTOM;
+						else if(i3==3) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=BS_VCENTER;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+/////////////////////////
+// SCROLLBAR プロパティ
+
+BOOL CALLBACK RadProperty_ScrollBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+
+
+			////////////////////////
+			// スタイル
+			////////////
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+
+			////////
+			// 配置
+			////////
+
+			//"指定無し"
+			SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_ADDSTRING,0,(long)STRING_SCROLLBARPROP_STYLE_FREE);
+			//"上/左"
+			SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_ADDSTRING,0,(long)STRING_SCROLLBARPROP_STYLE_TOPORLEFT);
+			//"下/右"
+			SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_ADDSTRING,0,(long)STRING_SCROLLBARPROP_STYLE_BOTTOMORRIGHT);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&SBS_TOPALIGN) SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&SBS_BOTTOMALIGN) SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_SETCURSEL,0,0);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_SBS_POSITION:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_SBS_POSITION,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(SBS_TOPALIGN|SBS_BOTTOMALIGN);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SBS_TOPALIGN;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SBS_BOTTOMALIGN;
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+//////////////////////
+// STATIC プロパティ
+
+BOOL CALLBACK RadProperty_StaticProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+			SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption);
+
+
+			////////////////////////
+			// スタイル
+			////////////
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&SS_NOPREFIX) SendDlgItemMessage(hwnd,IDC_SS_NOPREFIX,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&SS_LEFTNOWORDWRAP) SendDlgItemMessage(hwnd,IDC_SS_LEFTNOWORDWRAP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&SS_NOTIFY) SendDlgItemMessage(hwnd,IDC_SS_NOTIFY,BM_SETCHECK,BST_CHECKED,0);
+
+
+			//////////////////
+			// テキストの配置
+			//////////////////
+
+			//"左端"
+			SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_ADDSTRING,0,(long)STRING_LEFT);
+			//"中央"
+			SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_ADDSTRING,0,(long)STRING_CENTER);
+			//"右端"
+			SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_ADDSTRING,0,(long)STRING_RIGHT);
+
+			//ビットを考慮してSS_LEFTを最後に検討する
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&SS_CENTER) SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&SS_RIGHT) SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_SETCURSEL,0,0);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_SS_NOPREFIX:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_SS_NOPREFIX,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_NOPREFIX;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~SS_NOPREFIX;
+						return 1;
+					}
+					break;
+				case IDC_SS_LEFTNOWORDWRAP:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_SS_LEFTNOWORDWRAP,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_LEFTNOWORDWRAP;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~SS_LEFTNOWORDWRAP;
+
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_SS_NOTIFY:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_SS_NOTIFY,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_NOTIFY;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~SS_NOTIFY;
+						return 1;
+					}
+					break;
+
+				case IDC_SS_TEXTPOS:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_SS_TEXTPOS,CB_GETCURSEL,0,0);
+						//SS_LEFT=0
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(SS_CENTER|SS_RIGHT);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_CENTER;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=SS_RIGHT;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+////////////////////////
+// TRACKBAR プロパティ
+BOOL CALLBACK RadProperty_TrackBarProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+
+
+			///////////////////////////
+			// スタイル
+			////////////
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+
+			////////
+			// 表示
+			////////
+
+			//"水平方向"
+			SendDlgItemMessage(hwnd,IDC_TBS_SITUATION,CB_ADDSTRING,0,(long)STRING_DIRECTION_HORIZONTAL);
+			//"垂直方向"
+			SendDlgItemMessage(hwnd,IDC_TBS_SITUATION,CB_ADDSTRING,0,(long)STRING_DIRECTION_VERTICAL);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TBS_VERT) SendDlgItemMessage(hwnd,IDC_TBS_SITUATION,CB_SETCURSEL,1,0);
+			else SendDlgItemMessage(hwnd,IDC_TBS_SITUATION,CB_SETCURSEL,0,0);
+
+
+			////////////
+			// ポイント
+			////////////
+
+			//"両方"
+			SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_ADDSTRING,0,(long)STRING_TRACKBARPROP_STYLE_POSITION_BOTH);
+			//"上/左"
+			SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_ADDSTRING,0,(long)STRING_TRACKBARPROP_STYLE_POSITION_TOPORLEFT);
+			//"下/右"
+			SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_ADDSTRING,0,(long)STRING_TRACKBARPROP_STYLE_POSITION_BOTTOMORRIGHT);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TBS_BOTH) SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_SETCURSEL,0,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TBS_TOP) SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_SETCURSEL,1,0);
+			else SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_SETCURSEL,2,0);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TBS_NOTICKS) SendDlgItemMessage(hwnd,IDC_TBS_NOTICKS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TBS_AUTOTICKS) SendDlgItemMessage(hwnd,IDC_TBS_AUTOTICKS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TBS_ENABLESELRANGE) SendDlgItemMessage(hwnd,IDC_TBS_ENABLESELRANGE,BM_SETCHECK,BST_CHECKED,0);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_TBS_SITUATION:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_TBS_SITUATION,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TBS_VERT;
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TBS_VERT;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_TBS_POINT:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_TBS_POINT,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(TBS_BOTH|TBS_TOP);
+						if(i3==0) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TBS_BOTH;
+						else if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TBS_TOP;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_TBS_NOTICKS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TBS_NOTICKS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TBS_NOTICKS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TBS_NOTICKS;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_TBS_AUTOTICKS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TBS_AUTOTICKS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TBS_AUTOTICKS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TBS_AUTOTICKS;
+						return 1;
+					}
+					break;
+				case IDC_TBS_ENABLESELRANGE:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TBS_ENABLESELRANGE,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TBS_ENABLESELRANGE;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TBS_ENABLESELRANGE;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+//////////////////////////
+// TREEVIEW プロパティ
+BOOL CALLBACK RadProperty_TreeViewProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+
+
+			////////////
+			//スタイル
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TVS_HASBUTTONS) SendDlgItemMessage(hwnd,IDC_TVS_HASBUTTONS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TVS_HASLINES) SendDlgItemMessage(hwnd,IDC_TVS_HASLINES,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TVS_LINESATROOT) SendDlgItemMessage(hwnd,IDC_TVS_LINESATROOT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TVS_EDITLABELS) SendDlgItemMessage(hwnd,IDC_TVS_EDITLABELS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TVS_DISABLEDRAGDROP) SendDlgItemMessage(hwnd,IDC_TVS_DISABLEDRAGDROP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TVS_SHOWSELALWAYS) SendDlgItemMessage(hwnd,IDC_TVS_SHOWSELALWAYS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TVS_NOSCROLL) SendDlgItemMessage(hwnd,IDC_TVS_NOSCROLL,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TVS_NOTOOLTIPS) SendDlgItemMessage(hwnd,IDC_TVS_NOTOOLTIPS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TVS_CHECKBOXES) SendDlgItemMessage(hwnd,IDC_TVS_CHECKBOXES,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TVS_FULLROWSELECT) SendDlgItemMessage(hwnd,IDC_TVS_FULLROWSELECT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TVS_TRACKSELECT) SendDlgItemMessage(hwnd,IDC_TVS_TRACKSELECT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&TVS_SINGLEEXPAND) SendDlgItemMessage(hwnd,IDC_TVS_SINGLEEXPAND,BM_SETCHECK,BST_CHECKED,0);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_TVS_HASBUTTONS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TVS_HASBUTTONS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TVS_HASBUTTONS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TVS_HASBUTTONS;
+						return 1;
+					}
+					break;
+				case IDC_TVS_HASLINES:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TVS_HASLINES,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TVS_HASLINES;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TVS_HASLINES;
+						return 1;
+					}
+					break;
+				case IDC_TVS_LINESATROOT:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TVS_LINESATROOT,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TVS_LINESATROOT;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TVS_LINESATROOT;
+						return 1;
+					}
+					break;
+				case IDC_TVS_EDITLABELS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TVS_EDITLABELS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TVS_EDITLABELS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TVS_EDITLABELS;
+						return 1;
+					}
+					break;
+				case IDC_TVS_DISABLEDRAGDROP:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TVS_DISABLEDRAGDROP,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TVS_DISABLEDRAGDROP;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TVS_DISABLEDRAGDROP;
+						return 1;
+					}
+					break;
+				case IDC_TVS_SHOWSELALWAYS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TVS_SHOWSELALWAYS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TVS_SHOWSELALWAYS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TVS_SHOWSELALWAYS;
+						return 1;
+					}
+					break;
+				case IDC_TVS_NOSCROLL:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TVS_NOSCROLL,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TVS_NOSCROLL;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TVS_NOSCROLL;
+						return 1;
+					}
+					break;
+				case IDC_TVS_NOTOOLTIPS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TVS_NOTOOLTIPS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TVS_NOTOOLTIPS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TVS_NOTOOLTIPS;
+						return 1;
+					}
+					break;
+				case IDC_TVS_CHECKBOXES:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TVS_CHECKBOXES,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TVS_CHECKBOXES;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TVS_CHECKBOXES;
+						return 1;
+					}
+					break;
+				case IDC_TVS_FULLROWSELECT:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TVS_FULLROWSELECT,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TVS_FULLROWSELECT;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TVS_FULLROWSELECT;
+						return 1;
+					}
+					break;
+				case IDC_TVS_TRACKSELECT:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TVS_TRACKSELECT,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TVS_TRACKSELECT;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TVS_TRACKSELECT;
+						return 1;
+					}
+					break;
+				case IDC_TVS_SINGLEEXPAND:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_TVS_SINGLEEXPAND,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=TVS_SINGLEEXPAND;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~TVS_SINGLEEXPAND;
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+
+
+//////////////////////
+// UPDOWN プロパティ
+BOOL CALLBACK RadProperty_UpDownProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3;
+	static BOOL bInitial;
+
+	switch(message){
+		case WM_INITDIALOG:
+			bInitial=1;
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].IdName);
+			SetDlgItemText(hwnd,IDC_CAPTION,ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].caption);
+
+
+			//////////////////
+			// スタイル
+			////////////
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_DISABLED) SendDlgItemMessage(hwnd,IDC_STYLE_DISABLED,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_VISIBLE) SendDlgItemMessage(hwnd,IDC_STYLE_VISIBLE,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_GROUP) SendDlgItemMessage(hwnd,IDC_STYLE_GROUP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&WS_TABSTOP) SendDlgItemMessage(hwnd,IDC_STYLE_TABSTOP,BM_SETCHECK,BST_CHECKED,0);
+
+
+			////////
+			// 方向
+			////////
+
+			//"水平方向"
+			SendDlgItemMessage(hwnd,IDC_UDS_SITUATION,CB_ADDSTRING,0,(long)STRING_DIRECTION_HORIZONTAL);
+			//"垂直方向"
+			SendDlgItemMessage(hwnd,IDC_UDS_SITUATION,CB_ADDSTRING,0,(long)STRING_DIRECTION_VERTICAL);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&UDS_HORZ) SendDlgItemMessage(hwnd,IDC_UDS_SITUATION,CB_SETCURSEL,0,0);
+			else SendDlgItemMessage(hwnd,IDC_UDS_SITUATION,CB_SETCURSEL,1,0);
+
+			////////////
+			// アタッチ
+			////////////
+
+			//"なし"
+			SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_ADDSTRING,0,(long)STRING_NONE_);
+			//"左端"
+			SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_ADDSTRING,0,(long)STRING_LEFT);
+			//"右端"
+			SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_ADDSTRING,0,(long)STRING_RIGHT);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&UDS_ALIGNLEFT) SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_SETCURSEL,1,0);
+			else if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&UDS_ALIGNRIGHT) SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_SETCURSEL,2,0);
+			else SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_SETCURSEL,0,0);
+
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&UDS_AUTOBUDDY) SendDlgItemMessage(hwnd,IDC_UDS_AUTOBUDDY,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&UDS_SETBUDDYINT) SendDlgItemMessage(hwnd,IDC_UDS_SETBUDDYINT,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&UDS_NOTHOUSANDS) SendDlgItemMessage(hwnd,IDC_UDS_NOTHOUSANDS,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&UDS_WRAP) SendDlgItemMessage(hwnd,IDC_UDS_WRAP,BM_SETCHECK,BST_CHECKED,0);
+			if(ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&UDS_ARROWKEYS) SendDlgItemMessage(hwnd,IDC_UDS_ARROWKEYS,BM_SETCHECK,BST_CHECKED,0);
+
+
+			bInitial=0;
+			break;
+		case WM_COMMAND:
+
+			i=GetWndNum(GetParent(GetParent(hwnd)));
+			if(i==-1) return 1;
+			i2=GetWndInfoNum(MdiInfo[i].path);
+
+			//共通スタイル
+			if(bInitial==0){
+				if(DefaultItemStyles(hwnd,i,i2,wParam)) return 1;
+			}
+
+			switch(LOWORD(wParam)){
+				case IDC_UDS_SITUATION:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_UDS_SITUATION,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~UDS_HORZ;
+						if(i3==0) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=UDS_HORZ;
+						DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+						return 1;
+					}
+					break;
+				case IDC_UDS_ATTACH:
+					if(HIWORD(wParam)==CBN_SELCHANGE){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						i3=SendDlgItemMessage(hwnd,IDC_UDS_ATTACH,CB_GETCURSEL,0,0);
+						ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~(UDS_ALIGNLEFT|UDS_ALIGNRIGHT);
+						if(i3==1) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=UDS_ALIGNLEFT;
+						else if(i3==2) ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=UDS_ALIGNRIGHT;
+						return 1;
+					}
+					break;
+
+				case IDC_UDS_AUTOBUDDY:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_UDS_AUTOBUDDY,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=UDS_AUTOBUDDY;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~UDS_AUTOBUDDY;
+						return 1;
+					}
+					break;
+				case IDC_UDS_SETBUDDYINT:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_UDS_SETBUDDYINT,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=UDS_SETBUDDYINT;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~UDS_SETBUDDYINT;
+						return 1;
+					}
+					break;
+				case IDC_UDS_NOTHOUSANDS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_UDS_NOTHOUSANDS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=UDS_NOTHOUSANDS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~UDS_NOTHOUSANDS;
+						return 1;
+					}
+					break;
+				case IDC_UDS_WRAP:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_UDS_WRAP,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=UDS_WRAP;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~UDS_WRAP;
+						return 1;
+					}
+					break;
+				case IDC_UDS_ARROWKEYS:
+					if(HIWORD(wParam)==BN_CLICKED){
+						//変更情報
+						Rad_NoticeChanging(i,RAD_UNDO_STYLE,MdiInfo[i].MdiRadInfo->SelectingItem[0],ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style);
+
+						if(SendDlgItemMessage(hwnd,IDC_UDS_ARROWKEYS,BM_GETCHECK,0,0))
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style|=UDS_ARROWKEYS;
+						else
+							ProjectInfo.pWindowInfo[i2].pChildInfo[MdiInfo[i].MdiRadInfo->SelectingItem[0]].style&=~UDS_ARROWKEYS;
+						return 1;
+					}
+					break;
+
+				case IDC_EXSTYLE:
+					if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_RAD_PROP_ITEM_EXSTYLE),hwnd,DlgRadProperty_Item_ExStyle)) return 1;
+					DrawRadWindow(i,&ProjectInfo.pWindowInfo[i2]);
+					return 1;
+			}
+	}
+	return 0;
+}
+
+
+LRESULT CALLBACK RadPropertyWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i;
+	RECT rect;
+	SCROLLINFO ScrollInfo;
+
+	switch(message){
+		case WM_MOUSEACTIVATE:
+			BringWindowToTop(GetParent(hwnd));
+			return 0;
+		case WM_VSCROLL:
+			ScrollInfo.cbSize=sizeof(SCROLLINFO);
+			ScrollInfo.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
+			GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
+			if(LOWORD(wParam)==SB_LINEUP) i=-20;
+			else if(LOWORD(wParam)==SB_LINEDOWN) i=20;
+			else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)ScrollInfo.nPage;
+			else if(LOWORD(wParam)==SB_PAGEDOWN) i=ScrollInfo.nPage;
+			else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-ScrollInfo.nPos;
+			else i=0;
+			GetClientRect(hwnd,&rect);
+			i=max(-ScrollInfo.nPos,min(i,ScrollInfo.nMax-rect.bottom-ScrollInfo.nPos));
+			if(i!=0){
+				ScrollInfo.nPos+=i;
+				SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1);
+				ScrollWindow(hwnd,0,-i,NULL,NULL);
+				UpdateWindow(hwnd);
+			}
+			return 0;
+		case WM_SIZE:
+			i=GetWndNum(GetParent(hwnd));
+			if(i==-1) return 0;	//ウィンドウが初期状態の場合
+			ScrollInfo.cbSize=sizeof(SCROLLINFO);
+			ScrollInfo.fMask=SIF_PAGE|SIF_RANGE|SIF_POS;
+			GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
+			GetClientRect(MdiInfo[i].MdiRadInfo->hProp_Dlg,&rect);
+			ScrollInfo.nMin=0;
+			ScrollInfo.nMax=rect.bottom;
+			ScrollInfo.nPage=HIWORD(lParam);
+			SetScrollInfo(hwnd,SB_VERT,&ScrollInfo,1);
+
+			i=ScrollInfo.nPos;
+			ScrollInfo.fMask=SIF_POS;
+			GetScrollInfo(hwnd,SB_VERT,&ScrollInfo);
+			if(i>ScrollInfo.nPos){
+				ScrollWindow(hwnd,0,i-ScrollInfo.nPos,NULL,NULL);
+				UpdateWindow(hwnd);
+			}
+			return 0;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/Rad_UndoRedo.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Rad_UndoRedo.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Rad_UndoRedo.cpp	(revision 178)
@@ -0,0 +1,559 @@
+#include "Common.h"
+
+void Rad_UndoCommand(int WndNum){
+	extern HINSTANCE hInst;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,WndInfoNum;
+	DWORD dw;
+	char *temporary;
+	RAD_UNDOSTATE *pUndoState;
+
+	pUndoState=&MdiInfo[WndNum].MdiRadInfo->undo;
+	i=pUndoState->NowPos-1;
+	if(i==-1) i=MAX_UNDONUM-1;
+	if(!pUndoState->Command[i]){
+		MessageBeep(0);
+		return;
+	}
+	pUndoState->NowPos=i;
+
+	WndInfoNum=GetWndInfoNum(MdiInfo[WndNum].path);
+	switch(pUndoState->Command[pUndoState->NowPos]){
+		case RAD_UNDO_INSERTITEM:
+			DeleteDlgItem(WndNum,WndInfoNum,pUndoState->SelectItemNum[pUndoState->NowPos],0);
+			MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]=-1;
+			break;
+		case RAD_UNDO_DELETEITEM:
+			CHILDINFO *pChildInfo;
+			RECT rect;
+			pChildInfo=(CHILDINFO *)pUndoState->lpdwData[pUndoState->NowPos];
+			rect.left=pChildInfo->pos.x;
+			rect.top=pChildInfo->pos.y;
+			rect.right=pChildInfo->pos.x+pChildInfo->size.cx;
+			rect.bottom=pChildInfo->pos.y+pChildInfo->size.cy;
+			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);
+			break;
+		case RAD_UNDO_NAME:
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
+				RAD_UNDOSTATE_NAME *names;
+				names=(RAD_UNDOSTATE_NAME *)pUndoState->lpdwData[pUndoState->NowPos];
+
+				temporary=ProjectInfo.pWindowInfo[WndInfoNum].name;
+				ProjectInfo.pWindowInfo[WndInfoNum].name=names->name;
+				names->name=temporary;
+				GlobalFree(MdiInfo[WndNum].path);
+				MdiInfo[WndNum].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(ProjectInfo.pWindowInfo[WndInfoNum].name)+1);
+				lstrcpy(MdiInfo[WndNum].path,ProjectInfo.pWindowInfo[WndInfoNum].name);
+
+				temporary=ProjectInfo.pWindowInfo[WndInfoNum].HandleName;
+				ProjectInfo.pWindowInfo[WndInfoNum].HandleName=names->HandleName;
+				names->HandleName=temporary;
+
+				temporary=ProjectInfo.pWindowInfo[WndInfoNum].CallBackName;
+				ProjectInfo.pWindowInfo[WndInfoNum].CallBackName=names->CallBackName;
+				names->CallBackName=temporary;
+			}
+			else{
+				temporary=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].IdName;
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].IdName=(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;
+		case RAD_UNDO_CAPTION:
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
+				temporary=ProjectInfo.pWindowInfo[WndInfoNum].caption;
+				ProjectInfo.pWindowInfo[WndInfoNum].caption=(char *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
+			}
+			else{
+				temporary=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].caption;
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].caption=(char *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
+			}
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+				ChangePropertyWindow(WndNum,WndInfoNum);
+			DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			break;
+		case RAD_UNDO_FONT:
+			LOGFONT *pLogFont,lf;
+			pLogFont=(LOGFONT *)pUndoState->lpdwData[pUndoState->NowPos];
+			lf=ProjectInfo.pWindowInfo[WndInfoNum].LogFont;
+			ProjectInfo.pWindowInfo[WndInfoNum].LogFont=*pLogFont;
+			*pLogFont=lf;
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+				ChangePropertyWindow(WndNum,WndInfoNum);
+			DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			break;
+		case RAD_UNDO_BGCOLOR:
+			dw=ProjectInfo.pWindowInfo[WndInfoNum].bgColor;
+			ProjectInfo.pWindowInfo[WndInfoNum].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,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			break;
+		case RAD_UNDO_WINDOWMENU:
+			temporary=ProjectInfo.pWindowInfo[WndInfoNum].MenuID;
+			ProjectInfo.pWindowInfo[WndInfoNum].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;
+		case RAD_UNDO_ICONRES:
+			temporary=ProjectInfo.pWindowInfo[WndInfoNum].IconResName;
+			ProjectInfo.pWindowInfo[WndInfoNum].IconResName=(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;
+		case RAD_UNDO_STYLE:
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
+				dw=ProjectInfo.pWindowInfo[WndInfoNum].style;
+				ProjectInfo.pWindowInfo[WndInfoNum].style=pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			}
+			else{
+				dw=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].style;
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].style=pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			}
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+				ChangePropertyWindow(WndNum,WndInfoNum);
+			DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			break;
+		case RAD_UNDO_EXSTYLE:
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
+				dw=ProjectInfo.pWindowInfo[WndInfoNum].ExStyle;
+				ProjectInfo.pWindowInfo[WndInfoNum].ExStyle=pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			}
+			else{
+				dw=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].ExStyle;
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].ExStyle=pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			}
+			DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			break;
+		case RAD_UNDO_POSITION:
+			POINTANDSIZE PointAndSize,*pReadPointAndSize;
+			pReadPointAndSize=(POINTANDSIZE *)pUndoState->lpdwData[pUndoState->NowPos];
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
+				PointAndSize.size=ProjectInfo.pWindowInfo[WndInfoNum].size;
+				ProjectInfo.pWindowInfo[WndInfoNum].size=pReadPointAndSize->size;
+			}
+			else{
+				PointAndSize.pos=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].pos;
+				PointAndSize.size=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].size;
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].pos=pReadPointAndSize->pos;
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].size=pReadPointAndSize->size;
+			}
+			*pReadPointAndSize=PointAndSize;
+			DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			SetStatusText(NULL);
+
+			//サポートダイアログの内容をセット
+			SetSupportDlgData(WndNum,WndInfoNum);
+			break;
+		case RAD_UNDO_IMAGESTATE:
+			IMAGECTRLINFO *pImageCtrlInfo;
+			pImageCtrlInfo=(IMAGECTRLINFO *)pUndoState->lpdwData[pUndoState->NowPos];
+
+			dw=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].ImageCtrlInfo.type;
+			ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].ImageCtrlInfo.type=pImageCtrlInfo->type;
+			pImageCtrlInfo->type=dw;
+
+			dw=(DWORD)ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].ImageCtrlInfo.path;
+			ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[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,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			break;
+		case RAD_UNDO_TYPE:
+			dw=ProjectInfo.pWindowInfo[WndInfoNum].type;
+			ProjectInfo.pWindowInfo[WndInfoNum].type=pUndoState->lpdwData[pUndoState->NowPos];
+			pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+				ChangePropertyWindow(WndNum,WndInfoNum);
+			break;
+	}
+
+	ProjectInfo.ModifyOfMaterial=1;
+
+	ResetState_UndoMenu();
+}
+void Rad_RedoCommand(int WndNum){
+	extern HINSTANCE hInst;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int WndInfoNum;
+	DWORD dw;
+	char *temporary;
+	RAD_UNDOSTATE *pUndoState;
+	CHILDINFO *pChildInfo;
+	RECT rect;
+
+	pUndoState=&MdiInfo[WndNum].MdiRadInfo->undo;
+	if(!pUndoState->Command[pUndoState->NowPos]){
+		MessageBeep(0);
+		return;
+	}
+
+	WndInfoNum=GetWndInfoNum(MdiInfo[WndNum].path);
+	switch(pUndoState->Command[pUndoState->NowPos]){
+		case RAD_UNDO_INSERTITEM:
+			pChildInfo=(CHILDINFO *)pUndoState->lpdwData[pUndoState->NowPos];
+			rect.left=pChildInfo->pos.x;
+			rect.top=pChildInfo->pos.y;
+			rect.right=pChildInfo->pos.x+pChildInfo->size.cx;
+			rect.bottom=pChildInfo->pos.y+pChildInfo->size.cy;
+			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);
+			break;
+		case RAD_UNDO_DELETEITEM:
+			DeleteDlgItem(WndNum,WndInfoNum,pUndoState->SelectItemNum[pUndoState->NowPos],0);
+			MdiInfo[WndNum].MdiRadInfo->SelectingItem[0]=-1;
+			break;
+		case RAD_UNDO_NAME:
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
+				RAD_UNDOSTATE_NAME *names;
+				names=(RAD_UNDOSTATE_NAME *)pUndoState->lpdwData[pUndoState->NowPos];
+
+				temporary=ProjectInfo.pWindowInfo[WndInfoNum].name;
+				ProjectInfo.pWindowInfo[WndInfoNum].name=names->name;
+				names->name=temporary;
+				GlobalFree(MdiInfo[WndNum].path);
+				MdiInfo[WndNum].path=(char *)GlobalAlloc(GMEM_FIXED,lstrlen(ProjectInfo.pWindowInfo[WndInfoNum].name)+1);
+				lstrcpy(MdiInfo[WndNum].path,ProjectInfo.pWindowInfo[WndInfoNum].name);
+
+				temporary=ProjectInfo.pWindowInfo[WndInfoNum].HandleName;
+				ProjectInfo.pWindowInfo[WndInfoNum].HandleName=names->HandleName;
+				names->HandleName=temporary;
+
+				temporary=ProjectInfo.pWindowInfo[WndInfoNum].CallBackName;
+				ProjectInfo.pWindowInfo[WndInfoNum].CallBackName=names->CallBackName;
+				names->CallBackName=temporary;
+			}
+			else{
+				temporary=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].IdName;
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].IdName=(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;
+		case RAD_UNDO_CAPTION:
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
+				temporary=ProjectInfo.pWindowInfo[WndInfoNum].caption;
+				ProjectInfo.pWindowInfo[WndInfoNum].caption=(char *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
+			}
+			else{
+				temporary=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].caption;
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].caption=(char *)pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temporary;
+			}
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+				ChangePropertyWindow(WndNum,WndInfoNum);
+			DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			break;
+		case RAD_UNDO_FONT:
+			LOGFONT *pLogFont,lf;
+			pLogFont=(LOGFONT *)pUndoState->lpdwData[pUndoState->NowPos];
+			lf=ProjectInfo.pWindowInfo[WndInfoNum].LogFont;
+			ProjectInfo.pWindowInfo[WndInfoNum].LogFont=*pLogFont;
+			*pLogFont=lf;
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+				ChangePropertyWindow(WndNum,WndInfoNum);
+			DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			break;
+		case RAD_UNDO_BGCOLOR:
+			dw=ProjectInfo.pWindowInfo[WndInfoNum].bgColor;
+			ProjectInfo.pWindowInfo[WndInfoNum].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,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			break;
+		case RAD_UNDO_WINDOWMENU:
+			temporary=ProjectInfo.pWindowInfo[WndInfoNum].MenuID;
+			ProjectInfo.pWindowInfo[WndInfoNum].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;
+		case RAD_UNDO_ICONRES:
+			temporary=ProjectInfo.pWindowInfo[WndInfoNum].IconResName;
+			ProjectInfo.pWindowInfo[WndInfoNum].IconResName=(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;
+		case RAD_UNDO_STYLE:
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
+				dw=ProjectInfo.pWindowInfo[WndInfoNum].style;
+				ProjectInfo.pWindowInfo[WndInfoNum].style=pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			}
+			else{
+				dw=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].style;
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].style=pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			}
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+				ChangePropertyWindow(WndNum,WndInfoNum);
+			DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			break;
+		case RAD_UNDO_EXSTYLE:
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
+				dw=ProjectInfo.pWindowInfo[WndInfoNum].ExStyle;
+				ProjectInfo.pWindowInfo[WndInfoNum].ExStyle=pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			}
+			else{
+				dw=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].ExStyle;
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].ExStyle=pUndoState->lpdwData[pUndoState->NowPos];
+				pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			}
+			DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			break;
+		case RAD_UNDO_POSITION:
+			POINTANDSIZE PointAndSize,*pReadPointAndSize;
+			pReadPointAndSize=(POINTANDSIZE *)pUndoState->lpdwData[pUndoState->NowPos];
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==SELECT_WINDOW){
+				PointAndSize.size=ProjectInfo.pWindowInfo[WndInfoNum].size;
+				ProjectInfo.pWindowInfo[WndInfoNum].size=pReadPointAndSize->size;
+			}
+			else{
+				PointAndSize.pos=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].pos;
+				PointAndSize.size=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].size;
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].pos=pReadPointAndSize->pos;
+				ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].size=pReadPointAndSize->size;
+			}
+			*pReadPointAndSize=PointAndSize;
+			DrawRadWindow(WndNum,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			SetStatusText(NULL);
+
+			//サポートダイアログの内容をセット
+			SetSupportDlgData(WndNum,WndInfoNum);
+			break;
+		case RAD_UNDO_IMAGESTATE:
+			IMAGECTRLINFO *pImageCtrlInfo;
+			pImageCtrlInfo=(IMAGECTRLINFO *)pUndoState->lpdwData[pUndoState->NowPos];
+
+			dw=ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].ImageCtrlInfo.type;
+			ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].ImageCtrlInfo.type=pImageCtrlInfo->type;
+			pImageCtrlInfo->type=dw;
+
+			dw=(DWORD)ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[pUndoState->SelectItemNum[pUndoState->NowPos]].ImageCtrlInfo.path;
+			ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[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,&ProjectInfo.pWindowInfo[WndInfoNum]);
+			break;
+		case RAD_UNDO_TYPE:
+			dw=ProjectInfo.pWindowInfo[WndInfoNum].type;
+			ProjectInfo.pWindowInfo[WndInfoNum].type=pUndoState->lpdwData[pUndoState->NowPos];
+			pUndoState->lpdwData[pUndoState->NowPos]=dw;
+			if(pUndoState->SelectItemNum[pUndoState->NowPos]==MdiInfo[WndNum].MdiRadInfo->SelectingItem[0])
+				ChangePropertyWindow(WndNum,WndInfoNum);
+			break;
+	}
+
+	pUndoState->NowPos++;
+	if(pUndoState->NowPos==MAX_UNDONUM) pUndoState->NowPos=0;
+
+	ProjectInfo.ModifyOfMaterial=1;
+
+	ResetState_UndoMenu();
+}
+void Rad_DeleteUndoData(int WndNum,int pos){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	RAD_UNDOSTATE *pUndoState;
+
+	pUndoState=&MdiInfo[WndNum].MdiRadInfo->undo;
+	switch(pUndoState->Command[pos]){
+		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);
+			break;
+		case RAD_UNDO_NAME:
+			if(pUndoState->SelectItemNum[pos]==SELECT_WINDOW){
+				RAD_UNDOSTATE_NAME *names;
+				names=(RAD_UNDOSTATE_NAME *)pUndoState->lpdwData[pos];
+				HeapDefaultFree(names->name);
+				HeapDefaultFree(names->HandleName);
+				HeapDefaultFree(names->CallBackName);
+				HeapDefaultFree(names);
+			}
+			else HeapDefaultFree((void *)pUndoState->lpdwData[pos]);
+			break;
+		case RAD_UNDO_CAPTION:
+			HeapDefaultFree((void *)pUndoState->lpdwData[pos]);
+			break;
+		case RAD_UNDO_FONT:
+			HeapDefaultFree((void *)pUndoState->lpdwData[pos]);
+			break;
+		case RAD_UNDO_WINDOWMENU:
+			if(pUndoState->lpdwData[pos])
+				HeapDefaultFree((void *)pUndoState->lpdwData[pos]);
+			break;
+		case RAD_UNDO_ICONRES:
+			if(pUndoState->lpdwData[pos])
+				HeapDefaultFree((void *)pUndoState->lpdwData[pos]);
+			break;
+		case RAD_UNDO_POSITION:
+			HeapDefaultFree((void *)pUndoState->lpdwData[pos]);
+			break;
+		case RAD_UNDO_IMAGESTATE:
+			IMAGECTRLINFO *pImageCtrlInfo;
+			pImageCtrlInfo=(IMAGECTRLINFO *)pUndoState->lpdwData[pos];
+			HeapDefaultFree(pImageCtrlInfo->path);
+			HeapDefaultFree(pImageCtrlInfo);
+			break;
+	}
+	pUndoState->Command[pos]=0;
+}
+void Rad_NoticeChanging(int WndNum,int Command,int SelectItemNum,DWORD dwData){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	char *temporary,*temp2;
+	RAD_UNDOSTATE *pUndoState;
+
+	pUndoState=&MdiInfo[WndNum].MdiRadInfo->undo;
+
+	//Redoされた場合の不要なデータを削除する
+	for(i=pUndoState->NowPos;;i++){
+		if(i==MAX_UNDONUM) i=0;
+		if(pUndoState->Command[i]==0) break;
+		Rad_DeleteUndoData(WndNum,i);
+	}
+
+	pUndoState->Command[pUndoState->NowPos]=Command;
+	pUndoState->SelectItemNum[pUndoState->NowPos]=SelectItemNum;
+	switch(Command){
+		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);
+			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->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);
+			}
+			pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)pSaveChildInfo;
+			break;
+		case RAD_UNDO_NAME:
+			if(SelectItemNum==SELECT_WINDOW){
+				RAD_UNDOSTATE_NAME *names,*SaveNames;
+				names=(RAD_UNDOSTATE_NAME *)dwData;
+				SaveNames=(RAD_UNDOSTATE_NAME *)HeapAlloc(hHeap,0,sizeof(RAD_UNDOSTATE_NAME));
+				SaveNames->name=(char *)HeapAlloc(hHeap,0,lstrlen(names->name)+1);
+				lstrcpy(SaveNames->name,names->name);
+				SaveNames->HandleName=(char *)HeapAlloc(hHeap,0,lstrlen(names->HandleName)+1);
+				lstrcpy(SaveNames->HandleName,names->HandleName);
+				SaveNames->CallBackName=(char *)HeapAlloc(hHeap,0,lstrlen(names->CallBackName)+1);
+				lstrcpy(SaveNames->CallBackName,names->CallBackName);
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)SaveNames;
+			}
+			else{
+				temporary=(char *)dwData;
+				temp2=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+				lstrcpy(temp2,temporary);
+				pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)temp2;
+			}
+			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;
+			break;
+		case RAD_UNDO_FONT:
+			LOGFONT *pLogFont,*pSaveLogFont;
+			pLogFont=(LOGFONT *)dwData;
+			pSaveLogFont=(LOGFONT *)HeapAlloc(hHeap,0,sizeof(LOGFONT));
+			*pSaveLogFont=*pLogFont;
+			pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)pSaveLogFont;
+			break;
+		case RAD_UNDO_BGCOLOR:
+			pUndoState->lpdwData[pUndoState->NowPos]=dwData;
+			break;
+		case RAD_UNDO_WINDOWMENU:
+		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;
+			}
+			break;
+		case RAD_UNDO_STYLE:
+		case RAD_UNDO_EXSTYLE:
+			pUndoState->lpdwData[pUndoState->NowPos]=dwData;
+			break;
+		case RAD_UNDO_POSITION:
+			POINTANDSIZE *pPointAndSize,*pSavePointAndSize;
+			pPointAndSize=(POINTANDSIZE *)dwData;
+			pSavePointAndSize=(POINTANDSIZE *)HeapAlloc(hHeap,0,sizeof(POINTANDSIZE));
+			pSavePointAndSize->pos=pPointAndSize->pos;
+			pSavePointAndSize->size=pPointAndSize->size;
+			pUndoState->lpdwData[pUndoState->NowPos]=(DWORD)pSavePointAndSize;
+			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;
+		case RAD_UNDO_TYPE:
+			pUndoState->lpdwData[pUndoState->NowPos]=dwData;
+			break;
+	}
+
+	pUndoState->NowPos++;
+	if(pUndoState->NowPos==MAX_UNDONUM) pUndoState->NowPos=0;
+	if(pUndoState->Command[pUndoState->NowPos]){
+		//一番古い情報を切り捨てる
+		Rad_DeleteUndoData(WndNum,pUndoState->NowPos);
+	}
+
+	extern PROJECTINFO ProjectInfo;
+	ProjectInfo.ModifyOfMaterial=1;
+
+	ResetState_UndoMenu();
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/Replace.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Replace.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Replace.cpp	(revision 178)
@@ -0,0 +1,487 @@
+#include "common.h"
+
+void TextEdit_ResetWordColor(int WndNum,CHARRANGE *pCharRange,int DocType){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2,IsStr;
+	char *pBuf,*pTemp;
+	CHARRANGE Range,cr2;
+
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+	//行の先頭位置を取得
+	i=pCharRange->cpMin;
+	for(;i>0;i--){
+		if(pBuf[i-1]=='\r'&&pBuf[i]=='\n'){
+			i++;
+			break;
+		}
+	}
+	Range.cpMin=i;
+
+	//行の末端位置を取得
+	i=pCharRange->cpMax;
+	for(;;i++){
+		if(pBuf[i]=='\0') break;
+		if(pBuf[i]=='\r'&&pBuf[i+1]=='\n') break;
+	}
+	Range.cpMax=i;
+
+	//初期化（すべて黒色に戻す）
+	for(i=Range.cpMin;i<Range.cpMax;i++){
+		MdiInfo[WndNum].pMdiTextEdit->pColorRef[i]=tci.rgbDefault;
+	}
+
+	if(DocType==WNDTYPE_TEXT) return;
+
+	pTemp=(char *)HeapAlloc(hHeap,0,Range.cpMax-Range.cpMin+1);
+
+	for(i=Range.cpMin,IsStr=0;i<Range.cpMax;i++){
+		if((IsVariableTopChar(pBuf[i])||pBuf[i]=='#')&&IsStr==0){
+			cr2.cpMin=i;
+			for(i2=0;;i++,i2++){
+				if((!IsVariableChar(pBuf[i]))||pBuf[i]=='.'){
+					pTemp[i2]=0;
+					break;
+				}
+				pTemp[i2]=pBuf[i];
+			}
+			cr2.cpMax=i;
+
+			//予約語（青色）
+			BOOL bResult=0;
+			if(DocType==WNDTYPE_BASIC){
+				i2=IsBasicReservedWord(pTemp);
+				bResult=IsManagementCommand(i2);
+			}
+			else if(DocType==WNDTYPE_HTML) bResult=IsHtmlReservedWord(pTemp);
+
+			if(bResult){
+				for(i2=cr2.cpMin;i2<cr2.cpMax;i2++){
+					MdiInfo[WndNum].pMdiTextEdit->pColorRef[i2]=tci.rgbStatement;
+				}
+			}
+		}
+		if(IsStr||pBuf[i]=='\"'&&IsStr==0){
+			//文字列カラー（""で囲まれる範囲）
+			MdiInfo[WndNum].pMdiTextEdit->pColorRef[i]=tci.rgbString;
+		}
+		if(pBuf[i]=='\0') break;
+		if(pBuf[i]=='\"') IsStr^=1;
+		if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+			i++;
+			IsStr=0;
+		}
+	}
+
+	HeapDefaultFree(pTemp);
+}
+
+void TextEdit_Replace(int WndNum,char *str,BOOL bRedraw){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	CHARRANGE Range,DelRange;
+
+	TextEdit_GetSel(WndNum,&DelRange);
+
+	Range.cpMin=DelRange.cpMin;
+	Range.cpMax=DelRange.cpMin+lstrlen(str);
+
+	//バッファ長を取得
+	int length;
+	length=lstrlen(MdiInfo[WndNum].pMdiTextEdit->buffer);
+
+	int delta;
+	delta=DelRange.cpMin-DelRange.cpMax+(Range.cpMax-Range.cpMin);
+	if(0<delta){
+		////////////////////
+		// バッファを再確保
+		////////////////////
+
+		MdiInfo[WndNum].pMdiTextEdit->buffer=(char *)HeapReAlloc(hHeap,
+			0,
+			MdiInfo[WndNum].pMdiTextEdit->buffer,
+			length+1+delta);
+
+		MdiInfo[WndNum].pMdiTextEdit->pColorRef=(COLORREF *)HeapReAlloc(hHeap,
+			0,
+			MdiInfo[WndNum].pMdiTextEdit->pColorRef,
+			(length+1+delta)*sizeof(COLORREF));
+	}
+
+
+	//ブレークポイントのオフセット分を計算
+	if(ProjectInfo.name[0]){
+		ProjectInfo.pobj_DBBreakPoint->replace(
+			MdiInfo[WndNum].path,
+			MdiInfo[WndNum].pMdiTextEdit->buffer,
+			&DelRange,
+			&Range,
+			str);
+	}
+	else{
+		extern CDBBreakPoint *pobj_DBBreakPoint;
+		pobj_DBBreakPoint->replace(
+			MdiInfo[WndNum].path,
+			MdiInfo[WndNum].pMdiTextEdit->buffer,
+			&DelRange,
+			&Range,
+			str);
+	}
+
+
+	//文字列バッファをスライドして、挿入
+	SlideString(MdiInfo[WndNum].pMdiTextEdit->buffer+DelRange.cpMax,
+		delta);
+	memcpy(MdiInfo[WndNum].pMdiTextEdit->buffer+Range.cpMin,str,lstrlen(str));
+
+	//文字カラーバッファをスライド
+	SlideBuffer(((char *)MdiInfo[WndNum].pMdiTextEdit->pColorRef)+DelRange.cpMax*sizeof(COLORREF),
+		(length-DelRange.cpMax) * sizeof(COLORREF),
+		delta*sizeof(COLORREF));
+	//色づけ
+	TextEdit_ResetWordColor(WndNum,&Range,MdiInfo[WndNum].DocType);
+
+	//新しいキャレット位置に変更
+	GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,
+		Range.cpMax,
+		&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+	MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+
+	//コントロールタブスペースの幅と行番号の文字数を更新
+	MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace=
+		GetControlTabSpace(WndNum,&MdiInfo[WndNum].pMdiTextEdit->iLineNumberTextCount);
+
+	if(bRedraw){
+		///////////////
+		// 再描画
+		///////////////
+
+		if(!TextEdit_ScrollCaret(WndNum,0)){
+			UpdateWindow(MdiInfo[WndNum].pMdiTextEdit->hEdit);	//ちらつき防止
+			InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->hEdit,NULL,0);
+		}
+
+		ResetCaretPos(WndNum,1);
+	}
+
+	//上下キャレット移動時の左右位置保持機能を解除
+	MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+
+	//編集メニューをリセット
+	ResetState_EditMenu();
+
+	if( ! MdiInfo[WndNum].pMdiTextEdit->IsModified() ){
+		//変更フラグをセット
+		MdiInfo[WndNum].pMdiTextEdit->Modify();
+	}
+
+
+	//if(ProjectInfo.name[0]){
+		//プロジェクトが開かれているとき
+		if(MdiInfo[WndNum].DocType==WNDTYPE_BASIC){
+			//クラスツリーを再表示
+			ResetClassTree(GetFileNum(WndNum));
+		}
+	//}
+}
+void TextEdit_ReplaceUpdateUndoData(int WndNum,char *str,BOOL bPaste,BOOL bRedraw){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int Command;
+	char *KeyStr,*DelStr;
+	char temporary[255];
+	CHARRANGE Range,DelRange;
+
+	if(MdiInfo[WndNum].IndentStr){
+		//自動インデントを有効にする
+		lstrcpy(temporary,MdiInfo[WndNum].IndentStr);
+
+		CancelBeforeAutoIndent(WndNum);
+		TextEdit_ReplaceUpdateUndoData(WndNum,temporary,0,1);
+	}
+
+	TextEdit_GetSel(WndNum,&DelRange);
+	if(DelRange.cpMin!=DelRange.cpMax){
+		Command=TEXTEDIT_UNDO_SELKEY;
+		DelStr=(char *)HeapAlloc(hHeap,0,DelRange.cpMax-DelRange.cpMin+1);
+
+		TextEdit_GetSelText(WndNum,&DelRange,DelStr);
+
+		Range.cpMin=DelRange.cpMin;
+		Range.cpMax=DelRange.cpMin;
+	}
+	else{
+		if(bPaste) Command=TEXTEDIT_UNDO_PASTE;
+		else Command=TEXTEDIT_UNDO_KEY;
+		DelStr=0;
+
+		Range=DelRange;
+	}
+	if(str[0]){
+		KeyStr=(char *)HeapAlloc(hHeap,0,lstrlen(str)+1);
+		lstrcpy(KeyStr,str);
+		Range.cpMax+=lstrlen(KeyStr);
+	}
+	else KeyStr=0;
+	TextEdit_NoticeChanging(WndNum,Command,KeyStr,DelStr,&Range,&DelRange);
+
+	TextEdit_Replace(WndNum,str,bRedraw);
+}
+
+
+void TextEdit_Convert(int id){
+	int i,i2;
+
+	int WndNum;
+	WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+	CHARRANGE CharRange;
+	int length;
+	TextEdit_GetSel(WndNum,&CharRange);
+
+#ifdef THETEXT
+	if(id==IDM_CONV_HASRETURN||id==IDM_CONV_QUOTE){
+#else
+	if(id==IDM_CODEFORMAT){
+#endif
+		char *pBuf;
+		pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+		//行全体を選択(min)
+		for(i=CharRange.cpMin;i>0;i--){
+			if(pBuf[i-1]=='\r'&&pBuf[i]=='\n'){
+				i++;
+				break;
+			}
+		}
+		CharRange.cpMin=i;
+
+		//行全体を選択(max)
+		for(i=CharRange.cpMax;;i++){
+			if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'||pBuf[i]=='\0') break;
+		}
+		CharRange.cpMax=i;
+
+		TextEdit_SetSel(WndNum,CharRange.cpMin,CharRange.cpMax,0);
+	}
+
+	length=CharRange.cpMax-CharRange.cpMin;
+
+	char *buffer,*temporary;
+	buffer=(char *)HeapAlloc(hHeap,0,length*3+1024);
+	temporary=(char *)HeapAlloc(hHeap,0,length*3+1024);
+	memcpy(buffer,MdiInfo[WndNum].pMdiTextEdit->buffer+CharRange.cpMin,length);
+	buffer[length]=0;
+
+	int x=0;
+	switch(id){
+		case IDM_CONV_ALPHA_SMALL:
+			CharLower(buffer);
+			break;
+		case IDM_CONV_ALPHA_BIG:
+			CharUpper(buffer);
+			break;
+		case IDM_CONV_HALF:
+			LCMapString(GetUserDefaultLCID(),LCMAP_HALFWIDTH,buffer,length+1,temporary,length*2+1);
+			lstrcpy(buffer,temporary);
+			break;
+		case IDM_CONV_MULTI:
+			LCMapString(GetUserDefaultLCID(),LCMAP_FULLWIDTH,buffer,length+1,temporary,length*2+1);
+			lstrcpy(buffer,temporary);
+			break;
+		case IDM_CONV_KATAKANA:
+			LCMapString(GetUserDefaultLCID(),LCMAP_KATAKANA,buffer,length+1,temporary,length*2+1);
+			lstrcpy(buffer,temporary);
+			break;
+		case IDM_CONV_HIRAGANA:
+			LCMapString(GetUserDefaultLCID(),LCMAP_HIRAGANA,buffer,length+1,temporary,length*2+1);
+			lstrcpy(buffer,temporary);
+			break;
+		case IDM_CONV_SPACE:
+			temporary=(char *)HeapReAlloc(hHeap,0,temporary,length*pobj_nv->TabSize+1);
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,length*pobj_nv->TabSize+1);
+			for(i=0,i2=0;;i++,i2++){
+				if(buffer[i]=='\t'){
+					memset(temporary+i2,' ',pobj_nv->TabSize);
+					i2+=pobj_nv->TabSize-1;
+					continue;
+				}
+				temporary[i2]=buffer[i];
+				if(buffer[i]=='\0') break;
+			}
+
+			lstrcpy(buffer,temporary);
+			break;
+		case IDM_CONV_TAB:
+			char szSpaceTemp[255];
+			memset(szSpaceTemp,' ',pobj_nv->TabSize);
+			szSpaceTemp[pobj_nv->TabSize]=0;
+
+			for(i=0,i2=0;;i++,i2++){
+				if(memcmp(buffer+i,szSpaceTemp,pobj_nv->TabSize)==0){
+					temporary[i2]='\t';
+					i+=pobj_nv->TabSize-1;
+					continue;
+				}
+				temporary[i2]=buffer[i];
+				if(buffer[i]=='\0') break;
+			}
+
+			lstrcpy(buffer,temporary);
+			break;
+
+#ifdef THETEXT
+		case IDM_CONV_HASRETURN:
+			//折り返し改行を挿入
+			int i3;
+			for(i=0,i2=0,x=0;;i++,i2++,x++){
+				if(buffer[i]=='\r'&&buffer[i+1]=='\n'){
+					temporary[i2++]=buffer[i++];
+					temporary[i2]=buffer[i];
+					x=-1;
+					continue;
+				}
+				if(x>pobj_nv->iMaxOneLineTextLength-2){
+					//自動改行（英単語を考慮）
+					int i3=0;
+					while(IsVariableChar(buffer[i-1])){
+						i--;
+						i2--;
+						x--;
+						i3++;
+						if(x==1){
+							i+=i3;
+							i2+=i3;
+							x+=i3;
+							break;
+						}
+					}
+					if(i3==1){
+						i++;
+						i2++;
+						x++;
+					}
+					temporary[i2++]='\r';
+					temporary[i2]='\n';
+					i--;
+					x=-1;
+					continue;
+				}
+
+				if(IsDBCSLeadByte(buffer[i])){
+					temporary[i2++]=buffer[i++];
+					temporary[i2]=buffer[i];
+					x++;
+				}
+				else{
+					temporary[i2]=buffer[i];
+
+					if(buffer[i]=='\t'){
+						//タブ文字
+						int tab;
+						tab=pobj_nv->TabSize;
+
+						if(x%tab==0) i3=tab;
+						else i3=tab-x%tab;
+						x+=i3-1;
+					}
+				}
+
+				if(buffer[i]=='\0') break;
+			}
+
+			lstrcpy(buffer,temporary);
+			break;
+		case IDM_CONV_QUOTE:
+			//引用文に変換
+			for(i=0,i2=0,x=0;;i++,i2++,x++){
+				if(x==0){
+					//"> " を挿入
+					temporary[i2++]='>';
+					temporary[i2++]=' ';
+				}
+				if(buffer[i]=='\r'&&buffer[i+1]=='\n'){
+					temporary[i2++]=buffer[i++];
+					temporary[i2]=buffer[i];
+					x=-1;
+					continue;
+				}
+				if(x>pobj_nv->iMaxOneLineTextLength-4){
+					//自動改行（英単語を考慮）
+					int i3=0;
+					while(IsVariableChar(buffer[i-1])){
+						i--;
+						i2--;
+						x--;
+						i3++;
+						if(x==1){
+							i+=i3;
+							i2+=i3;
+							x+=i3;
+							break;
+						}
+					}
+					if(i3==1){
+						i++;
+						i2++;
+						x++;
+					}
+					temporary[i2++]='\r';
+					temporary[i2]='\n';
+					i--;
+					x=-1;
+					continue;
+				}
+
+				if(IsDBCSLeadByte(buffer[i])){
+					temporary[i2++]=buffer[i++];
+					temporary[i2]=buffer[i];
+					x++;
+				}
+				else{
+					temporary[i2]=buffer[i];
+					if(buffer[i]=='\t'){
+						//タブ文字
+						int tab;
+						tab=pobj_nv->TabSize;
+
+						if(x%tab==0) i3=tab;
+						else i3=tab-x%tab;
+						x+=i3-1;
+					}
+				}
+
+				if(buffer[i]=='\0') break;
+			}
+
+			lstrcpy(buffer,temporary);
+			break;
+
+#else	//ProjectEditor
+
+		case IDM_CODEFORMAT:
+			char *temp2;
+			temp2=CodeFormatter(buffer);
+			HeapDefaultFree(buffer);
+			buffer=temp2;
+			break;
+
+#endif
+	}
+
+
+
+	//テキストエディタの文字列をリプレイス
+	TextEdit_ReplaceUpdateUndoData(WndNum,
+		buffer,
+		1,
+		1);
+
+	HeapDefaultFree(buffer);
+	HeapDefaultFree(temporary);
+
+	//キャレット位置までスクロールする
+	TextEdit_ScrollCaret(WndNum,0);
+	ResetCaretPos(WndNum);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/Resource.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Resource.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Resource.cpp	(revision 178)
@@ -0,0 +1,529 @@
+#include "common.h"
+
+#if defined(JPN)
+//日本語
+#include "pj_msg_jpn.h"
+#else
+//英語
+#include "pj_msg_eng.h"
+#endif
+
+void GetResourceData(void){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	int i2,i3;
+	char *buffer,temporary[MAX_PATH],temp2[MAX_PATH],temp3[MAX_PATH];
+	HANDLE hFile;
+
+	lstrcpy(temporary,ProjectInfo.ResourceFileName);
+	GetFullPath(temporary,ProjectInfo.dir);
+
+	hFile=CreateFile(temporary,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;
+				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++;
+	}
+
+	//リソースが空の場合
+	if(ProjectInfo.res.NumberOfCursorRes==0&&
+		ProjectInfo.res.NumberOfBitmapRes==0&&
+		ProjectInfo.res.NumberOfIconRes==0)
+		ProjectInfo.ResourceFileName[0]=0;
+
+	HeapDefaultFree(buffer);
+}
+
+void Project_CursorResInsert(void){
+	extern HANDLE hHeap;
+	extern LPSTR CursorFileFilter;
+	extern PROJECTINFO ProjectInfo;
+	int i2,i3;
+	char temporary[MAX_PATH];
+
+	if(!ProjectInfo.ResourceFileName[0])
+		sprintf(ProjectInfo.ResourceFileName,"%s.rc",ProjectInfo.name);
+
+	//"カーソル ファイルを指定してください"
+	if(!GetFilePathDialog(hOwner,temporary,CursorFileFilter,STRING_FILEOPENTITLE_CURSOR,TRUE)) return;
+
+	GetRelationalPath(temporary,ProjectInfo.dir);
+
+	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);
+
+	//ツリービューに追加
+	extern HWND hMaterialTreeView;
+	TV_INSERTSTRUCT tv;
+	tv.hInsertAfter=TVI_SORT;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+	tv.item.iImage=6;
+	tv.item.iSelectedImage=6;
+	tv.hParent=ProjectInfo.res.hCursorTreeItem;
+	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++;
+	ProjectInfo.ModifuOfResource=1;
+}
+void Project_Cursor_Delete(int CursorInfoNum){
+	extern PROJECTINFO ProjectInfo;
+	int i;
+
+	//ツリービューから削除
+	extern HWND hMaterialTreeView;
+	TreeView_DeleteItem(hMaterialTreeView,ProjectInfo.res.pCursorResInfo[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];
+
+	ProjectInfo.ModifuOfResource=1;
+}
+void Project_Cursor_RenameID(int CursorInfoNum){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	extern char NewIdName[MAX_PATH];
+	extern HWND hMaterialTreeView;
+	int i2;
+	char temporary[MAX_PATH];
+	TVITEM tvItem;
+
+	if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,DlgProject_ResourceID_Input,(long)ProjectInfo.res.pCursorResInfo[CursorInfoNum].IdName)) return;
+
+	//重複チェック
+	for(i2=0;i2<ProjectInfo.res.NumberOfCursorRes;i2++){
+		if(i2==CursorInfoNum) continue;
+		if(lstrcmp(NewIdName,ProjectInfo.res.pCursorResInfo[i2].IdName)==0){
+			//"ID \"%s\" は既にプロジェクト内に存在します。"
+			sprintf(temporary,STRING_DUPLICATIONERROR_ID_IN_PROJECT,NewIdName);
+			MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+			return;
+		}
+	}
+
+	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;
+	tvItem.mask=TVIF_TEXT;
+	tvItem.pszText=ProjectInfo.res.pCursorResInfo[CursorInfoNum].IdName;
+	tvItem.cchTextMax=lstrlen(ProjectInfo.res.pCursorResInfo[CursorInfoNum].IdName)+1;
+	TreeView_SetItem(hMaterialTreeView,&tvItem);
+
+	ProjectInfo.ModifuOfResource=1;
+
+	TreeView_SortChildren(hMaterialTreeView,
+		TreeView_GetParent(hMaterialTreeView,ProjectInfo.res.pCursorResInfo[CursorInfoNum].hTreeItem),
+		0);
+}
+
+void Project_BitmapResInsert(void){
+	extern HANDLE hHeap;
+	extern LPSTR BitmapFileFilter;
+	extern PROJECTINFO ProjectInfo;
+	int i2,i3;
+	char temporary[MAX_PATH];
+
+	if(!ProjectInfo.ResourceFileName[0])
+		sprintf(ProjectInfo.ResourceFileName,"%s.rc",ProjectInfo.name);
+
+	//"ビットマップ ファイルを指定してください"
+	if(!GetFilePathDialog(hOwner,temporary,BitmapFileFilter,STRING_FILEOPENTITLE_BITMAP,TRUE)) return;
+
+	GetRelationalPath(temporary,ProjectInfo.dir);
+
+	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);
+
+	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);
+
+	//ツリービューに追加
+	extern HWND hMaterialTreeView;
+	TV_INSERTSTRUCT tv;
+	tv.hInsertAfter=TVI_SORT;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+	tv.item.iImage=5;
+	tv.item.iSelectedImage=5;
+	tv.hParent=ProjectInfo.res.hBitmapTreeItem;
+	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++;
+	ProjectInfo.ModifuOfResource=1;
+
+
+	////////////////////////////////
+	// ウィンドウ プロパティを更新
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	for(i2=0;i2<MAX_WNDNUM;i2++){
+		if(MdiInfo[i2].hwnd&&MdiInfo[i2].DocType==WNDTYPE_RAD){
+			if(MdiInfo[i2].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
+				ChangePropertyWindow(i2,GetWndInfoNum(MdiInfo[i2].path));
+		}
+	}
+}
+void Project_Bitmap_Delete(int BitmapInfoNum){
+	extern PROJECTINFO ProjectInfo;
+	int i;
+
+	//ツリービューから削除
+	extern HWND hMaterialTreeView;
+	TreeView_DeleteItem(hMaterialTreeView,ProjectInfo.res.pBitmapResInfo[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];
+
+	ProjectInfo.ModifuOfResource=1;
+}
+void Project_Bitmap_RenameID(int BitmapInfoNum){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	extern char NewIdName[MAX_PATH];
+	extern HWND hMaterialTreeView;
+	int i2;
+	char temporary[MAX_PATH];
+	TVITEM tvItem;
+
+	if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,DlgProject_ResourceID_Input,(long)ProjectInfo.res.pBitmapResInfo[BitmapInfoNum].IdName)) return;
+
+	//重複チェック
+	for(i2=0;i2<ProjectInfo.res.NumberOfBitmapRes;i2++){
+		if(i2==BitmapInfoNum) continue;
+		if(lstrcmp(NewIdName,ProjectInfo.res.pBitmapResInfo[i2].IdName)==0){
+			//"ID \"%s\" は既にプロジェクト内に存在します。"
+			sprintf(temporary,STRING_DUPLICATIONERROR_ID_IN_PROJECT,NewIdName);
+			MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+			return;
+		}
+	}
+
+	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;
+	tvItem.mask=TVIF_TEXT;
+	tvItem.pszText=ProjectInfo.res.pBitmapResInfo[BitmapInfoNum].IdName;
+	tvItem.cchTextMax=lstrlen(ProjectInfo.res.pBitmapResInfo[BitmapInfoNum].IdName)+1;
+	TreeView_SetItem(hMaterialTreeView,&tvItem);
+
+	ProjectInfo.ModifuOfResource=1;
+
+	TreeView_SortChildren(hMaterialTreeView,
+		TreeView_GetParent(hMaterialTreeView,ProjectInfo.res.pBitmapResInfo[BitmapInfoNum].hTreeItem),
+		0);
+}
+void Project_IconResInsert(void){
+	extern HANDLE hHeap;
+	extern LPSTR IconFileFilter;
+	extern PROJECTINFO ProjectInfo;
+	int i2,i3;
+	char temporary[MAX_PATH];
+
+	if(!ProjectInfo.ResourceFileName[0])
+		sprintf(ProjectInfo.ResourceFileName,"%s.rc",ProjectInfo.name);
+
+	//"アイコン ファイルを指定してください"
+	if(!GetFilePathDialog(hOwner,temporary,IconFileFilter,STRING_FILEOPENTITLE_ICON,TRUE)) return;
+
+	GetRelationalPath(temporary,ProjectInfo.dir);
+
+	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);
+
+	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);
+
+	//ツリービューに追加
+	extern HWND hMaterialTreeView;
+	TV_INSERTSTRUCT tv;
+	tv.hInsertAfter=TVI_SORT;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+	tv.item.iImage=4;
+	tv.item.iSelectedImage=4;
+	tv.hParent=ProjectInfo.res.hIconTreeItem;
+	if(ProjectInfo.res.NumberOfIconRes==0) lstrcat(temporary," (Main)");
+	tv.item.pszText=temporary;
+
+	ProjectInfo.res.pIconResInfo[ProjectInfo.res.NumberOfIconRes].hTreeItem=
+		TreeView_InsertItem(hMaterialTreeView,&tv);
+
+	TreeView_SelectItem(hMaterialTreeView,ProjectInfo.res.pIconResInfo[ProjectInfo.res.NumberOfIconRes].hTreeItem);
+
+	ProjectInfo.res.NumberOfIconRes++;
+	ProjectInfo.ModifuOfResource=1;
+
+	////////////////////////////////
+	// ウィンドウ プロパティを更新
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	for(i2=0;i2<MAX_WNDNUM;i2++){
+		if(MdiInfo[i2].hwnd&&MdiInfo[i2].DocType==WNDTYPE_RAD){
+			if(MdiInfo[i2].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
+				ChangePropertyWindow(i2,GetWndInfoNum(MdiInfo[i2].path));
+		}
+	}
+}
+void Project_Icon_Delete(int IconInfoNum){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	int i2;
+	char temporary[MAX_PATH];
+	TVITEM tv;
+
+	//ツリービューから削除
+	extern HWND hMaterialTreeView;
+	TreeView_DeleteItem(hMaterialTreeView,ProjectInfo.res.pIconResInfo[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){
+		tv.mask=TVIF_TEXT|TVIF_HANDLE;
+		tv.pszText=temporary;
+		tv.cchTextMax=MAX_PATH;
+		tv.hItem=ProjectInfo.res.pIconResInfo[0].hTreeItem;
+		TreeView_GetItem(hMaterialTreeView,&tv);
+		lstrcat(tv.pszText," (Main)");
+		TreeView_SetItem(hMaterialTreeView,&tv);
+	}
+
+	ProjectInfo.ModifuOfResource=1;
+
+	////////////////////////////////
+	// ウィンドウ プロパティを更新
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	for(i2=0;i2<MAX_WNDNUM;i2++){
+		if(MdiInfo[i2].hwnd&&MdiInfo[i2].DocType==WNDTYPE_RAD){
+			if(MdiInfo[i2].MdiRadInfo->SelectingItem[0]==SELECT_WINDOW)
+				ChangePropertyWindow(i2,GetWndInfoNum(MdiInfo[i2].path));
+		}
+	}
+}
+void Project_Icon_RenameID(int IconInfoNum){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	extern char NewIdName[MAX_PATH];
+	extern HWND hMaterialTreeView;
+	int i2;
+	char temporary[MAX_PATH];
+	TVITEM tvItem;
+
+	if(!DialogBoxParam(hResInst,MAKEINTRESOURCE(IDD_INPUTID),hOwner,DlgProject_ResourceID_Input,(long)ProjectInfo.res.pIconResInfo[IconInfoNum].IdName)) return;
+
+	//重複チェック
+	for(i2=0;i2<ProjectInfo.res.NumberOfIconRes;i2++){
+		if(i2==IconInfoNum) continue;
+		if(lstrcmp(NewIdName,ProjectInfo.res.pIconResInfo[i2].IdName)==0){
+			//"ID \"%s\" は既にプロジェクト内に存在します。"
+			sprintf(temporary,STRING_DUPLICATIONERROR_ID_IN_PROJECT,NewIdName);
+			MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+			return;
+		}
+	}
+
+	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;
+	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;
+	TreeView_SetItem(hMaterialTreeView,&tvItem);
+
+	ProjectInfo.ModifuOfResource=1;
+
+	TreeView_SortChildren(hMaterialTreeView,
+		TreeView_GetParent(hMaterialTreeView,ProjectInfo.res.pIconResInfo[IconInfoNum].hTreeItem),
+		0);
+}
+
+BOOL CALLBACK DlgProject_ResourceID_Input(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern char NewIdName[MAX_PATH];
+	switch(message){
+		case WM_INITDIALOG:
+			//"IDの変更"
+			SetWindowText(hwnd,STRING_RENAME_ID);
+
+			SetDlgItemText(hwnd,IDC_IDNAME,(char *)lParam);
+			SetPosCenter(hwnd);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					GetDlgItemText(hwnd,IDC_IDNAME,NewIdName,MAX_PATH);
+					if(!NewIdName[0]){
+						//"ID名を入力して下さい。"
+						MessageBox(hwnd,STRING_ERROR_MUST_IDNAME,APPLICATION_NAME,MB_OK);
+						return 1;
+					}
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/Ruler.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Ruler.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Ruler.cpp	(revision 178)
@@ -0,0 +1,117 @@
+#include "common.h"
+
+LRESULT CALLBACK RulerProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	switch(message){
+		case WM_PAINT:
+			CRuler *pobj_Ruler;
+			pobj_Ruler=(CRuler *)GetWindowLong(hwnd,GWL_USERDATA);
+
+			HDC hdc;
+			PAINTSTRUCT ps;
+			hdc=BeginPaint(hwnd,&ps);
+
+			pobj_Ruler->draw(hdc);
+
+			EndPaint(hwnd,&ps);
+			break;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
+
+CRuler::CRuler(HWND hParent,int WndNum){
+	m_WndNum=WndNum;
+
+	hRulerWnd=CreateWindowEx(0,"Ruler","Ruler",
+		WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE,
+		0,0,0,0,
+		hParent,0,hInst,0);
+	SetWindowLong(hRulerWnd,GWL_USERDATA,(long)this);
+
+	HDC hdc;
+	hdc=GetDC(hRulerWnd);
+
+	memdc=CreateCompatibleDC(hdc);
+	hMemBmp=CreateCompatibleBitmap(hdc,ScreenX,HEIGHT_RULER);
+	SelectObject(memdc,hMemBmp);
+
+	ReleaseDC(hRulerWnd,hdc);
+}
+CRuler::~CRuler(){
+	DeleteDC(memdc);
+	DeleteObject(hMemBmp);
+
+	DestroyWindow(hRulerWnd);
+}
+
+void CRuler::resize(int x,int y,int cx,int cy){
+	MoveWindow(hRulerWnd,x,y,cx,cy,1);
+}
+void CRuler::draw(HDC hdc){
+	int i;
+
+	//スクロールバーによるベースポジションを取得
+	int BaseX,BaseY;
+	BaseX=0;
+	BaseY=0;
+	GetScrollBaseCaretPos(m_WndNum,&BaseX,&BaseY);
+
+	int iControlTabSpace;
+	iControlTabSpace=MdiInfo[m_WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+
+	HBRUSH hBrush,hOldBrush;
+	hBrush=CreateSolidBrush(RGB(230,230,230));
+
+	HPEN hPen,hOldPen;
+	hPen=CreatePen(PS_SOLID,0,RGB(60,60,60));
+
+	//背景色を塗りつぶす
+	hOldBrush=(HBRUSH)SelectObject(memdc,hBrush);
+	PatBlt(memdc,0,0,ScreenX,HEIGHT_RULER,PATCOPY);
+	SelectObject(memdc,hOldBrush);
+
+
+	extern HFONT hRulerFont;
+	HFONT hOldFont;
+	hOldFont=(HFONT)SelectObject(memdc,hRulerFont);
+
+	hOldPen=(HPEN)SelectObject(memdc,hPen);
+
+	//ラインを描画
+	extern int font_width;
+	int x;
+	for(x=iControlTabSpace,i=-BaseX;x<ScreenX;x+=font_width,i++){
+		if(i%10==0){
+			MoveToEx(memdc,x,0,NULL);
+			LineTo(memdc,x,HEIGHT_RULER);
+		}
+		else if(i%5==0){
+			MoveToEx(memdc,x,HEIGHT_RULER/2,NULL);
+			LineTo(memdc,x,HEIGHT_RULER);
+		}
+		else{
+			MoveToEx(memdc,x,HEIGHT_RULER-3,NULL);
+			LineTo(memdc,x,HEIGHT_RULER);
+		}
+	}
+
+	//桁番号を描画
+	char temporary[32];
+	SetBkColor(memdc,RGB(230,230,230));
+	SetTextColor(memdc,RGB(60,60,60));
+	for(x=iControlTabSpace,i=-BaseX;x<ScreenX;x+=font_width,i++){
+		if(i%10==0){
+			sprintf(temporary,"%d",i);
+			TextOut(memdc,x+2,0,temporary,lstrlen(temporary));
+		}
+	}
+
+	SelectObject(memdc,hOldPen);
+	SelectObject(memdc,hOldFont);
+
+
+	//画面に描画
+	BitBlt(hdc,0,0,ScreenX,HEIGHT_RULER,memdc,0,0,SRCCOPY);
+
+	DeleteObject(hBrush);
+	DeleteObject(hPen);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/Ruler.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Ruler.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Ruler.h	(revision 178)
@@ -0,0 +1,17 @@
+
+#define HEIGHT_RULER 10
+
+LRESULT CALLBACK RulerProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+class CRuler{
+	int m_WndNum;
+	HDC memdc;
+	HBITMAP hMemBmp;
+public:
+	HWND hRulerWnd;
+	CRuler(HWND hParent,int WndNum);
+	~CRuler();
+
+	void resize(int x,int y,int cx,int cy);
+	void draw(HDC hdc);
+};
Index: tag/abdev(2007.06.20)/ProjectEditor/Search.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/Search.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/Search.cpp	(revision 178)
@@ -0,0 +1,533 @@
+#include "common.h"
+
+long *pFindPos;
+int FindPosCounter;
+
+char *CompareSuper(HWND hDlg,char *buffer,char *szFind,BOOL IsBigSmall,bool isWordUnit,BOOL IsRegExp,int *pLength ){
+	char *pTemp;
+
+	if(buffer[0]=='\0') return 0;
+
+	if(IsRegExp){
+		//正規表現を有効にしながら検索
+		pTemp=obj_RegExp.compare(hDlg,buffer,szFind,IsBigSmall, isWordUnit, pLength);
+	}
+	else{
+		//通常の検索
+		pTemp=ComparisonString(buffer,szFind,IsBigSmall?true:false, isWordUnit );
+
+		*pLength=lstrlen(szFind);
+	}
+
+	return pTemp;
+}
+
+void SetSearchData(HWND hDlg,char *str,_int8 IsBigSmall, bool isWordUnit){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2,i3,i4,i5,length;
+	int WndNum;
+	char *buffer,*FindStr,*LineStr;
+	HWND hEdit;
+
+	WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+	if(WndNum==-1) return;
+	hEdit=GetWindow(GetWindow(hClient,GW_CHILD),GW_CHILD);
+
+	i=lstrlen(MdiInfo[WndNum].pMdiTextEdit->buffer)+1;
+
+	buffer=(char *)HeapAlloc(hHeap,0,i);
+	lstrcpy(buffer,MdiInfo[WndNum].pMdiTextEdit->buffer);
+
+	LineStr=(char *)HeapAlloc(hHeap,0,i+64);
+
+	pFindPos[0]=(long)hEdit;
+	i=0;
+	i3=1;
+	while(1){
+		FindStr=CompareSuper(hDlg,buffer+i,str,IsBigSmall, isWordUnit, pobj_nv->bRegExp,&length);
+		if(FindStr==(char *)-1){
+			//エラー
+			return;
+		}
+		if(!FindStr) break;
+
+		i=FindStr-buffer;
+		for(i4=0,i5=1;i>i4;i4++){
+			if(buffer[i4-1]=='\r'&&buffer[i4]=='\n') i5++;
+		}
+		for(;i>0;i--){
+			if(buffer[i-2]=='\r'&&buffer[i-1]=='\n') break;
+		}
+
+		FindPosCounter+=sizeof(long);
+		pFindPos=(long *)HeapReAlloc(hHeap,0,pFindPos,FindPosCounter);
+		pFindPos[i3]=i;
+
+		sprintf(LineStr,"Line:%d  ",i5);
+		for(i2=lstrlen(LineStr);;i++,i2++){
+			if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+				LineStr[i2]=0;
+				break;
+			}
+			LineStr[i2]=buffer[i];
+		}
+		SendDlgItemMessage(hDlg,IDC_FINDLIST,LB_ADDSTRING,0,(long)LineStr);
+		i3++;
+	}
+	HeapDefaultFree(buffer);
+	HeapDefaultFree(LineStr);
+}
+BOOL CALLBACK DlgFindAll(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,WndNum;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_SHOWITEM:
+					i=SendDlgItemMessage(hwnd,IDC_FINDLIST,LB_GETCURSEL,0,0);
+					if(i==LB_ERR) return 1;
+					i++;
+
+					if(!IsWindow((HWND)pFindPos[0])){
+						MessageBeep(0);
+						return 1;
+					}
+
+					WndNum=GetWndNum(GetParent((HWND)pFindPos[0]));
+					if(WndNum==-1) return 1;
+
+					CHARRANGE CharRange;
+					CharRange.cpMin=pFindPos[i];
+
+					char *pBuf;
+					pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+					//行の末端位置を取得
+					for(i=CharRange.cpMin;;i++){
+						if(pBuf[i]=='\0') break;
+						if(pBuf[i]=='\r'&&pBuf[i+1]=='\n') break;
+					}
+					CharRange.cpMax=i;
+
+					TextEdit_SetSel(WndNum,CharRange.cpMin,CharRange.cpMax,TRUE);
+
+					SetFocus((HWND)pFindPos[0]);
+					return 1;
+				case IDCANCEL:
+					HeapDefaultFree(pFindPos);
+					EndDialog(hwnd,0);
+					return 1;
+				case IDC_FINDLIST:
+					if(HIWORD(wParam)==LBN_DBLCLK) SendMessage(hwnd,WM_COMMAND,IDC_SHOWITEM,0);
+					return 1;
+			}
+			break;
+		case WM_SIZE:
+			RECT rect;
+			GetClientRect(hwnd,&rect);
+			MoveWindow(GetDlgItem(hwnd,IDC_FINDLIST),rect.left,26,rect.right,rect.bottom-26,1);
+			return 1;
+	}
+	return 0;
+}
+BOOL StartSearch(HWND hDlg,char *FindString,_int8 IsBigSmall, bool isWordUnit, BOOL IsShowMessage){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	char *pBuf,msg[255];
+	CHARRANGE CharRange;
+
+	int WndNum;
+	WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+	if(WndNum==-1) return 0;
+
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+	TextEdit_GetSel(WndNum,&CharRange);
+	i=CharRange.cpMax;
+
+FindStart:
+
+	int length;
+
+	i=(int)CompareSuper(hDlg,pBuf+i,FindString,IsBigSmall, isWordUnit, pobj_nv->bRegExp,&length);
+	if(i==-1){
+		//エラー
+		return 0;
+	}
+
+	if(i){
+		//検索文字列を反転表示
+		i-=(int)pBuf;
+		CharRange.cpMin=i;
+		CharRange.cpMax=i+length;
+		TextEdit_SetSel(WndNum,CharRange.cpMin,CharRange.cpMax,TRUE);
+
+		return 1;
+	}
+	else{
+		if(!IsShowMessage) return 0;
+
+		i=(int)CompareSuper(hDlg,pBuf,FindString,IsBigSmall, isWordUnit, pobj_nv->bRegExp,&length);
+		if(i==-1){
+			//エラー
+			return 0;
+		}
+
+		if(i){
+			//"ファイルの最初から検索しますか？"
+			if(MessageBox(hDlg,STRING_SEARCH_AGAIN,"ProjectEditor - Search",MB_YESNO|MB_ICONINFORMATION)==IDYES){
+				i=0;
+				goto FindStart;
+			}
+		}
+		else{
+			//"文字列 \"%s\" が見つかりません"
+			sprintf(msg,STRING_SEARCH_NOTFOUND,FindString);
+			MessageBox(hDlg,msg,"ProjectEditor - Search",MB_OK|MB_ICONINFORMATION);
+		}
+	}
+	return 0;
+}
+void AddFindData(HWND hwnd,char ppData[MAX_FINDLIST][MAX_PATH],char *str){
+	int i;
+	for(i=0;i<MAX_FINDLIST;i++){
+		if(lstrcmp(ppData[i],str)==0) break;
+	}
+	if(i==MAX_FINDLIST) i--;
+	for(;i>0;i--) lstrcpy(ppData[i],ppData[i-1]);
+	lstrcpy(ppData[0],str);
+	SendMessage(hwnd,CB_RESETCONTENT,0,0);
+	for(i=0;i<MAX_FINDLIST;i++){
+		if(ppData[i][0]=='\0') break;
+		SendMessage(hwnd,CB_ADDSTRING,0,(long)ppData[i]);
+	}
+	SendMessage(hwnd,CB_SETCURSEL,0,0);
+}
+BOOL CALLBACK DlgFind(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HWND FindAllDlg;
+	int i,WndNum;
+	char temporary[8192],*pTemp;
+	CHARRANGE CharRange;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+
+			//大文字・小文字
+			if(pobj_nv->bFindStrBigSmall) SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_SETCHECK,BST_CHECKED,0);
+
+			// 単語単位
+			if( pobj_nv->isWordUnit ){
+				SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_SETCHECK, BST_CHECKED, 0 );
+			}
+
+			//正規表現
+			if(pobj_nv->bRegExp) SendDlgItemMessage(hwnd,IDC_REGEXP,BM_SETCHECK,BST_CHECKED,0);
+
+			//検索文字列コンボボックスを初期化
+			SendDlgItemMessage(hwnd,IDC_FINDSTR,CB_RESETCONTENT,0,0);
+			for(i=0;i<MAX_FINDLIST;i++){
+				if(pobj_nv->FindStr[i][0]=='\0') break;
+				SendDlgItemMessage(hwnd,IDC_FINDSTR,CB_ADDSTRING,0,(long)pobj_nv->FindStr[i]);
+			}
+			SendDlgItemMessage(hwnd,IDC_FINDSTR,CB_LIMITTEXT,8192,0);
+
+			WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+			//選択されている文字列を取得
+			TextEdit_GetSel(WndNum,&CharRange);
+			pTemp=(char *)HeapAlloc(hHeap,0,CharRange.cpMax-CharRange.cpMin+1);
+			memcpy(pTemp,
+				MdiInfo[WndNum].pMdiTextEdit->buffer+CharRange.cpMin,
+				CharRange.cpMax-CharRange.cpMin);
+			pTemp[CharRange.cpMax-CharRange.cpMin]=0;
+
+			if(pTemp[0]) SetDlgItemText(hwnd,IDC_FINDSTR,pTemp);
+			else SendDlgItemMessage(hwnd,IDC_FINDSTR,CB_SETCURSEL,0,0);
+
+			HeapDefaultFree(pTemp);
+
+			SetFocus(GetDlgItem(hwnd,IDC_FINDSTR));
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					GetDlgItemText(hwnd,IDC_FINDSTR,temporary,MAX_PATH);
+					if(temporary[0]==0) return 1;
+					AddFindData(GetDlgItem(hwnd,IDC_FINDSTR),pobj_nv->FindStr,temporary);
+
+					//大文字・小文字
+					if(SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_GETCHECK,0,0)) pobj_nv->bFindStrBigSmall=1;
+					else pobj_nv->bFindStrBigSmall=0;
+
+					// 単語単位
+					pobj_nv->isWordUnit =
+						( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 );
+
+					//正規表現
+					if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1;
+					else pobj_nv->bRegExp=0;
+
+					StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit, 1);
+					return 1;
+				case IDC_FINDALL:
+					GetDlgItemText(hwnd,IDC_FINDSTR,temporary,MAX_PATH);
+					if(temporary[0]==0) return 1;
+					AddFindData(GetDlgItem(hwnd,IDC_FINDSTR),pobj_nv->FindStr,temporary);
+
+					//大文字・小文字
+					if(SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_GETCHECK,0,0)) pobj_nv->bFindStrBigSmall=1;
+					else pobj_nv->bFindStrBigSmall=0;
+
+					// 単語単位
+					pobj_nv->isWordUnit =
+						( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 );
+
+					//正規表現
+					if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1;
+					else pobj_nv->bRegExp=0;
+
+					FindAllDlg=CreateDialog(hResInst,MAKEINTRESOURCE(IDD_FINDALL),GetWindow(hwnd,GW_OWNER),(DLGPROC)DlgFindAll);
+					ShowWindow(FindAllDlg,SW_SHOW);
+
+					FindPosCounter=sizeof(long);
+					pFindPos=(long *)HeapAlloc(hHeap,0,FindPosCounter);
+					SetSearchData(FindAllDlg,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit );
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+BOOL CALLBACK DlgPermutation(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern HINSTANCE hInst;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	int WndNum;
+	char temporary[8192],temp2[8192],*pTemp;
+	CHARRANGE CharRange;
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+
+			//大文字・小文字
+			if(pobj_nv->bFindStrBigSmall) SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_SETCHECK,BST_CHECKED,0);
+
+			// 単語単位
+			if( pobj_nv->isWordUnit ){
+				SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_SETCHECK, BST_CHECKED, 0 );
+			}
+
+			//正規表現
+			if(pobj_nv->bRegExp) SendDlgItemMessage(hwnd,IDC_REGEXP,BM_SETCHECK,BST_CHECKED,0);
+
+
+			//検索文字列コンボボックスを初期化
+			SendDlgItemMessage(hwnd,IDC_FINDSTR,CB_RESETCONTENT,0,0);
+			for(i=0;i<MAX_FINDLIST;i++){
+				if(pobj_nv->FindStr[i][0]=='\0') break;
+				SendDlgItemMessage(hwnd,IDC_FINDSTR,CB_ADDSTRING,0,(long)pobj_nv->FindStr[i]);
+			}
+			SendDlgItemMessage(hwnd,IDC_FINDSTR,CB_LIMITTEXT,8192,0);
+
+			WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+			//選択されている文字列を取得
+			TextEdit_GetSel(WndNum,&CharRange);
+			pTemp=(char *)HeapAlloc(hHeap,0,CharRange.cpMax-CharRange.cpMin+1);
+			memcpy(pTemp,
+				MdiInfo[WndNum].pMdiTextEdit->buffer+CharRange.cpMin,
+				CharRange.cpMax-CharRange.cpMin);
+			pTemp[CharRange.cpMax-CharRange.cpMin]=0;
+
+			if(pTemp[0]) SetDlgItemText(hwnd,IDC_FINDSTR,pTemp);
+			else SendDlgItemMessage(hwnd,IDC_FINDSTR,CB_SETCURSEL,0,0);
+
+			HeapDefaultFree(pTemp);
+
+			//置換文字列コンボボックスを初期化
+			SendDlgItemMessage(hwnd,IDC_PERMUTATIONSTR,CB_RESETCONTENT,0,0);
+			for(i=0;i<MAX_FINDLIST;i++){
+				if(pobj_nv->PermutationStr[i][0]=='\0') break;
+				SendDlgItemMessage(hwnd,IDC_PERMUTATIONSTR,CB_ADDSTRING,0,(long)pobj_nv->PermutationStr[i]);
+			}
+			SendDlgItemMessage(hwnd,IDC_PERMUTATIONSTR,CB_SETCURSEL,0,0);
+			SendDlgItemMessage(hwnd,IDC_PERMUTATIONSTR,CB_LIMITTEXT,8192,0);
+
+			SetFocus(GetDlgItem(hwnd,IDC_FINDSTR));
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDC_FIND:
+					//大文字・小文字
+					if(SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_GETCHECK,0,0)) pobj_nv->bFindStrBigSmall=1;
+					else pobj_nv->bFindStrBigSmall=0;
+
+					// 単語単位
+					pobj_nv->isWordUnit =
+						( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 );
+
+					//正規表現
+					if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1;
+					else pobj_nv->bRegExp=0;
+
+					GetDlgItemText(hwnd,IDC_FINDSTR,temporary,MAX_PATH);
+					if(temporary[0]==0) return 1;
+					AddFindData(GetDlgItem(hwnd,IDC_FINDSTR),pobj_nv->FindStr,temporary);
+
+					StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit, 1);
+					return 1;
+				case IDC_PERMUTATIONNEXT:
+					//////////
+					// 置換
+					//////////
+
+					//大文字・小文字
+					if(SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_GETCHECK,0,0)) pobj_nv->bFindStrBigSmall=1;
+					else pobj_nv->bFindStrBigSmall=0;
+
+					// 単語単位
+					pobj_nv->isWordUnit =
+						( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 );
+
+					//正規表現
+					if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1;
+					else pobj_nv->bRegExp=0;
+
+					//検索する文字列を取得
+					GetDlgItemText(hwnd,IDC_FINDSTR,temporary,MAX_PATH);
+					if(temporary[0]==0) return 1;
+					AddFindData(GetDlgItem(hwnd,IDC_FINDSTR),pobj_nv->FindStr,temporary);
+
+					//置換する文字列を取得
+					GetDlgItemText(hwnd,IDC_PERMUTATIONSTR,temp2,MAX_PATH);
+					AddFindData(GetDlgItem(hwnd,IDC_PERMUTATIONSTR),pobj_nv->PermutationStr,temp2);
+
+					WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+					//選択されている文字列を取得
+					TextEdit_GetSel(WndNum,&CharRange);
+					pTemp=(char *)HeapAlloc(hHeap,0,CharRange.cpMax-CharRange.cpMin+1);
+					memcpy(pTemp,
+						MdiInfo[WndNum].pMdiTextEdit->buffer+CharRange.cpMin,
+						CharRange.cpMax-CharRange.cpMin);
+					pTemp[CharRange.cpMax-CharRange.cpMin]=0;
+
+					int length;
+					i=(int)CompareSuper(hwnd,pTemp,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit, pobj_nv->bRegExp,&length);
+					if(i==-1){
+						HeapDefaultFree(pTemp);
+						return 1;
+					}
+
+					if(i){
+						if(pobj_nv->bRegExp){
+							char *pTempPermu;
+
+							//正規表現の結果文字列を取得（置換後用の文字列を取得）
+							pTempPermu=obj_RegExp.GetPermuStr(hwnd,pTemp,temporary,temp2,pobj_nv->bFindStrBigSmall);
+							if(pTempPermu==(char *)-1||pTempPermu==0){
+								HeapDefaultFree(pTemp);
+								return 1;
+							}
+
+							//置換する
+							TextEdit_ReplaceUpdateUndoData(WndNum,pTempPermu,0,1);
+
+							HeapDefaultFree(pTempPermu);
+						}
+						else{
+							//置換する
+							TextEdit_ReplaceUpdateUndoData(WndNum,temp2,0,1);
+						}
+					}
+					HeapDefaultFree(pTemp);
+
+					//次を検索
+					SendMessage(hwnd,WM_COMMAND,IDC_FIND,0);
+
+					return 1;
+				case IDC_PERMUTATIONALL:
+					//////////////
+					// すべて置換
+					//////////////
+
+					//大文字・小文字
+					if(SendDlgItemMessage(hwnd,IDC_ISBIGSMALL,BM_GETCHECK,0,0)) pobj_nv->bFindStrBigSmall=1;
+					else pobj_nv->bFindStrBigSmall=0;
+
+					// 単語単位
+					pobj_nv->isWordUnit =
+						( SendDlgItemMessage( hwnd, IDC_ISWORDUNIT, BM_GETCHECK, 0, 0 ) != 0 );
+
+					//正規表現
+					if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1;
+					else pobj_nv->bRegExp=0;
+
+					//検索する文字列を取得
+					GetDlgItemText(hwnd,IDC_FINDSTR,temporary,MAX_PATH);
+					if(temporary[0]==0) return 1;
+					AddFindData(GetDlgItem(hwnd,IDC_FINDSTR),pobj_nv->FindStr,temporary);
+
+					//置換する文字列を取得
+					GetDlgItemText(hwnd,IDC_PERMUTATIONSTR,temp2,MAX_PATH);
+					AddFindData(GetDlgItem(hwnd,IDC_PERMUTATIONSTR),pobj_nv->PermutationStr,temp2);
+
+					//正規表現
+					if(SendDlgItemMessage(hwnd,IDC_REGEXP,BM_GETCHECK,0,0)) pobj_nv->bRegExp=1;
+					else pobj_nv->bRegExp=0;
+
+					WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+					TextEdit_SetSel(WndNum,0,0,TRUE);
+
+					while(StartSearch(hwnd,temporary,pobj_nv->bFindStrBigSmall, pobj_nv->isWordUnit, 0)){
+						if(pobj_nv->bRegExp){
+							//選択されている文字列を取得
+							TextEdit_GetSel(WndNum,&CharRange);
+							pTemp=(char *)HeapAlloc(hHeap,0,CharRange.cpMax-CharRange.cpMin+1);
+							memcpy(pTemp,
+								MdiInfo[WndNum].pMdiTextEdit->buffer+CharRange.cpMin,
+								CharRange.cpMax-CharRange.cpMin);
+							pTemp[CharRange.cpMax-CharRange.cpMin]=0;
+
+							char *pTempPermu;
+
+							//正規表現の結果文字列を取得（置換後用の文字列を取得）
+							pTempPermu=obj_RegExp.GetPermuStr(hwnd,pTemp,temporary,temp2,pobj_nv->bFindStrBigSmall);
+							if(pTempPermu==(char *)-1||pTempPermu==0){
+								HeapDefaultFree(pTemp);
+								return 1;
+							}
+
+							//置換する
+							TextEdit_ReplaceUpdateUndoData(WndNum,pTempPermu,0,1);
+
+							HeapDefaultFree(pTempPermu);
+							HeapDefaultFree(pTemp);
+						}
+						else{
+							//置換する
+							TextEdit_ReplaceUpdateUndoData(WndNum,temp2,0,1);
+						}
+					}
+
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/StringCount.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/StringCount.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/StringCount.cpp	(revision 178)
@@ -0,0 +1,98 @@
+#include "common.h"
+
+#ifdef THETEXT
+
+BOOL CALLBACK DlgStringCount(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	if(message==WM_INITDIALOG){
+		SetPosCenter(hwnd);
+
+		int i,WndNum;
+
+		WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+
+		char *pBuf;
+		if(lParam){
+			//選択範囲
+			CHARRANGE CharRange;
+			TextEdit_GetSel(WndNum,&CharRange);
+			pBuf=(char *)HeapAlloc(hHeap,0,(CharRange.cpMax-CharRange.cpMin)+1);
+			TextEdit_GetSelText(WndNum,&CharRange,pBuf);
+
+			SetWindowText(hwnd,"選択範囲の文字カウント");
+		}
+		else{
+			//すべての範囲
+			pBuf=(char *)HeapAlloc(hHeap,0,lstrlen(MdiInfo[WndNum].pMdiTextEdit->buffer)+1);
+			lstrcpy(pBuf,MdiInfo[WndNum].pMdiTextEdit->buffer);
+		}
+
+		//総バイト数を取得
+		int iByte;
+		iByte=lstrlen(pBuf);
+
+		//文字数（スペースを含めない）を取得
+		int iOmitSpace=0;
+		for(i=0;i<iByte;i++){
+			if(pBuf[i]==' '||pBuf[i]=='\t') continue;
+			if(pBuf[i]==(char)0x81&&pBuf[i+1]==(char)0x40){
+				i++;
+				continue;
+			}
+			if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+				i++;
+				continue;
+			}
+			iOmitSpace++;
+			if(IsDBCSLeadByte(pBuf[i])){
+				i++;
+				continue;
+			}
+		}
+
+		//文字数（スペースを含む）を取得
+		int iWithSpace=0,iLineNum=0;
+		for(i=0;i<iByte;i++){
+			if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+
+				//行数
+				iLineNum++;
+
+				i++;
+				continue;
+			}
+			iWithSpace++;
+			if(IsDBCSLeadByte(pBuf[i])){
+				i++;
+				continue;
+			}
+		}
+
+		if(iByte) iLineNum++;
+
+		char temporary[255];
+
+		//総バイト数
+		Digit(iByte,temporary);
+		SetDlgItemText(hwnd,IDC_SCOUNT_BYTE,temporary);
+
+		//文字数（スペースを含めない）
+		Digit(iOmitSpace,temporary);
+		SetDlgItemText(hwnd,IDC_SCOUNT_OMIT_SPACE,temporary);
+
+		//文字数（スペースを含む）
+		Digit(iWithSpace,temporary);
+		SetDlgItemText(hwnd,IDC_SCOUNT_WITH_SPACE,temporary);
+
+		//行数
+		Digit(iLineNum,temporary);
+		SetDlgItemText(hwnd,IDC_SCOUNT_LINENUM,temporary);
+
+
+		HeapDefaultFree(pBuf);
+	}
+	if(message==WM_COMMAND&&LOWORD(wParam)==IDCANCEL) EndDialog(hwnd,NULL);
+	return 0;
+}
+
+#endif //THETEXT
+
Index: tag/abdev(2007.06.20)/ProjectEditor/SubOperation.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/SubOperation.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/SubOperation.cpp	(revision 178)
@@ -0,0 +1,1542 @@
+#include "Common.h"
+
+
+void ScreenToClient(HWND hwnd,RECT *pRect){
+	ScreenToClient(hwnd,(POINT *)pRect);
+	ScreenToClient(hwnd,(POINT *)(((long)(void *)pRect)+sizeof(POINT)));
+}
+void ClientToScreen(HWND hwnd,RECT *pRect){
+	ClientToScreen(hwnd,(POINT *)pRect);
+	ClientToScreen(hwnd,(POINT *)(((long)(void *)pRect)+sizeof(POINT)));
+}
+
+
+typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE hProcess,PBOOL Wow64Process);
+BOOL IsWow64(void){
+	///////////////////////////////////////////////////////////
+	// ProjectEditor.exeがWOW64技術で動作しているのかどうか
+	///////////////////////////////////////////////////////////
+	BOOL bIsWow64 = FALSE;
+	LPFN_ISWOW64PROCESS fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(GetModuleHandle("kernel32"),"IsWow64Process");
+
+	if (NULL != fnIsWow64Process)
+	{
+		if (!fnIsWow64Process(GetCurrentProcess(),&bIsWow64))
+		{
+			// handle error
+			bIsWow64 = FALSE;
+		}
+	}
+	return bIsWow64;
+}
+
+void URLEncode(LPSTR pszSrc){
+	char *temp;
+	temp=(char *)malloc(65535);
+
+	int i,i2;
+	for (i = 0,i2=0; ; i++,i2++)
+	{
+		if(pszSrc[i]=='\0'){
+			temp[i2] = 0;
+			break;
+		}
+
+		// 英数字 _ . - は変換しないでそのまま
+		if (isalnum((BYTE)pszSrc[i]) || pszSrc[i] == '_' || pszSrc[i] == '.' || pszSrc[i] == '-'){
+			temp[i2] = pszSrc[i];
+		}
+		// それ以外は %3B のような形式に変換
+		else{
+			sprintf(temp+i2,"%%%02X", (BYTE)pszSrc[i]);
+			i2+=lstrlen(temp+i2);
+			i2--;
+		}
+	}
+
+	lstrcpy(pszSrc,temp);
+	free(temp);
+}
+
+void Digit(int num,char *buffer){
+	char temporary[255];
+	int i,iPos;
+
+	sprintf(temporary,"%d",abs(num));
+
+	//カンマが不要の場合は抜ける
+	if(lstrlen(temporary)<=3){
+		wsprintf(buffer,"%d",num);
+		return;
+	}
+
+	//合計の文字数からバッファを確保
+	if(num<0){
+		buffer[0]='-';
+		iPos=1;
+	}
+	else{
+		buffer[0]=0;
+		iPos=0;
+	}
+
+	//3桁毎にカンマを加えながら文字列をコピーする
+	int iFirst;
+	iFirst=lstrlen(temporary)%3;
+	if(iFirst==0) iFirst=3;
+	memcpy(buffer+iPos,temporary,iFirst);
+	iPos+=iFirst;
+
+	int i2;
+	i2=(lstrlen(temporary)-4)/3;
+
+	for(i=0;i<=i2;i++){
+		buffer[iPos]=',';
+		iPos++;
+		memcpy(buffer+iPos,temporary+i*3+iFirst,3);
+		iPos+=3;
+		buffer[iPos]=0;
+	}
+}
+
+void RectNaturalFormat(RECT *ReadRect,RECT *CopyRect){
+	if(ReadRect->left > ReadRect->right){
+		CopyRect->left=ReadRect->right;
+		CopyRect->right=ReadRect->left;
+	}
+	else{
+		CopyRect->left=ReadRect->left;
+		CopyRect->right=ReadRect->right;
+	}
+	if(ReadRect->top > ReadRect->bottom){
+		CopyRect->top=ReadRect->bottom;
+		CopyRect->bottom=ReadRect->top;
+	}
+	else{
+		CopyRect->top=ReadRect->top;
+		CopyRect->bottom=ReadRect->bottom;
+	}
+}
+void RectNaturalFormat(int *x1,int *y1,int *x2,int *y2){
+	int temp;
+	if(*x1>*x2){
+		temp=*x1;
+		*x1=*x2;
+		*x2=temp;
+	}
+	if(*y1>*y2){
+		temp=*y1;
+		*y1=*y2;
+		*y2=temp;
+	}
+}
+void KillSpaces(char *str1,char *str2){
+	int i,i2,IsStr;
+	for(i=0,i2=0,IsStr=0;;i++,i2++){
+		while((str1[i]==' '||str1[i]=='\t')&&IsStr==0&&str1[i]!='\0') i++;
+		if(str1[i]=='\"') IsStr^=1;
+		str2[i2]=str1[i];
+		if(str1[i]=='\0') break;
+	}
+}
+void RemoveStringQuotes(char *str){
+	int i;
+	if(str[0]!='\"') return;
+	for(i=0;;i++){
+		str[i]=str[i+1];
+		if(str[i]=='\"') break;
+	}
+	str[i]=0;
+}
+void SlideString(char *buffer, int slide){
+	char *temp;
+	temp=(char *)malloc(lstrlen(buffer)+1);
+	lstrcpy(temp,buffer);
+	lstrcpy(buffer+slide,temp);
+	free(temp);
+}
+void SlideBuffer(char *buffer,int length,int slide){
+	void *temp;
+	temp=malloc(length+1);
+	memcpy(temp,buffer,length);
+	memcpy(buffer+slide,temp,length);
+	free(temp);
+}
+BOOL IsVariableTopChar(char c){
+	if((c>='A'&&c<='Z')||(c>='a'&&c<='z')||c=='_') return 1;
+	return 0;
+}
+bool IsNumberChar( char c ){
+	if(c>='0'&&c<='9'){
+		return true;
+	}
+	return false;
+}
+BOOL IsVariableChar(char c){
+	if((c>='A'&&c<='Z')||(c>='a'&&c<='z')||(c>='0'&&c<='9')||
+		c=='_'||c=='.'||c=='$') return 1;
+	return 0;
+}
+
+BOOL IsCommandBackDelimitation(char *buffer,int pos){
+	if(buffer[pos]=='\n'||buffer[pos]==':') return 1;
+	return 0;
+}
+BOOL IsCommandDelimitation(char *buffer,int p){
+	if(buffer[p]=='\r'&&buffer[p+1]=='\n') return 2;
+	if(buffer[p]=='\n'||buffer[p]==':'||buffer[p]=='\0') return 1;
+	return 0;
+}
+
+char *ComparisonString( char *str1, char *str2, bool isBigSmall, bool isWordUnit ){
+	char *temp1 = (char *)malloc( lstrlen( str1 ) +1 );
+	char *temp2 = (char *)malloc( lstrlen( str2 ) +1 );
+
+	lstrcpy( temp1, str1 );
+	lstrcpy( temp2, str2 );
+
+	if( isBigSmall == false ){
+		// 大文字小文字を区別しない場合
+		// すべて大文字にしておく
+		CharUpper( temp1 );
+		CharUpper( temp2 );
+	}
+
+	int len2 = lstrlen( temp2 );
+
+	const char *temp3 = strstr( temp1, temp2 );
+	while( temp3 ){
+		if( isWordUnit ){
+			int pos = (int)temp3 - (int)temp1;
+			if( pos == 0 ){
+				if( !( IsVariableTopChar( temp1[len2] ) || IsNumberChar( temp1[len2] ) ) ){
+						break;
+				}
+			}
+			else{
+				if( !( IsVariableTopChar( temp1[pos-1] ) || IsNumberChar( temp1[pos-1] ) )
+					&& !( IsVariableTopChar( temp1[pos+len2] ) || IsNumberChar( temp1[pos+len2] ) )
+					){
+						break;
+				}
+			}
+		}
+		else{
+			break;
+		}
+
+		temp3 = strstr( temp3 + 1, temp2 );
+	}
+
+	char *result = NULL;
+	if( temp3 ){
+		int pos = (int)temp3 - (int)temp1;
+		result = str1 + pos;
+	}
+
+	free( temp1 );
+	free( temp2 );
+
+	return result;
+}
+int GetOneParameter(char *Parameter,int pos,char *retAns){
+	int i,i2,IsStr,PareNum;
+	for(i=pos,i2=0,IsStr=0,PareNum=0;;i++,i2++){
+		if(IsDBCSLeadByte(Parameter[i])){
+			retAns[i2]=Parameter[i];
+			retAns[++i2]=Parameter[++i];
+			continue;
+		}
+		if(Parameter[i]=='\"') IsStr^=1;
+		if(Parameter[i]=='('&&IsStr==0) PareNum++;
+		if(Parameter[i]==')'&&IsStr==0) PareNum--;
+		if(Parameter[i]==','&&IsStr==0&&PareNum==0){
+			retAns[i2]=0;
+			break;
+		}
+		retAns[i2]=Parameter[i];
+		if(Parameter[i]=='\0'||Parameter[i]=='\r'&&Parameter[i+1]=='\n'){
+			retAns[i2]=0;
+			break;
+		}
+	}
+	if(Parameter[i]==',') i++;
+	return i;
+}
+int GetStringInPare(char *buffer,char *ReadBuffer){
+	int i,IsStr,PareNum;
+	for(i=0,IsStr=0,PareNum=0;;i++){
+		buffer[i]=ReadBuffer[i];
+		if(ReadBuffer[i]=='\"') IsStr^=1;
+		else if(ReadBuffer[i]=='('&&IsStr==0) PareNum++;
+		else if(ReadBuffer[i]==')'&&IsStr==0){
+			PareNum--;
+			if(PareNum==0){
+				i++;
+				buffer[i]=0;
+				break;
+			}
+		}
+		else if(ReadBuffer[i]=='\0') return 0;
+	}
+	return i;
+}
+int GetStringInBracket(char *buffer,char *ReadBuffer){
+	int i,IsStr,PareNum;
+	for(i=0,IsStr=0,PareNum=0;;i++){
+		buffer[i]=ReadBuffer[i];
+		if(IsDBCSLeadByte(ReadBuffer[i])){
+			i++;
+			buffer[i]=ReadBuffer[i];
+			continue;
+		}
+		if(ReadBuffer[i]=='\"') IsStr^=1;
+		else if(ReadBuffer[i]=='['&&IsStr==0) PareNum++;
+		else if(ReadBuffer[i]==']'&&IsStr==0){
+			PareNum--;
+			if(PareNum==0){
+				i++;
+				buffer[i]=0;
+				break;
+			}
+		}
+		else if(ReadBuffer[i]=='\0') return 0;
+	}
+	return i;
+}
+void JumpBlank(char *pBuf,int *piPos){
+	int i;
+	i=*piPos;
+
+	while(1){
+		while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		if(pBuf[i]=='\0') break;
+		if(pBuf[i]=='\''){
+			//注釈文（一行）
+			for(i++;;i++){
+				if(pBuf[i]=='\0') break;
+				if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+					i+=2;
+					break;
+				}
+			}
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		}
+		if(pBuf[i]=='/'&&pBuf[i+1]=='*'){
+			//注釈文（複数行）
+			i+=2;
+			while(!(pBuf[i]=='*'&&pBuf[i+1]=='/')){
+				i++;
+				if(pBuf[i]=='\0') break;
+			}
+			if(pBuf[i]){
+				i+=2;
+			}
+		}
+		while(pBuf[i]=='\r'&&pBuf[i+1]=='\n') i+=2;
+
+		if(!(
+			pBuf[i]==' '||
+			pBuf[i]=='\t'||
+			pBuf[i]=='\''||
+			(pBuf[i]=='/'&&pBuf[i+1]=='*')
+			)) break;
+	}
+
+	*piPos=i;
+}
+
+BOOL CheckParenthesis(char *buffer){
+	int i,IsStr,PareNum,sw;
+	_int8 bracket[1024];
+
+	for(i=0,IsStr=0,PareNum=0,sw=0;;i++){
+		if(buffer[i]=='\"'){
+			IsStr^=1;
+			continue;
+		}
+
+		else if(buffer[i]=='('&&IsStr==0){
+			bracket[PareNum]=0;
+			PareNum++;
+		}
+		else if(buffer[i]=='['&&IsStr==0){
+			bracket[PareNum]=1;
+			PareNum++;
+		}
+
+		else if(buffer[i]==')'&&IsStr==0){
+			PareNum--;
+			if(bracket[PareNum]!=0||PareNum<0){
+				//"カッコ \'( )\'"
+				return 0;
+			}
+		}
+		else if(buffer[i]==']'&&IsStr==0){
+			PareNum--;
+			if(bracket[PareNum]!=1||PareNum<0){
+				//"カッコ \'( )\'"
+				return 0;
+			}
+		}
+
+		else if(buffer[i]=='\n'||buffer[i]=='\0'){
+
+			//"カッコ \'( )\'"
+			if(buffer[i]=='\0'){
+				if(PareNum!=0){
+					return 0;
+				}
+
+				if(IsStr!=0){
+					return 0;
+				}
+			}
+			if(buffer[i]=='\0') break;
+
+			sw=0;
+		}
+	}
+	return 1;
+}
+
+DWORD GetValue(char *value){
+	unsigned long ans;
+	if(value[0]=='&'){
+		if(value[1]=='o'||value[1]=='O') sscanf(value+2,"%o",&ans);
+		if(value[1]=='h'||value[1]=='H') sscanf(value+2,"%x",&ans);
+	}
+	else ans=atol(value);
+	return ans;
+}
+BOOL IsManagementCommand(int ComNum){
+	switch(ComNum){
+		case -1:
+		case COM_ABSTRACT:
+		case COM_CLASS:
+		case COM_CONST:
+		case COM_DEBUG:
+		case COM_DECLARE:
+		case COM_DEF:
+		case COM_DIM:
+		case COM_DO:
+		case COM_END:
+		case COM_ENUM:
+		case COM_FOR:
+		case COM_FUNCTION:
+		case COM_GOSUB:
+		case COM_GOTO:
+		case COM_IF:
+		case COM_INHERITS:
+		case COM_INTERFACE:
+		case COM_LOOP:
+		case COM_NAMESPACE:
+		case COM_NEXT:
+		case COM_PRIVATE:
+		case COM_PROTECTED:
+		case COM_PUBLIC:
+		case COM_RETURN:
+		case COM_SELECT:
+		case COM_SUB:
+		case COM_TYPE:
+		case COM_TYPEDEF:
+		case COM_VIRTUAL:
+		case COM_OVERRIDE:
+		case COM_WEND:
+		case COM_WHILE:
+		case COM_WITH:
+			return 1;
+		default:
+			break;
+	}
+	return 0;
+}
+int IsBasicReservedWord(char *str){
+	if(str[0]=='a'||str[0]=='A'){
+		if(lstrcmpi(str,"Abstract")==0) return COM_ABSTRACT;
+		if(lstrcmpi(str,"As")==0) return -1;
+	}
+	else if(str[0]=='b'||str[0]=='B'){
+		if(lstrcmpi(str,"Beep")==0) return COM_BEEP;
+		if(lstrcmp(str,"Boolean")==0) return -1;
+		if(lstrcmpi(str,"ByRef")==0) return -1;
+		if(lstrcmpi(str,"ByVal")==0) return -1;
+		if(lstrcmp(str,"Byte")==0) return -1;
+	}
+	else if(str[0]=='c'||str[0]=='C'){
+		if(lstrcmpi(str,"Case")==0) return -1;
+		if(lstrcmp(str,"Char")==0) return -1;
+		if(lstrcmpi(str,"ChDir")==0) return COM_CHDIR;
+		if(lstrcmpi(str,"Circle")==0) return COM_CIRCLE;
+		if(lstrcmpi(str,"Class")==0) return COM_CLASS;
+		if(lstrcmpi(str,"Close")==0) return COM_CLOSE;
+		if(lstrcmpi(str,"Cls")==0) return COM_CLS;
+		if(lstrcmpi(str,"Color")==0) return COM_COLOR;
+		if(lstrcmpi(str,"Const")==0) return COM_CONST;
+		if(lstrcmpi(str,"Continue")==0) return -1;
+	}
+	else if(str[0]=='d'||str[0]=='D'){
+		if(lstrcmpi(str,"Debug")==0) return COM_DEBUG;
+		if(lstrcmpi(str,"Declare")==0) return COM_DECLARE;
+		if(lstrcmpi(str,"Def")==0) return COM_DEF;
+		if(lstrcmpi(str,"Delete")==0) return -1;
+		if(lstrcmpi(str,"DelWnd")==0) return COM_DELWND;
+		if(lstrcmpi(str,"Dim")==0) return COM_DIM;
+		if(lstrcmpi(str,"Do")==0) return COM_DO;
+		if(lstrcmp(str,"Double")==0) return -1;
+		if(lstrcmp(str,"DWord")==0) return -1;
+	}
+	else if(str[0]=='e'||str[0]=='E'){
+		if(lstrcmpi(str,"Else")==0) return -1;
+		if(lstrcmpi(str,"ElseIf")==0) return -1;
+		if(lstrcmpi(str,"End")==0) return COM_END;
+		if(lstrcmpi(str,"EndIf")==0) return -1;
+		if(lstrcmpi(str,"EndFunction")==0) return -1;
+		if(lstrcmpi(str,"EndSub")==0) return -1;
+		if(lstrcmpi(str,"EndType")==0) return -1;
+		if(lstrcmpi(str,"EndSelect")==0) return -1;
+		if(lstrcmpi(str,"EndWith")==0) return -1;
+		if(lstrcmpi(str,"Enum")==0) return COM_ENUM;
+		if(lstrcmpi(str,"Exit")==0) return -1;
+		if(lstrcmpi(str,"ExitDo")==0) return -1;
+		if(lstrcmpi(str,"ExitFor")==0) return -1;
+		if(lstrcmpi(str,"ExitFunction")==0) return -1;
+		if(lstrcmpi(str,"ExitSub")==0) return -1;
+		if(lstrcmpi(str,"ExitWhile")==0) return -1;
+	}
+	else if(str[0]=='f'||str[0]=='F'){
+		if(lstrcmp(str,"False")==0) return -1;
+		if(lstrcmpi(str,"Field")==0) return COM_FIELD;
+		if(lstrcmpi(str,"For")==0) return COM_FOR;
+		if(lstrcmpi(str,"Function")==0) return COM_FUNCTION;
+	}
+	else if(str[0]=='g'||str[0]=='G'){
+		if(lstrcmpi(str,"Get")==0) return COM_GET;
+		if(lstrcmpi(str,"GoSub")==0) return COM_GOSUB;
+		if(lstrcmpi(str,"Goto")==0) return COM_GOTO;
+	}
+	else if(str[0]=='i'||str[0]=='I'){
+		if(lstrcmpi(str,"If")==0) return COM_IF;
+		if(lstrcmpi(str,"Imports")==0) return -1;
+		if(lstrcmpi(str,"Inherits")==0) return COM_INHERITS;
+		if(lstrcmpi(str,"Input")==0) return COM_INPUT;
+		if(lstrcmp(str,"Int64")==0) return -1;
+		if(lstrcmp(str,"Integer")==0) return -1;
+		if(lstrcmpi(str,"Interface")==0) return COM_INTERFACE;
+	}
+	else if(str[0]=='k'||str[0]=='K'){
+		if(lstrcmpi(str,"Kill")==0) return COM_KILL;
+	}
+	else if(str[0]=='l'||str[0]=='L'){
+		if(lstrcmpi(str,"Let")==0) return COM_LET;
+		if(lstrcmpi(str,"Line")==0) return COM_LINE;
+		if(lstrcmpi(str,"Locate")==0) return COM_LOCATE;
+		if(lstrcmp(str,"Long")==0) return -1;
+		if(lstrcmpi(str,"Loop")==0) return COM_LOOP;
+	}
+	else if(str[0]=='m'||str[0]=='M'){
+		if(lstrcmpi(str,"MkDir")==0) return COM_MKDIR;
+		if(lstrcmpi(str,"MsgBox")==0) return COM_MSGBOX;
+	}
+	else if(str[0]=='n'||str[0]=='N'){
+		if(lstrcmpi(str,"Namespace")==0) return COM_NAMESPACE;
+		if(lstrcmpi(str,"Next")==0) return COM_NEXT;
+		if(lstrcmpi(str,"New")==0) return -1;
+		if(lstrcmpi(str,"Nothing")==0) return -1;
+	}
+	else if(str[0]=='o'||str[0]=='O'){
+		if(lstrcmp(str,"Object")==0) return -1;
+		if(lstrcmpi(str,"Open")==0) return COM_OPEN;
+		if(lstrcmpi(str,"Operator")==0) return -1;
+		if(lstrcmpi(str,"Override")==0) return COM_OVERRIDE;
+	}
+	else if(str[0]=='p'||str[0]=='P'){
+		if(lstrcmpi(str,"Paint")==0) return COM_PAINT;
+		if(lstrcmpi(str,"Print")==0) return COM_PRINT;
+		if(lstrcmpi(str,"Private")==0) return COM_PRIVATE;
+		if(lstrcmpi(str,"Protected")==0) return COM_PROTECTED;
+		if(lstrcmpi(str,"PSet")==0) return COM_PSET;
+		if(lstrcmpi(str,"Put")==0) return COM_PUT;
+		if(lstrcmpi(str,"Public")==0) return COM_PUBLIC;
+	}
+	else if(str[0]=='q'||str[0]=='Q'){
+		if(lstrcmp(str,"QWord")==0) return -1;
+	}
+	else if(str[0]=='r'||str[0]=='R'){
+		if(lstrcmpi(str,"Randomize")==0) return COM_RANDOMIZE;
+		if(lstrcmpi(str,"Rem")==0) return COM_REM;
+		if(lstrcmpi(str,"Return")==0) return COM_RETURN;
+	}
+	else if(str[0]=='s'||str[0]=='S'){
+		if(lstrcmp(str,"SByte")==0) return -1;
+		if(lstrcmpi(str,"Select")==0) return COM_SELECT;
+		if(lstrcmpi(str,"SelectCase")==0) return COM_SELECT;
+		if(lstrcmp(str,"Single")==0) return -1;
+		if(lstrcmpi(str,"Sleep")==0) return COM_SLEEP;
+		if(lstrcmp(str,"Static")==0) return -1;
+		if(lstrcmp(str,"String")==0) return -1;
+		if(lstrcmpi(str,"Sub")==0) return COM_SUB;
+		if(lstrcmpi(str,"Super")==0) return -1;
+	}
+	else if(str[0]=='t'||str[0]=='T'){
+		if(lstrcmpi(str,"Then")==0) return -1;
+		if(lstrcmpi(str,"This")==0) return -1;
+		if(lstrcmp(str,"True")==0) return -1;
+		if(lstrcmpi(str,"Type")==0) return COM_TYPE;
+		if(lstrcmpi(str,"TypeDef")==0) return COM_TYPEDEF;
+	}
+	else if(str[0]=='u'||str[0]=='U'){
+		if(lstrcmpi(str,"Until")==0) return -1;
+	}
+	else if(str[0]=='v'||str[0]=='V'){
+		if(lstrcmpi(str,"Virtual")==0) return COM_VIRTUAL;
+	}
+	else if(str[0]=='w'||str[0]=='W'){
+		if(lstrcmpi(str,"Wend")==0) return COM_WEND;
+		if(lstrcmpi(str,"While")==0) return COM_WHILE;
+		if(lstrcmpi(str,"Window")==0) return COM_WINDOW;
+		if(lstrcmpi(str,"With")==0) return COM_WITH;
+		if(lstrcmp(str,"Word")==0) return -1;
+		if(lstrcmpi(str,"Write")==0) return COM_WRITE;
+	}
+	else if(str[0]=='#'){
+		if(lstrcmpi(str,"#include")==0) return -1;
+		if(lstrcmpi(str,"#strict")==0) return -1;
+		if(lstrcmpi(str,"#console")==0) return -1;
+		if(lstrcmpi(str,"#prompt")==0) return -1;
+		if(lstrcmpi(str,"#N88BASIC")==0) return -1;
+		if(lstrcmpi(str,"#define")==0) return -1;
+		if(lstrcmpi(str,"#ifdef")==0) return -1;
+		if(lstrcmpi(str,"#ifndef")==0) return -1;
+		if(lstrcmpi(str,"#else")==0) return -1;
+		if(lstrcmpi(str,"#endif")==0) return -1;
+	}
+	return 0;
+}
+
+HBITMAP CreateGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2){
+	//グラデーションビットマップを生成
+
+	BITMAPINFO BitmapInfo;
+	memset(&BitmapInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER));
+	BitmapInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
+	BitmapInfo.bmiHeader.biWidth=pSize->cx;
+	BitmapInfo.bmiHeader.biHeight=pSize->cy;
+	BitmapInfo.bmiHeader.biPlanes=1;
+	BitmapInfo.bmiHeader.biBitCount=24;
+
+	HDC hdc;
+	hdc=GetDC(GetDesktopWindow());
+
+	HBITMAP hBitmap;
+	BYTE *pByte;
+	hBitmap=CreateDIBSection(hdc,&BitmapInfo,DIB_RGB_COLORS,(void **)&pByte,0,0);
+
+	int i,i2,x,y;
+	COLORREF rgb;
+	i=BitmapInfo.bmiHeader.biWidth*3;
+	if(i%sizeof(LONG)!=0) i+=sizeof(LONG)-(i%sizeof(LONG));
+	for(y=0;y<BitmapInfo.bmiHeader.biHeight;y++){
+		if(y<BitmapInfo.bmiHeader.biHeight/2-2) rgb=color2;
+		else if(y>BitmapInfo.bmiHeader.biHeight/2+2) rgb=color1;
+		else{
+			double ratio;
+			ratio=((double)y-((double)BitmapInfo.bmiHeader.biHeight/(double)2-(double)2))/(double)4;
+			//ratio=(double)y/(double)BitmapInfo.bmiHeader.biHeight;
+			rgb=RGB(
+				LOBYTE(LOWORD(color2))+(int)(double)(LOBYTE(LOWORD(color1))-LOBYTE(LOWORD(color2)))*(ratio),	//赤要素
+				HIBYTE(LOWORD(color2))+(int)(double)(HIBYTE(LOWORD(color1))-HIBYTE(LOWORD(color2)))*(ratio),	//緑要素
+				LOBYTE(HIWORD(color2))+(int)(double)(LOBYTE(HIWORD(color1))-LOBYTE(HIWORD(color2)))*(ratio)		//青要素
+				);
+		}
+		for(x=0;x<BitmapInfo.bmiHeader.biWidth;x++){
+			i2=y*i+x*3;
+			pByte[i2+2]=LOBYTE(LOWORD(rgb));
+			pByte[i2+1]=HIBYTE(LOWORD(rgb));
+			pByte[i2]=LOBYTE(HIWORD(rgb));
+		}
+	}
+
+	ReleaseDC(GetDesktopWindow(),hdc);
+
+	return hBitmap;
+}
+HBITMAP CreateVertGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2){
+	//グラデーションビットマップを生成
+
+	BITMAPINFO BitmapInfo;
+	memset(&BitmapInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER));
+	BitmapInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
+	BitmapInfo.bmiHeader.biWidth=pSize->cx;
+	BitmapInfo.bmiHeader.biHeight=pSize->cy;
+	BitmapInfo.bmiHeader.biPlanes=1;
+	BitmapInfo.bmiHeader.biBitCount=24;
+
+	HDC hdc;
+	hdc=GetDC(GetDesktopWindow());
+
+	HBITMAP hBitmap;
+	BYTE *pByte;
+	hBitmap=CreateDIBSection(hdc,&BitmapInfo,DIB_RGB_COLORS,(void **)&pByte,0,0);
+
+	int i,i2,x,y;
+	COLORREF rgb;
+	i=BitmapInfo.bmiHeader.biWidth*3;
+	if(i%sizeof(LONG)!=0) i+=sizeof(LONG)-(i%sizeof(LONG));
+	for(y=0;y<BitmapInfo.bmiHeader.biHeight;y++){
+		if(y<BitmapInfo.bmiHeader.biHeight/2-2) rgb=color2;
+		else if(y>BitmapInfo.bmiHeader.biHeight/2+2) rgb=color1;
+		else{
+			double ratio;
+			ratio=(double)y/(double)BitmapInfo.bmiHeader.biHeight;
+			rgb=RGB(
+				LOBYTE(LOWORD(color2))+(int)(double)(LOBYTE(LOWORD(color1))-LOBYTE(LOWORD(color2)))*(ratio),	//赤要素
+				HIBYTE(LOWORD(color2))+(int)(double)(HIBYTE(LOWORD(color1))-HIBYTE(LOWORD(color2)))*(ratio),	//緑要素
+				LOBYTE(HIWORD(color2))+(int)(double)(LOBYTE(HIWORD(color1))-LOBYTE(HIWORD(color2)))*(ratio)		//青要素
+				);
+		}
+		for(x=0;x<BitmapInfo.bmiHeader.biWidth;x++){
+			i2=y*i+x*3;
+			pByte[i2+2]=LOBYTE(LOWORD(rgb));
+			pByte[i2+1]=HIBYTE(LOWORD(rgb));
+			pByte[i2]=LOBYTE(HIWORD(rgb));
+		}
+	}
+
+	ReleaseDC(GetDesktopWindow(),hdc);
+
+	return hBitmap;
+}
+HBITMAP CreateHorzGradationBitmap(SIZE *pSize,COLORREF color1,COLORREF color2){
+	//グラデーションビットマップを生成
+
+	BITMAPINFO BitmapInfo;
+	memset(&BitmapInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER));
+	BitmapInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
+	BitmapInfo.bmiHeader.biWidth=pSize->cx;
+	BitmapInfo.bmiHeader.biHeight=pSize->cy;
+	BitmapInfo.bmiHeader.biPlanes=1;
+	BitmapInfo.bmiHeader.biBitCount=24;
+
+	HDC hdc;
+	hdc=GetDC(GetDesktopWindow());
+
+	HBITMAP hBitmap;
+	BYTE *pByte;
+	hBitmap=CreateDIBSection(hdc,&BitmapInfo,DIB_RGB_COLORS,(void **)&pByte,0,0);
+
+	int i,i2,x,y;
+	COLORREF rgb;
+	i=BitmapInfo.bmiHeader.biWidth*3;
+	if(i%sizeof(LONG)!=0) i+=sizeof(LONG)-(i%sizeof(LONG));
+	for(x=0;x<BitmapInfo.bmiHeader.biWidth;x++){
+		double ratio;
+		ratio=(double)x/(double)BitmapInfo.bmiHeader.biWidth;
+		rgb=RGB(
+			LOBYTE(LOWORD(color1))+(int)(double)(LOBYTE(LOWORD(color2))-LOBYTE(LOWORD(color1)))*(ratio),	//赤要素
+			HIBYTE(LOWORD(color1))+(int)(double)(HIBYTE(LOWORD(color2))-HIBYTE(LOWORD(color1)))*(ratio),	//緑要素
+			LOBYTE(HIWORD(color1))+(int)(double)(LOBYTE(HIWORD(color2))-LOBYTE(HIWORD(color1)))*(ratio)		//青要素
+			);
+		for(y=0;y<BitmapInfo.bmiHeader.biHeight;y++){
+			i2=y*i+x*3;
+			pByte[i2+2]=LOBYTE(LOWORD(rgb));
+			pByte[i2+1]=HIBYTE(LOWORD(rgb));
+			pByte[i2]=LOBYTE(HIWORD(rgb));
+		}
+	}
+
+	ReleaseDC(GetDesktopWindow(),hdc);
+
+	return hBitmap;
+}
+HICON CreateGrayIcon(HICON hBaseIcon){
+	////////////////////////
+	// 淡色アイコンを生成
+	////////////////////////
+
+	HICON hGrayIcon;
+
+	ICONINFO IconInfo;
+	GetIconInfo(hBaseIcon,&IconInfo);
+
+
+	//ビットマップを加工
+	BITMAP Bitmap;
+	GetObject(IconInfo.hbmColor,sizeof(Bitmap),&Bitmap);
+
+	BITMAPINFO BitmapInfo;
+	memset(&BitmapInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER));
+	BitmapInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
+	BitmapInfo.bmiHeader.biWidth=Bitmap.bmWidth;
+	BitmapInfo.bmiHeader.biHeight=Bitmap.bmHeight;
+	BitmapInfo.bmiHeader.biPlanes=1;
+	BitmapInfo.bmiHeader.biBitCount=24;
+	BitmapInfo.bmiHeader.biCompression=BI_RGB;
+
+	HDC hdc;
+	hdc=GetDC(GetDesktopWindow());
+
+	BYTE *pByte;
+	pByte=(BYTE *)HeapAlloc(hHeap,0,Bitmap.bmWidth*Bitmap.bmHeight*sizeof(COLORREF));
+	GetDIBits(hdc,
+		IconInfo.hbmColor,
+		0,
+		Bitmap.bmHeight,
+		(void *)pByte,
+		&BitmapInfo,
+		DIB_RGB_COLORS);
+
+	int i,i2,x,y;
+	i=BitmapInfo.bmiHeader.biWidth*3;
+	if(i%sizeof(LONG)!=0) i+=sizeof(LONG)-(i%sizeof(LONG));
+	for(x=0;x<BitmapInfo.bmiHeader.biWidth;x++){
+		for(y=0;y<BitmapInfo.bmiHeader.biHeight;y++){
+			i2=y*i+x*3;
+			if(pByte[i2+2]==0&&pByte[i2+1]==0&&pByte[i2]==0){
+				//透明色
+				//何もしない
+			}
+			else{
+				double ratio=0.5;	//明るさ
+
+				pByte[i2+2]+=(BYTE)((double)(255-pByte[i2+2])*ratio);
+				pByte[i2+1]+=(BYTE)((double)(255-pByte[i2+1])*ratio);
+				pByte[i2]+=(BYTE)((double)(255-pByte[i2])*ratio);
+
+				pByte[i2+2]=(BYTE)(((int)pByte[i2+2]+(int)pByte[i2+1]+(int)pByte[i2])/3);
+				pByte[i2+1]=pByte[i2+2];
+				pByte[i2]=pByte[i2+2];
+			}
+		}
+	}
+
+	SetDIBits(hdc,
+		IconInfo.hbmColor,
+		0,
+		Bitmap.bmHeight,
+		(void *)pByte,
+		&BitmapInfo,
+		DIB_RGB_COLORS);
+
+	HeapDefaultFree(pByte);
+
+	ReleaseDC(GetDesktopWindow(),hdc);
+
+
+	hGrayIcon=CreateIconIndirect(&IconInfo);
+
+	//不要なビットマップを破棄
+	DeleteObject(IconInfo.hbmMask);
+	DeleteObject(IconInfo.hbmColor);
+
+	return hGrayIcon;
+}
+void GetSize(SIZE *pSize,RECT *pRect){
+	pSize->cx=pRect->right-pRect->left;
+	pSize->cy=pRect->bottom-pRect->top;
+}
+BOOL HitTest(RECT *pRect,POINT *pPos){
+	if(pRect->left<=pPos->x&&pPos->x<pRect->right&&
+		pRect->top<=pPos->y&&pPos->y<pRect->bottom) return 1;
+	return 0;
+}
+BOOL Rectangle(HDC hdc,RECT *pRect){
+	return Rectangle(hdc,pRect->left,pRect->top,pRect->right,pRect->bottom);
+}
+
+void ComboBox_SetSelText(HWND hCombo,char *lpszText){
+	SendMessage(hCombo,CB_SETCURSEL,
+		SendMessage(hCombo,CB_FINDSTRINGEXACT,0,(LPARAM)lpszText),
+		0);
+}
+
+void SetCursorByState(int state){
+	if(state==FRAME_UPPER_LEFT||state==FRAME_LOWER_RIGHT) SetCursor(LoadCursor(0,IDC_SIZENWSE));
+	else if(state==FRAME_UPPER_RIGHT||state==FRAME_LOWER_LEFT) SetCursor(LoadCursor(0,IDC_SIZENESW));
+	else if(state==FRAME_LEFT||state==FRAME_RIGHT) SetCursor(LoadCursor(0,IDC_SIZEWE));
+	else if(state==FRAME_UPPER||state==FRAME_LOWER) SetCursor(LoadCursor(0,IDC_SIZENS));
+	else if(state==FRAME_INSIDE) SetCursor(LoadCursor(0,IDC_SIZEALL));
+	else SetCursor(LoadCursor(0,IDC_ARROW));
+}
+
+void SetTextEditColorDesign(TEXTEDIT_COLOR_INFO *pColorInfo,CTheme *pobj_Theme,BOOL bRedraw){
+	pColorInfo->rgbDefault=pobj_Theme->TextColorInfo.rgbDefault;
+	pColorInfo->rgbComment=pobj_Theme->TextColorInfo.rgbComment;
+	pColorInfo->rgbStatement=pobj_Theme->TextColorInfo.rgbStatement;
+	pColorInfo->rgbString=pobj_Theme->TextColorInfo.rgbString;
+	pColorInfo->rgbCursorBack=pobj_Theme->TextColorInfo.rgbCursorBack;
+	pColorInfo->rgbBackground=pobj_Theme->TextColorInfo.rgbBackground;
+
+	//アクティブテーマにセット
+	lstrcpy(pobj_nv->szActiveTheme,pobj_Theme->m_name);
+
+	//テーマ依存の描画リソースを取得
+	pobj_DBTheme->unlock();
+	pobj_DBTheme->lock();
+
+	if(bRedraw){
+		//再描画
+		extern MDIINFO MdiInfo[MAX_WNDNUM];
+		int i;
+		for(i=0;i<MAX_WNDNUM;i++){
+			if(MdiInfo[i].hwnd){
+				if(IS_DOCUMENT_TEXT(MdiInfo[i].DocType)){
+					SetTextEditWordColor(i);
+					InvalidateRect(MdiInfo[i].pMdiTextEdit->hEdit,NULL,0);
+				}
+			}
+		}
+	}
+}
+
+BOOL SetupProjectEditor(void){
+	extern HINSTANCE hInst;
+	int i;
+	char str[MAX_PATH],temporary[MAX_PATH];
+
+
+	//リソース用DLLをマッピング
+#if defined(JPN)
+	//日本語リソース
+	sprintf(temporary,"%sSubOperation\\res.dll",pj_editor_Dir);
+#else
+	//英語リソース
+	sprintf(temporary,"%sSubOperation\\res_e.dll",pj_editor_Dir);
+#endif
+	hResInst=LoadLibrary(temporary);
+
+	//アイコンリソースDLLをマッピング
+	sprintf(temporary,"%sSubOperation\\icon_res.dll",pj_editor_Dir);
+	hIconResInst=LoadLibrary(temporary);
+
+	//LuxCtrl.dllをマッピング
+	sprintf(temporary,"%sSubOperation\\LuxCtrl.dll",pj_editor_Dir);
+	hLib_LuxCtrl=LoadLibrary(temporary);
+	if(!hLib_LuxCtrl){
+		MessageBox(0,"LuxCtrl.dllの読み込みに失敗しました。",APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+		return 0;
+	}
+	LuxToolbar_CreateInstance=
+		(PROC_LuxToolbar_CreateInstance)GetProcAddress(hLib_LuxCtrl,"LuxToolbar_CreateInstance");
+
+
+	//モジュールディレクトリを取得
+	GetModuleFileName(hInst,temporary,MAX_PATH);
+	_splitpath(temporary,pj_editor_Dir,str,NULL,NULL);
+	lstrcat(pj_editor_Dir,str);
+
+	//ヒープオブジェクトを作成
+	extern HANDLE hHeap;
+	hHeap=HeapCreate(HEAP_GENERATE_EXCEPTIONS,0,0);
+
+
+	//自動バックアップ用のディレクトリを生成
+	CreateBackupDir();
+
+
+	//COMを初期化
+	CoInitialize(0);
+
+	//スクリーンサイズを取得
+	ScreenX=GetSystemMetrics(SM_CXSCREEN);
+	ScreenY=GetSystemMetrics(SM_CYSCREEN);
+
+	//コンパイラ名をセット（デフォルトはWin32）
+	extern char *lpszCompilerName;
+	lpszCompilerName=WIN32_COMPILER_NAME;
+
+	//不揮発性のデータを取得
+	pobj_nv=new CNonVolatile;
+	pobj_nv->load();
+
+
+	//アルファブレンド用のAPIを取得
+	extern FWINLAYER pSetLayeredWindowAttributes;
+	extern HINSTANCE hUser32Lib;
+	hUser32Lib=LoadLibrary("user32.dll");
+	pSetLayeredWindowAttributes=(FWINLAYER)GetProcAddress(hUser32Lib,"pSetLayeredWindowAttributes");
+
+
+
+
+	/////////////////////
+	// フォントを定義
+	/////////////////////
+
+	//パラメータ ヒント フォント
+	extern METHODCHECKINFO MethodCheckInfo;
+	MethodCheckInfo.hFont=CreateFontIndirect(&MethodCheckInfo.LogFont);
+	i=MethodCheckInfo.LogFont.lfWeight;
+	MethodCheckInfo.LogFont.lfWeight=FW_BOLD;
+	MethodCheckInfo.hBoldFont=CreateFontIndirect(&MethodCheckInfo.LogFont);
+	MethodCheckInfo.LogFont.lfWeight=i;
+
+	//ステータスバー フォント
+	LOGFONT LogFont;
+	extern HFONT hStatusFont;
+	LogFont.lfHeight=-12;
+	LogFont.lfWidth=0;
+	LogFont.lfEscapement=0;
+	LogFont.lfOrientation=0;
+	LogFont.lfWeight=FW_REGULAR;
+	LogFont.lfItalic=NULL;
+	LogFont.lfUnderline=NULL;
+	LogFont.lfStrikeOut=NULL;
+	LogFont.lfCharSet=SHIFTJIS_CHARSET;
+	LogFont.lfOutPrecision=OUT_STRING_PRECIS;
+	LogFont.lfClipPrecision=CLIP_STROKE_PRECIS;
+	LogFont.lfQuality=DRAFT_QUALITY;
+	LogFont.lfPitchAndFamily=VARIABLE_PITCH;
+	sprintf(LogFont.lfFaceName,"ＭＳ Ｐゴシック");
+	hStatusFont=CreateFontIndirect(&LogFont);
+
+	//ハイパーリンク フォント
+	extern HFONT hHyperLinkFont;
+	LogFont.lfHeight=-12;
+	LogFont.lfWidth=0;
+	LogFont.lfEscapement=0;
+	LogFont.lfOrientation=0;
+	LogFont.lfWeight=FW_REGULAR;
+	LogFont.lfItalic=NULL;
+	LogFont.lfUnderline=TRUE;
+	LogFont.lfStrikeOut=NULL;
+	LogFont.lfCharSet=SHIFTJIS_CHARSET;
+	LogFont.lfOutPrecision=OUT_STRING_PRECIS;
+	LogFont.lfClipPrecision=CLIP_STROKE_PRECIS;
+	LogFont.lfQuality=DRAFT_QUALITY;
+	LogFont.lfPitchAndFamily=VARIABLE_PITCH;
+	sprintf(LogFont.lfFaceName,"ＭＳ Ｐゴシック");
+	hHyperLinkFont=CreateFontIndirect(&LogFont);
+
+	//ルーラー フォント
+	extern HFONT hRulerFont;
+	LogFont.lfHeight=-10;
+	LogFont.lfWidth=0;
+	LogFont.lfEscapement=0;
+	LogFont.lfOrientation=0;
+	LogFont.lfWeight=FW_REGULAR;
+	LogFont.lfItalic=NULL;
+	LogFont.lfUnderline=0;
+	LogFont.lfStrikeOut=NULL;
+	LogFont.lfCharSet=SHIFTJIS_CHARSET;
+	LogFont.lfOutPrecision=OUT_STRING_PRECIS;
+	LogFont.lfClipPrecision=CLIP_STROKE_PRECIS;
+	LogFont.lfQuality=DRAFT_QUALITY;
+	LogFont.lfPitchAndFamily=VARIABLE_PITCH;
+	sprintf(LogFont.lfFaceName,"ＭＳ ゴシック");
+	hRulerFont=CreateFontIndirect(&LogFont);
+
+	//行番号の描画用
+	extern HFONT hFont_LineNumber;
+	LogFont.lfHeight=-11;
+	LogFont.lfWidth=0;
+	LogFont.lfEscapement=0;
+	LogFont.lfOrientation=0;
+	LogFont.lfWeight=FW_BOLD;
+	LogFont.lfItalic=NULL;
+	LogFont.lfUnderline=NULL;
+	LogFont.lfStrikeOut=NULL;
+	LogFont.lfCharSet=ANSI_CHARSET;
+	LogFont.lfOutPrecision=OUT_STRING_PRECIS;
+	LogFont.lfClipPrecision=CLIP_STROKE_PRECIS;
+	LogFont.lfQuality=DRAFT_QUALITY;
+	LogFont.lfPitchAndFamily=VARIABLE_PITCH;
+	sprintf(LogFont.lfFaceName,"Courier New");
+	hFont_LineNumber=CreateFontIndirect(&LogFont);
+
+	//メニューフォント
+    NONCLIENTMETRICS NCMetrics;
+    NCMetrics.cbSize = sizeof( NONCLIENTMETRICS );
+    SystemParametersInfo( SPI_GETNONCLIENTMETRICS, sizeof( NONCLIENTMETRICS ), &NCMetrics, 0 );
+	hMenuFont=CreateFontIndirect(&NCMetrics.lfMenuFont);
+
+
+
+	//背景ブラシ
+	extern HBRUSH h3DFaceBackBrush;
+	h3DFaceBackBrush=CreateSolidBrush(GetSysColor(COLOR_3DFACE));
+
+	//アイコン
+	extern HICON hOwnerIcon,hBasicProgramIcon,hTextDocumentIcon,hWindowDocumentIcon;
+	hOwnerIcon=(HICON)LoadImage(hInst,MAKEINTRESOURCE(IDI_MAIN),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);
+	hBasicProgramIcon=(HICON)LoadImage(hResInst,MAKEINTRESOURCE(IDI_BASICPROGRAM),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);
+	hTextDocumentIcon=(HICON)LoadImage(hResInst,MAKEINTRESOURCE(IDI_TEXTDOCUMENT),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);
+	hWindowDocumentIcon=(HICON)LoadImage(hResInst,MAKEINTRESOURCE(IDI_WINDOW),IMAGE_ICON,16,16,LR_DEFAULTCOLOR);
+
+
+
+
+	//メインメニュー
+	pobj_MainMenu=new CMenuEx(LoadMenu(hResInst,MAKEINTRESOURCE(IDR_MAINMENU)));
+
+	pobj_MainMenu->InitOwnerDraw(1);			//オーナー描画の初期化
+
+	CSubMenuEx *pobj_FileMenu;
+	pobj_FileMenu=pobj_MainMenu->ppobj_MenuItemData[0]->pobj_SubMenu;
+
+	//未完成
+	extern HMENU hFirstMainMenu;
+	hFirstMainMenu=0;
+
+	//「最近使ったファイル」サブメニューを取得（と同時にも正規のメニュー文字列を指定）
+	for(i=0;i<pobj_FileMenu->iMenuItemNum;i++){
+		if(pobj_FileMenu->ppobj_MenuItemData[i]->str){
+			if(lstrcmp(pobj_FileMenu->ppobj_MenuItemData[i]->str,"FileHistory")==0){
+				pobj_FileMenu->RenameMenuItem(i,"最近使ったファイル(&F)");
+
+				extern CSubMenuEx *pobj_FileHistoryMenu;
+				pobj_FileHistoryMenu=pobj_FileMenu->ppobj_MenuItemData[i]->pobj_SubMenu;
+			}
+
+#ifndef THETEXT
+			//「最近使ったプロジェクト」サブメニューを取得（と同時にも正規のメニュー文字列を指定）
+			//※ProjectEditorのみ
+			if(lstrcmp(pobj_FileMenu->ppobj_MenuItemData[i]->str,"ProjectHistory")==0){
+				pobj_FileMenu->RenameMenuItem(i,"最近使ったプロジェクト(&J)");
+
+				extern CSubMenuEx *pobj_ProjectHistoryMenu;
+				pobj_ProjectHistoryMenu=pobj_FileMenu->ppobj_MenuItemData[i]->pobj_SubMenu;
+			}
+#endif
+		}
+	}
+
+#define ICONSET(itemID,iconID) pobj_MainMenu->SetIcon(itemID,(HICON)LoadImage(hIconResInst,MAKEINTRESOURCE(iconID),IMAGE_ICON,16,16,0));
+	//メニューアイコンをセット
+
+	//ファイル
+	ICONSET(IDM_NEW,IDI_NEW);
+	ICONSET(IDM_OPEN,IDI_OPEN);
+	ICONSET(IDM_SAVE,IDI_SAVE);
+	ICONSET(IDM_ALLSAVE,IDI_ALLSAVE);
+	ICONSET(IDM_PREVIEW,IDI_PREVIEW);
+	ICONSET(IDM_PRINTOUT,IDI_PRINT);
+
+	//編集
+	ICONSET(IDM_CUT,IDI_CUT);
+	ICONSET(IDM_COPY,IDI_COPY);
+	ICONSET(IDM_PASTE,IDI_PASTE);
+	ICONSET(IDM_UNDO,IDI_UNDO);
+	ICONSET(IDM_REDO,IDI_REDO);
+	ICONSET(IDM_FIND,IDI_FIND);
+
+	//表示
+	ICONSET(IDM_SET,IDI_OPTION);
+
+	//変換
+	ICONSET(IDM_CONV_ALPHA_SMALL,IDI_CONV_ALPHA_SMALL);
+	ICONSET(IDM_CONV_ALPHA_BIG,IDI_CONV_ALPHA_BIG);
+	ICONSET(IDM_CONV_HALF,IDI_CONV_HALF);
+	ICONSET(IDM_CONV_MULTI,IDI_CONV_MULTI);
+	ICONSET(IDM_CONV_KATAKANA,IDI_CONV_KATAKANA);
+	ICONSET(IDM_CONV_HIRAGANA,IDI_CONV_HIRAGANA);
+
+	//ヘルプ
+	ICONSET(IDM_TOPIC,IDI_HELP);
+
+#ifdef THETEXT
+	//TheTextのみの機能
+	ICONSET(IDM_STRING_COUNT,IDI_STRINGCOUNT);
+#else
+	//ProjectEditorのみの機能
+
+	//リリース
+	ICONSET(IDM_RELEASECOMPILE,IDI_RELEASECOMPILE);
+	ICONSET(IDM_RELEASERUN,IDI_RELEASERUN);
+
+	//デバッグ
+	ICONSET(IDM_ATTACH,IDI_ATTACH);
+	ICONSET(IDM_DEBUGCOMPILE,IDI_DEBUGCOMPILE);
+	ICONSET(IDM_DEBUG,IDI_DEBUGRUN);
+	ICONSET(IDM_BREAKPOINT,IDI_BREAKPOINT);
+	ICONSET(IDM_STEP_IN,IDI_STEPIN);
+	ICONSET(IDM_STEP_OVER,IDI_STEPOVER);
+	ICONSET(IDM_STEP_CURSOR,IDI_STEPTOCURSOR);
+	ICONSET(IDM_DEBUG_PAUSE,IDI_DEBUGPAUSE);
+	ICONSET(IDM_DEBUG_STOP,IDI_DEBUGSTOP);
+
+	//コミュニティ
+	ICONSET(IDM_COMMUNITY,IDI_COMMUNITY_MAIN);
+	ICONSET(IDM_COMMU_SEARCH,IDI_COMMUNITY_FIND);
+	ICONSET(IDM_COMMU_PM,IDI_COMMUNITY_PRIVATEMSG);
+	ICONSET(ID_COMMU_FORUM1,IDI_COMMUNITY_FORUM);
+	ICONSET(ID_COMMU_FORUM2,IDI_COMMUNITY_FORUM);
+	ICONSET(ID_COMMU_FORUM3,IDI_COMMUNITY_FORUM);
+	ICONSET(ID_COMMU_FORUM4,IDI_COMMUNITY_FORUM);
+	ICONSET(ID_COMMU_FORUM5,IDI_COMMUNITY_FORUM);
+	ICONSET(ID_COMMU_FORUM6,IDI_COMMUNITY_FORUM_SECRET);
+	ICONSET(ID_COMMU_FORUM7,IDI_COMMUNITY_FORUM);
+	ICONSET(ID_COMMU_FORUM8,IDI_COMMUNITY_FORUM);
+#endif
+
+#undef ICONSET
+
+
+
+
+	extern HMENU hEditMenuBase,hEditMenu;
+	hEditMenuBase=LoadMenu(hResInst,MAKEINTRESOURCE(IDR_EDITMENU));
+	hEditMenu=GetSubMenu(hEditMenuBase,0);
+
+	extern HMENU hRebarMenuBase,hRebarMenu;
+	hRebarMenuBase=LoadMenu(hResInst,MAKEINTRESOURCE(IDR_REBARMENU));
+	hRebarMenu=GetSubMenu(hRebarMenuBase,0);
+
+	extern HMENU hTabMenuBase,hTabMenu,hTabColorMenu;
+	hTabMenuBase=LoadMenu(hResInst,MAKEINTRESOURCE(IDR_TABMENU));
+	hTabMenu=GetSubMenu(hTabMenuBase,0);
+	hTabColorMenu=GetSubMenu(hTabMenu,0);
+
+	extern HMENU hFileTreeMenuBase;
+	hFileTreeMenuBase=LoadMenu(hResInst,MAKEINTRESOURCE(IDR_PROJECTVIEW_FILETREEMENU));
+
+	extern HMENU hProcedureTreeMenuBase;
+	hProcedureTreeMenuBase=LoadMenu(hResInst,MAKEINTRESOURCE(IDR_PROJECTVIEW_PROCEDURETREEMENU));
+
+	extern HMENU hMaterialTreeMenuBase;
+	hMaterialTreeMenuBase=LoadMenu(hResInst,MAKEINTRESOURCE(IDR_PROJECTVIEW_MATERIALTREEMENU));
+
+	extern HMENU hRadMenuBase;
+	hRadMenuBase=LoadMenu(hResInst,MAKEINTRESOURCE(IDR_RADCONTEXTMENU));
+
+	//クリップボードのデータ形式（RAD用）を新規登録
+	extern DWORD dwRadClipboardID;
+	dwRadClipboardID=RegisterClipboardFormat("ProjectEditor-RAD");
+
+	//256色の標準パレットを読み込む
+	extern RGBQUAD DefaultColorTable256[256];
+	HANDLE hFile;
+	DWORD dw;
+	sprintf(temporary,"%sSubOperation\\8bit.plt",pj_editor_Dir);
+	hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	if(hFile==INVALID_HANDLE_VALUE){
+		//"\"%s\" ファイルの読み込みに失敗しました。"
+		sprintf(str,STRING_ERROR_CANT_FILEOPEN,temporary);
+		MessageBox(NULL,str,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+		return 0;
+	}
+	ReadFile(hFile,DefaultColorTable256,sizeof(RGBQUAD)*256,&dw,NULL);
+	CloseHandle(hFile);
+
+
+
+	//デザインテーマオブジェクトを生成
+	pobj_DBTheme=new CDBTheme();
+
+
+	/////////////////////////
+	// カラーデザインを設定
+	CTheme *pobj_Theme;
+	pobj_Theme=pobj_DBTheme->GetActiveTheme();
+	if(!pobj_Theme) pobj_Theme=pobj_DBTheme->ppobj_Theme[0];
+
+	SetTextEditColorDesign(&tci,pobj_Theme,0);
+
+
+#ifndef THETEXT
+	/////////////////////////////////////////////////////
+	// ProjectEditorのみ
+	/////////////////////////////////////////////////////
+
+
+	//クラスビュー管理オブジェクトを生成
+	pobj_ClassTreeView=new CClassTreeView();
+
+
+	/////////////////////////
+	// basic.sbpの内容を取得
+	/////////////////////////
+
+	extern char *pHeaderBuf;
+	sprintf(temporary,"%sbasic.sbp",pobj_nv->szIncludeDir);
+	GetFullPath( temporary, pj_editor_Dir );
+	pHeaderBuf=ReadBuffer(temporary);
+
+	if( !pHeaderBuf ){
+		pHeaderBuf=(char *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+	}
+
+	//ファイルをインクルード
+	pHeaderBuf=IncludeFiles(pHeaderBuf);
+
+
+	//デバッガ管理オブジェクトを生成
+	pobj_Debugger=new CDebugger();
+#endif
+
+
+	//ブレークポイント管理オブジェクトを生成
+	extern CDBBreakPoint *pobj_DBBreakPoint;
+	pobj_DBBreakPoint=new CDBBreakPoint();
+
+
+	return 1;
+}
+void EndProjectEditor(void){
+
+#ifndef THETEXT
+	/////////////////////////////////////////////////////
+	// ProjectEditorのみ
+	/////////////////////////////////////////////////////
+
+
+	//クラスビュー管理オブジェクトを破棄
+	delete pobj_ClassTreeView;
+	pobj_ClassTreeView=0;
+
+	//basic.sbpのソースコードバッファを解放
+	extern char *pHeaderBuf;
+	HeapDefaultFree(pHeaderBuf);
+
+	//デバッガ管理オブジェクトを破棄
+	delete pobj_Debugger;
+#endif
+
+	//ブレークポイント管理オブジェクトを破棄
+	extern CDBBreakPoint *pobj_DBBreakPoint;
+	delete pobj_DBBreakPoint;
+
+	//デザインテーマオブジェクトを破棄
+	delete pobj_DBTheme;
+
+	//不揮発性のデータを保存
+	pobj_nv->save();
+	delete pobj_nv;
+	pobj_nv=0;
+
+	//メインメニューオブジェクトを破棄
+	delete pobj_MainMenu;
+	pobj_MainMenu=0;
+
+	extern HFONT hStatusFont;
+	DeleteObject(hStatusFont);
+	extern HFONT hHyperLinkFont;
+	DeleteObject(hHyperLinkFont);
+	extern HFONT hRulerFont;
+	DeleteObject(hRulerFont);
+	extern HFONT hFont_LineNumber;
+	DeleteObject(hFont_LineNumber);
+	extern METHODCHECKINFO MethodCheckInfo;
+	DeleteObject(MethodCheckInfo.hFont);
+	DeleteObject(MethodCheckInfo.hBoldFont);
+	extern HICON hOwnerIcon,hBasicProgramIcon,hTextDocumentIcon,hWindowDocumentIcon;
+	DestroyIcon(hOwnerIcon);
+	DestroyIcon(hBasicProgramIcon);
+	DestroyIcon(hTextDocumentIcon);
+	DestroyIcon(hWindowDocumentIcon);
+	extern HMENU hEditMenuBase,hRebarMenuBase,hTabMenuBase;
+	DestroyMenu(hEditMenuBase);
+	DestroyMenu(hRebarMenuBase);
+	DestroyMenu(hTabMenuBase);
+	extern HMENU hFileTreeMenuBase;
+	DestroyMenu(hFileTreeMenuBase);
+	extern HMENU hProcedureTreeMenuBase;
+	DestroyMenu(hProcedureTreeMenuBase);
+	extern HMENU hMaterialTreeMenuBase;
+	DestroyMenu(hMaterialTreeMenuBase);
+	extern HMENU hRadMenuBase;
+	DestroyMenu(hRadMenuBase);
+
+	//背景ブラシ
+	extern HBRUSH h3DFaceBackBrush;
+	DeleteObject(h3DFaceBackBrush);
+
+	//スタンダードツールバーを破棄
+	if(pobj_StandardToolbar){
+		pobj_StandardToolbar->Release();
+		pobj_StandardToolbar=0;
+	}
+
+	//ビルドツールバーを破棄
+	if(pobj_ReleaseToolbar){
+		pobj_ReleaseToolbar->Release();
+		pobj_ReleaseToolbar=0;
+	}
+
+	//デバッガ用ツールバーを破棄
+	if(pobj_DebuggerToolbar){
+		pobj_DebuggerToolbar->Release();
+		pobj_DebuggerToolbar=0;
+	}
+
+	//ヒープオブジェクトを解放
+	extern HANDLE hHeap;
+	HeapDestroy(hHeap);
+
+	//DLLを解放
+	FreeLibrary(hResInst);
+	FreeLibrary(hIconResInst);
+	FreeLibrary(hLib_LuxCtrl);
+
+	//アルファブレンド用のAPIを解放
+	extern HINSTANCE hUser32Lib;
+	FreeLibrary(hUser32Lib);
+
+
+
+
+	//////////////////////////////////////
+	// バックアップ用ファイルを削除
+	//////////////////////////////////////
+	extern char szBackupDirPath[MAX_PATH];
+	RemoveDirectoryStrong(szBackupDirPath);
+
+}
+
+//各ウィンドウ生成
+void SetupWindow(HWND hwnd){
+	extern HINSTANCE hInst;
+	extern HMENU hFirstMainMenu;
+	RECT rect;
+	CLIENTCREATESTRUCT ccs;
+
+	INITCOMMONCONTROLSEX InitCommCtrl;
+	InitCommCtrl.dwSize=sizeof(INITCOMMONCONTROLSEX);
+	InitCommCtrl.dwICC=ICC_COOL_CLASSES|ICC_PAGESCROLLER_CLASS|ICC_WIN95_CLASSES|ICC_TAB_CLASSES;
+	InitCommonControlsEx(&InitCommCtrl);
+
+	//タブウィンドウ
+	pobj_MainTab=new CMainTab(hwnd);
+
+	//MDIの親ウィンドウ（クライアントウィンドウ）を作成
+	ccs.hWindowMenu=hFirstMainMenu;
+	ccs.idFirstChild=ID_FIRSTCHILD;
+	GetClientRect(hwnd,&rect);
+	hClient=CreateWindowEx(WS_EX_CLIENTEDGE,"MDICLIENT",NULL,
+		WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_VISIBLE,
+		0,0,0,0,
+		hwnd,(HMENU)1,hInst,(LPSTR)&ccs);
+
+	//レバーオブジェクトを生成
+	pobj_Rebar=new CMainRebar(hwnd);
+
+	//ステータスバー
+	extern HWND hStatusBar;
+	extern HFONT hStatusFont;
+	hStatusBar=CreateStatusWindow(
+		WS_VISIBLE|WS_CHILD|WS_CLIPSIBLINGS|SBARS_SIZEGRIP|CCS_BOTTOM,
+		NULL,hwnd,NULL);
+	SendMessage(hStatusBar,WM_SETFONT,(long)hStatusFont,0);
+
+	//プロジェクト ビュー
+	extern HWND hProjectView;
+	extern HWND hProjectView_ToolWindow;
+	RECT *prc;
+	prc=&pobj_nv->rectProjectView;
+	hProjectView_ToolWindow=CreateWindowEx(WS_EX_TOOLWINDOW,"ProjectView_ToolWindow","ProjectView",
+		WS_POPUP|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_CLIPCHILDREN,
+		prc->left,prc->top,prc->right-prc->left,prc->bottom-prc->top,
+		hwnd,0,hInst,0);
+	hProjectView=CreateWindowEx(WS_EX_STATICEDGE,"ProjectView","ProjectView",
+		WS_CHILD|WS_CLIPCHILDREN,
+		0,0,0,0,
+		hwnd,0,hInst,0);
+	if(pobj_nv->bClipProjectView==0){
+		SetWindowLong(hProjectView,GWL_EXSTYLE,0);
+		SetParent(hProjectView,hProjectView_ToolWindow);
+		ResizeProjectView_ToolWindow();
+	}
+
+	//メニュー状態を設定
+	ResetState_DocMenu();
+
+
+	//SideWebを生成
+	pobj_SideWeb=new CSideWeb(hwnd);
+}
+
+//実行コマンド
+BOOL SetRunning(HWND hChild){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern LPSTR DefFileFilter;
+	int WndNum;
+	char temporary[MAX_PATH],temp2[MAX_PATH];
+	HANDLE hFind;
+	WIN32_FIND_DATA wfd;
+
+	extern char *lpszCompilerName;
+	sprintf(temporary,"%s%s",pj_editor_Dir,lpszCompilerName);
+	hFind=FindFirstFile(temporary,&wfd);
+	if(hFind==INVALID_HANDLE_VALUE){
+		//"BasicCompiler.exe が見つかりません"
+		MessageBox(hOwner,STRING_ERROR_NOBASICCOMPILER,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+		return FALSE;
+	}
+	FindClose(hFind);
+
+	WndNum=GetWndNum(hChild);
+	if(IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+		if(MdiInfo[WndNum].path[0]=='\0'){
+			//"保存先のファイルを指定してください"
+			if(!GetFilePathDialog(hOwner,temp2,DefFileFilter,STRING_FILESAVETITLE_DEFAULT,0)) return FALSE;
+
+			if(!SaveDocument(hChild,temp2)) return 0;
+		}
+		else{
+			if( MdiInfo[WndNum].pMdiTextEdit->IsModified() ){
+				if(!SaveDocument(hChild,NULL)) return 0;
+			}
+			else{
+				if(hFind=FindFirstFile(MdiInfo[WndNum].path,&wfd)){
+					if(hFind==INVALID_HANDLE_VALUE){
+						if(!SaveDocument(hChild,NULL)) return 0;
+					}
+					else FindClose(hFind);
+				}
+			}
+		}
+	}
+	return 1;
+}
+
+BOOL IsNeedCompile(char *FileName,BOOL bDebug){
+	char temporary[MAX_PATH],temp2[MAX_PATH],temp3[MAX_PATH];
+	HANDLE hFind,hFile;
+	WIN32_FIND_DATA wfd;
+	FILETIME SourceTime,ExeTime;
+
+	_splitpath(FileName,temporary,temp2,temp3,NULL);
+	lstrcat(temporary,temp2);
+	lstrcat(temporary,temp3);
+	if(bDebug) lstrcat(temporary,"_debug.exe");
+	else lstrcat(temporary,".exe");
+
+	hFind=FindFirstFile(temporary,&wfd);
+	if(hFind==INVALID_HANDLE_VALUE) return 1;
+	FindClose(hFind);
+
+	hFile=CreateFile(FileName,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	GetFileTime(hFile,NULL,NULL,&SourceTime);
+	CloseHandle(hFile);
+
+	hFile=CreateFile(temporary,GENERIC_READ,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
+	GetFileTime(hFile,NULL,NULL,&ExeTime);
+	CloseHandle(hFile);
+
+	if(SourceTime.dwHighDateTime<ExeTime.dwHighDateTime) return 0;
+	else if(SourceTime.dwHighDateTime==ExeTime.dwHighDateTime&&
+		SourceTime.dwLowDateTime<=ExeTime.dwLowDateTime) return 0;
+	return 1;
+}
+
+string GetLastErrorString(){
+	char *lpMsgBuf;
+
+	FormatMessage( 
+		FORMAT_MESSAGE_ALLOCATE_BUFFER | 
+		FORMAT_MESSAGE_FROM_SYSTEM | 
+		FORMAT_MESSAGE_IGNORE_INSERTS,
+		NULL,
+		GetLastError(),
+		MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // デフォルト言語
+		(LPTSTR) &lpMsgBuf,
+		0,
+		NULL 
+	);
+
+	string result = lpMsgBuf;
+
+	LocalFree( lpMsgBuf );
+
+	return result;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/TabCtrl.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/TabCtrl.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/TabCtrl.cpp	(revision 178)
@@ -0,0 +1,419 @@
+#include "Common.h"
+
+
+CMainTab *pobj_MainTab=0;
+WNDPROC OldMainTabWndProc;
+
+
+LRESULT CALLBACK MainTabWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	static BOOL indexDrag=-1;
+	TCHITTESTINFO tcHitTest;
+	int iNewPos;
+	char temporary[MAX_PATH];
+	switch(message){
+		case WM_LBUTTONDOWN:
+			//クリックされたアイテムインデックスを取得
+			GetCursorPos(&tcHitTest.pt);
+			ScreenToClient(pobj_MainTab->hTab,&tcHitTest.pt);
+			indexDrag=TabCtrl_HitTest(pobj_MainTab->hTab,&tcHitTest);
+			if(indexDrag==-1) break;
+
+			SetCapture(hwnd);
+			break;
+		case WM_LBUTTONUP:
+			indexDrag=-1;
+			ReleaseCapture();
+			break;
+		case WM_MOUSEMOVE:
+			if(indexDrag!=-1){
+				GetCursorPos(&tcHitTest.pt);
+				ScreenToClient(pobj_MainTab->hTab,&tcHitTest.pt);
+				iNewPos=TabCtrl_HitTest(pobj_MainTab->hTab,&tcHitTest);
+				if(iNewPos==-1) break;
+				if(indexDrag!=iNewPos){
+					LockWindowUpdate(hOwner);
+
+					TC_ITEM tcItem;
+					tcItem.mask=TCIF_TEXT|TCIF_PARAM;
+					tcItem.pszText=temporary;
+					tcItem.cchTextMax=MAX_PATH;
+					TabCtrl_GetItem(pobj_MainTab->hTab,indexDrag,&tcItem);
+
+					TabCtrl_DeleteItem(pobj_MainTab->hTab,indexDrag);
+
+					TabCtrl_InsertItem(pobj_MainTab->hTab,iNewPos,&tcItem);
+
+					int iTemp;
+					iTemp=TabCtrl_HitTest(pobj_MainTab->hTab,&tcHitTest);
+					if(iTemp!=iNewPos){
+						TabCtrl_DeleteItem(pobj_MainTab->hTab,iNewPos);
+						TabCtrl_InsertItem(pobj_MainTab->hTab,indexDrag,&tcItem);
+
+						LockWindowUpdate(0);
+						break;
+					}
+
+					indexDrag=iNewPos;
+
+					LockWindowUpdate(0);
+				}
+			}
+			return 0;
+		case WM_PAINT:
+			HDC hdc;
+			PAINTSTRUCT ps;
+			hdc=BeginPaint(hwnd,&ps);
+			if(pobj_MainTab)
+				pobj_MainTab->draw(hdc);
+			EndPaint(hwnd,&ps);
+			return 0;
+	}
+	return CallWindowProc(OldMainTabWndProc,hwnd,message,wParam,lParam);
+}
+
+
+int CMainTab::SearchItemIndex( const char *lpszText ){
+	int i2,i3;
+	char temporary[MAX_PATH];
+
+	i3=TabCtrl_GetItemCount(hTab);
+
+	TC_ITEM tcItem;
+	tcItem.mask=TCIF_TEXT;
+	tcItem.pszText=temporary;
+	tcItem.cchTextMax=MAX_PATH;
+
+	for(i2=0;i2<i3;i2++){
+		TabCtrl_GetItem(hTab,i2,&tcItem);
+
+		//アスタリスクを取り除いて評価する
+		if( tcItem.pszText[ lstrlen( tcItem.pszText ) -1 ] == '*' ){
+			tcItem.pszText[ lstrlen( tcItem.pszText ) -1 ] = 0;
+		}
+
+		if(lstrcmpi(lpszText,tcItem.pszText)==0) break;
+	}
+	if(i2==i3) return -1;
+
+	return i2;
+}
+void CMainTab::SetItemText( int index, const char *ItemText ){
+	TC_ITEM tcItem;
+	tcItem.mask=TCIF_TEXT;
+	tcItem.pszText=(LPSTR)ItemText;
+	tcItem.cchTextMax=MAX_PATH;
+
+	TabCtrl_SetItem(hTab,index,&tcItem);
+}
+void CMainTab::GetItemText( int index, char *ItemText ){
+	TC_ITEM tcItem;
+	tcItem.mask = TCIF_TEXT;
+	tcItem.pszText = ItemText;
+	tcItem.cchTextMax = MAX_PATH;
+	TabCtrl_GetItem( hTab, index, &tcItem );
+}
+bool CMainTab::IsModified( int index ){
+	//アスタリスク表示かどうかを判断する
+
+	//アイテム文字列を取得
+	char ItemText[MAX_PATH];
+	GetItemText( index, ItemText );
+
+	if( ItemText[ lstrlen( ItemText ) -1 ] == '*' ){
+		//アスタリスクがあったとき
+		return true;
+	}
+
+	//その他
+	return false;
+}
+
+
+CMainTab::CMainTab(HWND hParent){
+	extern HFONT hStatusFont;
+	hTab=CreateWindowEx(0,WC_TABCONTROL,NULL,
+		WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_VISIBLE|TCS_OWNERDRAWFIXED,
+		0,0,0,0,
+		hParent,0,hInst,0);
+
+	TabCtrl_SetPadding(hTab,5,4);
+
+	DWORD dwStyle;
+    dwStyle = TabCtrl_GetExtendedStyle(hTab);
+    dwStyle &= ~TCS_EX_FLATSEPARATORS;
+    TabCtrl_SetExtendedStyle(hTab, dwStyle);
+
+
+	//サブクラス化
+	OldMainTabWndProc=(WNDPROC)GetWindowLong(hTab,GWL_WNDPROC);
+	SetWindowLong(hTab,GWL_WNDPROC,(LONG_PTR)MainTabWndProc);
+
+	//ボールド体フォントを生成
+	LOGFONT lf;
+	GetObject(hStatusFont,sizeof(LOGFONT),&lf);
+	lf.lfWeight=FW_BOLD;
+	hBoldFont=CreateFontIndirect(&lf);
+
+	SendMessage(hTab,WM_SETFONT,(long)hBoldFont,0);
+}
+
+CMainTab::~CMainTab(){
+	DeleteObject(hBoldFont);
+}
+
+void CMainTab::InsertItem( const char *lpszText, bool isResize, COLORREF color ){
+	int sw=0;
+	if(TabCtrl_GetItemCount(hTab)==0) sw=1;
+
+	if(color==-1) color=RGB(230,230,230);
+
+	TC_ITEM tcItem;
+	tcItem.mask=TCIF_TEXT|TCIF_PARAM;
+	tcItem.pszText=(LPSTR)lpszText;
+	tcItem.lParam=color;
+	TabCtrl_InsertItem(hTab,0,&tcItem);
+	TabCtrl_SetCurSel(hTab,0);
+
+	if(isResize){
+		if(sw) ResizeOwnerWnd();
+	}
+}
+
+void CMainTab::DeleteItem( const char *lpszText, bool isResize ){
+	int i2;
+	i2=SearchItemIndex(lpszText);
+	if(i2==-1) return;
+
+	TabCtrl_DeleteItem(hTab,i2);
+
+	if(isResize){
+		if(TabCtrl_GetItemCount(hTab)==0) ResizeOwnerWnd();
+	}
+}
+
+void CMainTab::RenameItem( const char *lpszOldText, const char *lpszNewText ){
+	int i2;
+	i2=SearchItemIndex(lpszOldText);
+	if(i2==-1) return;
+
+	SetItemText( i2, lpszNewText );
+}
+
+void CMainTab::NofityModifyDocument( const char *ItemText ){
+	//ドキュメントが変更されたとき、アスタリスクを付けて表示する
+
+	//インデックスを取得
+	int index = SearchItemIndex( ItemText );
+	if( index == -1 ) return;
+
+	//既にアスタリスク表示されていた場合は抜ける
+	if( IsModified( index ) ) return;
+
+	//アスタリスクを付加
+	char temporary[MAX_PATH];
+	lstrcpy( temporary, ItemText );
+	lstrcat( temporary, "*" );
+
+	//タブアイテムを更新
+	SetItemText( index, temporary );
+}
+void CMainTab::NofityUnModifyDocument( const char *ItemText ){
+	//ドキュメントが保存されたとき、アスタリスクを非表示にする
+
+	//インデックスを取得
+	int index = SearchItemIndex( ItemText );
+	if( index == -1 ) return;
+
+	//既にアスタリスクが非表示の場合は抜ける
+	if( ! IsModified( index ) ) return;
+
+	//タブアイテムを更新
+	SetItemText( index, ItemText );
+}
+
+COLORREF CMainTab::GetItemColor( char *ItemText ){
+	//インデックスを取得
+	int index = SearchItemIndex( ItemText );
+	if( index == -1 ) return -1;
+
+	TC_ITEM tcItem;
+	tcItem.mask = TCIF_PARAM;
+	TabCtrl_GetItem( hTab, index, &tcItem );
+	return tcItem.lParam;
+}
+
+void CMainTab::SelChangeEvent(){
+	int i;
+	i=TabCtrl_GetCurSel(hTab);
+
+	char ItemText[MAX_PATH];
+	TC_ITEM tcItem;
+	tcItem.mask=TCIF_TEXT;
+	tcItem.pszText=ItemText;
+	tcItem.cchTextMax=MAX_PATH;
+	TabCtrl_GetItem(hTab,i,&tcItem);
+
+	if( ItemText[ lstrlen( ItemText ) -1 ] == '*' ){
+		//アスタリスクがあったときは取り除く
+		ItemText[ lstrlen( ItemText ) -1 ] = 0;
+	}
+
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	for(i=0;i<MAX_WNDNUM;i++){
+		if(lstrcmpi(ItemText,MdiInfo[i].title)==0) break;
+	}
+	BringWindowToTop(MdiInfo[i].hwnd);
+}
+void CMainTab::MdiActiveEvent(char *lpszText){
+	int i2;
+	i2=SearchItemIndex(lpszText);
+	if(i2==-1) return;
+
+	TabCtrl_SetCurSel(hTab,i2);
+}
+
+void CMainTab::draw(HDC hdc){
+	COLORREF colorGray;
+	HBRUSH hGrayBrush;
+
+	int nMaxPage;
+	nMaxPage=TabCtrl_GetItemCount(hTab);
+
+	//ペンを生成
+	HPEN hPen,hOldPen;
+	COLORREF colorPen;
+	colorPen=RGB(127,140,155);
+	hPen=CreatePen(PS_SOLID,0,colorPen);
+	hOldPen=(HPEN)SelectObject(hdc,hPen);
+
+	//描画領域を塗りつぶす
+	RECT rc;
+	GetClientRect(hTab,&rc);
+	FillRect(hdc,&rc,GetSysColorBrush(COLOR_3DFACE));
+
+	//リージョンを生成
+	HRGN hDefaultRgn;
+	hDefaultRgn=CreateRectRgnIndirect(&rc);
+
+	int i;
+	char temporary[MAX_PATH];
+	HFONT hOldFont;
+	TCITEM item;
+	memset(&item,0,sizeof(TCITEM));
+	item.mask=TCIF_TEXT|TCIF_PARAM;
+	item.pszText=temporary;
+	item.cchTextMax=MAX_PATH;
+	for(i=nMaxPage-1;i>=0;i--){
+		if(i==TabCtrl_GetCurSel(hTab)){
+			//フォーカスを持つタブは最後に描画するため、飛び越す
+			continue;
+		}
+
+		TabCtrl_GetItem(hTab,i,&item);
+
+		//座標取得
+		TabCtrl_GetItemRect(hTab,i,&rc);
+
+
+
+		////////////////////////////
+		// タブ枠を描画
+		////////////////////////////
+		colorGray=item.lParam;
+
+		//ブラシを生成
+		hGrayBrush=CreateSolidBrush(colorGray);
+
+		SetBkColor(hdc,colorGray);
+
+		HBRUSH hOldBrush;
+		hOldBrush=(HBRUSH)SelectObject(hdc,hGrayBrush);
+
+		HRGN hRgn1,hRgn2;
+		hRgn1=CreateRectRgn(rc.left,rc.top,rc.right-20,rc.bottom);
+		hRgn2=CreateRectRgn(rc.right-20,rc.top,rc.right+2,rc.bottom);
+
+		SelectObject(hdc,hRgn1);
+		RoundRect(hdc,rc.left,rc.top,rc.right+2,rc.bottom+20,20,15);
+		SelectObject(hdc,hRgn2);
+		RoundRect(hdc,rc.left,rc.top,rc.right+2,rc.bottom+20,3,3);
+		SelectObject(hdc,hDefaultRgn);
+
+		DeleteObject(hRgn1);
+		DeleteObject(hRgn2);
+
+		SelectObject(hdc,hOldBrush);
+		DeleteObject(hGrayBrush);
+
+
+		extern HFONT hStatusFont;
+		hOldFont=(HFONT)SelectObject(hdc,hStatusFont);
+
+
+
+		//文字を描画
+		DrawText(hdc,item.pszText,-1,&rc,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
+
+
+		SelectObject(hdc,hOldFont);
+	}
+
+
+	/////////////////////////////////
+	// フォーカスを持つタブを描画
+	/////////////////////////////////
+	i=TabCtrl_GetCurSel(hTab);
+
+	TabCtrl_GetItem(hTab,i,&item);
+
+	//座標取得
+	TabCtrl_GetItemRect(hTab,i,&rc);
+
+	{
+		rc.top-=2;
+		////////////////////////////
+		// タブ枠を描画
+		////////////////////////////
+		colorGray=item.lParam;
+
+		//ブラシを生成
+		hGrayBrush=CreateSolidBrush(colorGray);
+
+		SetBkColor(hdc,colorGray);
+
+		HBRUSH hOldBrush;
+		hOldBrush=(HBRUSH)SelectObject(hdc,hGrayBrush);
+
+		HRGN hRgn1,hRgn2;
+		hRgn1=CreateRectRgn(rc.left,rc.top,rc.right-20,rc.bottom);
+		hRgn2=CreateRectRgn(rc.right-20,rc.top,rc.right+2,rc.bottom);
+
+		SelectObject(hdc,hRgn1);
+		RoundRect(hdc,rc.left,rc.top,rc.right+2,rc.bottom+20,20,15);
+		SelectObject(hdc,hRgn2);
+		RoundRect(hdc,rc.left,rc.top,rc.right+2,rc.bottom+20,3,3);
+		SelectObject(hdc,hDefaultRgn);
+
+		DeleteObject(hRgn1);
+		DeleteObject(hRgn2);
+
+		SelectObject(hdc,hOldBrush);
+		DeleteObject(hGrayBrush);
+
+		rc.top+=2;
+	}
+
+	hOldFont=(HFONT)SelectObject(hdc,hBoldFont);
+
+	//文字を描画
+	DrawText(hdc,item.pszText,-1,&rc,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
+
+	SelectObject(hdc,hOldFont);
+
+
+
+	SelectObject(hdc,hOldPen);
+	DeleteObject(hPen);
+
+	DeleteObject(hDefaultRgn);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/TabCtrl.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/TabCtrl.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/TabCtrl.h	(revision 178)
@@ -0,0 +1,46 @@
+
+
+class CMainTab{
+	HFONT hBoldFont;
+
+	//アイテム文字列を元にインデックスを取得する
+	int SearchItemIndex( const char *lpszText );
+
+	//アイテム文字列を変更する
+	void SetItemText( int index, const char *ItemText );
+
+	//アイテム文字列を取得する
+	void GetItemText( int index, char *ItemText );
+
+	//アスタリスク表示かどうかを調べる（true/変更あり, false/変更なし）
+	bool IsModified( int index );
+
+public:
+	HWND hTab;
+
+	CMainTab(HWND hParent);
+	~CMainTab();
+
+	//アイテムを挿入
+	void InsertItem( const char *lpszText, bool isResize, COLORREF color = -1 );
+
+	//アイテムを削除
+	void DeleteItem( const char *lpszText, bool isResize );
+
+	//アイテムの名前を変更
+	void RenameItem( const char *lpszOldText, const char *lpszNewText );
+
+	//変更あり通知
+	void NofityModifyDocument( const char *ItemText );
+
+	//変更なし通知
+	void NofityUnModifyDocument( const char *ItemText );
+
+	COLORREF GetItemColor( char *ItemText );
+
+	void SelChangeEvent();
+	void MdiActiveEvent(char *lpszText);
+
+	void draw(HDC hdc);
+};
+extern CMainTab *pobj_MainTab;
Index: tag/abdev(2007.06.20)/ProjectEditor/TextEditor.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/TextEditor.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/TextEditor.cpp	(revision 178)
@@ -0,0 +1,344 @@
+#include "Common.h"
+
+extern HFONT hFont_TextEdit,hFont_HyperLink_TextEdit;
+extern int font_width,font_height;
+
+
+int GetControlTabSpace(int WndNum,int *piCount){
+	if(pobj_nv->bEditor_LineNumber){
+		extern MDIINFO MdiInfo[MAX_WNDNUM];
+
+		char *pBuf;
+		pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+		int i,iNum=1,x=0;
+		for(i=0;;i++,x++){
+			if(IsRightTurn(pBuf,i,x)){
+				//右端で折り返す
+				iNum++;
+				x=-1;
+				i--;
+				continue;
+			}
+			if(pBuf[i]=='\0') break;
+			if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+				iNum++;
+
+				x=-1;
+			}
+		}
+		char temporary[255];
+		sprintf(temporary,"%d",iNum);
+
+		extern SIZE sizeLineNumberFont;
+
+		i=lstrlen(temporary);
+		if(piCount) *piCount=i;
+
+		return sizeLineNumberFont.cx*(i+2);
+	}
+
+	return CONTROL_TAB_SPACE_DEFAULT;
+}
+
+void ResetTextEditFont(HWND hwnd){
+	if(hFont_TextEdit) DeleteObject(hFont_TextEdit);
+	hFont_TextEdit=CreateFontIndirect(&pobj_nv->lf);
+
+	//下線フォント
+	LOGFONT lf;
+	lf=pobj_nv->lf;
+	lf.lfUnderline=TRUE;
+	if(hFont_HyperLink_TextEdit) DeleteObject(hFont_HyperLink_TextEdit);
+	hFont_HyperLink_TextEdit=CreateFontIndirect(&lf);
+
+	HDC hdc;
+	HFONT hOldFont;
+	hdc=GetDC(hwnd);
+
+
+	hOldFont=(HFONT)SelectObject(hdc,hFont_TextEdit);
+
+	//単位文字の幅、高さ
+	SIZE size;
+	GetTextExtentPoint32(hdc,"A",1,&size);
+	font_width=size.cx;
+	font_height=size.cy;
+
+	SelectObject(hdc,hOldFont);
+
+
+	//行番号表示用フォントのサイズ
+	extern HFONT hFont_LineNumber;
+	hOldFont=(HFONT)SelectObject(hdc,hFont_LineNumber);
+	extern SIZE sizeLineNumberFont;
+	GetTextExtentPoint32(hdc,"A",1,&sizeLineNumberFont);
+	SelectObject(hdc, hOldFont);
+	
+	
+	ReleaseDC(hwnd,hdc);
+}
+void SetTextEditWordColor(int WndNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,i2,i3,IsStr;
+	char str[255];
+	char *pBuf;
+
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+	if(MdiInfo[WndNum].DocType==WNDTYPE_TEXT){
+		//通常のテキストはすべてをデフォルトカラー（標準で黒）にする
+		for(i=0;;i++){
+			if(pBuf[i]=='\0') break;
+			MdiInfo[WndNum].pMdiTextEdit->pColorRef[i]=tci.rgbDefault;
+		}
+		return;
+	}
+
+
+	for(i=0,IsStr=0;;i++){
+		if(pBuf[i]=='\0') break;
+
+		if((IsVariableTopChar(pBuf[i]))&&IsStr==0){
+			for(i2=0;;i++,i2++){
+				if((!IsVariableChar(pBuf[i]))||pBuf[i]=='.'){
+					str[i2]=0;
+					break;
+				}
+				str[i2]=pBuf[i];
+			}
+
+			BOOL bResult=0;
+			if(MdiInfo[WndNum].DocType==WNDTYPE_BASIC){
+				i3=IsBasicReservedWord(str);
+				bResult=IsManagementCommand(i3);
+			}
+			else if(MdiInfo[WndNum].DocType==WNDTYPE_HTML){
+				bResult=IsHtmlReservedWord(str);
+			}
+
+			if(bResult){
+				for(i3=i-i2;i3<i;i3++){
+					MdiInfo[WndNum].pMdiTextEdit->pColorRef[i3]=tci.rgbStatement;
+				}
+			}
+			else{
+				for(i3=i-i2;i3<i;i3++){
+					MdiInfo[WndNum].pMdiTextEdit->pColorRef[i3]=tci.rgbDefault;
+				}
+			}
+			i--;
+			continue;
+		}
+		else{
+			if(IsStr||pBuf[i]=='\"'&&IsStr==0){
+				//文字列カラー（""で囲まれる範囲）
+				MdiInfo[WndNum].pMdiTextEdit->pColorRef[i]=tci.rgbString;
+			}
+			else{
+				//通常カラー
+				MdiInfo[WndNum].pMdiTextEdit->pColorRef[i]=tci.rgbDefault;
+			}
+		}
+
+		if(pBuf[i]=='\"') IsStr^=1;
+
+		if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+			IsStr=0;
+			continue;
+		}
+	}
+}
+void ResetScrollbar(int WndNum,int max_x,int max_y){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	RECT rect;
+
+	//エディタ画面左端のコントロールタブ
+	int iControlTabSpace;
+	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+
+	HWND hEdit;
+	hEdit=GetWindow(MdiInfo[WndNum].hwnd,GW_CHILD);
+	GetClientRect(hEdit,&rect);
+
+	SCROLLINFO si;
+	si.cbSize=sizeof(SCROLLINFO);
+	si.fMask=SIF_PAGE|SIF_RANGE|SIF_DISABLENOSCROLL;
+
+	//垂直スクロールバーの設定
+	GetScrollInfo(hEdit,SB_VERT,&si);
+	si.nPage=(rect.bottom/font_height)-1;
+	si.nMin=0;
+	si.nMax=max_y+si.nPage/5*3;
+	SetScrollInfo(hEdit,SB_VERT,&si,1);
+
+	//水平スクロールバーの設定
+	GetScrollInfo(hEdit,SB_HORZ,&si);
+	si.nMin=0;
+	si.nPage=(rect.right-iControlTabSpace)/font_width   -1;
+	si.nMax=max_x+si.nPage/3;
+	SetScrollInfo(hEdit,SB_HORZ,&si,1);
+
+	//ルーラーを再描画
+	InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd,NULL,0);
+	UpdateWindow(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd);
+}
+
+#define HIRA_START	(unsigned char)0x9F		//ひらがなの2バイト目の範囲
+#define HIRA_END	(unsigned char)0xF1
+#define KATA_START	(unsigned char)0x40		//カタカナの2バイト目の範囲
+#define KATA_END	(unsigned char)0x96
+BOOL IsHiragana(char *pBuf){
+	if((unsigned char)pBuf[0]==(unsigned char)0x82&&
+		HIRA_START<=(unsigned char)pBuf[1]&&(unsigned char)pBuf[1]<=HIRA_END) return 1;
+	return 0;
+}
+BOOL IsKatakana(char *pBuf){
+	if(((unsigned char)pBuf[0]==(unsigned char)0x83&&
+		KATA_START<=(unsigned char)pBuf[1]&&(unsigned char)pBuf[1]<=KATA_END)||
+		(unsigned char)pBuf[0]==(unsigned char)0x81&&(unsigned char)pBuf[1]==(unsigned char)0x5B) return 1;
+	return 0;
+}
+BOOL IsKanji(char *pBuf){
+	if((unsigned char)0x88<=(unsigned char)pBuf[0] && (unsigned char)pBuf[0]<=(unsigned char)0xEA) return 1;
+	return 0;
+}
+BOOL IsAlphabet(char c){
+	if('a'<=c&&c<='z'||'A'<=c&&c<='Z') return 1;
+	return 0;
+}
+BOOL IsReturnCode(char *pBuf){
+	if(pBuf[0]=='\r'&&pBuf[1]=='\n') return 1;
+	return 0;
+}
+void TextEdit_GetWordCaret(HWND hwnd,int WndNum,POINT *pPos,int *piStart,int *piEnd,BOOL bBeforeAfterFlag){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i,start,end;
+	char *pBuf;
+
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+	//ダブルクリック位置を取得（バッファインデックス）
+	i=GetBufferIndexFromCaretPos(pBuf,
+		pPos->x,
+		pPos->y);
+
+	if(IsDBCSLeadByte(pBuf[i])){
+		///////////////////
+		// 全角文字のとき
+		///////////////////
+
+		if(IsHiragana(pBuf+i)){
+			//ひらがな
+
+			//単語の先頭位置を取得
+			start=i;
+			for(;;start-=2){
+				if(0>start){
+					start+=2;
+					break;
+				}
+				if(!IsHiragana(pBuf+start)){
+					start+=2;
+					break;
+				}
+			}
+
+			//単語の終端位置を取得
+			end=i;
+			for(;;end+=2){
+				if(!IsHiragana(pBuf+end)) break;
+			}
+		}
+		else if(IsKatakana(pBuf+i)){
+			//カタカナ
+
+			//単語の先頭位置を取得
+			start=i;
+			for(;;start-=2){
+				if(0>start){
+					start+=2;
+					break;
+				}
+				if(!IsKatakana(pBuf+start)){
+					start+=2;
+					break;
+				}
+			}
+
+			//単語の終端位置を取得
+			end=i;
+			for(;;end+=2){
+				if(!IsKatakana(pBuf+end)) break;
+			}
+		}
+		else if(IsKanji(pBuf+i)){
+			//漢字
+
+			//単語の先頭位置を取得
+			start=i;
+			for(;;start-=2){
+				if(0>start){
+					start+=2;
+					break;
+				}
+				if(!IsKanji(pBuf+start)){
+					start+=2;
+					break;
+				}
+			}
+
+			//単語の終端位置を取得
+			end=i;
+			for(;;end+=2){
+				if(!IsKanji(pBuf+end)) break;
+			}
+		}
+		else{
+			//漢字とその他の全角文字
+			start=i;
+			end=start+2;
+		}
+	}
+	else{
+		///////////////////
+		// 半角文字のとき
+		///////////////////
+
+		//単語の先頭位置を取得
+		start=i;
+		for(;0<=start;start--){
+			if(!(IsVariableChar(pBuf[start])&&pBuf[start]!='.')){
+				break;
+			}
+		}
+		start++;
+
+		//単語の終端位置を取得
+		end=i;
+		for(;;end++){
+			if(!(IsVariableChar(pBuf[end])&&pBuf[end]!='.')) break;
+		}
+	}
+
+	*piStart=start;
+	*piEnd=end;
+}
+void CancelBeforeAutoIndent(int WndNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+
+	i=GetBufferIndexFromCaretPos(
+		MdiInfo[WndNum].pMdiTextEdit->buffer,
+		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+		MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+	GetCaretPosFromBufferIndex(
+		MdiInfo[WndNum].pMdiTextEdit->buffer,
+		i-lstrlen(MdiInfo[WndNum].IndentStr),
+		&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+
+	TextEdit_Replace(WndNum,"",1);
+
+	HeapDefaultFree(MdiInfo[WndNum].IndentStr);
+	MdiInfo[WndNum].IndentStr=0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/TextEditor_EventProc.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/TextEditor_EventProc.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/TextEditor_EventProc.cpp	(revision 178)
@@ -0,0 +1,271 @@
+#include "Common.h"
+
+
+//IME関連のイベント
+void TextEditEvent_IME_StartComposition(HWND hwnd);
+BOOL TextEditEvent_IME_Composition(HWND hwnd,LPARAM lParam);
+
+//マウス関連のイベント
+void TextEditEvent_LButtonDown(HWND hwnd,POINT *pMousePos);
+void TextEditEvent_LButtonUp(HWND hwnd,POINT *pMousePos);
+void TextEditEvent_MouseMove(HWND hwnd,POINT *pMousePos);
+void TextEditEvent_LButtonDblClk(HWND hwnd,POINT *pMousePos);
+
+//キーボード関連のイベント
+void TextEditEvent_KeyUp(HWND hwnd,int nVirtualKey);
+void TextEditEvent_Char(HWND hwnd,int nVirtualKey);
+void TextEditEvent_KeyDown(HWND hwnd,int nVirtualKey,int lKeyData);
+
+
+
+HFONT hFont_TextEdit,hFont_HyperLink_TextEdit;
+int font_width,font_height;
+
+//改行時のキャレットちらつき防止用
+int hide_caret_switch;
+
+LRESULT CALLBACK TextEditProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern HANDLE hHeap;
+	extern HWND hDocCombo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	static DWORD dwAutoScroll;
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+	int i,WndNum;
+	SCROLLINFO si;
+	RECT rect;
+	POINT pos;
+
+	switch(message){
+		case WM_MDIACTIVATE:
+			if(!lParam) return 0;
+			i=GetWndNum((HWND)lParam);
+			if(i==-1) return 0;	//ウィンドウが初期状態の場合
+
+			i=SendMessage(hDocCombo,CB_FINDSTRINGEXACT,0,(long)MdiInfo[i].title);
+			SendMessage(hDocCombo,CB_SETCURSEL,i,0);
+			SetStatusText(NULL);
+			ResetState_EditMenu();
+			return 0;
+
+
+
+		///////////////////////
+		// IME関連のイベント
+		///////////////////////
+
+		case WM_IME_STARTCOMPOSITION:
+			TextEditEvent_IME_StartComposition(hwnd);
+			//デフォルト処理を行う
+			break;
+		case WM_IME_CHAR:
+			//デフォルト処理を行わない（WM_CHARを呼び出さないため）
+			return 0;
+		case WM_IME_COMPOSITION:
+			if(!TextEditEvent_IME_Composition(hwnd,lParam)) return 0;
+
+			//デフォルト処理を行う
+			break;
+
+
+
+		//////////////////////////
+		// マウス関連のイベント
+		//////////////////////////
+
+		case WM_LBUTTONDOWN:
+			pos.x=LOWORD(lParam);
+			pos.y=HIWORD(lParam);
+			TextEditEvent_LButtonDown(hwnd,&pos);
+			return 0;
+		case WM_LBUTTONUP:
+			pos.x=LOWORD(lParam);
+			pos.y=HIWORD(lParam);
+			TextEditEvent_LButtonUp(hwnd,&pos);
+			return 0;
+		case WM_MOUSEMOVE:
+			pos.x=LOWORD(lParam);
+			pos.y=HIWORD(lParam);
+			TextEditEvent_MouseMove(hwnd,&pos);
+			return 0;
+		case WM_LBUTTONDBLCLK:
+			pos.x=LOWORD(lParam);
+			pos.y=HIWORD(lParam);
+			TextEditEvent_LButtonDblClk(hwnd,&pos);
+			return 0;
+		case WM_RBUTTONUP:
+			pos.x=LOWORD(lParam);
+			pos.y=HIWORD(lParam);
+			ClientToScreen(hwnd,&pos);
+
+			//ポップアップメニューを表示
+			extern HMENU hEditMenu;
+			TrackPopupMenu(hEditMenu,TPM_LEFTALIGN|TPM_RIGHTBUTTON,pos.x,pos.y,0,hOwner,NULL);
+			return 0;
+
+
+
+		//////////////////////////////
+		// キーボード関係のイベント
+		//////////////////////////////
+
+		case WM_KEYUP:
+			TextEditEvent_KeyUp(hwnd,wParam);
+			return 0;
+		case WM_CHAR:
+			TextEditEvent_Char(hwnd,wParam);
+			return 0;
+		case WM_KEYDOWN:
+			TextEditEvent_KeyDown(hwnd,wParam,lParam);
+			return 0;
+
+
+
+		case WM_PAINT:
+			PAINTSTRUCT ps;
+			HDC hdc;
+
+			WndNum=GetWndNum(GetParent(hwnd));
+			if(WndNum==-1) return 0;
+
+			hdc=BeginPaint(hwnd,&ps);
+			TextEdit_DrawBuffer(hdc,WndNum);
+			EndPaint(hwnd,&ps);
+			return 0;
+		case WM_SETFOCUS:
+			WndNum=GetWndNum(GetParent(hwnd));
+			if(WndNum==-1) return 0;
+
+			//線型キャレットを作成
+			CreateCaret(hwnd,NULL,1,font_height);
+
+			//キャレットポジションを設定
+			ResetCaretPos(WndNum);
+
+			//キャレットを表示（改行の処理中のキャレットちらつきを防止の考慮に注意）
+			if(hide_caret_switch==0) ShowCaret(hwnd);
+			return 0;
+		case WM_RESETCARETPOS:
+			WndNum=GetWndNum(GetParent(hwnd));
+			ResetCaretPos(WndNum);
+			return 0;
+		case WM_KILLFOCUS:
+			HideCaret(hwnd);
+			DestroyCaret();
+			return 0;
+		case WM_MOUSEWHEEL:
+			int zDelta;
+			zDelta= (short) HIWORD(wParam);
+
+			WndNum=GetWndNum(GetParent(hwnd));
+			si.cbSize=sizeof(SCROLLINFO);
+			si.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
+			GetScrollInfo(hwnd,SB_VERT,&si);
+
+			i=0;
+			if(zDelta>=120){
+				//上へスクロール
+				i=-3;
+			}
+			else if(zDelta<=-120){
+				//下へスクロール
+				i=3;
+			}
+
+			if(i){
+				GetClientRect(hwnd,&rect);
+				i=max(-si.nPos,min(i,si.nMax-(rect.bottom/font_height-2)-si.nPos));
+				if(i!=0){
+					si.nPos+=i;
+					SetScrollInfo(hwnd,SB_VERT,&si,1);
+
+					InvalidateRect(hwnd,NULL,0);
+				}
+				ResetCaretPos(WndNum);
+			}
+			return 0;
+		case WM_SIZE:
+			WndNum=GetWndNum(GetParent(hwnd));
+			if(WndNum==-1) return 0;
+			InvalidateRect(hwnd,NULL,0);
+			return 0;
+		case WM_VSCROLL:
+			WndNum=GetWndNum(GetParent(hwnd));
+			si.cbSize=sizeof(SCROLLINFO);
+			si.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
+			GetScrollInfo(hwnd,SB_VERT,&si);
+			if(LOWORD(wParam)==SB_LINEUP) i=-1;
+			else if(LOWORD(wParam)==SB_LINEDOWN) i=1;
+			else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)si.nPage;
+			else if(LOWORD(wParam)==SB_PAGEDOWN) i=si.nPage;
+			else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-si.nPos;
+			else i=0;
+			GetClientRect(hwnd,&rect);
+			i=max(-si.nPos,min(i,si.nMax-(rect.bottom/font_height-2)-si.nPos));
+			if(i!=0){
+				si.nPos+=i;
+				SetScrollInfo(hwnd,SB_VERT,&si,1);
+
+				InvalidateRect(hwnd,NULL,0);
+			}
+			ResetCaretPos(WndNum);
+			return 0;
+		case WM_HSCROLL:
+			WndNum=GetWndNum(GetParent(hwnd));
+			si.cbSize=sizeof(SCROLLINFO);
+			si.fMask=SIF_POS|SIF_PAGE|SIF_RANGE;
+			GetScrollInfo(hwnd,SB_HORZ,&si);
+			if(LOWORD(wParam)==SB_LINEUP) i=-1;
+			else if(LOWORD(wParam)==SB_LINEDOWN) i=1;
+			else if(LOWORD(wParam)==SB_PAGEUP) i=-(signed int)si.nPage;
+			else if(LOWORD(wParam)==SB_PAGEDOWN) i=si.nPage;
+			else if(LOWORD(wParam)==SB_THUMBTRACK) i=HIWORD(wParam)-si.nPos;
+			else i=0;
+
+			GetClientRect(hwnd,&rect);
+
+			int iControlTabSpace;
+			iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+
+			i=max(-si.nPos,min(i,si.nMax-((rect.right-iControlTabSpace)/font_width)-si.nPos));
+			if(i!=0){
+				si.nPos+=i;
+				SetScrollInfo(hwnd,SB_HORZ,&si,1);
+
+				InvalidateRect(hwnd,NULL,0);
+			}
+			ResetCaretPos(WndNum);
+
+			//ルーラーを再描画
+			InvalidateRect(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd,NULL,0);
+			UpdateWindow(MdiInfo[WndNum].pMdiTextEdit->pobj_Ruler->hRulerWnd);
+
+			return 0;
+		case WM_CLOSE:
+			CloseDocWindow(GetWndNum(hwnd));
+			pobj_nv->bMDIZoomed=IsZoomed(hwnd);
+			i=DefMDIChildProc(hwnd,message,wParam,lParam);
+
+			//メニュー状態を設定
+			ResetState_DocMenu();
+
+			return i;
+
+
+
+		case WM_SEARCH_TAB_CREATE:
+			HWND hOneTabWnd;
+			hOneTabWnd=CreateWindowEx(0,"OneTab","OneTab",
+				WS_CHILD|WS_VISIBLE,
+				0,0,0,0,
+				MdiInfo[wParam].pMdiTextEdit->pobj_WebResult->hwnd,0,hInst,0);
+
+			SetWindowLong(hOneTabWnd,GWL_USERDATA,(long)lParam);
+
+			return (LRESULT)hOneTabWnd;
+		case WM_SEARCH_TAB_CLOSE:
+			DestroyWindow((HWND)lParam);
+			return 0;
+	}
+	return DefMDIChildProc(hwnd,message,wParam,lParam);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/TextEditor_ImeEvent.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/TextEditor_ImeEvent.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/TextEditor_ImeEvent.cpp	(revision 178)
@@ -0,0 +1,73 @@
+#include "common.h"
+
+extern HFONT hFont_TextEdit,hFont_HyperLink_TextEdit;
+extern int font_width,font_height;
+
+void TextEditEvent_IME_StartComposition(HWND hwnd){
+	int WndNum;
+	WndNum=GetWndNum(GetParent(hwnd));
+
+	int iControlTabSpace;
+	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+
+	HIMC hIMC;
+	hIMC=ImmGetContext(hwnd);
+
+	//コンポジションをセット
+	POINT pos;
+	COMPOSITIONFORM CompForm;
+	CompForm.dwStyle=CFS_POINT;
+	pos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+	GetScrollBaseCaretPos(WndNum,(int *)&pos.x,(int *)&pos.y);
+	CompForm.ptCurrentPos.x=pos.x*font_width+iControlTabSpace;
+	CompForm.ptCurrentPos.y=pos.y*font_height;
+	ImmSetCompositionWindow(hIMC, &CompForm);
+
+	//フォントをセット
+	ImmSetCompositionFont(hIMC,&pobj_nv->lf);
+
+	ImmReleaseContext(hwnd,hIMC);
+}
+
+BOOL TextEditEvent_IME_Composition(HWND hwnd,LPARAM lParam){
+	if(lParam&GCS_RESULTSTR){
+		int WndNum;
+		WndNum=GetWndNum(GetParent(hwnd));
+
+		int iControlTabSpace;
+		iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+
+		////////////////////
+		// 確定文字列を取得
+		////////////////////
+
+		//コンテキストを取得
+		HIMC hIMC;
+		hIMC=ImmGetContext(hwnd);
+
+		int i;
+		char temporary[4096];
+		i=ImmGetCompositionString(hIMC, GCS_RESULTSTR, temporary,4096);
+		if(i==0) return 0;
+		temporary[i]=0;
+
+		//バッファをリプレイス
+		TextEdit_ReplaceUpdateUndoData(WndNum,temporary,0,1);
+		UpdateWindow(hwnd);
+
+		//コンポジションをセット（立て続けにIME入力が行われる場合を考慮）
+		POINT pos;
+		COMPOSITIONFORM CompForm;
+		CompForm.dwStyle=CFS_POINT;
+		pos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+		GetScrollBaseCaretPos(WndNum,(int *)&pos.x,(int *)&pos.y);
+		CompForm.ptCurrentPos.x=pos.x*font_width+iControlTabSpace;
+		CompForm.ptCurrentPos.y=pos.y*font_height;
+		ImmSetCompositionWindow(hIMC, &CompForm);
+
+		//コンテキストを解放
+		ImmReleaseContext(hwnd,hIMC);
+	}
+
+	return 1;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/TextEditor_KeyEvent.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/TextEditor_KeyEvent.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/TextEditor_KeyEvent.cpp	(revision 178)
@@ -0,0 +1,987 @@
+#include "common.h"
+#include "HtmlAnalysis.h"
+
+
+void TextEditEvent_StartAnalysis_Basic(HWND hwnd,int WndNum,int nVirtualKey);
+void TextEditEvent_StartAnalysis_Html(HWND hwnd,int WndNum,int nVirtualKey);
+
+
+void TextEditEvent_KeyUp(HWND hwnd,int nVirtualKey){
+	if(nVirtualKey==VK_CONTROL&&pobj_nv->bCtrlKeyHyperLink){
+		int WndNum;
+		WndNum=GetWndNum(GetParent(hwnd));
+
+		if(MdiInfo[WndNum].pMdiTextEdit->iUnderStart!=-1){
+			//ハイパーリンク下線の表示を解除
+			MdiInfo[WndNum].pMdiTextEdit->iUnderStart=-1;
+			MdiInfo[WndNum].pMdiTextEdit->iUnderEnd=-1;
+
+			//再描画
+			InvalidateRect(hwnd,NULL,0);
+			UpdateWindow(hwnd);
+		}
+
+		obj_WebStrings.clear();
+	}
+}
+
+
+int IsIndentAdditionCommand_FromBuffer(char *buffer){
+	int i;
+	char temporary[255];
+
+	for(i=0;;i++){
+		if(!IsVariableChar(buffer[i])){
+			temporary[i]=0;
+			break;
+		}
+		temporary[i]=buffer[i];
+	}
+
+	if(lstrcmpi(temporary,"If")==0){
+		//If文の場合はブロック形式の有無を判定
+
+		for(;;i++){
+			if(buffer[i]=='\''||
+				IsCommandDelimitation(buffer,i)){
+				i--;
+				break;
+			}
+		}
+
+		while(buffer[i]==' '||buffer[i]=='\t') i--;
+
+		if(memicmp(buffer+i-3,"Then",4)==0){
+			//ブロック形式のIf
+			return 1;
+		}
+		else{
+			//一行のみのIf
+			return 0;
+		}
+	}
+
+	if(
+		lstrcmpi(temporary,"Case")==0||
+		lstrcmpi(temporary,"Class")==0||
+		lstrcmpi(temporary,"Do")==0||
+		lstrcmpi(temporary,"Else")==0||
+		lstrcmpi(temporary,"ElseIf")==0||
+		lstrcmpi(temporary,"Enum")==0||
+		lstrcmpi(temporary,"For")==0||
+		lstrcmpi(temporary,"Function")==0||
+		lstrcmpi(temporary,"Namespace")==0||
+		lstrcmpi(temporary,"Override")==0||
+		lstrcmpi(temporary,"Sub")==0||
+		lstrcmpi(temporary,"Type")==0||
+		lstrcmpi(temporary,"Virtual")==0||
+		lstrcmpi(temporary,"Static")==0||
+		lstrcmpi(temporary,"While")==0||
+		lstrcmpi(temporary,"With")==0||
+
+		lstrcmpi(temporary,"Private")==0||
+		lstrcmpi(temporary,"Protected")==0||
+		lstrcmpi(temporary,"Public")==0
+		) return 1;
+	else if(lstrcmpi(temporary,"Select")==0) return 2;
+	else if(lstrcmpi(temporary,"Interface")==0) return 3;
+
+	return 0;
+}
+int IsIndentDecreaseCommand_FromBuffer(char *buffer){
+	int i;
+	char temporary[255];
+
+	for(i=0;;i++){
+		if(!IsVariableChar(buffer[i])){
+			temporary[i]=0;
+			break;
+		}
+		temporary[i]=buffer[i];
+	}
+
+	if(lstrcmpi(temporary,"End")==0&&(buffer[i]==' '||buffer[i]=='\t')){
+		//End ～の場合
+
+		int i2=i;
+
+		while(buffer[i]==' '||buffer[i]=='\t') i++;
+
+		for(;;i++,i2++){
+			if(!IsVariableChar(buffer[i])){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=buffer[i];
+		}
+	}
+
+	if(
+		lstrcmpi(temporary,"Case")==0||
+		lstrcmpi(temporary,"EndClass")==0||
+		lstrcmpi(temporary,"Loop")==0||
+		lstrcmpi(temporary,"Else")==0||
+		lstrcmpi(temporary,"ElseIf")==0||
+		lstrcmpi(temporary,"EndIf")==0||
+		lstrcmpi(temporary,"EndEnum")==0||
+		lstrcmpi(temporary,"Next")==0||
+		lstrcmpi(temporary,"EndFunction")==0||
+		lstrcmpi(temporary,"EndNamespace")==0||
+		lstrcmpi(temporary,"EndSub")==0||
+		lstrcmpi(temporary,"EndType")==0||
+		lstrcmpi(temporary,"Wend")==0||
+		lstrcmpi(temporary,"EndWith")==0||
+
+		lstrcmpi(temporary,"Private")==0||
+		lstrcmpi(temporary,"Protected")==0||
+		lstrcmpi(temporary,"Public")==0
+		) return 1;
+	else if(lstrcmpi(temporary,"EndSelect")==0) return 2;
+	else if(lstrcmpi(temporary,"EndInterface")==0) return 3;
+
+
+	return 0;
+}
+
+int TextEdit_GetLineIndex(int WndNum,int iPos){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	char *pBuf;
+
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+	for(i=iPos;i>0;i--){
+		if(pBuf[i-1]=='\r'&&pBuf[i]=='\n') return i+1;
+	}
+	return i;
+}
+void TextEditEvent_Char(HWND hwnd,int nVirtualKey){
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+	int i,i2,i3;
+	char temporary[1024];
+	char *pBuf,*pTemp;
+	CHARRANGE CharRange;
+
+
+	//BackSpaceはWM_KEYDOWNで処理
+	if(nVirtualKey==VK_BACK) return;
+
+	if(nVirtualKey==VK_ESCAPE){
+		if(ComplementWndInfo.hWnd){
+			//コード補完リストを破棄する
+			DestroyWindow(ComplementWndInfo.hWnd);
+			ComplementWndInfo.hWnd=0;
+		}
+
+		extern METHODCHECKINFO MethodCheckInfo;
+		if(MethodCheckInfo.hWnd){
+			//パラメータヒントを破棄する
+			DestroyWindow(MethodCheckInfo.hWnd);
+			MethodCheckInfo.hWnd=0;
+		}
+
+		return;
+	}
+
+	//未対応の文字コードの誤り入力を阻止
+	if(GetKeyState(VK_CONTROL)&0x8000) return;
+
+	int WndNum;
+	WndNum=GetWndNum(GetParent(hwnd));
+
+	if(ComplementWndInfo.hWnd){
+		if((!(IsVariableChar(nVirtualKey)||nVirtualKey==VK_RETURN))||nVirtualKey=='.'){
+			//コード補完リストを破棄する
+
+			//ペアステートメント補完の場合は、空白文字を容認する
+			if(!(nVirtualKey==' '&&ComplementWndInfo.pMemberInfo[0].dwAccess==ACCESS_PAIRCOMMAND)){
+				DestroyWindow(ComplementWndInfo.hWnd);
+				ComplementWndInfo.hWnd=0;
+			}
+		}
+	}
+
+	if(nVirtualKey==VK_RETURN){
+		if(ComplementWndInfo.hWnd){
+			//コード補完リストが表示されているとき
+			for(i=0;i<ComplementWndInfo.MemberNum;i++){
+				if(ListView_GetItemState(ComplementWndInfo.hList,i,LVIS_SELECTED)) break;
+			}
+			if(i!=ComplementWndInfo.MemberNum){
+				SendMessage(ComplementWndInfo.hList,WM_KEYDOWN,VK_RETURN,0);
+				return;
+			}
+			else{
+				//コード補完リストを破棄する
+				DestroyWindow(ComplementWndInfo.hWnd);
+				ComplementWndInfo.hWnd=0;
+			}
+		}
+
+		temporary[0]='\r';
+		temporary[1]='\n';
+		temporary[2]=0;
+
+		if(nVirtualKey==VK_RETURN&&pobj_nv->bAutoIndent){
+			//////////////////
+			// 自動インデント
+			//////////////////
+
+			//インデント処理中はちらつき防止のため、キャレットを一時非表示にする
+			extern int hide_caret_switch;
+			HideCaret(hwnd);
+			hide_caret_switch=1;
+
+			if(MdiInfo[WndNum].IndentStr){
+				//以前の自動インデントを消去する
+				CancelBeforeAutoIndent(WndNum);
+			}
+
+			pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+			int StartX;
+
+			//リプレイス前のカーソルバッファ位置を取得
+			i=GetBufferIndexFromCaretPos(pBuf,
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+			StartX=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x;
+
+			//リプレイス
+			TextEdit_ReplaceUpdateUndoData(WndNum,temporary,0,1);
+			pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+			//リプレイス後のカーソル行のインデントをi3に取得
+			for(i3=0;;i3++){
+				if(pBuf[i+i3]!='\t') break;
+			}
+
+			//前の行のインデントをコピー（i2にタブ数を格納）
+			for(;i>0;i--){
+				if(
+					pBuf[i-1]=='\r'&&pBuf[i]=='\n'&&
+					(!(pBuf[i+1]=='\r'&&pBuf[i+2]=='\n'))
+					){
+					i++;
+					break;
+				}
+			}
+
+			for(i2=0;;i2++){
+				if(pBuf[i+i2]!='\t') break;
+			}
+
+			if(MdiInfo[WndNum].DocType==WNDTYPE_BASIC){
+				//インデント追加のコマンドかどうかを判断
+				if(IsIndentAdditionCommand_FromBuffer(pBuf+i+i2)) i2++;
+			}
+
+			i2-=i3;
+			if(i2<0) i2=0;
+
+			//インデントが無いとき
+			if(i2==0){
+				hide_caret_switch=0;
+				ResetCaretPos(WndNum);
+				ShowCaret(hwnd);
+				return;
+			}
+
+			/*（Ｉ…カーソル）
+			（「\t\tⅠ」のような場合）、
+			（「\t\tⅠtext...」のような場合）を判断
+			*/
+			i=GetBufferIndexFromCaretPos(pBuf,
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+			if(pBuf[i]=='\r'&&
+				pBuf[i+1]=='\n'){
+				//自動インデントを開始する（「\t\tⅠ」のような場合）
+				MdiInfo[WndNum].IndentStr=(char *)HeapAlloc(hHeap,0,i2+1);
+				memset(MdiInfo[WndNum].IndentStr,'\t',i2);
+				MdiInfo[WndNum].IndentStr[i2]=0;
+				TextEdit_Replace(WndNum,MdiInfo[WndNum].IndentStr,1);
+			}
+			else{
+				//自動インデントを有効にする（「\t\tⅠtext...」のような場合）
+
+				//リプレイス前のカーソルが行の先頭位置にあった場合は抜け出す
+				if(StartX==0){
+					hide_caret_switch=0;
+					ResetCaretPos(WndNum);
+					ShowCaret(hwnd);
+					return;
+				}
+
+				memset(temporary,'\t',i2);
+				temporary[i2]=0;
+				TextEdit_ReplaceUpdateUndoData(WndNum,temporary,0,1);
+			}
+
+			hide_caret_switch=0;
+			ShowCaret(hwnd);
+			return;
+		}
+	}
+	else if(nVirtualKey==VK_TAB){
+		pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+		TextEdit_GetSel(WndNum,&CharRange);
+		for(i=CharRange.cpMin;i>0;i--){
+			if(pBuf[i-1]=='\r'&&pBuf[i]=='\n'){
+				i++;
+				break;
+			}
+		}
+		CharRange.cpMin=i;
+
+		for(i2=0;i<CharRange.cpMax;i++){
+			if(pBuf[i]=='\0') break;
+			if(pBuf[i]=='\r'&&pBuf[i+1]=='\n') i2++;
+		}
+		if(i2){
+			if(GetKeyState(VK_SHIFT)&0x8000){
+				//////////////////////////////////
+				// 複数行にわたってタブ文字を削除
+				//////////////////////////////////
+
+				if(pBuf[CharRange.cpMax-2]=='\r'&&pBuf[CharRange.cpMax-1]=='\n'){
+					CharRange.cpMax-=2;
+				}
+
+				TextEdit_SetSel(WndNum,CharRange.cpMin,CharRange.cpMax);
+
+				pTemp=(char *)HeapAlloc(hHeap,0,CharRange.cpMax-CharRange.cpMin+1);
+
+				i=CharRange.cpMin;
+				for(i3=0;i<CharRange.cpMax;i++,i3++){
+					if(i==CharRange.cpMin&&pBuf[i]=='\t'){
+						i3--;
+						continue;
+					}
+					if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'&&pBuf[i+2]=='\t'){
+						pTemp[i3]='\r';
+						pTemp[i3+1]='\n';
+						i3++;
+
+						i+=2;
+						continue;
+					}
+					pTemp[i3]=pBuf[i];
+				}
+				pTemp[i3]=0;
+			}
+			else{
+				//////////////////////////
+				// 複数行にタブ文字を追加
+				//////////////////////////
+
+				if(pBuf[CharRange.cpMax-2]=='\r'&&pBuf[CharRange.cpMax-1]=='\n'){
+					CharRange.cpMax-=2;
+				}
+
+				i2++;	//先頭行のタブ文字も追加の対象
+				TextEdit_SetSel(WndNum,CharRange.cpMin,CharRange.cpMax);
+
+				pTemp=(char *)HeapAlloc(hHeap,0,CharRange.cpMax-CharRange.cpMin+1 +i2);
+
+				i=CharRange.cpMin;
+				if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+					i3=0;
+				}
+				else{
+					pTemp[0]='\t';
+					i3=1;
+				}
+				for(;i<CharRange.cpMax;i++,i3++){
+					if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'&&
+						(!(pBuf[i+2]=='\r'&&pBuf[i+3]=='\n'))){
+						pTemp[i3]='\r';
+						pTemp[i3+1]='\n';
+						pTemp[i3+2]='\t';
+						i3+=2;
+
+						i++;
+						continue;
+					}
+					pTemp[i3]=pBuf[i];
+				}
+				pTemp[i3]=0;
+			}
+
+			//リプレイス
+			TextEdit_ReplaceUpdateUndoData(WndNum,pTemp,0,0);
+			pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+			HeapDefaultFree(pTemp);
+
+			//キャレット位置の設定
+			for(i=CharRange.cpMin+i3;;i++){
+				if(pBuf[i]=='\0') break;
+				if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+					i+=2;
+					break;
+				}
+			}
+			TextEdit_SetSel(WndNum,
+				CharRange.cpMin,
+				i);
+
+			//再描画
+			if(!TextEdit_ScrollCaret(WndNum,0))
+				InvalidateRect(hwnd,NULL,0);
+			ResetCaretPos(WndNum);
+
+			return;
+		}
+		else{
+			temporary[0]='\t';
+			temporary[1]=0;
+		}
+	}
+	else{
+		temporary[0]=nVirtualKey;
+		temporary[1]=0;
+	}
+
+
+	if(ComplementWndInfo.hWnd){
+		//コード補完リスト表示中のとき
+		ComplementWndInfo.iLength++;
+	}
+
+
+
+	///////////////////////
+	// キー入力の受け入れ
+	///////////////////////
+
+	TextEdit_ReplaceUpdateUndoData(WndNum,temporary,0,1);
+
+
+
+	////////////////////////////////////////////
+	// コード補完機能、パラメータヒントなど
+	////////////////////////////////////////////
+
+	if(MdiInfo[WndNum].DocType==WNDTYPE_BASIC)
+		TextEditEvent_StartAnalysis_Basic(hwnd,WndNum,nVirtualKey);
+	else if(MdiInfo[WndNum].DocType==WNDTYPE_HTML){
+		TextEditEvent_StartAnalysis_Html(hwnd,WndNum,nVirtualKey);
+	}
+}
+void TextEditEvent_KeyDown(HWND hwnd,int nVirtualKey,int lKeyData){
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+	int i,i2;
+	CHARRANGE CharRange;
+	char *pBuf;
+
+	int WndNum;
+	WndNum=GetWndNum(GetParent(hwnd));
+
+	if(nVirtualKey==VK_LEFT||nVirtualKey==VK_UP||nVirtualKey==VK_RIGHT||nVirtualKey==VK_DOWN||nVirtualKey==VK_PRIOR||nVirtualKey==VK_NEXT){
+		if(MdiInfo[WndNum].IndentStr){
+			//自動インデント中のインデントを無効にする
+			CancelBeforeAutoIndent(WndNum);
+			if(nVirtualKey==VK_LEFT) return;
+		}
+
+		if(ComplementWndInfo.hWnd){
+			//コード補完リスト表示中のとき
+			if(!(nVirtualKey==VK_LEFT||nVirtualKey==VK_RIGHT)){
+				//コード補完リストにフォーカスを与える
+				PostMessage(ComplementWndInfo.hList,WM_KEYDOWN,nVirtualKey,lKeyData);
+				return;
+			}
+		}
+
+		switch(nVirtualKey){
+			case VK_LEFT:
+				//上下キャレット移動時の左右位置保持機能を解除
+				MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+
+				if((MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
+					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)||
+					GetKeyState(VK_SHIFT)&0x8000){
+					//選択中でないとき、またはシフトキーが押されているとき
+					GetNaturalCaretPos_Left(WndNum);
+				}
+				else{
+					//選択中のとき
+					if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
+						MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+					else if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y>MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
+						MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+					else{
+						if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x)
+							MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+						else
+							MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+					}
+				}
+				break;
+			case VK_RIGHT:
+				//上下キャレット移動時の左右位置保持機能を解除
+				MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+
+				if((MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
+					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)||
+					GetKeyState(VK_SHIFT)&0x8000){
+					//選択中でないとき、またはシフトキーが押されているとき
+					GetNaturalCaretPos_Right(WndNum,
+						&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+				}
+				else{
+					//選択中のとき
+					if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
+						MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+					else if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y>MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
+						MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+					else{
+						if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x)
+							MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+						else
+							MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+					}
+				}
+				break;
+			case VK_UP:
+				if((GetKeyState(VK_CONTROL)&0x8000)&&
+					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x!=0){
+					//行の先頭へキャレットを移動
+					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x=0;
+
+					//上下キャレット移動時の左右位置保持機能を解除
+					MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+				}
+				else{
+					if((MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
+						MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)||
+						GetKeyState(VK_SHIFT)&0x8000){
+						//選択中でないとき、またはシフトキーが押されているとき
+						GetNaturalCaretPos_Up(WndNum,
+							&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+					}
+					else{
+						//選択中のとき
+						if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
+							MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+						else if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y>MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
+							MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+						else{
+							if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x)
+								MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+							else
+								MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+						}
+
+						GetNaturalCaretPos_Up(WndNum,
+							&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+					}
+				}
+				break;
+			case VK_DOWN:
+				i2=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y;
+				if((MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x&&
+					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y==MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)||
+					GetKeyState(VK_SHIFT)&0x8000){
+					//選択中でないとき、またはシフトキーが押されているとき
+					GetNaturalCaretPos_Down(WndNum,
+						&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+				}
+				else{
+					//選択中のとき
+					if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
+						MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+					else if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y>MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.y)
+						MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+					else{
+						if(MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x<MdiInfo[WndNum].pMdiTextEdit->EndCaretPos.x)
+							MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=MdiInfo[WndNum].pMdiTextEdit->EndCaretPos;
+						else
+							MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+					}
+
+					GetNaturalCaretPos_Down(WndNum,
+						&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+				}
+
+				if(GetKeyState(VK_CONTROL)&0x8000){
+					if(i2!=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y){
+						//行の先頭へキャレットを移動
+						MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x=0;
+					}
+					else{
+						//行の末端へキャレットを移動（終端行の場合）
+						CaretPos_LooseToNatural(WndNum,
+							INT_MAX,
+							MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y,
+							&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+					}
+
+					//上下キャレット移動時の左右位置保持機能を解除
+					MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+				}
+				break;
+			case VK_PRIOR:
+				GetNaturalCaretPos_PageUp(WndNum,
+					&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+				break;
+			case VK_NEXT:
+				GetNaturalCaretPos_PageDown(WndNum,
+					&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+				break;
+		}
+
+		if(!(GetKeyState(VK_SHIFT)&0x8000)){
+			//シフトキーが押されていない、通常時
+			MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+		}
+
+		if(nVirtualKey==VK_PRIOR){
+			//ページアップスクロール
+			SendMessage(hwnd,WM_VSCROLL,SB_PAGEUP,0);
+		}
+		else if(nVirtualKey==VK_NEXT){
+			//ページダウンスクロール
+			SendMessage(hwnd,WM_VSCROLL,SB_PAGEDOWN,0);
+		}
+		else{
+			//その他、スクロールが必要な場合を考慮
+			TextEdit_ScrollCaret(WndNum,0);
+			ResetCaretPos(WndNum);
+		}
+
+		//編集メニューをリセット
+		ResetState_EditMenu();
+
+		//再描画（選択時の反転表示が解除されたときを考慮）
+		UpdateWindow(hwnd);	//ちらつき防止
+		InvalidateRect(hwnd,NULL,0);
+	}
+	else if(nVirtualKey==VK_HOME||nVirtualKey==VK_END){
+
+		//上下キャレット移動時の左右位置保持機能を解除
+		MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+
+		if(GetKeyState(VK_CONTROL)&0x8000){
+			//ファイルの先頭または末端へキャレットを移動
+			if(nVirtualKey==VK_HOME){
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x=0;
+				MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y=0;
+			}
+			else if(nVirtualKey==VK_END){
+				//存在するキャレット位置に変換
+				CaretPos_LooseToNatural(WndNum,
+					INT_MAX,
+					INT_MAX,
+					&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+			}
+		}
+		else{
+			//行の先頭または末端へキャレットを移動
+			if(nVirtualKey==VK_HOME) MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x=0;
+			else if(nVirtualKey==VK_END){
+				//存在するキャレット位置に変換
+				CaretPos_LooseToNatural(WndNum,
+					INT_MAX,
+					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y,
+					&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+			}
+		}
+
+		if(!(GetKeyState(VK_SHIFT)&0x8000)){
+			//シフトキーが押されていない、通常時
+			MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+		}
+
+		if(!TextEdit_ScrollCaret(WndNum,0)){
+			//再描画（選択時の反転表示が解除されたときを考慮）
+			InvalidateRect(hwnd,NULL,0);
+		}
+		ResetCaretPos(WndNum);
+
+		//編集メニューをリセット
+		ResetState_EditMenu();
+	}
+	else if(nVirtualKey==VK_DELETE){
+		////////////
+		// 削除キー
+		////////////
+
+		TextEdit_GetSel(WndNum,&CharRange);
+
+		pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+		//キャレットがファイルの終端にあるとき
+		if(CharRange.cpMin==lstrlen(pBuf)) return;
+
+		if(CharRange.cpMin==CharRange.cpMax){
+			if(MdiInfo[WndNum].IndentStr){
+				//自動インデントを有効にする
+				char temporary[1024];
+				lstrcpy(temporary,MdiInfo[WndNum].IndentStr);
+
+				CancelBeforeAutoIndent(WndNum);
+				TextEdit_ReplaceUpdateUndoData(WndNum,temporary,0,1);
+			}
+
+			if(pBuf[CharRange.cpMin]=='\r'&&pBuf[CharRange.cpMin+1]=='\n'||
+				IsDBCSLeadByte(pBuf[CharRange.cpMin])){
+				CharRange.cpMax+=2;
+			}
+			else CharRange.cpMax++;
+
+			GetCaretPosFromBufferIndex(
+				MdiInfo[WndNum].pMdiTextEdit->buffer,
+				CharRange.cpMax,
+				&MdiInfo[WndNum].pMdiTextEdit->EndCaretPos);
+		}
+
+		TextEdit_ReplaceUpdateUndoData(WndNum,"",0,1);
+	}
+	else if(nVirtualKey==VK_BACK){
+		/////////////////
+		// BackSpaceキー
+		/////////////////
+
+		if(MdiInfo[WndNum].IndentStr){
+			//自動インデント中のインデントの場合、インデントの1文字を削除する
+			if(lstrlen(MdiInfo[WndNum].IndentStr)==1){
+				//1文字しか残っていない場合は自動インデントそのものを消去する
+				CancelBeforeAutoIndent(WndNum);
+			}
+			else{
+				MdiInfo[WndNum].IndentStr[lstrlen(MdiInfo[WndNum].IndentStr)-1]=0;
+
+				i=GetBufferIndexFromCaretPos(
+					MdiInfo[WndNum].pMdiTextEdit->buffer,
+					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+					MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+				GetCaretPosFromBufferIndex(
+					MdiInfo[WndNum].pMdiTextEdit->buffer,
+					i-1,
+					&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+				TextEdit_Replace(WndNum,"",1);
+			}
+			return;
+		}
+
+		TextEdit_GetSel(WndNum,&CharRange);
+
+		if(CharRange.cpMax==0) return;
+		if(CharRange.cpMin==CharRange.cpMax){
+			if(ComplementWndInfo.hWnd){
+				//コード補完リスト表示中のとき
+				ComplementWndInfo.iLength--;
+			}
+
+			SendMessage(hwnd,WM_KEYDOWN,VK_LEFT,0);
+		}
+		SendMessage(hwnd,WM_KEYDOWN,VK_DELETE,0);
+	}
+}
+
+
+
+void TextEditEvent_StartAnalysis_Basic(HWND hwnd,int WndNum,int nVirtualKey){
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+	int i,i2,i3;
+	CHARRANGE CharRange;
+	char temporary[1024];
+
+	char *pBuf;
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+
+	////////////////////
+	// パラメータヒント
+	////////////////////
+
+	extern METHODCHECKINFO MethodCheckInfo;
+	if(pobj_nv->dwParameterHint&&
+		(!ComplementWndInfo.hWnd)&&
+		(MethodCheckInfo.hWnd||nVirtualKey==' '||nVirtualKey=='\"'||nVirtualKey=='(')){
+			//直前に入力された文字を表示
+			UpdateWindow(hwnd);
+
+			//パラメータヒントを表示
+			ShowParameterHint(WndNum);
+	}
+
+
+	///////////////////////////////
+	// ペアステートメント補完
+	///////////////////////////////
+
+	if(
+		pobj_nv->BackNum_PairStatementComplement&&
+		(nVirtualKey=='c'||nVirtualKey=='C'||		//Case
+		nVirtualKey=='e'||nVirtualKey=='E'||		//End ～
+		nVirtualKey=='l'||nVirtualKey=='L'||		//Loop
+		nVirtualKey=='n'||nVirtualKey=='N'||		//Next
+		nVirtualKey=='p'||nVirtualKey=='P'||		//Private、Protected、Public
+		nVirtualKey=='w'||nVirtualKey=='W')		//Wend
+		){
+
+		i=GetBufferIndexFromCaretPos(pBuf,
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+
+		i2=i-2;
+		while(pBuf[i2]==' '||pBuf[i2]=='\t') i2--;
+		if(IsCommandBackDelimitation(pBuf,i2)){
+			if(GetEndPairCommandInfo(pBuf,i-1)){
+
+				//入力された頭文字と一致するかどうかを検証
+				for(i3=0;i3<ComplementWndInfo.MemberNum;i3++){
+					if((char)CharUpper((LPSTR)(char)nVirtualKey)==
+						(char)CharUpper((LPSTR)ComplementWndInfo.pMemberInfo[i3].pName[0])) break;
+				}
+				if(i3==ComplementWndInfo.MemberNum){
+					DeleteComplementInfo();
+					return;
+				}
+
+				ComplementWndInfo.iLength=1;
+				CodeComplement(WndNum,i-1);
+
+				//初期入力時に補完リストの選択をさせるため
+				ResetCaretPos(WndNum);
+			}
+		}
+	}
+
+
+	//////////////////
+	// コード補完機能
+	//////////////////
+
+	if(nVirtualKey=='.'&&pobj_nv->bShowComplementWnd){
+		TextEdit_GetSel(WndNum,&CharRange);
+
+Complement:
+		i2=CharRange.cpMin-1;
+
+		i3=TextEdit_GetLineIndex(WndNum,i2);
+		int IsStr;
+		for(IsStr=0;i3<i2;i3++){
+			if(IsDBCSLeadByte(pBuf[i3])){
+				i3++;
+				continue;
+			}
+			if(pBuf[i3]=='\r'&&pBuf[i3+1]=='\n') break;
+			if(pBuf[i3]=='\''){
+				//注釈文のとき
+				return;
+			}
+			if(pBuf[i3]=='\"') IsStr^=1;
+		}
+		if(IsStr){
+			//文字列内のとき
+			return;
+		}
+
+		for(i=i2;i>0;i--){
+			if(pBuf[i-1]=='-'&&pBuf[i]=='>')i-=2;
+			if(pBuf[i]==']'){
+				for(i3=1,i--;i>0;i--){
+					if(pBuf[i]==']') i3++;
+					if(pBuf[i]=='['){
+						i3--;
+						if(i3==0) break;
+					}
+				}
+				if(pBuf[i]=='[') continue;
+				break;
+			}
+			if(pBuf[i]==')'){
+				for(i3=1,i--;i>0;i--){
+					if(pBuf[i]==')') i3++;
+					if(pBuf[i]=='('){
+						i3--;
+						if(i3==0) break;
+					}
+				}
+				if(pBuf[i]=='(') continue;
+				break;
+			}
+			if(!(IsVariableChar(pBuf[i])||pBuf[i]=='.')){
+				i++;
+				break;
+			}
+		}
+
+		if((nVirtualKey=='.'&&i2-i==0)||
+			nVirtualKey=='>'&&i2-i==1){
+			//オブジェクト識別子がないとき、Withを検索
+			GetWithObjectVariable(pBuf,i2,temporary);
+
+			if(nVirtualKey=='.') lstrcat(temporary,".");
+			else lstrcat(temporary,"->");
+		}
+		else{
+			//オブジェクト識別子をtemporaryにコピー
+
+			//アクセス違反を防ぐため、VN_SIZE以上の参照データへの補完は行わない
+			if(i2-i>VN_SIZE) return;
+
+			if(pBuf[i]=='.'){
+				GetWithObjectVariable(pBuf,i2,temporary);
+			}
+			else if(pBuf[i]=='-'&&pBuf[i+1]=='>'){
+				GetWithObjectVariable(pBuf,i2,temporary);
+			}
+			else temporary[0]=0;
+
+			i3=lstrlen(temporary);
+			memcpy(temporary+i3,pBuf+i,i2-i+1);
+			temporary[i3+i2-i+1]=0;
+		}
+
+		if(temporary[0]){
+			//オブジェクト識別子を検出した場合
+			if(GetComplementInfo(temporary,pBuf,i2)){
+				ComplementWndInfo.iLength=0;
+				CodeComplement(WndNum,i2+1);
+			}
+		}
+	}
+	else if(nVirtualKey=='>'&&pobj_nv->bShowComplementWnd){
+		TextEdit_GetSel(WndNum,&CharRange);
+		if(pBuf[CharRange.cpMin-2]=='-'){
+			goto Complement;
+		}
+	}
+}
+void TextEditEvent_StartAnalysis_Html(HWND hwnd,int WndNum,int nVirtualKey){
+	//////////////////////////
+	// HTMLのコード補完
+	//////////////////////////
+
+	extern COMPLEMENT_WINDOW_INFO ComplementWndInfo;
+	int i;
+
+	char *pBuf;
+	pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+
+
+
+	///////////////////////////////
+	// コード補完
+	///////////////////////////////
+
+	if(nVirtualKey==' '){
+ 
+		i=GetBufferIndexFromCaretPos(pBuf,
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x,
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y);
+
+		if(GetNowTagInfo(pBuf,i-1)){
+			ComplementWndInfo.iLength=0;
+			CodeComplement(WndNum,i);
+
+			//初期入力時に補完リストの選択をさせるため
+			ResetCaretPos(WndNum);
+		}
+	}
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/TextEditor_MouseEvent.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/TextEditor_MouseEvent.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/TextEditor_MouseEvent.cpp	(revision 178)
@@ -0,0 +1,332 @@
+#include "common.h"
+
+void TextEditEvent_LButtonDown(HWND hwnd,POINT *pMousePos){
+	POINT pos;
+	int i;
+
+	int WndNum;
+	WndNum=GetWndNum(GetParent(hwnd));
+
+	if((GetKeyState(VK_CONTROL)&0x8000)&&pobj_nv->bCtrlKeyHyperLink){
+		//Ctrlキーが押されているとき
+		if(MdiInfo[WndNum].pMdiTextEdit->iUnderStart!=-1){
+			//単語が選択可能なとき
+
+			//半角文字列を選択時の全角とのズレを修正
+			int start,end;
+			start=MdiInfo[WndNum].pMdiTextEdit->iUnderStart;
+			end=MdiInfo[WndNum].pMdiTextEdit->iUnderEnd;
+			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,start,&pos);
+			start=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,pos.x,pos.y);
+			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,end,&pos);
+			end=GetBufferIndexFromCaretPos(MdiInfo[WndNum].pMdiTextEdit->buffer,pos.x,pos.y);
+
+			int length;
+			length=end-start;
+			if(length<=0) return;
+
+			char *pTemp;
+			pTemp=(char *)HeapAlloc(hHeap,0,length+1);
+			memcpy(
+				pTemp,
+				MdiInfo[WndNum].pMdiTextEdit->buffer+start,
+				length);
+			pTemp[length]=0;
+
+			obj_WebStrings.add(pTemp);
+
+			extern HWND hWebSearchCombo;
+			SetWindowText(GetWindow(hWebSearchCombo,GW_CHILD),obj_WebStrings.GetBuffer());
+
+			SendMessage(GetWindow(hWebSearchCombo,GW_CHILD),WM_CHAR,VK_RETURN,0);
+
+			HeapDefaultFree(pTemp);
+
+			return;
+		}
+	}
+
+	SetFocus(hwnd);
+	SetCapture(hwnd);
+
+	int iControlTabSpace;
+	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+
+	if(MdiInfo[WndNum].IndentStr){
+		//自動インデント中のインデントを無効にする
+		CancelBeforeAutoIndent(WndNum);
+	}
+
+	MdiInfo[WndNum].pMdiTextEdit->bAutoScroll=0;
+
+	//上下キャレット移動時の左右位置保持機能を解除
+	MdiInfo[WndNum].pMdiTextEdit->Temp_UpDown_CaretXPos=-1;
+
+	if(0<=(pMousePos->x) && (pMousePos->x)<iControlTabSpace){
+		//コントロールタブをクリックしたときの処理
+
+		//カーソルを矢印マークにする
+		SetCursor(LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_ARROW_TO_RIGHT)));
+
+		GetNaturalCaretPos_Click(WndNum,
+			0,
+			pMousePos->y,
+			&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+		MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+
+		////////////
+		// 行を選択
+		////////////
+
+		char *pBuf;
+		pBuf=MdiInfo[WndNum].pMdiTextEdit->buffer;
+		CHARRANGE CharRange;
+		TextEdit_GetSel(WndNum,&CharRange);
+		i=CharRange.cpMin;
+		for(;;i++){
+			if(pBuf[i]=='\0') break;
+			if(pBuf[i]=='\r'&&pBuf[i+1]=='\n'){
+				i+=2;
+				break;
+			}
+		}
+		TextEdit_SetSel(WndNum,
+			i,
+			CharRange.cpMin);
+	}
+	else{
+		GetNaturalCaretPos_Click(WndNum,
+			pMousePos->x-iControlTabSpace,
+			pMousePos->y,
+			&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+
+		if(!(GetKeyState(VK_SHIFT)&0x8000)){
+			//シフトキーが押されていない、通常時
+			MdiInfo[WndNum].pMdiTextEdit->EndCaretPos=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos;
+		}
+
+		ResetCaretPos(WndNum);
+
+		if(!TextEdit_ScrollCaret(WndNum,0)){
+			//再描画（選択時の反転表示が解除されたときを考慮）
+			UpdateWindow(hwnd);	//ちらつき防止
+			InvalidateRect(hwnd,NULL,0);
+		}
+	}
+}
+
+void TextEditEvent_LButtonUp(HWND hwnd,POINT *pMousePos){
+	int WndNum;
+	WndNum=GetWndNum(GetParent(hwnd));
+
+	int iControlTabSpace;
+	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+
+	if(0<=(pMousePos->x) && (pMousePos->x)<iControlTabSpace){
+		//コントロールタブをクリックしたときの処理
+
+		//カーソルを矢印マークにする
+		SetCursor(LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_ARROW_TO_RIGHT)));
+	}
+
+	if(GetCapture()==hwnd){
+		//////////////////////////
+		// ドラッグが終了するとき
+		//////////////////////////
+
+		ReleaseCapture();
+
+		//オートスクロールスレッドを停止
+		MdiInfo[WndNum].pMdiTextEdit->bAutoScroll=0;
+
+		//編集メニューをリセット
+		ResetState_EditMenu();
+	}
+}
+
+void AutoScrollThread(HWND hwnd){
+	//////////////////////////////
+	// 左右方向にオートスクロール
+	//////////////////////////////
+
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int WndNum;
+	POINT pos;
+
+	WndNum=GetWndNum(GetParent(hwnd));
+
+	
+	//エディタ画面左端のコントロールタブ
+	int iControlTabSpace;
+	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+
+
+	while(MdiInfo[WndNum].pMdiTextEdit->bAutoScroll){
+		GetCursorPos(&pos);
+		ScreenToClient(hwnd,&pos);
+
+		GetNaturalCaretPos_Click(WndNum,
+			pos.x-iControlTabSpace,
+			pos.y,
+			&pos);
+
+		//存在するキャレット位置に変換
+		CaretPos_LooseToNatural(WndNum,
+			pos.x,
+			pos.y,
+			&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+
+		if(!TextEdit_ScrollCaret(WndNum,1))
+			InvalidateRect(hwnd,NULL,0);
+
+		//別スレッドからResetCaretPosを呼び出す
+		SendMessage(hwnd,WM_RESETCARETPOS,0,0);
+
+		Sleep(70);
+	}
+
+	_endthread();
+}
+void TextEditEvent_MouseMove(HWND hwnd,POINT *pMousePos){
+	int WndNum;
+	WndNum=GetWndNum(GetParent(hwnd));
+	if(WndNum==-1) return;
+
+	int iControlTabSpace;
+	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+
+	if(GetCapture()==hwnd){
+		//////////////
+		// ドラッグ中
+		//////////////
+
+		RECT rect;
+		GetClientRect(hwnd,&rect);
+
+		if(
+			(short)pMousePos->y<0||				//上方向へオートスクロール
+			rect.bottom<=(short)pMousePos->y||	//下方向へオートスクロール
+			(short)pMousePos->x<iControlTabSpace||	//左方向へオートスクロール
+			rect.right<=(short)pMousePos->x		//右方向へオートスクロール
+			){
+			////////////////////////////
+			// オートスクロール
+			////////////////////////////
+
+			if(MdiInfo[WndNum].pMdiTextEdit->bAutoScroll){
+				//すでにオートスクロールスレッドが作動中のときは抜け出す
+				return;
+			}
+
+			//オートスクロールスレッドを起動
+			MdiInfo[WndNum].pMdiTextEdit->bAutoScroll=1;
+
+			_beginthread((void (__cdecl *)(void *))AutoScrollThread,0,(void *)hwnd);
+
+			return;
+		}
+		else if(MdiInfo[WndNum].pMdiTextEdit->bAutoScroll){
+			//オートスクロールを解除
+			MdiInfo[WndNum].pMdiTextEdit->bAutoScroll=0;
+		}
+
+
+		//////////////////////
+		// 通常のドラッグ選択
+		//////////////////////
+
+		POINT pos;
+		GetNaturalCaretPos_Click(WndNum,
+			pMousePos->x-iControlTabSpace,
+			pMousePos->y,
+			&pos);
+
+		if(pos.x!=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.x||pos.y!=MdiInfo[WndNum].pMdiTextEdit->StartCaretPos.y){
+			MdiInfo[WndNum].pMdiTextEdit->StartCaretPos=pos;
+
+			InvalidateRect(hwnd,NULL,0);
+			ResetCaretPos(WndNum);
+		}
+	}
+	else{
+		if(0<=pMousePos->x&&pMousePos->x<iControlTabSpace){
+			//コントロールタブの上にポインタがあるとき
+
+			//カーソルを矢印マークにする
+			SetCursor(LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_ARROW_TO_RIGHT)));
+
+			return;
+		}
+
+		if(pobj_nv->bCtrlKeyHyperLink){
+			if(GetKeyState(VK_CONTROL)&0x8000){
+				//Ctrlキーが押されているとき
+
+				POINT pos;
+				GetNaturalCaretPos_Click(WndNum,
+					pMousePos->x-iControlTabSpace,
+					pMousePos->y,
+					&pos);
+
+				TextEdit_GetWordCaret(
+					MdiInfo[WndNum].pMdiTextEdit->hEdit,
+					WndNum,
+					&pos,
+					&MdiInfo[WndNum].pMdiTextEdit->iUnderStart,&MdiInfo[WndNum].pMdiTextEdit->iUnderEnd,
+					WORDCARET_AFTER);
+
+				SetCursor(LoadCursor(0,IDC_ARROW));
+
+				InvalidateRect(hwnd,NULL,0);
+				UpdateWindow(hwnd);
+			}
+			else{
+				if(MdiInfo[WndNum].pMdiTextEdit->iUnderStart!=-1){
+					MdiInfo[WndNum].pMdiTextEdit->iUnderStart=-1;
+					MdiInfo[WndNum].pMdiTextEdit->iUnderEnd=-1;
+
+					InvalidateRect(hwnd,NULL,0);
+					UpdateWindow(hwnd);
+				}
+			}
+		}
+	}
+}
+
+void TextEdit_WordSelect(HWND hwnd,int WndNum){
+	////////////////////////////////////
+	// ダブルクリックによる単語セレクト
+	////////////////////////////////////
+
+	int start,end;
+	TextEdit_GetWordCaret(hwnd,WndNum,&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos,&start,&end,WORDCARET_AFTER);
+
+	//セレクト
+	TextEdit_SetSel(WndNum,start,end);
+
+	//再描画
+	InvalidateRect(hwnd,NULL,0);
+	ResetCaretPos(WndNum);
+}
+void TextEditEvent_LButtonDblClk(HWND hwnd,POINT *pMousePos){
+	int WndNum;
+	WndNum=GetWndNum(GetParent(hwnd));
+
+	int iControlTabSpace;
+	iControlTabSpace=MdiInfo[WndNum].pMdiTextEdit->iWidth_ControlTabSpace;
+
+	if(0<=(pMousePos->x) && (pMousePos->x)<iControlTabSpace){
+		//コントロールタブをダブルクリックしたときの処理
+
+		//カーソルを矢印マーク（デフォルト）にする
+		SetCursor(LoadCursor(hResInst,MAKEINTRESOURCE(IDC_CURSOR_ARROW_TO_RIGHT)));
+
+		return;
+	}
+	else{
+		TextEdit_WordSelect(hwnd,WndNum);
+
+		//編集メニューをリセット
+		ResetState_EditMenu();
+	}
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/TextEditor_UndoRedo.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/TextEditor_UndoRedo.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/TextEditor_UndoRedo.cpp	(revision 178)
@@ -0,0 +1,160 @@
+#include "common.h"
+
+void TextEdit_UndoCommand(int WndNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	TEXTEDIT_UNDOSTATE *pUndoState;
+
+	//自動インデント中のインデントを無効にする
+	if(MdiInfo[WndNum].IndentStr) CancelBeforeAutoIndent(WndNum);
+
+	pUndoState=MdiInfo[WndNum].pMdiTextEdit->pTextEditUndoState;
+	i=pUndoState->NowPos-1;
+	if(i==-1) i=MAX_UNDONUM-1;
+	if(!pUndoState->Command[i]){
+		MessageBeep(0);
+		return;
+	}
+	pUndoState->NowPos=i;
+
+	//選択範囲をセット
+	GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,
+		pUndoState->Range[pUndoState->NowPos].cpMin,
+		&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+	GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,
+		pUndoState->Range[pUndoState->NowPos].cpMax,
+		&MdiInfo[WndNum].pMdiTextEdit->EndCaretPos);
+
+	switch(pUndoState->Command[pUndoState->NowPos]){
+		case TEXTEDIT_UNDO_KEY:
+		case TEXTEDIT_UNDO_PASTE:
+			TextEdit_Replace(WndNum,"",1);
+			break;
+		case TEXTEDIT_UNDO_SELKEY:
+			TextEdit_Replace(WndNum,pUndoState->DelStr[pUndoState->NowPos],1);
+			break;
+	}
+
+	TextEdit_ScrollCaret(WndNum,0);
+	ResetCaretPos(WndNum);
+
+	//元に戻す、やり直しメニューをリセット
+	ResetState_UndoMenu();
+
+	//変更を通知
+	MdiInfo[WndNum].pMdiTextEdit->NofityUndoRedoToModify();
+}
+void TextEdit_RedoCommand(int WndNum){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	TEXTEDIT_UNDOSTATE *pUndoState;
+
+	pUndoState=MdiInfo[WndNum].pMdiTextEdit->pTextEditUndoState;
+	if(!pUndoState->Command[pUndoState->NowPos]){
+		MessageBeep(0);
+		return;
+	}
+
+	switch(pUndoState->Command[pUndoState->NowPos]){
+		case TEXTEDIT_UNDO_KEY:
+		case TEXTEDIT_UNDO_PASTE:
+			//選択範囲をセット
+			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,
+				pUndoState->Range[pUndoState->NowPos].cpMin,
+				&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,
+				pUndoState->Range[pUndoState->NowPos].cpMin,
+				&MdiInfo[WndNum].pMdiTextEdit->EndCaretPos);
+
+			TextEdit_Replace(WndNum,pUndoState->KeyStr[pUndoState->NowPos],1);
+			break;
+		case TEXTEDIT_UNDO_SELKEY:
+			//選択範囲をセット
+			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,
+				pUndoState->DelRange[pUndoState->NowPos].cpMin,
+				&MdiInfo[WndNum].pMdiTextEdit->StartCaretPos);
+			GetCaretPosFromBufferIndex(MdiInfo[WndNum].pMdiTextEdit->buffer,
+				pUndoState->DelRange[pUndoState->NowPos].cpMax,
+				&MdiInfo[WndNum].pMdiTextEdit->EndCaretPos);
+
+			TextEdit_Replace(WndNum,pUndoState->KeyStr[pUndoState->NowPos],1);
+			break;
+	}
+
+	TextEdit_ScrollCaret(WndNum,0);
+	ResetCaretPos(WndNum);
+
+	pUndoState->NowPos++;
+	if(pUndoState->NowPos==MAX_UNDONUM) pUndoState->NowPos=0;
+
+	//元に戻す、やり直しメニューをリセット
+	ResetState_UndoMenu();
+
+	//変更を通知
+	MdiInfo[WndNum].pMdiTextEdit->NofityUndoRedoToModify();
+}
+
+BOOL bUndoDelimitation(char c){
+	if(c==' '||c=='\t'||
+		c=='\"'||
+		c==','||c==':'||c==';'||
+		c=='('||c==')'||
+		c=='+'||c=='-'||c=='*'||c=='/'||c=='^'||c=='\\'||c=='<'||c=='>'||c=='=') return 1;
+	return 0;
+}
+void TextEdit_NoticeChanging(int WndNum,int Command,char *KeyStr,char *DelStr,CHARRANGE *Range,CHARRANGE *DelRange){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	int i;
+	TEXTEDIT_UNDOSTATE *pUndoState;
+
+	pUndoState=MdiInfo[WndNum].pMdiTextEdit->pTextEditUndoState;
+
+	//Redoされた場合の不要なデータを削除する
+	for(i=pUndoState->NowPos;;i++){
+		if(i==MAX_UNDONUM) i=0;
+		if(pUndoState->Command[i]==0) break;
+		TextEdit_DeleteUndoData(pUndoState,i);
+	}
+
+	i=pUndoState->NowPos-1;
+	if(i==-1) i=MAX_UNDONUM-1;
+	if(pUndoState->Command[i]==Command&&
+		pUndoState->Command[i]==TEXTEDIT_UNDO_KEY){
+		if(pUndoState->Range[i].cpMax==Range->cpMin&&KeyStr[0]!='\r'){
+			if(!(bUndoDelimitation(pUndoState->KeyStr[i][0])^bUndoDelimitation(KeyStr[0]))){
+				pUndoState->KeyStr[i]=(char *)HeapReAlloc(hHeap,0,pUndoState->KeyStr[i],lstrlen(pUndoState->KeyStr[i])+lstrlen(KeyStr)+1);
+				lstrcat(pUndoState->KeyStr[i],KeyStr);
+				pUndoState->Range[i].cpMax+=lstrlen(KeyStr);
+
+				HeapDefaultFree(KeyStr);
+
+				//元に戻す、やり直しメニューをリセット
+				ResetState_UndoMenu();
+				return;
+			}
+		}
+	}
+
+	//データ更新
+	pUndoState->Command[pUndoState->NowPos]=Command;
+	pUndoState->KeyStr[pUndoState->NowPos]=KeyStr;
+	pUndoState->DelStr[pUndoState->NowPos]=DelStr;
+	pUndoState->Range[pUndoState->NowPos]=*Range;
+	if(DelRange) pUndoState->DelRange[pUndoState->NowPos]=*DelRange;
+
+	pUndoState->NowPos++;
+	if(pUndoState->NowPos==MAX_UNDONUM) pUndoState->NowPos=0;
+	if(pUndoState->Command[pUndoState->NowPos]){
+		//一番古い情報を切り捨てる
+		TextEdit_DeleteUndoData(pUndoState,pUndoState->NowPos);
+	}
+
+	//元に戻す、やり直しメニューをリセット
+	ResetState_UndoMenu();
+}
+
+void TextEdit_DeleteUndoData(TEXTEDIT_UNDOSTATE *pUndoState,int pos){
+	if(pUndoState->KeyStr[pos]) HeapDefaultFree(pUndoState->KeyStr[pos]);
+	if(pUndoState->DelStr[pos]) HeapDefaultFree(pUndoState->DelStr[pos]);
+	pUndoState->Command[pos]=0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/WebSearch.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/WebSearch.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/WebSearch.cpp	(revision 178)
@@ -0,0 +1,1129 @@
+#include "common.h"
+#include "CIEsink.h"
+
+
+#define ID_TIMER_POPUP_ANIMATION 100
+#define ID_TIMER_IDLE 200
+
+extern FWINLAYER pSetLayeredWindowAttributes;
+
+
+LRESULT CALLBACK ResultListProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	CResultList *pobj_ResultList;
+	POINT pos;
+	RECT rc;
+	int iItem;
+
+	switch(message){
+		case WM_TIMER:
+			if(wParam==ID_TIMER_POPUP_ANIMATION){
+				pobj_ResultList=(CResultList *)GetWindowLong(hwnd,GWL_USERDATA);
+
+				pSetLayeredWindowAttributes(hwnd, 0,(int)((double)255/(double)100*(double)(pobj_ResultList->iAnimeCount*10)), LWA_ALPHA);
+
+				GetWindowRect(hwnd,&rc);
+				rc.top++;
+				SetWindowPos(hwnd,0,rc.left,rc.top,0,0,SWP_NOSIZE);
+
+				pobj_ResultList->iAnimeCount+=1;
+				if(pobj_ResultList->iAnimeCount>10){
+					KillTimer(hwnd,ID_TIMER_POPUP_ANIMATION);
+
+					SetTimer(hwnd,ID_TIMER_IDLE,100,NULL);
+				}
+			}
+			else if(wParam==ID_TIMER_IDLE){
+				InvalidateRect(hwnd,NULL,0);
+			}
+			return 0;
+		case WM_PAINT:
+			pobj_ResultList=(CResultList *)GetWindowLong(hwnd,GWL_USERDATA);
+
+			RECT ClientRect;
+			GetClientRect(hwnd,&ClientRect);
+
+			//描画を開始
+			HDC hdc;
+			PAINTSTRUCT ps;
+			hdc=BeginPaint(hwnd,&ps);
+
+			//メモリデバイスコンテキストを生成
+			HDC memdc;
+			HBITMAP hMemBmp;
+			memdc=CreateCompatibleDC(hdc);
+			hMemBmp=CreateCompatibleBitmap(hdc,ClientRect.right,ClientRect.bottom);
+			SelectObject(memdc,hMemBmp);
+
+			//フォントをセット
+			extern HFONT hStatusFont;
+			HFONT hOldFont;
+			hOldFont=(HFONT)SelectObject(memdc,hStatusFont);
+
+			//ウィンドウサイズを取得（アイテム座標を取得）
+			GetCursorPos(&pos);
+			GetWindowRect(hwnd,&rc);
+			rc.bottom=rc.top+LINK_ITEM_HEIGHT;
+
+			//クライアント アイテム 座標を取得
+			ClientRect.left+=10;
+			ClientRect.bottom=ClientRect.top+LINK_ITEM_HEIGHT;
+
+			//ブラシを生成
+			HBRUSH hFaceBrush,hShadowBrush,hOldBrush;
+			hFaceBrush=CreateSolidBrush(GetSysColor(COLOR_3DFACE));
+			hShadowBrush=CreateSolidBrush(GetSysColor(COLOR_3DSHADOW));
+
+			for(iItem=0;iItem<10;iItem++){
+				if(rc.left<pos.x && pos.x<rc.right && rc.top<pos.y && pos.y<rc.bottom){
+
+					SetBkColor(memdc,GetSysColor(COLOR_3DSHADOW));
+
+					hOldBrush=(HBRUSH)SelectObject(memdc,hShadowBrush);
+				}
+				else{
+					extern HFONT hStatusFont;
+					hOldFont=(HFONT)SelectObject(memdc,hStatusFont);
+
+					SetBkColor(memdc,GetSysColor(COLOR_3DFACE));
+
+					hOldBrush=(HBRUSH)SelectObject(memdc,hFaceBrush);
+				}
+				SetTextColor(memdc,RGB(0,0,255));
+
+				PatBlt(memdc,ClientRect.left-10,ClientRect.top,ClientRect.right,ClientRect.bottom,PATCOPY);
+				SelectObject(memdc,hOldBrush);
+
+				DrawText(memdc,pobj_ResultList->pobj_OneTab->lpszTitle[iItem],-1,&ClientRect,DT_LEFT|DT_VCENTER|DT_SINGLELINE);
+
+				rc.top+=LINK_ITEM_HEIGHT;
+				rc.bottom=rc.top+LINK_ITEM_HEIGHT;
+
+				ClientRect.top+=LINK_ITEM_HEIGHT;
+				ClientRect.bottom=ClientRect.top+LINK_ITEM_HEIGHT;
+			}
+
+			SelectObject(memdc,hOldFont);
+
+			GetClientRect(hwnd,&ClientRect);
+			BitBlt(hdc,0,0,ClientRect.right,ClientRect.bottom,memdc,0,0,SRCCOPY);
+
+			EndPaint(hwnd,&ps);
+
+			DeleteObject(hFaceBrush);
+			DeleteObject(hShadowBrush);
+
+			DeleteDC(memdc);
+			DeleteObject(hMemBmp);
+			break;
+
+		case WM_LBUTTONDOWN:
+			pobj_ResultList=(CResultList *)GetWindowLong(hwnd,GWL_USERDATA);
+
+			GetCursorPos(&pos);
+			GetWindowRect(hwnd,&rc);
+			rc.bottom=rc.top+LINK_ITEM_HEIGHT;
+
+			for(iItem=0;iItem<10;iItem++){
+				if(rc.left<pos.x && pos.x<rc.right && rc.top<pos.y && pos.y<rc.bottom){
+					ShellExecute(hwnd,"open",pobj_ResultList->pobj_OneTab->lpszUrl[iItem],NULL,NULL,SW_SHOWNORMAL);
+					break;
+				}
+
+				rc.top+=LINK_ITEM_HEIGHT;
+				rc.bottom=rc.top+LINK_ITEM_HEIGHT;
+			}
+			return 0;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
+
+CResultList::CResultList(COneTab *pot){
+	pobj_OneTab=pot;
+	iAnimeCount=0;
+
+	hwnd=CreateWindowEx(0,"ResultList","ResultList",
+		WS_POPUP|WS_CLIPCHILDREN|WS_VISIBLE|WS_BORDER,
+		0,0,0,0,
+		hOwner,0,hInst,0);
+
+	//ウィンドウを半透明にする
+	int lStyle;
+	lStyle=GetWindowLong(hwnd,GWL_EXSTYLE) | WS_EX_LAYERED;
+	SetWindowLong(hwnd,GWL_EXSTYLE,lStyle);
+	pSetLayeredWindowAttributes(hwnd, 0, 0, LWA_ALPHA);
+
+	SetWindowLong(hwnd,GWL_USERDATA,(long)this);
+	SetTimer(hwnd,ID_TIMER_POPUP_ANIMATION,10,NULL);
+	BringWindowToTop(hwnd);
+
+	RECT rc;
+	GetWindowRect(pobj_OneTab->hTabWnd,&rc);
+
+	HDC hdc;
+	hdc=GetDC(hwnd);
+
+	extern HFONT hStatusFont;
+	HFONT hOldFont;
+	hOldFont=(HFONT)SelectObject(hdc,hStatusFont);
+
+
+	//アイテム数を取得
+	int iItem,iMaxWidth=0;
+	for(iItem=0;iItem<10;iItem++){
+		if(pobj_OneTab->lpszTitle[iItem]==0){
+			break;
+		}
+
+		SIZE size;
+		GetTextExtentPoint32(hdc,pobj_OneTab->lpszTitle[iItem],lstrlen(pobj_OneTab->lpszTitle[iItem]),&size);
+
+		if(iMaxWidth<size.cx){
+			//最大幅を取得
+			iMaxWidth=size.cx;
+		}
+	}
+
+	SelectObject(hdc,hOldFont);
+	ReleaseDC(hwnd,hdc);
+
+	MoveWindow(hwnd,rc.left,rc.top-iItem*LINK_ITEM_HEIGHT-10,iMaxWidth+20,iItem*LINK_ITEM_HEIGHT,1);
+}
+CResultList::~CResultList(){
+	DestroyWindow(hwnd);
+}
+
+
+
+LRESULT CALLBACK OneTabProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	COneTab *pobj_OneTab;
+	RECT rc;
+	POINT pos;
+
+	switch(message){
+		case WM_CREATE:
+			SetTimer(hwnd,0,100,NULL);
+			return 0;
+		case WM_TIMER:
+			InvalidateRect(hwnd,NULL,0);
+			return 0;
+		case WM_PAINT:
+			pobj_OneTab=(COneTab *)GetWindowLong(hwnd,GWL_USERDATA);
+
+			HBRUSH hBrush,hOldBrush;
+
+			HDC hdc;
+			PAINTSTRUCT ps;
+			hdc=BeginPaint(hwnd,&ps);
+
+			GetCursorPos(&pos);
+			GetWindowRect(hwnd,&rc);
+			HFONT hOldFont;
+			if(rc.left<=pos.x && pos.x<=rc.right && rc.top<=pos.y && pos.y<=rc.bottom){
+				extern HFONT hStatusFont;
+				hOldFont=(HFONT)SelectObject(hdc,hStatusFont);
+
+				SetBkColor(hdc,GetSysColor(COLOR_3DSHADOW));
+
+				hBrush=CreateSolidBrush(GetSysColor(COLOR_3DSHADOW));
+
+				//リストを表示
+				if(pobj_OneTab->pobj_ResultList==0){
+					pobj_OneTab->pobj_ResultList=new CResultList(pobj_OneTab);
+				}
+			}
+			else{
+				extern HFONT hStatusFont;
+				hOldFont=(HFONT)SelectObject(hdc,hStatusFont);
+
+				SetBkColor(hdc,GetSysColor(COLOR_3DFACE));
+
+				hBrush=CreateSolidBrush(GetSysColor(COLOR_3DFACE));
+
+				//リストを破棄
+				if(pobj_OneTab->pobj_ResultList){
+					GetWindowRect(pobj_OneTab->pobj_ResultList->hwnd,&rc);
+					if(!(rc.left<=pos.x && pos.x<=rc.right && rc.top<=pos.y && pos.y<=rc.bottom)){
+						delete pobj_OneTab->pobj_ResultList;
+						pobj_OneTab->pobj_ResultList=0;
+					}
+				}
+			}
+			SetTextColor(hdc,RGB(0,0,255));
+
+			GetClientRect(hwnd,&rc);
+
+			hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+			PatBlt(hdc,0,0,rc.right,rc.bottom,PATCOPY);
+			SelectObject(hdc,hOldBrush);
+
+			rc.left++;
+			DrawText(hdc,pobj_OneTab->lpszString,-1,&rc,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
+
+			SelectObject(hdc,hOldFont);
+
+			//左端の境界線
+			HPEN hPen,hOldPen;
+			hPen=CreatePen(PS_SOLID,0,GetSysColor(COLOR_3DSHADOW));
+			hOldPen=(HPEN)SelectObject(hdc,hPen);
+			MoveToEx(hdc,0,0,NULL);
+			LineTo(hdc,0,rc.bottom-rc.top);
+			SelectObject(hdc,hOldPen);
+			DeleteObject(hPen);
+
+			EndPaint(hwnd,&ps);
+
+			DeleteObject(hBrush);
+			return 0;
+		case WM_LBUTTONDOWN:
+			pobj_OneTab=(COneTab *)GetWindowLong(hwnd,GWL_USERDATA);
+
+			ShellExecute(hwnd,"open",pobj_OneTab->lpszUrl[0],NULL,NULL,SW_SHOWNORMAL);
+			return 0;
+
+		case WM_COMMAND:
+			break;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
+
+COneTab::COneTab(int WndNum,char *str){
+	//0で初期化
+	memset(this,0,sizeof(COneTab));
+
+	m_WndNum=WndNum;
+
+	lpszString=(char *)malloc(lstrlen(str)+1);
+	lstrcpy(lpszString,str);
+
+
+	//Web検索をかける
+	WebSearch();
+
+
+
+	/////////////////////////////////
+	// テキストアイテムの幅を取得
+	/////////////////////////////////
+
+	HDC hdc;
+	SIZE size;
+	hdc=GetDC(hOwner);
+
+	extern HFONT hStatusFont;
+	HFONT hOldFont;
+	hOldFont=(HFONT)SelectObject(hdc,hStatusFont);
+
+	GetTextExtentPoint32(hdc,lpszString,lstrlen(lpszString),&size);
+
+	SelectObject(hdc,hOldFont);
+
+	ReleaseDC(hOwner,hdc);
+	iWindowWidth=size.cx+20;
+
+	if(MdiInfo[WndNum].pMdiTextEdit==0) return;
+	hTabWnd=(HWND)SendMessage(MdiInfo[WndNum].pMdiTextEdit->hEdit,WM_SEARCH_TAB_CREATE,(WPARAM)WndNum,(LPARAM)this);
+}
+COneTab::~COneTab(){
+	free(lpszString);
+
+	int i;
+	for(i=0;i<10;i++){
+		if(lpszTitle[i]) free(lpszTitle[i]);
+		if(lpszUrl[i]) free(lpszUrl[i]);
+	}
+
+	if(MdiInfo[m_WndNum].pMdiTextEdit)
+		SendMessage(MdiInfo[m_WndNum].pMdiTextEdit->hEdit,WM_SEARCH_TAB_CLOSE,0,(LPARAM)hTabWnd);
+}
+
+void COneTab::WebSearch(){
+	//URLエンコード
+	char *temporary;
+	temporary=(char *)malloc(lstrlen(lpszString)*3+1024);
+	wsprintf(temporary,"辞書 %s",lpszString);
+	URLEncode(temporary);
+
+	char *lpszTempUrl;
+	lpszTempUrl=(char *)malloc(lstrlen(temporary)+1024);
+	sprintf(lpszTempUrl,"http://www.activebasic.com/application_web_search/search.php?query=%s&type=web&utf_sw=1&start=1",temporary);
+
+	free(temporary);
+
+
+	HINTERNET hInternet;
+	HINTERNET hNetFile;
+	hInternet = InternetOpen("Agent", 0, NULL, NULL, 0);
+	if(hInternet==0){
+		return;
+	}
+	hNetFile = InternetOpenUrl(hInternet, lpszTempUrl, NULL, 0, 0, 0);
+	if(hNetFile==0){
+		InternetCloseHandle(hInternet);
+		return;
+	}
+
+	/* オープンしたURLからデータを(1000バイトずつ)読み込む */
+	DWORD dwReadSize;
+	BOOL bResult;
+	char *buffer;
+	buffer=(char *)malloc(8192);
+	buffer[0]=0;
+
+	while(1){
+		char temp3[1024];
+		bResult = InternetReadFile(
+			hNetFile,
+			temp3,
+			1000,
+			&dwReadSize);
+
+		/* 全て読み込んだらループを抜ける */
+		if(bResult && (dwReadSize == 0)) break;
+
+		temp3[dwReadSize]=0;
+		lstrcat(buffer,temp3);
+	}
+
+
+	//UTF-8からShift-JISに変換
+	char *temp2;
+	temp2=(char *)malloc(8192);
+	nkf.pSetNkfOption("-sx");	//Shift-JISに変換（xは半角カタカナを全角に変換しないオプション）
+	nkf.pNkfConvert(temp2,buffer);
+	free(buffer);
+
+
+	InternetCloseHandle(hNetFile);
+	InternetCloseHandle(hInternet);
+
+
+	//タイトル・URLを取得
+	int iItem;
+	int i=0,i2;
+	for(iItem=0;iItem<10;iItem++){
+		lpszTitle[iItem]=(char *)malloc(lstrlen(temp2)+1);
+		lpszUrl[iItem]=(char *)malloc(lstrlen(temp2)+1);
+		for(i2=0;;i++,i2++){
+			//タイトル
+			if(temp2[i]=='\n'||temp2[i]=='\0'){
+				lpszTitle[iItem][i2]=0;
+				break;
+			}
+			lpszTitle[iItem][i2]=temp2[i];
+		}
+		if(temp2[i]){
+			//URL
+			for(i++,i2=0;;i++,i2++){
+				if(temp2[i]=='\n'||temp2[i]=='\0'){
+					lpszUrl[iItem][i2]=0;
+					break;
+				}
+				lpszUrl[iItem][i2]=temp2[i];
+			}
+		}
+		if(temp2[i]){
+			//サマリー
+			for(i++,i2=0;;i++,i2++){
+				if(temp2[i]=='\n'||temp2[i]=='\0'){
+					break;
+				}
+			}
+		}
+
+		if(temp2[i]=='\0') break;
+		i++;
+	}
+
+
+	free(temp2);
+
+
+	free(lpszTempUrl);
+}
+
+
+
+
+
+
+LRESULT CALLBACK WebResultWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	switch(message){
+		case WM_COMMAND:
+			break;
+	}
+	return DefWindowProc(hwnd,message,wParam,lParam);
+}
+
+CWebResult::CWebResult(HWND hParent){
+	ppobj_OneTab=(COneTab **)malloc(1);
+	iTabNum=0;
+
+	hwnd=CreateWindowEx(0,"WebResult","WebResult",
+		WS_CHILD|WS_CLIPCHILDREN|WS_VISIBLE,
+		0,0,0,0,
+		hParent,0,hInst,0);
+}
+CWebResult::~CWebResult(){
+	int i;
+	for(i=0;i<iTabNum;i++){
+		delete ppobj_OneTab[i];
+	}
+
+	free(ppobj_OneTab);
+	ppobj_OneTab=0;
+
+	DestroyWindow(hwnd);
+}
+
+void CWebResult::resize(int x,int y,int cx,int cy){
+	MoveWindow(hwnd,x,y,cx,cy,1);
+}
+
+void CWebResult::add(int WndNum,char *lpszSearchText){
+	COneTab *pobj_temp_OneTab;
+	pobj_temp_OneTab=new COneTab(WndNum,lpszSearchText);
+	if(MdiInfo[WndNum].pMdiTextEdit==0){
+		delete pobj_temp_OneTab;
+		return;
+	}
+
+	if(pobj_temp_OneTab->lpszTitle[0]){
+		if(pobj_temp_OneTab->lpszTitle[0][0]=='\0'){
+			delete pobj_temp_OneTab;
+			return;
+		}
+	}
+	else{
+		delete pobj_temp_OneTab;
+		return;
+	}
+
+
+	ppobj_OneTab=(COneTab **)realloc(ppobj_OneTab,(iTabNum+1)*sizeof(COneTab));
+
+	//ローテーション
+	int i;
+	for(i=iTabNum-1;i>=0;i--){
+		ppobj_OneTab[i+1]=ppobj_OneTab[i];
+	}
+
+	ppobj_OneTab[0]=pobj_temp_OneTab;
+	iTabNum++;
+
+	if(iTabNum==10){
+		//古いアイテムを破棄
+		delete ppobj_OneTab[iTabNum-1];
+		iTabNum--;
+	}
+
+	int offset=0;
+	for(i=0;i<iTabNum;i++){
+		offset+=ppobj_OneTab[i]->iWindowWidth;
+	}
+	for(i=iTabNum-1;i>=0;i--){
+		offset-=ppobj_OneTab[i]->iWindowWidth;
+		MoveWindow(ppobj_OneTab[i]->hTabWnd,
+			offset,
+			0,
+			ppobj_OneTab[i]->iWindowWidth,
+			20,
+			1);
+	}
+}
+BOOL CWebResult::DuplicateCheck(char *str){
+	int i;
+	for(i=0;i<iTabNum;i++){
+		if(lstrcmpi(ppobj_OneTab[i]->lpszString,str)==0){
+			return 1;
+		}
+	}
+	return 0;
+}
+
+
+
+BOOL bSearchingWeb;
+char *lpszRetrySearchStr;
+void WebSearchThread(void *temp_str){
+	char *str;
+	str=(char *)malloc(lstrlen((char *)temp_str)+1);
+	lstrcpy(str,(char *)temp_str);
+	HeapDefaultFree(temp_str);
+
+	int WndNum;
+	WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+	if(bSearchingWeb){
+		if(lpszRetrySearchStr) free(lpszRetrySearchStr);
+		lpszRetrySearchStr=str;
+
+		_endthread();
+		return;
+	}
+	bSearchingWeb=1;
+
+
+wait_repeat:
+	Sleep(500);
+	if(lpszRetrySearchStr){
+		free(str);
+
+		str=lpszRetrySearchStr;
+		lpszRetrySearchStr=0;
+		goto wait_repeat;
+	}
+
+
+	if(WndNum==-1){
+		goto exit;
+	}
+	if(MdiInfo[WndNum].pMdiTextEdit==0){
+		goto exit;
+	}
+
+	//重複チェック
+	if(MdiInfo[WndNum].pMdiTextEdit->pobj_WebResult->DuplicateCheck(str)){
+		goto exit;
+	}
+
+
+
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	MdiInfo[WndNum].pMdiTextEdit->pobj_WebResult->add(WndNum,str);
+
+exit:
+	bSearchingWeb=0;
+
+	free(str);
+
+
+	if(lpszRetrySearchStr){
+		str=lpszRetrySearchStr;
+		lpszRetrySearchStr=0;
+		goto wait_repeat;
+	}
+
+
+	_endthread();
+}
+
+
+
+
+////////////////////////////
+// 以下、SideWeb
+////////////////////////////
+
+CComModule _Module;
+
+BEGIN_OBJECT_MAP(ObjectMap)
+END_OBJECT_MAP()
+
+HWND hNowIEWnd;
+LRESULT CALLBACK SideWebProc (HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
+{
+	CComQIPtr<IWebBrowser2>	pWB2 ;
+
+	switch (iMsg)
+	{
+		case WM_CREATE :
+		{
+			AtlAxWinInit();
+			hNowIEWnd = CreateWindow("AtlAxWin", "Shell.Explorer.2", WS_CHILD|WS_VISIBLE, 0,0,0,0, 
+						hwnd, (HMENU)0, hInst, NULL);
+			if(!hNowIEWnd){
+				MessageBox(hOwner,"IEコンポーネントの生成に失敗しました","lockey_browser",MB_OK|MB_ICONEXCLAMATION);
+				PostQuitMessage(0);
+				return 0;
+			}
+
+			// ActiveXコントロールのインターフェースを要求
+			CComPtr<IUnknown>	 punkIE;
+			if (AtlAxGetControl(hNowIEWnd, &punkIE) == S_OK)
+			{
+				// IUnknownポインタからIWebBrowser2ポインタへキャスト
+				pWB2 = punkIE;
+
+				if(pWB2)
+				{
+					// シンクオブジェクトの作成
+					CComObject<CIESink>* sink;
+					CComObject<CIESink>::CreateInstance(&sink);
+
+					// イベントをDispatchするよう、IEコントロールにお願い
+					HRESULT hr = sink->AdviseToIE(punkIE);
+					if(SUCCEEDED(hr))
+					{
+						//成功
+						return 0;
+					}
+				}
+
+				MessageBox(hOwner,"IEコンポーネントの生成に失敗しました","ProjectEditor",MB_OK|MB_ICONEXCLAMATION);
+				PostQuitMessage(0);
+				return 0;
+			}
+
+			return 0 ;
+		}
+
+		case WM_SIZE :
+			MoveWindow(GetWindow(hwnd,GW_CHILD), 0, 0, LOWORD(lParam), HIWORD(lParam), 1) ;
+			return 0 ;
+
+		case WM_KEYDOWN:
+		{
+			// ActiveXコントロールのインターフェースを要求
+			CComPtr<IUnknown>	 punkIE;
+			if (AtlAxGetControl(hNowIEWnd, &punkIE) == S_OK)
+			{
+				// IUnknownポインタからIWebBrowser2ポインタへキャスト
+				pWB2 = punkIE;
+
+				CComQIPtr<IOleInPlaceActiveObject, &IID_IOleInPlaceActiveObject> pIOIPAO(pWB2) ;
+
+				if(pIOIPAO)
+				{
+					MSG msg;
+					msg.message = iMsg;
+					msg.wParam = wParam;
+					msg.lParam = lParam;
+
+					pIOIPAO->TranslateAccelerator(&msg);
+				}
+ 
+				return 0 ;
+			}
+		}
+
+		case WM_BROWS_GO:
+
+			{
+				// ActiveXコントロールのインターフェースを要求
+				CComPtr<IUnknown>	 punkIE;
+				if (AtlAxGetControl(hNowIEWnd, &punkIE) == S_OK)
+				{
+					// IUnknownポインタからIWebBrowser2ポインタへキャスト
+					pWB2 = punkIE;
+
+					// URLへ移動
+					CComVariant vempty, vUrl((char *)lParam);
+					pWB2->Navigate2 (&vUrl, &vempty, &vempty, &vempty, &vempty );
+				}
+			}
+
+			return 0;
+
+		case WM_BROWS_DESTROY:
+			DestroyWindow(hwnd);
+			return 0;
+
+		case WM_DESTROY :
+			{
+				// ActiveXコントロールのインターフェースを要求
+				CComPtr<IUnknown>	 punkIE;
+				if (AtlAxGetControl(hNowIEWnd, &punkIE) == S_OK)
+				{
+					// IUnknownポインタからIWebBrowser2ポインタへキャスト
+					pWB2 = punkIE;
+
+					pWB2.Release();
+				}
+
+			}
+			return 0 ;
+	}
+
+	return DefWindowProc (hwnd, iMsg, wParam, lParam) ;
+}
+
+CChildSideWeb::CChildSideWeb(HWND hParent,HWND hTab,char *title,char *site){
+	hwnd=CreateWindowEx(WS_EX_CLIENTEDGE,"SideWeb","SideWeb",
+		WS_CHILD|WS_CLIPCHILDREN,
+		0,0,0,0,
+		hParent,0,hInst,0);
+	hIEWnd=hNowIEWnd;
+
+	TC_ITEM tcItem;
+	tcItem.mask=TCIF_TEXT;
+
+	tcItem.pszText=title;
+	TabCtrl_InsertItem(hTab,SendMessage(hTab,TCM_GETITEMCOUNT,0,0),&tcItem);
+
+	//タイトル
+	lpszTitle=(char *)malloc(lstrlen(title)+1);
+	lstrcpy(lpszTitle,title);
+
+	//サイト
+	lpszSite=(char *)malloc(lstrlen(site)+1);
+	lstrcpy(lpszSite,site);
+}
+CChildSideWeb::~CChildSideWeb(){
+	free(lpszTitle);
+	free(lpszSite);
+	DestroyWindow(hwnd);
+}
+
+
+CSideWeb *pobj_SideWeb=0;
+
+CSideWeb::CSideWeb(HWND hParent){
+	lpszNowUrl=0;
+	bShow=0;
+
+	_Module.Init(ObjectMap, hInst);
+
+	//タブを生成
+	extern HFONT hStatusFont;
+	hTab=CreateWindowEx(0,WC_TABCONTROL,NULL,
+		WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_VISIBLE,
+		0,0,0,0,
+		hParent,0,hInst,0);
+	SendMessage(hTab,WM_SETFONT,(long)hStatusFont,0);
+
+	//→ボタンを生成
+	hRightButton=CreateWindow("BUTTON","→",WS_CHILD|WS_VISIBLE,
+		0,0,20,13,
+		hParent,(HMENU)IDC_CLIP,hInst,0);
+	SendMessage(hRightButton,WM_SETFONT,(long)hStatusFont,0);
+
+
+	iChildSideWebNum=pobj_nv->pobj_DBDomain->iDomainNum+1;
+	ppobj_ChildSideWeb=(CChildSideWeb **)malloc(iChildSideWebNum*sizeof(CChildSideWeb *));
+	ppobj_ChildSideWeb[0]=new CChildSideWeb(hParent,hTab,"全般","");
+	int i;
+	for(i=0;i<pobj_nv->pobj_DBDomain->iDomainNum;i++){
+		ppobj_ChildSideWeb[i+1]=new CChildSideWeb(hParent,hTab,
+			pobj_nv->pobj_DBDomain->ppobj_Domain[i]->lpszName,
+			pobj_nv->pobj_DBDomain->ppobj_Domain[i]->lpszDomain);
+	}
+
+
+	TabCtrl_SetCurSel(hTab,0);
+	ShowWindow(ppobj_ChildSideWeb[0]->hwnd,SW_SHOW);
+	hNowIEWnd=ppobj_ChildSideWeb[0]->hIEWnd;
+}
+CSideWeb::~CSideWeb(){
+	int i;
+	for(i=0;i<iChildSideWebNum;i++){
+		delete ppobj_ChildSideWeb[i];
+	}
+	free(ppobj_ChildSideWeb);
+	ppobj_ChildSideWeb=0;
+
+	if(lpszNowUrl) free(lpszNowUrl);
+
+	DestroyWindow(hTab);
+	DestroyWindow(hRightButton);
+}
+void CSideWeb::resize(int x,int y,int cx,int cy){
+	int iTabHeight=25;
+
+	MoveWindow(hTab,x,y,cx-30,iTabHeight,1);
+
+	SetWindowPos(hRightButton,NULL,x+cx-25,y+7,0,0,SWP_NOSIZE);
+
+	int i;
+	for(i=0;i<iChildSideWebNum;i++){
+		MoveWindow(ppobj_ChildSideWeb[i]->hwnd,x,y+iTabHeight,cx,cy-iTabHeight,1);
+	}
+
+	m_Rect.left=x;
+	m_Rect.top=y;
+	m_Rect.right=x+cx;
+	m_Rect.bottom=y+cy;
+}
+
+void CSideWeb::GoPage(char *lpszUrl){
+	char *pTemp;
+	pTemp=(char *)malloc(lstrlen(lpszUrl)+1);
+	lstrcpy(pTemp,lpszUrl);
+
+	if(lpszNowUrl) free(lpszNowUrl);
+	lpszNowUrl=pTemp;
+
+	int iTabPos;
+	iTabPos=SendMessage(hTab,TCM_GETCURSEL,0,0);
+
+
+	pTemp=(char *)malloc(lstrlen(lpszNowUrl)+1024);
+	if(ppobj_ChildSideWeb[iTabPos]->lpszSite[0])
+		sprintf(pTemp,"%s&site=%s",lpszNowUrl,ppobj_ChildSideWeb[iTabPos]->lpszSite);
+	else lstrcpy(pTemp,lpszNowUrl);
+
+	SendMessage(ppobj_ChildSideWeb[iTabPos]->hwnd,WM_BROWS_GO,0,(LPARAM)pTemp);
+
+	free(pTemp);
+
+	bShow=1;
+	ResizeOwnerWnd();	
+}
+
+void CSideWeb::SelChangeEvent(){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	char temporary[MAX_PATH];
+
+	int i;
+	i=TabCtrl_GetCurSel(hTab);
+
+	TC_ITEM tcItem;
+	tcItem.mask=TCIF_TEXT;
+	tcItem.pszText=temporary;
+	tcItem.cchTextMax=MAX_PATH;
+	TabCtrl_GetItem(hTab,i,&tcItem);
+
+	for(i=0;i<iChildSideWebNum;i++){
+		ShowWindow(ppobj_ChildSideWeb[i]->hwnd,SW_HIDE);
+	}
+
+	for(i=0;i<iChildSideWebNum;i++){
+		if(lstrcmpi(temporary,ppobj_ChildSideWeb[i]->lpszTitle)==0){
+			ShowWindow(ppobj_ChildSideWeb[i]->hwnd,SW_SHOW);
+			hNowIEWnd=ppobj_ChildSideWeb[i]->hIEWnd;
+			GoPage(lpszNowUrl);
+			break;
+		}
+	}
+}
+
+void CSideWeb::GetRect(RECT *prc){
+	*prc=m_Rect;
+}
+
+
+
+
+
+CWebStrings obj_WebStrings;
+
+CWebStrings::CWebStrings(){
+	buffer=(char *)malloc(1);
+	buffer[0]=0;
+
+	ppStr=(char **)malloc(1);
+	iStrNum=0;
+}
+CWebStrings::~CWebStrings(){
+	free(buffer);
+
+	int i;
+	for(i=0;i<iStrNum;i++){
+		free(ppStr[i]);
+	}
+	free(ppStr);
+}
+
+void CWebStrings::add(char *query){
+	//重複チェック
+	int i;
+	for(i=0;i<iStrNum;i++){
+		if(lstrcmpi(ppStr[i],query)==0){
+			return;
+		}
+	}
+
+	ppStr=(char **)realloc(ppStr,(iStrNum+1)*sizeof(char *));
+	ppStr[iStrNum]=(char *)malloc(lstrlen(query)+1);
+	lstrcpy(ppStr[iStrNum],query);
+	iStrNum++;
+}
+
+void CWebStrings::clear(){
+	buffer[0]=0;
+
+	int i;
+	for(i=0;i<iStrNum;i++){
+		free(ppStr[i]);
+	}
+	iStrNum=0;
+}
+
+char *CWebStrings::GetBuffer(){
+	buffer[0]=0;
+	int i;
+	for(i=0;i<iStrNum;i++){
+		buffer=(char *)realloc(buffer,lstrlen(buffer)+lstrlen(ppStr[i])+2);
+		if(i) lstrcat(buffer," ");
+		lstrcat(buffer,ppStr[i]);
+	}
+	return buffer;
+}
+
+
+
+//////////////////////////
+// Web検索用ドメイン管理
+//////////////////////////
+
+CDomain::CDomain(char *name,char *domain){
+	//表示名
+	lpszName=(char *)HeapAlloc(hHeap,0,lstrlen(name)+1);
+	lstrcpy(lpszName,name);
+
+	//ドメイン
+	lpszDomain=(char *)HeapAlloc(hHeap,0,lstrlen(domain)+1);
+	lstrcpy(lpszDomain,domain);
+}
+CDomain::~CDomain(){
+	HeapDefaultFree(lpszName);
+	HeapDefaultFree(lpszDomain);
+}
+
+
+void CDBDomain::init(){
+	int i;
+	for(i=0;i<iDomainNum;i++){
+		delete ppobj_Domain[i];
+	}
+	iDomainNum=0;
+}
+CDBDomain::CDBDomain(){
+	ppobj_Domain=(CDomain **)HeapAlloc(hHeap,0,1);
+	iDomainNum=0;
+
+	m_hListView=0;
+}
+CDBDomain::~CDBDomain(){
+	init();
+	HeapDefaultFree(ppobj_Domain);
+}
+
+void CDBDomain::load(){
+	char temporary[MAX_PATH],temp2[MAX_PATH];
+	sprintf(temporary,"%sUserSetting\\domain.ini",pj_editor_Dir);
+
+	char *buffer;
+	buffer=ReadBuffer_NonErrMsg(temporary);
+	if(buffer){
+		int i;
+		i=0;
+		while(buffer[i]){
+			//表示名
+			i=GetOneParameter(buffer,i,temporary);
+			if(temporary[0]=='\0') break;
+
+			//ドメイン
+			i=GetOneParameter(buffer,i,temp2);
+			if(temp2[0]=='\0') break;
+
+			if(buffer[i]=='\r'&&buffer[i+1]=='\n'){
+				i+=2;
+			}
+
+			add(temporary,temp2);
+		}
+		HeapDefaultFree(buffer);
+	}
+	else{
+		add("辞書","ja.wikipedia.org");
+		add("MSDN","msdn.microsoft.com");
+	}
+}
+void CDBDomain::save(){
+	char temporary[MAX_PATH];
+	sprintf(temporary,"%sUserSetting\\domain.ini",pj_editor_Dir);
+
+	char *buffer;
+	buffer=(char *)HeapAlloc(hHeap,0,iDomainNum*MAX_PATH*2+1);
+	buffer[0]=0;
+
+	int i;
+	for(i=0;i<iDomainNum;i++){
+		sprintf(buffer+lstrlen(buffer),"%s,%s\r\n",ppobj_Domain[i]->lpszName,ppobj_Domain[i]->lpszDomain);
+	}
+
+	WriteBuffer(temporary,buffer,lstrlen(buffer));
+
+	HeapDefaultFree(buffer);
+}
+
+void CDBDomain::copy_get(CDBDomain *pobj_DBDomain){
+	init();
+
+	int i;
+	for(i=0;i<pobj_DBDomain->iDomainNum;i++){
+		add(pobj_DBDomain->ppobj_Domain[i]->lpszName,pobj_DBDomain->ppobj_Domain[i]->lpszDomain);
+	}
+}
+
+void CDBDomain::SetListView(HWND hListView){
+	m_hListView=hListView;
+
+	int i;
+	for(i=0;i<iDomainNum;i++){
+		LV_ITEM item;
+
+		item.mask=LVIF_TEXT;
+		item.pszText=ppobj_Domain[i]->lpszName;
+		item.iItem=i;
+		item.iSubItem=0;
+		ListView_InsertItem(m_hListView,&item);
+
+		item.pszText=ppobj_Domain[i]->lpszDomain;
+		item.iItem=i;
+		item.iSubItem++;
+		ListView_SetItem(m_hListView,&item);
+	}
+}
+
+void CDBDomain::add(char *name,char *domain){
+	ppobj_Domain=(CDomain **)HeapReAlloc(hHeap,0,ppobj_Domain,(iDomainNum+1)*sizeof(CDomain *));
+	ppobj_Domain[iDomainNum]=new CDomain(name,domain);
+	iDomainNum++;
+
+
+	if(m_hListView){
+		int i;
+		i=ListView_GetItemCount(m_hListView);
+
+		//リストビューに追加
+		LV_ITEM item;
+		item.mask=LVIF_TEXT;
+		item.pszText=name;
+		item.iItem=i;
+		item.iSubItem=0;
+		ListView_InsertItem(m_hListView,&item);
+
+		item.pszText=domain;
+		item.iItem=i;
+		item.iSubItem++;
+		ListView_SetItem(m_hListView,&item);
+	}
+}
+void CDBDomain::del(char *name){
+	int i;
+	for(i=0;i<iDomainNum;i++){
+		if(lstrcmp(ppobj_Domain[i]->lpszName,name)==0) break;
+	}
+	if(i==iDomainNum) return;
+
+	if(m_hListView){
+		//リストビューから削除
+		ListView_DeleteItem(m_hListView,i);
+	}
+
+	delete ppobj_Domain[i];
+	iDomainNum--;
+	for(;i<iDomainNum;i++){
+		ppobj_Domain[i]=ppobj_Domain[i+1];
+	}
+}
+void CDBDomain::change(char *szBeforeName,char *name,char *domain){
+	int i;
+	for(i=0;i<iDomainNum;i++){
+		if(lstrcmp(ppobj_Domain[i]->lpszName,szBeforeName)==0) break;
+	}
+	if(i==iDomainNum) return;
+
+	ppobj_Domain[i]->lpszName=(char *)HeapReAlloc(hHeap,0,ppobj_Domain[i]->lpszName,lstrlen(name)+1);
+	lstrcpy(ppobj_Domain[i]->lpszName,name);
+
+	ppobj_Domain[i]->lpszDomain=(char *)HeapReAlloc(hHeap,0,ppobj_Domain[i]->lpszDomain,lstrlen(domain)+1);
+	lstrcpy(ppobj_Domain[i]->lpszDomain,domain);
+
+
+	if(m_hListView){
+		//リストビューの設定
+		ListView_SetItemText(m_hListView,i,0,name);
+		ListView_SetItemText(m_hListView,i,1,domain);
+	}
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/WebSearch.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/WebSearch.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/WebSearch.h	(revision 178)
@@ -0,0 +1,145 @@
+
+#define LINK_ITEM_HEIGHT 20
+
+LRESULT CALLBACK ResultListProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+LRESULT CALLBACK OneTabProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+LRESULT CALLBACK WebResultWndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+class COneTab;
+
+class CResultList{
+public:
+	HWND hwnd;
+	int iAnimeCount;
+	COneTab *pobj_OneTab;
+
+	CResultList(COneTab *pobj_OneTab);
+	~CResultList();
+};
+
+class COneTab{
+	int m_WndNum;
+
+public:
+	HWND hTabWnd;
+	CResultList *pobj_ResultList;
+
+	int iWindowWidth;
+
+	char *lpszString;
+	char *lpszTitle[10];
+	char *lpszUrl[10];
+
+	COneTab(int WndNum,char *str);
+	~COneTab();
+
+	void WebSearch();
+};
+
+class CWebResult{
+
+	COneTab **ppobj_OneTab;
+	int iTabNum;
+
+public:
+	HWND hwnd;
+	CWebResult(HWND hParent);
+	~CWebResult();
+
+	void resize(int x,int y,int cx,int cy);
+
+	void add(int WndNum,char *lpszSearchText);
+
+	BOOL DuplicateCheck(char *str);
+};
+
+void WebSearchThread(void *temp_str);
+
+
+
+
+LRESULT CALLBACK SideWebProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
+
+class CChildSideWeb{
+public:
+	HWND hwnd;
+	HWND hIEWnd;
+	char *lpszTitle;
+	char *lpszSite;
+
+	CChildSideWeb(HWND hParent,HWND hTab,char *title,char *site);
+	~CChildSideWeb();
+
+	void resize(int x,int y,int cx,int cy);
+};
+
+class CSideWeb{
+
+	CChildSideWeb **ppobj_ChildSideWeb;
+	int iChildSideWebNum;
+
+	char *lpszNowUrl;
+
+	RECT m_Rect;
+
+	HWND hRightButton;
+
+public:
+	HWND hTab;
+	BOOL bShow;
+	CSideWeb(HWND hParent);
+	~CSideWeb();
+	void resize(int x,int y,int cx,int cy);
+
+	void GoPage(char *lpszUrl);
+
+	void SelChangeEvent();
+
+	void GetRect(RECT *prc);
+};
+extern CSideWeb *pobj_SideWeb;
+
+class CWebStrings{
+	char *buffer;
+	char **ppStr;
+	char iStrNum;
+public:
+	CWebStrings();
+	~CWebStrings();
+
+	void add(char *query);
+	void clear();
+
+	char *GetBuffer();
+};
+extern CWebStrings obj_WebStrings;
+
+
+class CDomain{
+public:
+	char *lpszName;
+	char *lpszDomain;
+	CDomain(char *name,char *domain);
+	~CDomain();
+};
+class CDBDomain{
+	HWND m_hListView;
+
+	void init();
+public:
+	CDomain **ppobj_Domain;
+	int iDomainNum;
+
+	CDBDomain();
+	~CDBDomain();
+
+	void load();
+	void save();
+	void copy_get(CDBDomain *pobj_DBDomain);
+
+	void SetListView(HWND hListView);
+
+	void add(char *name,char *domain);
+	void del(char *name);
+	void change(char *szBeforeName,char *name,char *domain);
+};
Index: tag/abdev(2007.06.20)/ProjectEditor/WindowControl.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/WindowControl.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/WindowControl.cpp	(revision 178)
@@ -0,0 +1,2344 @@
+#include "Common.h"
+
+#if defined(JPN)
+//日本語
+#include "pj_msg_jpn.h"
+#else
+//英語
+#include "pj_msg_eng.h"
+#endif
+
+int GetWndInfoNum(char *name){
+	extern PROJECTINFO ProjectInfo;
+	int i;
+	for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+		if(lstrcmpi(name,ProjectInfo.pWindowInfo[i].name)==0) return i;
+	}
+	return -1;
+}
+void ChangeDivisionToOrSign(char *CopyBuffer,const char *ReadBuffer){
+	int i,i2;
+	for(i=0,i2=0;;i++,i2++){
+		if(ReadBuffer[i]=='|'){
+			CopyBuffer[i2]=0;
+			lstrcpy(CopyBuffer+i2," or ");
+			i2+=3;
+			continue;
+		}
+		CopyBuffer[i2]=ReadBuffer[i];
+		if(ReadBuffer[i]=='\0') break;
+	}
+}
+void ChangeOrSignToDivision(char *CopyBuffer,const char *ReadBuffer){
+	int i,i2,IsStr;
+	for(i=0,i2=0,IsStr=0;;i++,i2++){
+		if(ReadBuffer[i]=='\"') IsStr^=1;
+		if(ReadBuffer[i]=='\0'){
+			CopyBuffer[i2]=0;
+			break;
+		}
+		if(ReadBuffer[i+3]=='\0'){
+			memcpy(CopyBuffer+i2,ReadBuffer+i,3);
+			CopyBuffer[i2+3]=0;
+			break;
+		}
+		if((ReadBuffer[i]==' '||ReadBuffer[i]=='\t')&&
+			(ReadBuffer[i+1]=='O'||ReadBuffer[i+1]=='o')&&(ReadBuffer[i+2]=='R'||ReadBuffer[i+2]=='r')&&
+			(ReadBuffer[i+3]==' '||ReadBuffer[i+3]=='\t')&&IsStr==0){
+			CopyBuffer[i2]='|';
+			i+=3;
+			continue;
+		}
+		CopyBuffer[i2]=ReadBuffer[i];
+	}
+}
+
+HGLOBAL Rad_GetChildInfoClipboardData(int WndNum,int WndInfoNum){
+	//CHILDINFO構造体をクリップボード用データ（pByteが示すバッファ）に変換する
+	extern PROJECTINFO ProjectInfo;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	HGLOBAL hGlobal;
+	BYTE *pByte;
+	int i2,i3,MemSize;
+	CHILDINFO *pChildInfo;
+
+	for(i3=0;;i3++){
+		if(MdiInfo[WndNum].MdiRadInfo->SelectingItem[i3]==-1) break;
+	}
+	
+
+	hGlobal=GlobalAlloc(GMEM_MOVEABLE,sizeof(int));
+	pByte=(BYTE *)GlobalLock(hGlobal);
+	*((int *)pByte)=i3;
+	GlobalUnlock(hGlobal);
+	i2=sizeof(int);
+
+	MemSize=i2;
+
+	for(i3--;i3>=0;i3--){
+		pChildInfo=&ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[MdiInfo[WndNum].MdiRadInfo->SelectingItem[i3]];
+
+		MemSize+=lstrlen(pChildInfo->IdName)+1+
+			sizeof(POINT)+
+			sizeof(SIZE)+
+			lstrlen(pChildInfo->caption)+1+
+			sizeof(DWORD)+
+			sizeof(DWORD)+
+			sizeof(int)+
+			sizeof(int)+
+			lstrlen(pChildInfo->ImageCtrlInfo.path)+1;
+
+		hGlobal=GlobalReAlloc(hGlobal,MemSize,0);
+		pByte=(BYTE *)GlobalLock(hGlobal);
+
+		lstrcpy((char *)pByte+i2,pChildInfo->IdName);
+		i2+=lstrlen(pChildInfo->IdName)+1;
+
+		memcpy(pByte+i2,&pChildInfo->pos,sizeof(POINT));
+		i2+=sizeof(POINT);
+
+		memcpy(pByte+i2,&pChildInfo->size,sizeof(SIZE));
+		i2+=sizeof(SIZE);
+
+		lstrcpy((char *)pByte+i2,pChildInfo->caption);
+		i2+=lstrlen(pChildInfo->caption)+1;
+
+		memcpy(pByte+i2,&pChildInfo->style,sizeof(DWORD));
+		i2+=sizeof(DWORD);
+
+		memcpy(pByte+i2,&pChildInfo->ExStyle,sizeof(DWORD));
+		i2+=sizeof(DWORD);
+
+		memcpy(pByte+i2,&pChildInfo->Control,sizeof(int));
+		i2+=sizeof(int);
+
+		memcpy(pByte+i2,&pChildInfo->ImageCtrlInfo.type,sizeof(int));
+		i2+=sizeof(int);
+
+		if(!pChildInfo->ImageCtrlInfo.path){
+			lstrcpy((char *)pByte+i2,"");
+			i2++;
+		}
+		else{
+			lstrcpy((char *)pByte+i2,pChildInfo->ImageCtrlInfo.path);
+			i2+=lstrlen(pChildInfo->ImageCtrlInfo.path)+1;
+		}
+
+		GlobalUnlock(hGlobal);
+	}
+
+	return hGlobal;
+}
+void Rad_PasteChildInfoClipboardData(int WndNum,HGLOBAL hGlobal){
+	//hGlobalに格納されているクリップボードデータをRAD画面に挿入する
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	BYTE *pByte;
+	int i2,i3,WndInfoNum;
+	CHILDINFO ChildInfo;
+	char temporary[255];
+
+	for(i2=1;i2<MAX_RAD_SELITEM;i2++) MdiInfo[WndNum].MdiRadInfo->SelectingItem[i2]=-1;
+
+	WndInfoNum=GetWndInfoNum(MdiInfo[WndNum].path);
+	pByte=(BYTE *)GlobalLock(hGlobal);
+	i3=*((int *)pByte);
+	i2=sizeof(int);
+
+	for(i3--;i3>=0;i3--){
+		//IdNameメンバは変更される可能性がある
+		ChildInfo.IdName=(char *)temporary;
+		lstrcpy(ChildInfo.IdName,(char *)pByte+i2);
+		i2+=lstrlen(ChildInfo.IdName)+1;
+
+		memcpy(&ChildInfo.pos,pByte+i2,sizeof(POINT));
+		i2+=sizeof(POINT);
+
+		memcpy(&ChildInfo.size,pByte+i2,sizeof(SIZE));
+		i2+=sizeof(SIZE);
+
+		ChildInfo.caption=(char *)pByte+i2;
+		i2+=lstrlen(ChildInfo.caption)+1;
+
+		memcpy(&ChildInfo.style,pByte+i2,sizeof(DWORD));
+		i2+=sizeof(DWORD);
+
+		memcpy(&ChildInfo.ExStyle,pByte+i2,sizeof(DWORD));
+		i2+=sizeof(DWORD);
+
+		memcpy(&ChildInfo.Control,pByte+i2,sizeof(int));
+		i2+=sizeof(int);
+
+		memcpy(&ChildInfo.ImageCtrlInfo.type,pByte+i2,sizeof(int));
+		i2+=sizeof(int);
+
+		ChildInfo.ImageCtrlInfo.path=(char *)pByte+i2;
+		if(lstrlen(ChildInfo.ImageCtrlInfo.path)==0){
+			ChildInfo.ImageCtrlInfo.path=0;
+			i2++;
+		}
+		else i2+=lstrlen(ChildInfo.ImageCtrlInfo.path)+1;
+
+		ChildInfo.pos.x+=17;
+		ChildInfo.pos.y+=10;
+
+		MdiInfo[WndNum].MdiRadInfo->SelectingItem[i3]=InsertDlgItem(WndNum,
+			WndInfoNum,
+			-1,
+			&ChildInfo.pos,
+			&ChildInfo.size,
+			ChildInfo.IdName,
+			ChildInfo.caption,
+			ChildInfo.style,
+			ChildInfo.ExStyle,
+			ChildInfo.Control,
+			ChildInfo.ImageCtrlInfo.type,
+			ChildInfo.ImageCtrlInfo.path,
+			2);
+	}
+
+	GlobalUnlock(hGlobal);
+
+	ChangePropertyWindow(WndNum,WndInfoNum);
+}
+
+char *FormatCaption(char *caption){
+	extern HANDLE hHeap;
+	int i2,i3,BufSize;
+	char *buffer;
+
+	BufSize=256*2;
+	buffer=(char *)HeapAlloc(hHeap,0,BufSize);
+	for(i2=0,i3=0;;i2++,i3++){
+		if(i2+256>=BufSize){
+			BufSize+=256;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufSize);
+		}
+		if(caption[i3]=='\"'){
+			lstrcpy(buffer+i2,"\"+Chr$(34)+\"");
+			i2+=lstrlen(buffer+i2);
+			i2--;
+			continue;
+		}
+		buffer[i2]=caption[i3];
+		if(caption[i3]=='\0') break;
+	}
+
+	return buffer;
+}
+char *SetCaptionSequence(char *caption){
+	extern HANDLE hHeap;
+	int i2,i3,BufSize;
+	char *buffer;
+
+	BufSize=256*2;
+	buffer=(char *)HeapAlloc(hHeap,0,BufSize);
+	for(i2=0,i3=0;;i2++,i3++){
+		if(i2+256>=BufSize){
+			BufSize+=256;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,BufSize);
+		}
+		buffer[i2]=caption[i3];
+		if(caption[i3]=='\"'){
+			buffer[i2++]='\\';
+			buffer[i2]='1';
+		}
+		else if(caption[i3]=='\\'){
+			buffer[i2++]='\\';
+			buffer[i2]='\\';
+		}
+		else if(caption[i3]=='\0') break;
+	}
+
+	return buffer;
+}
+void RestoreCaptionSequence(char *caption){
+	int i2,i3;
+
+	for(i2=0,i3=0;;i2++,i3++){
+		caption[i2]=caption[i3];
+		if(caption[i3]=='\\'){
+			i3++;
+			if(caption[i3]=='1') caption[i2]='\"';
+			else caption[i2]=caption[i3];
+		}
+		else if(caption[i3]=='\0') break;
+	}
+}
+
+//テンプレートソースファイルに値をセットする
+char *PermutationWndPgmTemplate(char *pBuf,char *pPjName, char *pWndName, char *pHandleName, char *pProcName){
+	extern HANDLE hHeap;
+	int i,i2;
+
+	for(i=0;;i++){
+		if(pBuf[i]=='\0') break;
+		if(memicmp(pBuf+i,"#name#",6)==0){
+			//プロジェクト名を置換
+			i2=lstrlen(pPjName);
+			if(i2>6) pBuf=(char *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,pBuf,lstrlen(pBuf)+(i2-6)+1);
+			SlideString(pBuf+i+6,i2-6);
+			memcpy(pBuf+i,pPjName,i2);
+		}
+		if(memicmp(pBuf+i,"#window#",8)==0){
+			//ウィンドウ名を置換
+			i2=lstrlen(pWndName);
+			if(i2>6) pBuf=(char *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,pBuf,lstrlen(pBuf)+(i2-8)+1);
+			SlideString(pBuf+i+8,i2-8);
+			memcpy(pBuf+i,pWndName,i2);
+		}
+		if(memicmp(pBuf+i,"#handle#",8)==0){
+			//ハンドル名を置換
+			i2=lstrlen(pHandleName);
+			if(i2>6) pBuf=(char *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,pBuf,lstrlen(pBuf)+(i2-8)+1);
+			SlideString(pBuf+i+8,i2-8);
+			memcpy(pBuf+i,pHandleName,i2);
+		}
+		if(memicmp(pBuf+i,"#procedure#",11)==0){
+			//プロシージャ名を置換
+			i2=lstrlen(pProcName);
+			if(i2>6) pBuf=(char *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,pBuf,lstrlen(pBuf)+(i2-11)+1);
+			SlideString(pBuf+i+11,i2-11);
+			memcpy(pBuf+i,pProcName,i2);
+		}
+	}
+
+	return pBuf;
+}
+
+BOOL GetItemNotifyMessageNameByEvent(char *buffer,int ClassID,const char *EventName){
+	if(lstrcmp(EventName,"Click")==0) lstrcpy(buffer,"NM_CLICK");
+	else if(lstrcmp(EventName,"CustomDraw")==0) lstrcpy(buffer,"NM_CUSTOMDRAW");
+	else if(lstrcmp(EventName,"DblClick")==0) lstrcpy(buffer,"NM_DBLCLK");
+	else if(lstrcmp(EventName,"KillFocus")==0) lstrcpy(buffer,"NM_KILLFOCUS");
+	else if(lstrcmp(EventName,"OutOfMemory")==0) lstrcpy(buffer,"NM_OUTOFMEMORY");
+	else if(lstrcmp(EventName,"RClick")==0) lstrcpy(buffer,"NM_RCLICK");
+	else if(lstrcmp(EventName,"RDblClick")==0) lstrcpy(buffer,"NM_RDBLCLK");
+	else if(lstrcmp(EventName,"ReleasedCapture")==0) lstrcpy(buffer,"NM_RELEASEDCAPTURE");
+	else if(lstrcmp(EventName,"Return")==0) lstrcpy(buffer,"NM_RETURN");
+	else if(lstrcmp(EventName,"SetFocus")==0) lstrcpy(buffer,"NM_SETFOCUS");
+	else{
+		if(ClassID==CT_LISTVIEW){
+			if(lstrcmp(EventName,"BeginDrag")==0) lstrcpy(buffer,"LVN_BEGINDRAG");
+			else if(lstrcmp(EventName,"BeginLabelEdit")==0) lstrcpy(buffer,"LVN_BEGINLABELEDIT");
+			else if(lstrcmp(EventName,"BeginRDrag")==0) lstrcpy(buffer,"LVN_BEGINRDRAG");
+			else if(lstrcmp(EventName,"ColumnClick")==0) lstrcpy(buffer,"LVN_COLUMNCLICK");
+			else if(lstrcmp(EventName,"DeleteAllItems")==0) lstrcpy(buffer,"LVN_DELETEALLITEMS");
+			else if(lstrcmp(EventName,"DeleteItem")==0) lstrcpy(buffer,"LVN_DELETEITEM");
+			else if(lstrcmp(EventName,"EndLabelEdit")==0) lstrcpy(buffer,"LVN_ENDLABELEDIT");
+			else if(lstrcmp(EventName,"GetDispInfo")==0) lstrcpy(buffer,"LVN_GETDISPINFO");
+			else if(lstrcmp(EventName,"InsertItem")==0) lstrcpy(buffer,"LVN_INSERTITEM");
+			else if(lstrcmp(EventName,"ItemChanged")==0) lstrcpy(buffer,"LVN_ITEMCHANGED");
+			else if(lstrcmp(EventName,"ItemChanging")==0) lstrcpy(buffer,"LVN_ITEMCHANGING");
+			else if(lstrcmp(EventName,"KeyDown")==0) lstrcpy(buffer,"LVN_KEYDOWN");
+			else if(lstrcmp(EventName,"SetDispInfo")==0) lstrcpy(buffer,"LVN_SETDISPINFO");
+			else return 0;
+		}
+		else if(ClassID==CT_UPDOWN){
+			if(lstrcmp(EventName,"Deltapos")==0) lstrcpy(buffer,"UDN_DELTAPOS");
+			else return 0;
+		}
+		else return 0;
+		//未完成
+	}
+	return 1;
+}
+BOOL GetNotifyCommandByItemMessage(WINDOW_INFO *pWindowInfo,ITEMEVENTINFO *pItemEventInfo,char *Command,char *spaces){
+	int i,i2,i3,sw;
+	char temporary[MAX_PATH];
+
+	i2=0;
+	sw=0;
+	for(i=0;;i++){
+		if(pItemEventInfo[i].IdName==0) break;
+		if(pItemEventInfo[i].ClassID==CT_LISTVIEW||
+			pItemEventInfo[i].ClassID==CT_TREEVIEW||
+			pItemEventInfo[i].ClassID==CT_UPDOWN||
+			pItemEventInfo[i].ClassID==CT_PROGRESSBAR||
+			pItemEventInfo[i].ClassID==CT_TRACKBAR){
+			//コモン コントロール（WM_NOTIFY）
+			sw=1;
+			sprintf(Command+i2,"%sCase %s\r\n",spaces,pItemEventInfo[i].IdName);
+			i2+=lstrlen(Command+i2);
+			sprintf(Command+i2,"%s\tSelect Case pnmHdr->code\r\n",spaces);
+			i2+=lstrlen(Command+i2);
+			for(i3=0;i3<pItemEventInfo[i].EventNum;i3++){
+				if(GetItemNotifyMessageNameByEvent(temporary,pItemEventInfo[i].ClassID,pItemEventInfo[i].pEventNames[i3])){
+					sprintf(Command+i2,"%s\t\tCase %s\r\n",spaces,temporary);
+					i2+=lstrlen(Command+i2);
+					sprintf(Command+i2,"%s\t\t\t%s_%s_%s(ByVal (pnmHdr As VoidPtr))\r\n",spaces,pWindowInfo->name,pItemEventInfo[i].IdName,pItemEventInfo[i].pEventNames[i3]);
+					i2+=lstrlen(Command+i2);
+				}
+			}
+			sprintf(Command+i2,"%s\tEnd Select\r\n",spaces);
+			i2+=lstrlen(Command+i2);
+		}
+	}
+	return sw;
+}
+void GetItemMessageNameByEvent(char *buffer,int ClassID,const char *EventName){
+	if(ClassID==CT_BUTTON||
+		ClassID==CT_CHECKBOX||
+		ClassID==CT_RADIOBUTTON){
+		if(lstrcmp(EventName,"Click")==0) lstrcpy(buffer,"BN_CLICKED");
+		else if(lstrcmp(EventName,"DblClick")==0) lstrcpy(buffer,"BN_DBLCLK");
+	}
+	else if(ClassID==CT_COMBOBOX){
+		if(lstrcmp(EventName,"CloseUp")==0) lstrcpy(buffer,"CBN_CLOSEUP");
+		else if(lstrcmp(EventName,"DblClick")==0) lstrcpy(buffer,"CBN_DBLCLK");
+		else if(lstrcmp(EventName,"DropDown")==0) lstrcpy(buffer,"CBN_DROPDOWN");
+		else if(lstrcmp(EventName,"EditChange")==0) lstrcpy(buffer,"CBN_EDITCHANGE");
+		else if(lstrcmp(EventName,"EditUpdate")==0) lstrcpy(buffer,"CBN_EDITUPDATE");
+		else if(lstrcmp(EventName,"ErrSpace")==0) lstrcpy(buffer,"CBN_ERRSPACE");
+		else if(lstrcmp(EventName,"KillFocus")==0) lstrcpy(buffer,"CBN_KILLFOCUS");
+		else if(lstrcmp(EventName,"SelChange")==0) lstrcpy(buffer,"CBN_SELCHANGE");
+		else if(lstrcmp(EventName,"SelEndCancel")==0) lstrcpy(buffer,"CBN_SELENDCANCEL");
+		else if(lstrcmp(EventName,"SelEndOk")==0) lstrcpy(buffer,"CBN_SELENDOK");
+		else if(lstrcmp(EventName,"SetFocus")==0) lstrcpy(buffer,"CBN_SETFOCUS");
+	}
+	else if(ClassID==CT_EDIT){
+		if(lstrcmp(EventName,"Change")==0) lstrcpy(buffer,"EN_CHANGE");
+		else if(lstrcmp(EventName,"ErrSpace")==0) lstrcpy(buffer,"EN_ERRSPACE");
+		else if(lstrcmp(EventName,"HScroll")==0) lstrcpy(buffer,"EN_HSCROLL");
+		else if(lstrcmp(EventName,"KillFocus")==0) lstrcpy(buffer,"EN_KILLFOCUS");
+		else if(lstrcmp(EventName,"MaxText")==0) lstrcpy(buffer,"EN_MAXTEXT");
+		else if(lstrcmp(EventName,"SetFocus")==0) lstrcpy(buffer,"EN_SETFOCUS");
+		else if(lstrcmp(EventName,"Update")==0) lstrcpy(buffer,"EN_UPDATE");
+		else if(lstrcmp(EventName,"VScroll")==0) lstrcpy(buffer,"EN_VSCROLL");
+	}
+	else if(ClassID==CT_IMAGEBOX||
+		ClassID==CT_STATIC){
+		if(lstrcmp(EventName,"Click")==0) lstrcpy(buffer,"STN_CLICKED");
+		else if(lstrcmp(EventName,"DblClick")==0) lstrcpy(buffer,"STN_DBLCLK");
+	}
+	else if(ClassID==CT_LISTBOX){
+		if(lstrcmp(EventName,"SelChange")==0) lstrcpy(buffer,"LBN_SELCHANGE");
+		else if(lstrcmp(EventName,"DblClick")==0) lstrcpy(buffer,"LBN_DBLCLK");
+		else if(lstrcmp(EventName,"ErrSpace")==0) lstrcpy(buffer,"LBN_ERRSPACE");
+		else if(lstrcmp(EventName,"KillFocus")==0) lstrcpy(buffer,"LBN_KILLFOCUS");
+		else if(lstrcmp(EventName,"SelCancel")==0) lstrcpy(buffer,"LBN_SELCANCEL");
+		else if(lstrcmp(EventName,"SetFocus")==0) lstrcpy(buffer,"LBN_SETFOCUS");
+	}
+}
+void GetCommandByItemMessage(WINDOW_INFO *pWindowInfo,ITEMEVENTINFO *pItemEventInfo,char *Command,char *spaces){
+	extern HANDLE hHeap;
+	int i,i2,i3;
+	char temporary[MAX_PATH];
+
+	i2=0;
+	for(i=0;;i++){
+		if(pItemEventInfo[i].IdName==0) break;
+		if(pItemEventInfo[i].ClassID!=CT_LISTVIEW&&
+			pItemEventInfo[i].ClassID!=CT_PROGRESSBAR&&
+			pItemEventInfo[i].ClassID!=CT_TREEVIEW&&
+			pItemEventInfo[i].ClassID!=CT_TRACKBAR&&
+			pItemEventInfo[i].ClassID!=CT_UPDOWN
+			){
+			//WM_COMMAND
+			sprintf(Command+i2,"%sCase %s\r\n",spaces,pItemEventInfo[i].IdName);
+			i2+=lstrlen(Command+i2);
+			if(pItemEventInfo[i].ClassID==CT_MENU){
+				sprintf(Command+i2,"%s\t%s_%s_MenuClick()\r\n",spaces,pWindowInfo->name,pItemEventInfo[i].IdName);
+				i2+=lstrlen(Command+i2);
+				for(i3=0;i3<pItemEventInfo[i].EventNum;i3++)
+					HeapDefaultFree(pItemEventInfo[i].pEventNames[i3]);
+			}
+			else{
+				sprintf(Command+i2,"%s\tSelect Case HIWORD(wParam)\r\n",spaces);
+				i2+=lstrlen(Command+i2);
+				for(i3=0;i3<pItemEventInfo[i].EventNum;i3++){
+					GetItemMessageNameByEvent(temporary,pItemEventInfo[i].ClassID,pItemEventInfo[i].pEventNames[i3]);
+					sprintf(Command+i2,"%s\t\tCase %s\r\n",spaces,temporary);
+					i2+=lstrlen(Command+i2);
+					sprintf(Command+i2,"%s\t\t\t%s_%s_%s()\r\n",spaces,pWindowInfo->name,pItemEventInfo[i].IdName,pItemEventInfo[i].pEventNames[i3]);
+					i2+=lstrlen(Command+i2);
+					HeapDefaultFree(pItemEventInfo[i].pEventNames[i3]);
+				}
+				sprintf(Command+i2,"%s\tEnd Select\r\n",spaces);
+				i2+=lstrlen(Command+i2);
+			}
+			HeapDefaultFree(pItemEventInfo[i].IdName);
+			HeapDefaultFree(pItemEventInfo[i].pEventNames);
+		}
+		else{
+			//WM_NOTIFY情報のメモリ解放
+			for(i3=0;i3<pItemEventInfo[i].EventNum;i3++)
+				HeapDefaultFree(pItemEventInfo[i].pEventNames[i3]);
+			HeapDefaultFree(pItemEventInfo[i].IdName);
+			HeapDefaultFree(pItemEventInfo[i].pEventNames);
+		}
+	}
+}
+
+void GetItemClassName(char *buffer,int Control){
+	switch(Control){
+		case CT_BUTTON:
+		case CT_CHECKBOX:
+		case CT_GROUPBOX:
+		case CT_RADIOBUTTON:
+			lstrcpy(buffer,"BUTTON");
+			break;
+		case CT_COMBOBOX:
+			lstrcpy(buffer,"COMBOBOX");
+			break;
+		case CT_EDIT:
+			lstrcpy(buffer,"EDIT");
+			break;
+		case CT_HSCROLLBAR:
+		case CT_VSCROLLBAR:
+			lstrcpy(buffer,"SCROLLBAR");
+			break;
+		case CT_LISTBOX:
+			lstrcpy(buffer,"LISTBOX");
+			break;
+		case CT_LISTVIEW:
+			lstrcpy(buffer,"SysListView32");
+			break;
+		case CT_IMAGEBOX:
+		case CT_STATIC:
+			lstrcpy(buffer,"STATIC");
+			break;
+		case CT_PROGRESSBAR:
+			lstrcpy(buffer,"msctls_progress32");
+			break;
+		case CT_TRACKBAR:
+			lstrcpy(buffer,"msctls_trackbar32");
+			break;
+		case CT_TREEVIEW:
+			lstrcpy(buffer,"SysTreeView32");
+			break;
+		//CT_UPDOWNはCreateUpDownControl関数で独自に作成される
+	}
+}
+long GetCommandByMessage(int WndInfoNum,const char *MessageName,BOOL bProcedureCall,char *Command,char *spaces){
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,sw;
+	char temporary[MAX_PATH],*temp2;
+	WINDOW_INFO *pWindowInfo;
+
+	pWindowInfo=&ProjectInfo.pWindowInfo[WndInfoNum];
+
+	Command[0]=0;
+
+
+	/////////////////////
+	// Default コマンド
+
+	if(lstrcmp(MessageName,"Activate")==0){
+		sprintf(Command,"%sCase WM_ACTIVATE\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(LOWORD(wParam),HIWORD(wParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"Create")==0){
+		if(pWindowInfo->type==WNDTYPE_MODALDLG||pWindowInfo->type==WNDTYPE_MODELESSDLG)
+			sprintf(Command,"%sCase WM_INITDIALOG\r\n",spaces);
+		else sprintf(Command,"%sCase WM_CREATE\r\n",spaces);
+		i=lstrlen(Command);
+
+		sprintf(Command+i,"%s\t%s=hWnd\r\n",spaces,pWindowInfo->HandleName);
+		i+=lstrlen(Command+i);
+
+		if(pWindowInfo->MenuID){
+			//メニュー作成
+			for(i2=0;i2<ProjectInfo.NumberOfMenu;i2++){
+				if(lstrcmpi(ProjectInfo.pMenuInfo[i2].IdName,pWindowInfo->MenuID)==0) break;
+			}
+			if(i2!=ProjectInfo.NumberOfMenu){
+				sprintf(Command+i,"%s\tSetMenu(hWnd,hMenu_%s)\r\n",spaces,ProjectInfo.pMenuInfo[i2].IdName);
+				i+=lstrlen(Command+i);
+			}
+		}
+
+		//子ウィンドウ作成
+		for(i2=0,sw=0;i2<pWindowInfo->NumberOfChildWindows;i2++){
+			if(pWindowInfo->pChildInfo[i2].Control==CT_UPDOWN){
+				sprintf(Command+i,"%s\tCreateUpDownControl(%d,%d,%d,%d,%d,hWnd,%s,GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,0,0,100,0)\r\n",
+					spaces,
+					pWindowInfo->pChildInfo[i2].style,
+					pWindowInfo->pChildInfo[i2].pos.x,pWindowInfo->pChildInfo[i2].pos.y,
+					pWindowInfo->pChildInfo[i2].size.cx,pWindowInfo->pChildInfo[i2].size.cy,
+					pWindowInfo->pChildInfo[i2].IdName);
+				i+=lstrlen(Command+i);
+			}
+			else{
+				GetItemClassName(temporary,pWindowInfo->pChildInfo[i2].Control);
+				temp2=FormatCaption(pWindowInfo->pChildInfo[i2].caption);
+				sprintf(Command+i,"%s\tCreateWindowEx(&H%08x,\"%s\",\"%s\",&H%08x,%d,%d,%d,%d,hWnd,%s As HMENU,GetModuleHandle(0),0)\r\n",
+					spaces,
+					pWindowInfo->pChildInfo[i2].ExStyle,
+					temporary,
+					temp2,
+					pWindowInfo->pChildInfo[i2].style,
+					pWindowInfo->pChildInfo[i2].pos.x,
+					pWindowInfo->pChildInfo[i2].pos.y,
+					pWindowInfo->pChildInfo[i2].size.cx,
+					pWindowInfo->pChildInfo[i2].size.cy,
+					pWindowInfo->pChildInfo[i2].IdName);
+				i+=lstrlen(Command+i);
+				HeapDefaultFree(temp2);
+				sprintf(Command+i,"%s\tSendMessage(GetDlgItem(hWnd,%s),WM_SETFONT,hFont_%s As WPARAM,0)\r\n",
+					spaces,
+					pWindowInfo->pChildInfo[i2].IdName,
+					pWindowInfo->name);
+				i+=lstrlen(Command+i);
+
+				if(pWindowInfo->pChildInfo[i2].Control==CT_IMAGEBOX){
+					//イメージ ボックスの場合
+					if((pWindowInfo->pChildInfo[i2].style&0x000F)==SS_ICON){
+						if(pWindowInfo->pChildInfo[i2].ImageCtrlInfo.type==IMGTYPE_FILE){
+							if(strstr(pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path,":")||
+								strstr(pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path,"\\\\")){
+								sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,\"%s\",IMAGE_ICON,0,0,LR_DEFAULTSIZE or LR_LOADFROMFILE)\r\n",
+									spaces,
+									pWindowInfo->name,
+									pWindowInfo->pChildInfo[i2].IdName,
+									pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path);
+							}
+							else{
+								if(sw==0){
+									sw=1;
+									lstrcpy(Command+i,"\r\n");
+									i+=2;
+									sprintf(Command+i,"%s\tDim ImageFilePath[MAX_PATH] As Byte\r\n",spaces);
+									i+=lstrlen(Command+i);
+									sprintf(Command+i,"%s\tDim ModulePath[MAX_PATH] As Byte, i As Long\r\n",spaces);
+									i+=lstrlen(Command+i);
+									sprintf(Command+i,"%s\tGetModuleFileName(GetModuleHandle(0),ModulePath,MAX_PATH)\r\n",spaces);
+									i+=lstrlen(Command+i);
+									sprintf(Command+i,"%s\tFor i=lstrlen(ModulePath)-1 To 0 Step -1\r\n",spaces);
+									i+=lstrlen(Command+i);
+									sprintf(Command+i,"%s\t\tIf ModulePath[i]=&H5C Then Exit For\r\n",spaces);
+									i+=lstrlen(Command+i);
+									sprintf(Command+i,"%s\tNext\r\n",spaces);
+									i+=lstrlen(Command+i);
+									sprintf(Command+i,"%s\tModulePath[i+1]=0\r\n",spaces);
+									i+=lstrlen(Command+i);
+									lstrcpy(Command+i,"\r\n");
+									i+=2;
+								}
+								sprintf(Command+i,"%s\twsprintf(ImageFilePath,\"%%s%s\",ModulePath)\r\n",spaces,pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path);
+								i+=lstrlen(Command+i);
+								sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,ImageFilePath,IMAGE_ICON,0,0,LR_DEFAULTSIZE or LR_LOADFROMFILE)\r\n",
+									spaces,
+									pWindowInfo->name,
+									pWindowInfo->pChildInfo[i2].IdName);
+							}
+							i+=lstrlen(Command+i);
+						}
+						else if(pWindowInfo->pChildInfo[i2].ImageCtrlInfo.type==IMGTYPE_RES){
+							sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,%s As *Byte,IMAGE_ICON,0,0,LR_DEFAULTSIZE)\r\n",
+								spaces,
+								pWindowInfo->name,
+								pWindowInfo->pChildInfo[i2].IdName,
+								pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path);
+							i+=lstrlen(Command+i);
+						}
+						sprintf(Command+i,"%s\tSendMessage(GetDlgItem(hWnd,%s),STM_SETICON,hImage_%s_%s As WPARAM,0)\r\n",
+							spaces,
+							pWindowInfo->pChildInfo[i2].IdName,
+							pWindowInfo->name,
+							pWindowInfo->pChildInfo[i2].IdName);
+						i+=lstrlen(Command+i);
+					}
+					else if((pWindowInfo->pChildInfo[i2].style&0x000F)==SS_BITMAP){
+						if(pWindowInfo->pChildInfo[i2].ImageCtrlInfo.type==IMGTYPE_FILE){
+							if(strstr(pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path,":")||
+								strstr(pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path,"\\\\")){
+								sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,\"%s\",IMAGE_BITMAP,0,0,LR_DEFAULTSIZE or LR_LOADFROMFILE)\r\n",
+									spaces,
+									pWindowInfo->name,
+									pWindowInfo->pChildInfo[i2].IdName,
+									pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path);
+							}
+							else{
+								if(sw==0){
+									sw=1;
+									lstrcpy(Command+i,"\r\n");
+									i+=2;
+									sprintf(Command+i,"%s\tDim ImageFilePath[MAX_PATH] As Byte\r\n",spaces);
+									i+=lstrlen(Command+i);
+									sprintf(Command+i,"%s\tDim ModulePath[MAX_PATH] As Byte, i As Long\r\n",spaces);
+									i+=lstrlen(Command+i);
+									sprintf(Command+i,"%s\tGetModuleFileName(GetModuleHandle(0),ModulePath,MAX_PATH)\r\n",spaces);
+									i+=lstrlen(Command+i);
+									sprintf(Command+i,"%s\tFor i=lstrlen(ModulePath)-1 To 0 Step -1\r\n",spaces);
+									i+=lstrlen(Command+i);
+									sprintf(Command+i,"%s\t\tIf ModulePath[i]=&H5C Then Exit For\r\n",spaces);
+									i+=lstrlen(Command+i);
+									sprintf(Command+i,"%s\tNext\r\n",spaces);
+									i+=lstrlen(Command+i);
+									sprintf(Command+i,"%s\tModulePath[i+1]=0\r\n",spaces);
+									i+=lstrlen(Command+i);
+									lstrcpy(Command+i,"\r\n");
+									i+=2;
+								}
+								sprintf(Command+i,"%s\twsprintf(ImageFilePath,\"%%s%s\",ModulePath)\r\n",spaces,pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path);
+								i+=lstrlen(Command+i);
+								sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,ImageFilePath,IMAGE_BITMAP,0,0,LR_LOADFROMFILE)\r\n",
+									spaces,
+									pWindowInfo->name,
+									pWindowInfo->pChildInfo[i2].IdName);
+							}
+							i+=lstrlen(Command+i);
+						}
+						else if(pWindowInfo->pChildInfo[i2].ImageCtrlInfo.type==IMGTYPE_RES){
+							sprintf(Command+i,"%s\thImage_%s_%s=LoadImage(GetWindowLongPtr(hWnd,GWLP_HINSTANCE) As HINSTANCE,%s As *Byte,IMAGE_BITMAP,0,0,LR_DEFAULTSIZE)\r\n",
+								spaces,
+								pWindowInfo->name,
+								pWindowInfo->pChildInfo[i2].IdName,
+								pWindowInfo->pChildInfo[i2].ImageCtrlInfo.path);
+							i+=lstrlen(Command+i);
+						}
+						sprintf(Command+i,"%s\tSendMessage(GetDlgItem(hWnd,%s),STM_SETIMAGE,IMAGE_BITMAP,hImage_%s_%s As LPARAM)\r\n",
+							spaces,
+							pWindowInfo->pChildInfo[i2].IdName,
+							pWindowInfo->name,
+							pWindowInfo->pChildInfo[i2].IdName);
+						i+=lstrlen(Command+i);
+					}
+				}
+			}
+		}
+
+		if(bProcedureCall)
+			sprintf(Command+i,"%s\t%s_%s(ByVal (lParam As VoidPtr))\r\n",spaces,pWindowInfo->name,MessageName);
+		return WM_CREATE;
+	}
+	else if(lstrcmp(MessageName,"Destroy")==0){
+		sprintf(Command,"%sCase WM_DESTROY\r\n",spaces);
+		i=lstrlen(Command);
+		if(bProcedureCall){
+			sprintf(Command+i,"%s\t%s_%s()\r\n",spaces,pWindowInfo->name,MessageName);
+			i+=lstrlen(Command+i);
+		}
+
+		if(pWindowInfo->MenuID){
+			//メニューを解放
+			for(i2=0;i2<ProjectInfo.NumberOfMenu;i2++){
+				if(lstrcmpi(ProjectInfo.pMenuInfo[i2].IdName,pWindowInfo->MenuID)==0) break;
+			}
+			if(i2!=ProjectInfo.NumberOfMenu){
+				sprintf(Command+i,"%s\tSetMenu(hWnd,NULL)\r\n",spaces);
+				i+=lstrlen(Command+i);
+			}
+		}
+
+		//イメージ ボックス用の変数を解放
+		for(i2=0;i2<pWindowInfo->NumberOfChildWindows;i2++){
+			if(pWindowInfo->pChildInfo[i2].Control==CT_IMAGEBOX){
+				if((pWindowInfo->pChildInfo[i2].style&0x000F)==SS_ICON)
+					sprintf(Command+i,"%s\tDestroyIcon(hImage_%s_%s)\r\n",spaces,pWindowInfo->name,pWindowInfo->pChildInfo[i2].IdName);
+				else if((pWindowInfo->pChildInfo[i2].style&0x000F)==SS_BITMAP)
+					sprintf(Command+i,"%s\tDeleteObject(hImage_%s_%s)\r\n",spaces,pWindowInfo->name,pWindowInfo->pChildInfo[i2].IdName);
+				i+=lstrlen(Command+i);
+			}
+		}
+		return WM_DESTROY;
+	}
+	else if(lstrcmp(MessageName,"DropFiles")==0){
+		sprintf(Command,"%sCase WM_DROPFILES\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As HDROP)\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"HScroll")==0){
+		sprintf(Command,"%sCase WM_HSCROLL\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(LOWORD(wParam),HIWORD(wParam),lParam As HWND)\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"KeyDown")==0){
+		sprintf(Command,"%sCase WM_KEYDOWN\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,lParam As Long)\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"KeyPress")==0){
+		sprintf(Command,"%sCase WM_CHAR\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,lParam As Long)\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"KeyUp")==0){
+		sprintf(Command,"%sCase WM_KEYUP\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,lParam As Long)\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"LButtonDown")==0){
+		sprintf(Command,"%sCase WM_LBUTTONDOWN\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,LOWORD(lParam),HIWORD(lParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"LButtonDblClick")==0){
+		sprintf(Command,"%sCase WM_LBUTTONDBLCLK\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,LOWORD(lParam),HIWORD(lParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"LButtonUp")==0){
+		sprintf(Command,"%sCase WM_LBUTTONUP\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,LOWORD(lParam),HIWORD(lParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"MButtonDown")==0){
+		sprintf(Command,"%sCase WM_MBUTTONDOWN\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,LOWORD(lParam),HIWORD(lParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"MButtonDblClick")==0){
+		sprintf(Command,"%sCase WM_MBUTTONDBLCLK\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,LOWORD(lParam),HIWORD(lParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"MButtonUp")==0){
+		sprintf(Command,"%sCase WM_MBUTTONUP\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,LOWORD(lParam),HIWORD(lParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"MouseMove")==0){
+		sprintf(Command,"%sCase WM_MOUSEMOVE\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,LOWORD(lParam),HIWORD(lParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"Move")==0){
+		sprintf(Command,"%sCase WM_MOVE\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(LOWORD(lParam),HIWORD(lParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"Notify")==0){
+		//コモンコントロールメッセージと共に挿入
+		return WM_NOTIFY;
+	}
+	else if(lstrcmp(MessageName,"Paint")==0){
+		sprintf(Command,"%sCase WM_PAINT\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\tDim ps As PAINTSTRUCT\r\n",spaces);
+		i+=lstrlen(Command+i);
+		sprintf(Command+i,"%s\tDim hDC As HDC\r\n",spaces);
+		i+=lstrlen(Command+i);
+		sprintf(Command+i,"%s\thDC=BeginPaint(hWnd,ps)\r\n",spaces);
+		i+=lstrlen(Command+i);
+		sprintf(Command+i,"%s\t%s_%s(hDC)\r\n",spaces,pWindowInfo->name,MessageName);
+		i+=lstrlen(Command+i);
+		sprintf(Command+i,"%s\tEndPaint(hWnd,ps)\r\n",spaces);
+		return WM_PAINT;
+	}
+	else if(lstrcmp(MessageName,"QueryClose")==0){
+		sprintf(Command,"%sCase WM_CLOSE\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\tDim cancel=0 As Integer\r\n",spaces);
+		i+=lstrlen(Command+i);
+		if(bProcedureCall){
+			sprintf(Command+i,"%s\t%s_%s(cancel)\r\n",spaces,pWindowInfo->name,MessageName);
+			i+=lstrlen(Command+i);
+		}
+		if(pWindowInfo->type==WNDTYPE_MODALDLG)
+			sprintf(Command+i,"%s\tIf cancel=0 Then EndDialog(hWnd,0)\r\n",spaces);
+		else
+			sprintf(Command+i,"%s\tIf cancel=0 Then DestroyWindow(hWnd)\r\n",spaces);
+		return WM_CLOSE;
+	}
+	else if(lstrcmp(MessageName,"RButtonDblClick")==0){
+		sprintf(Command,"%sCase WM_RBUTTONDBLCLK\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,LOWORD(lParam),HIWORD(lParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"RButtonDown")==0){
+		sprintf(Command,"%sCase WM_RBUTTONDOWN\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,LOWORD(lParam),HIWORD(lParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"RButtonUp")==0){
+		sprintf(Command,"%sCase WM_RBUTTONUP\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,LOWORD(lParam),HIWORD(lParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"Resize")==0){
+		sprintf(Command,"%sCase WM_SIZE\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As Long,LOWORD(lParam),HIWORD(lParam))\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"SetFocus")==0){
+		sprintf(Command,"%sCase WM_SETFOCUS\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s()\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"Timer")==0){
+		sprintf(Command,"%sCase WM_TIMER\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam As DWord)\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	else if(lstrcmp(MessageName,"VScroll")==0){
+		sprintf(Command,"%sCase WM_VSCROLL\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(LOWORD(wParam),HIWORD(wParam),lParam As HWND)\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+
+
+	///////////////////
+	// MMSYS コマンド
+
+	else if(lstrcmp(MessageName,"MciNotify")==0){
+		sprintf(Command,"%sCase MM_MCINOTIFY\r\n",spaces);
+		i=lstrlen(Command);
+		sprintf(Command+i,"%s\t%s_%s(wParam,lParam)\r\n",spaces,pWindowInfo->name,MessageName);
+	}
+	return 0;
+}
+
+char **GetMenuItemConstData(MENU_INFO *pMenuInfo,int NumberOfMenu,int *ConstNumber,char **ppNames,int *NamesNum,char *buffer,int *base){
+	extern HANDLE hHeap;
+	int i,i2,sw1;
+
+	for(i=0;i<NumberOfMenu;i++){
+		if(pMenuInfo[i].pMenuInfo){
+			//ポップアップ
+			ppNames=GetMenuItemConstData(pMenuInfo[i].pMenuInfo,pMenuInfo[i].NumberOfMenu,ConstNumber,ppNames,NamesNum,buffer,base);
+		}
+		else if(pMenuInfo[i].type==MFT_STRING){
+			//重複チェック
+			for(i2=0,sw1=0;i2<*NamesNum;i2++){
+				if(lstrcmpi(ppNames[i2],pMenuInfo[i].IdName)==0){
+					sw1=1;
+					break;
+				}
+			}
+			if(sw1==0){
+				ppNames=(char **)HeapReAlloc(hHeap,0,ppNames,sizeof(char *)*((*NamesNum)+1));
+				ppNames[*NamesNum]=pMenuInfo[i].IdName;
+				(*NamesNum)++;
+
+				sprintf(buffer+(*base),"Const %s=%d\r\n",pMenuInfo[i].IdName,*ConstNumber);
+				(*base)+=lstrlen(buffer+(*base));
+				(*ConstNumber)++;
+			}
+		}
+	}
+	return ppNames;
+}
+int GetMakeMenuCommand(MENU_INFO *pMenuInfo,int NumberOfMenu,char *MenuHandle,char *Command,BOOL bMain){
+	int i,i2;
+	char temporary[MAX_PATH];
+
+	i=0;
+	sprintf(Command+i,"Dim %s As HMENU\r\n",MenuHandle);
+	i+=lstrlen(Command+i);
+	if(bMain) sprintf(Command+i,"%s=CreateMenu()\r\n",MenuHandle);
+	else sprintf(Command+i,"%s=CreatePopupMenu()\r\n",MenuHandle);
+	i+=lstrlen(Command+i);
+
+	for(i2=NumberOfMenu-1;i2>=0;i2--){
+		if(pMenuInfo[i2].pMenuInfo){
+			sprintf(temporary,"%s_%d",MenuHandle,i2);
+			i+=GetMakeMenuCommand(pMenuInfo[i2].pMenuInfo,pMenuInfo[i2].NumberOfMenu,temporary,Command+i,0);
+			sprintf(Command+i,"InsMenu %s,0,MF_BYPOSITION,Ex\"%s\",0,%s,%d\r\n",
+				MenuHandle,
+				pMenuInfo[i2].caption,
+				temporary,
+				pMenuInfo[i2].state);
+			i+=lstrlen(Command+i);
+		}
+		else{
+			if(pMenuInfo[i2].type==MFT_STRING){
+				sprintf(Command+i,"InsMenu %s,0,MF_BYPOSITION,Ex\"%s\",%s,0,%d\r\n",
+					MenuHandle,
+					pMenuInfo[i2].caption,
+					pMenuInfo[i2].IdName,
+					pMenuInfo[i2].state);
+				i+=lstrlen(Command+i);
+			}
+			else if(pMenuInfo[i2].type==MFT_SEPARATOR){
+				sprintf(Command+i,"InsMenu %s,0,MF_BYPOSITION,\"\"\r\n",
+					MenuHandle);
+				i+=lstrlen(Command+i);
+			}
+		}
+	}
+	return i;
+}
+int GetDestroyMenuCommand(MENU_INFO *pMenuInfo,int NumberOfMenu,char *MenuHandle,char *Command){
+	int i,i2;
+	char temporary[MAX_PATH];
+
+	i=0;
+	sprintf(Command+i,"\tDestroyMenu(%s)\r\n",MenuHandle);
+	i+=lstrlen(Command+i);
+
+	for(i2=NumberOfMenu-1;i2>=0;i2--){
+		if(pMenuInfo[i2].pMenuInfo){
+			sprintf(temporary,"%s_%d",MenuHandle,i2);
+			i+=GetDestroyMenuCommand(pMenuInfo[i2].pMenuInfo,pMenuInfo[i2].NumberOfMenu,temporary,Command+i);
+		}
+	}
+	return i;
+}
+void SaveWindowProgram(){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3,i4,i5,i6,sw1,sw2,sw3,sw4,size;
+	char *buffer,**ppNames,temporary[MAX_PATH];
+	WINDOW_INFO *pWindowInfo;
+
+	pWindowInfo=ProjectInfo.pWindowInfo;
+
+	size=2;
+	buffer=(char *)HeapAlloc(hHeap,0,65535*size);
+	lstrcpy(buffer,"'このファイルはウィンドウ定義ファイル（*.wnd）をもとに生成されています\r\n\r\n");
+	i2=lstrlen(buffer);
+
+	if(ProjectInfo.dwOption&PJ_OP_COMMCTRL){
+		//コマンコントロールを初期化
+		lstrcpy(buffer+i2,"Dim _RadSys_InitCtrls As INITCOMMONCONTROLSEX\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"_RadSys_InitCtrls.dwSize=Len(_RadSys_InitCtrls)\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"_RadSys_InitCtrls.dwICC=ICC_WIN95_CLASSES\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"InitCommonControlsEx(_RadSys_InitCtrls)\r\n\r\n");
+		i2+=lstrlen(buffer+i2);
+	}
+
+
+	////////////
+	//IDを定義
+
+	ppNames=(char **)HeapAlloc(hHeap,0,1);
+	for(i=0,i4=1000,i5=0;i<ProjectInfo.NumberOfWindows;i++){
+		for(i3=0;i3<pWindowInfo[i].NumberOfChildWindows;i3++){
+
+			//重複チェック
+			for(i6=0,sw1=0;i6<i5;i6++){
+				if(lstrcmpi(ppNames[i6],pWindowInfo[i].pChildInfo[i3].IdName)==0){
+					sw1=1;
+					break;
+				}
+			}
+			if(sw1) continue;
+
+			ppNames=(char **)HeapReAlloc(hHeap,0,ppNames,sizeof(char *)*(i5+1));
+			ppNames[i5]=pWindowInfo[i].pChildInfo[i3].IdName;
+			i5++;
+
+			sprintf(buffer+i2,"Const %s=%d\r\n",pWindowInfo[i].pChildInfo[i3].IdName,i4);
+			i2+=lstrlen(buffer+i2);
+			i4++;
+
+			while(i2>65535*(size-1)){
+				size++;
+				buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size);
+			}
+		}
+	}
+
+	//メニューのIDを定義
+	ppNames=GetMenuItemConstData(ProjectInfo.pMenuInfo,ProjectInfo.NumberOfMenu,&i4,ppNames,&i5,buffer,&i2);
+
+	HeapDefaultFree(ppNames);
+	lstrcpy(buffer+i2,"\r\n");
+	i2+=lstrlen(buffer+i2);
+
+
+	//ハンドル変数を定義
+	for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+		sprintf(buffer+i2,"Dim %s As HWND\r\n",pWindowInfo[i].HandleName);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"Dim hFont_%s As HFONT\r\n",pWindowInfo[i].name);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"hFont_%s=CreateFont(%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\"%s\")\r\n",
+			pWindowInfo[i].name,
+			pWindowInfo[i].LogFont.lfHeight,
+			pWindowInfo[i].LogFont.lfWidth,
+			pWindowInfo[i].LogFont.lfEscapement,
+			pWindowInfo[i].LogFont.lfOrientation,
+			pWindowInfo[i].LogFont.lfWeight,
+			pWindowInfo[i].LogFont.lfItalic,
+			pWindowInfo[i].LogFont.lfUnderline,
+			pWindowInfo[i].LogFont.lfStrikeOut,
+			pWindowInfo[i].LogFont.lfCharSet,
+			pWindowInfo[i].LogFont.lfOutPrecision,
+			pWindowInfo[i].LogFont.lfClipPrecision,
+			pWindowInfo[i].LogFont.lfQuality,
+			pWindowInfo[i].LogFont.lfPitchAndFamily,
+			pWindowInfo[i].LogFont.lfFaceName);
+		i2+=lstrlen(buffer+i2);
+
+		while(i2>65535*(size-1)){
+			size++;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size);
+		}
+	}
+
+	//背景に使用するブラシを定義
+	lstrcpy(buffer+i2,"Dim h3DFaceBrush As HBRUSH\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"h3DFaceBrush=CreateSolidBrush(GetSysColor(COLOR_3DFACE))\r\n");
+	i2+=lstrlen(buffer+i2);
+	for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+		if(pWindowInfo[i].bgColor<=0&&
+			pWindowInfo[i].bgColor!=-(int)RGB(255,255,255)&&
+			pWindowInfo[i].bgColor!=-(int)RGB(0,0,0)){
+				sprintf(buffer+i2,"Dim _RadSys_hBackBrush%d As HBRUSH\r\n",i);
+				i2+=lstrlen(buffer+i2);
+				sprintf(buffer+i2,"_RadSys_hBackBrush%d=CreateSolidBrush(%d)\r\n",i,-pWindowInfo[i].bgColor);
+				i2+=lstrlen(buffer+i2);
+		}
+		if(pWindowInfo[i].bgColor>=0x1000){
+				sprintf(buffer+i2,"Dim _RadSys_hBackBrush%d As HBRUSH\r\n",i);
+				i2+=lstrlen(buffer+i2);
+				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[i].bgColor-0x1000].IdName);
+				i2+=lstrlen(buffer+i2);
+		}
+	}
+
+	lstrcpy(buffer+i2,"\r\n");
+	i2+=lstrlen(buffer+i2);
+
+	//イメージ ボックス用の変数を定義
+	for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+		for(i3=0;i3<pWindowInfo[i].NumberOfChildWindows;i3++){
+			if(pWindowInfo[i].pChildInfo[i3].Control==CT_IMAGEBOX){
+				if((pWindowInfo[i].pChildInfo[i3].style&0x000F)==SS_ICON||
+					(pWindowInfo[i].pChildInfo[i3].style&0x000F)==SS_BITMAP){
+					sprintf(buffer+i2,"Dim hImage_%s_%s As HANDLE\r\n",pWindowInfo[i].name,pWindowInfo[i].pChildInfo[i3].IdName);
+					i2+=lstrlen(buffer+i2);
+
+					while(i2>65535*(size-1)){
+						size++;
+						buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size);
+					}
+				}
+			}
+		}
+	}
+
+	lstrcpy(buffer+i2,"\r\n");
+	i2+=lstrlen(buffer+i2);
+
+	//メニュー作成
+	for(i=0;i<ProjectInfo.NumberOfMenu;i++){
+		sprintf(temporary,"hMenu_%s",ProjectInfo.pMenuInfo[i].IdName);
+
+		//InsertMenuItem郡
+		i2+=GetMakeMenuCommand(ProjectInfo.pMenuInfo[i].pMenuInfo,ProjectInfo.pMenuInfo[i].NumberOfMenu,temporary,buffer+i2,1);
+
+		lstrcpy(buffer+i2,"\r\n");
+		i2+=lstrlen(buffer+i2);
+
+		while(i2>65535*(size-1)){
+			size++;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size);
+		}
+	}
+
+
+	//////////////////////////
+	//オブジェクトの解放処理
+	sprintf(buffer+i2,"Sub %s_DestroyObjects()\r\n",ProjectInfo.name);
+	i2+=lstrlen(buffer+i2);
+
+	//メニュー解放
+	for(i=0;i<ProjectInfo.NumberOfMenu;i++){
+		sprintf(temporary,"hMenu_%s",ProjectInfo.pMenuInfo[i].IdName);
+		i2+=GetDestroyMenuCommand(ProjectInfo.pMenuInfo[i].pMenuInfo,ProjectInfo.pMenuInfo[i].NumberOfMenu,temporary,buffer+i2);
+
+		while(i2>65535*(size-1)){
+			size++;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size);
+		}
+	}
+
+	for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+		//フォントハンドル解放
+		sprintf(buffer+i2,"\tDeleteObject(hFont_%s)\r\n",ProjectInfo.pWindowInfo[i].name);
+		i2+=lstrlen(buffer+i2);
+
+		while(i2>65535*(size-1)){
+			size++;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size);
+		}
+	}
+
+	//背景ブラシを解放
+	lstrcpy(buffer+i2,"\tDeleteObject(h3DFaceBrush)\r\n");
+	i2+=lstrlen(buffer+i2);
+	for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+		if(pWindowInfo[i].bgColor<=0&&
+			pWindowInfo[i].bgColor!=-(int)RGB(255,255,255)&&
+			pWindowInfo[i].bgColor!=-(int)RGB(0,0,0)){
+				sprintf(buffer+i2,"\tDeleteObject(_RadSys_hBackBrush%d)\r\n",i);
+				i2+=lstrlen(buffer+i2);
+		}
+	}
+
+	sprintf(buffer+i2,"End Sub\r\n\r\n");
+	i2+=lstrlen(buffer+i2);
+
+	//ユーザー定義のコールバック関数が存在するかどうか
+	BOOL bAvailUserProc[MAX_WNDNUM];
+
+
+	for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+		if(i!=0){
+			lstrcpy(buffer+i2,"\r\n");
+			i2+=lstrlen(buffer+i2);
+		}
+
+		//////////////////////////
+		//コールバック関数を生成
+
+		//処理メッセージを抽出
+		ITEMEVENTINFO *pItemEventInfo;
+		ppNames=GetProcedureNamesOfMessageCall(i,&pItemEventInfo,&i3,&bAvailUserProc[i]);
+
+		sprintf(buffer+i2,"Function EventCall_%s(hWnd As HWND, message As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT\r\n",pWindowInfo[i].name);
+		i2+=lstrlen(buffer+i2);
+
+		lstrcpy(buffer+i2,"\tSelect Case message\r\n");
+		i2+=lstrlen(buffer+i2);
+
+		//通常メッセージ郡
+		for(i4=0,sw1=0,sw2=0,sw3=0,sw4=0;i4<i3;i4++){
+			i5=GetCommandByMessage(i,ppNames[i4],1,buffer+i2,"\t\t");
+			i2+=lstrlen(buffer+i2);
+			if(i5==WM_CREATE) sw1=1;
+			else if(i5==WM_DESTROY) sw2=1;
+			else if(i5==WM_CLOSE) sw3=1;
+			else if(i5==WM_NOTIFY) sw4=1;
+			HeapDefaultFree(ppNames[i4]);
+		}
+		HeapDefaultFree(ppNames);
+
+		//WM_CREATE、WM_DESTROY、WM_PAINTが呼び出されていない場合
+		if(!sw1){
+			GetCommandByMessage(i,"Create",0,buffer+i2,"\t\t");
+			i2+=lstrlen(buffer+i2);
+		}
+		if(!sw2){
+			GetCommandByMessage(i,"Destroy",0,buffer+i2,"\t\t");
+			i2+=lstrlen(buffer+i2);
+		}
+		if(!sw3){
+			GetCommandByMessage(i,"QueryClose",0,buffer+i2,"\t\t");
+			i2+=lstrlen(buffer+i2);
+		}
+
+		//アイテムメッセージ郡（WM_NOTIFY）
+		if(pItemEventInfo[0].IdName){
+			i3=i2;
+			lstrcpy(buffer+i2,"\t\tCase WM_NOTIFY\r\n");
+			i2+=lstrlen(buffer+i2);
+			if(sw4){
+				sprintf(buffer+i2,"\t\t\t%s_Notify(ByVal (lParam As *NMHDR))\r\n",pWindowInfo[i].name);
+				i2+=lstrlen(buffer+i2);
+			}
+			lstrcpy(buffer+i2,"\t\t\tDim pnmHdr As *NMHDR\r\n");
+			i2+=lstrlen(buffer+i2);
+			lstrcpy(buffer+i2,"\t\t\tpnmHdr=lParam As *NMHDR\r\n");
+			i2+=lstrlen(buffer+i2);
+			lstrcpy(buffer+i2,"\t\t\tSelect Case LOWORD(wParam)\r\n");
+			i2+=lstrlen(buffer+i2);
+
+			if(GetNotifyCommandByItemMessage(&pWindowInfo[i],pItemEventInfo,buffer+i2,"\t\t\t\t")){
+				i2+=lstrlen(buffer+i2);
+
+				lstrcpy(buffer+i2,"\t\t\tEnd Select\r\n");
+				i2+=lstrlen(buffer+i2);
+			}
+			else{
+				//WM_NOTIFYを削除
+				i2=i3;
+				if(sw4) goto DefaultNotifyEvent;
+			}
+		}
+		else if(sw4){
+DefaultNotifyEvent:
+			lstrcpy(buffer+i2,"\t\tCase WM_NOTIFY\r\n");
+			i2+=lstrlen(buffer+i2);
+			sprintf(buffer+i2,"\t\t\t%s_Notify(ByVal (lParam As *NMHDR))\r\n",pWindowInfo[i].name);
+			i2+=lstrlen(buffer+i2);
+		}
+
+		//アイテムメッセージ郡（WM_COMMAND）
+		if(pItemEventInfo[0].IdName){
+			lstrcpy(buffer+i2,"\t\tCase WM_COMMAND\r\n");
+			i2+=lstrlen(buffer+i2);
+			lstrcpy(buffer+i2,"\t\t\tSelect Case LOWORD(wParam)\r\n");
+			i2+=lstrlen(buffer+i2);
+
+			//pItemEventInfoのIdName、EventNameメンバのメモリ解放はこの関数内で行う
+			GetCommandByItemMessage(&pWindowInfo[i],pItemEventInfo,buffer+i2,"\t\t\t\t");
+			i2+=lstrlen(buffer+i2);
+
+			lstrcpy(buffer+i2,"\t\t\tEnd Select\r\n");
+			i2+=lstrlen(buffer+i2);
+		}
+		HeapDefaultFree(pItemEventInfo);
+
+		// DefWindowProc関数
+		lstrcpy(buffer+i2,"\t\tCase Else\r\n");
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"\t\t\tEventCall_%s=DefWindowProc(hWnd,message,wParam,lParam)\r\n",pWindowInfo[i].name);
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\t\t\tExit Function\r\n");
+		i2+=lstrlen(buffer+i2);
+
+		lstrcpy(buffer+i2,"\tEnd Select\r\n");
+		i2+=lstrlen(buffer+i2);
+
+		sprintf(buffer+i2,"\tEventCall_%s=0\r\n",pWindowInfo[i].name);
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"End Function\r\n");
+		i2+=lstrlen(buffer+i2);
+
+		while(i2>65535*(size-1)){
+			size++;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size);
+		}
+	}
+
+
+	//////////////////////////
+	//ダイアログボックス関連
+
+	//クラス登録
+	lstrcpy(buffer+i2,"\r\nFunction DefaultCallProc(hWnd As HWND, message As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"\tDefaultCallProc=DefWindowProc(hWnd,message,wParam,lParam)\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"End Function\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"\r\nDim _RadSys_dlgwcl As WNDCLASSEX\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"FillMemory(VarPtr(_RadSys_dlgwcl),Len(_RadSys_dlgwcl),0)\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_dlgwcl.cbSize=Len(_RadSys_dlgwcl)\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_dlgwcl.hInstance=GetModuleHandle(0)\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_dlgwcl.style=CS_HREDRAW or CS_VREDRAW or CS_DBLCLKS\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_dlgwcl.hIcon=LoadIcon(NULL,MAKEINTRESOURCE(IDI_APPLICATION))\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_dlgwcl.hIconSm=LoadIcon(NULL,MAKEINTRESOURCE(IDI_WINLOGO))\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_dlgwcl.hCursor=LoadCursor(NULL,MAKEINTRESOURCE(IDC_ARROW))\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_dlgwcl.lpszClassName=\"NORMALDLG\"\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_dlgwcl.hbrBackground=h3DFaceBrush\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_dlgwcl.lpfnWndProc=AddressOf(DefaultCallProc)\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"RegisterClassEx(_RadSys_dlgwcl)\r\n");
+	i2+=lstrlen(buffer+i2);
+
+	//DialogBox関数
+	lstrcpy(buffer+i2,"\r\nFunction DialogBox(hOwnerWnd As HWND, TemplateName As LPSTR) As LONG_PTR\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"\tDim hDlg As HWND\r\n");
+	i2+=lstrlen(buffer+i2);
+	for(i=0,sw1=0;i<ProjectInfo.NumberOfWindows;i++){
+		if(pWindowInfo[i].type==WNDTYPE_MODALDLG){
+			if(sw1==0){
+				sprintf(buffer+i2,"\tIf lstrcmp(TemplateName,\"%s\")=0 Then\r\n",pWindowInfo[i].name);
+				i2+=lstrlen(buffer+i2);
+				sw1=1;
+			}
+			else{
+				sprintf(buffer+i2,"\tElseIf lstrcmp(TemplateName,\"%s\")=0 Then\r\n",pWindowInfo[i].name);
+				i2+=lstrlen(buffer+i2);
+			}
+			sprintf(buffer+i2,"\t\t%s=CreateWindowEx(&H%08x,\"NORMALDLG\",\"%s\",&H%08x,%d,%d,%d,%d,hOwnerWnd,%d As HMENU,GetModuleHandle(0),0)\r\n",
+				pWindowInfo[i].HandleName,
+				pWindowInfo[i].ExStyle,
+				pWindowInfo[i].caption,
+				pWindowInfo[i].style,
+				pWindowInfo[i].pos.x,
+				pWindowInfo[i].pos.y,
+				pWindowInfo[i].size.cx,
+				pWindowInfo[i].size.cy,
+				pWindowInfo[i].id);
+			i2+=lstrlen(buffer+i2);
+			sprintf(buffer+i2,"\t\thDlg=%s\r\n",
+				pWindowInfo[i].HandleName);
+			i2+=lstrlen(buffer+i2);
+			if(bAvailUserProc[i]){
+				sprintf(buffer+i2,"\t\tSetWindowLongPtr(%s,GWLP_WNDPROC,AddressOf(%s) As LONG_PTR)\r\n",
+					pWindowInfo[i].HandleName,
+					pWindowInfo[i].CallBackName);
+			}
+			else{
+				sprintf(buffer+i2,"\t\tSetWindowLongPtr(%s,GWLP_WNDPROC,AddressOf(EventCall_%s) As LONG_PTR)\r\n",
+					pWindowInfo[i].HandleName,
+					pWindowInfo[i].name);
+			}
+			i2+=lstrlen(buffer+i2);
+			sprintf(buffer+i2,"\t\tSendMessage(%s,WM_INITDIALOG,0,0)\r\n",pWindowInfo[i].HandleName);
+			i2+=lstrlen(buffer+i2);
+			if(pWindowInfo[i].IconResName){
+				sprintf(buffer+i2,"\t\tSendMessage(%s,WM_SETICON,ICON_SMALL,LoadIcon(GetModuleHandle(0),MAKEINTRESOURCE(%s)) As LPARAM)\r\n",pWindowInfo[i].HandleName,pWindowInfo[i].IconResName);
+				i2+=lstrlen(buffer+i2);
+			}
+			sprintf(buffer+i2,"\t\tShowWindow(%s,SW_SHOW)\r\n",pWindowInfo[i].HandleName);
+			i2+=lstrlen(buffer+i2);
+		}
+		while(i2>65535*(size-1)){
+			size++;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size);
+		}
+	}
+	if(sw1){
+		lstrcpy(buffer+i2,"\tElse\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\t\tExit Function\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\tEnd If\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\tEnableWindow(hOwnerWnd,0)\r\n\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\tDim msg As MSG, iResult As Long\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\tDo\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\t\tiResult=GetMessage(msg,0,0,0)\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\t\tIf iResult=0 or iResult=-1 Then Exit Do\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\t\tIf IsDialogMessage(hDlg,msg) Then Continue\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\t\tTranslateMessage(msg)\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\t\tDispatchMessage(msg)\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\tLoop\r\n");
+		i2+=lstrlen(buffer+i2);
+		lstrcpy(buffer+i2,"\tDialogBox=msg.wParam\r\n");
+		i2+=lstrlen(buffer+i2);
+	}
+	lstrcpy(buffer+i2,"End Function\r\n");
+	i2+=lstrlen(buffer+i2);
+
+	//EndDialog関数
+	lstrcpy(buffer+i2,"Sub EndDialog(hWnd As HWND, lResult As Long)\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"\tEnableWindow(GetWindow(hWnd,GW_OWNER),1)\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"\tDestroyWindow(hWnd)\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"\tPostMessage(0,WM_QUIT,lResult,0)\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"End Sub\r\n");
+	i2+=lstrlen(buffer+i2);
+
+	//CreateDialog関数
+	lstrcpy(buffer+i2,"\r\nFunction CreateDialog(hOwnerWnd As HWND, TemplateName As LPSTR) As HWND\r\n");
+	i2+=lstrlen(buffer+i2);
+	for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+		if(pWindowInfo[i].type==WNDTYPE_MODELESSDLG){
+			sprintf(buffer+i2,"\tIf lstrcmp(TemplateName,\"%s\")=0 Then\r\n",pWindowInfo[i].name);
+			i2+=lstrlen(buffer+i2);
+
+			sprintf(buffer+i2,"\t\t%s=CreateWindowEx(&H%08x,\"NORMALDLG\",\"%s\",&H%08x,%d,%d,%d,%d,hOwnerWnd,%d As HMENU,GetModuleHandle(0),0)\r\n",
+				pWindowInfo[i].HandleName,
+				pWindowInfo[i].ExStyle,
+				pWindowInfo[i].caption,
+				pWindowInfo[i].style,
+				pWindowInfo[i].pos.x,
+				pWindowInfo[i].pos.y,
+				pWindowInfo[i].size.cx,
+				pWindowInfo[i].size.cy,
+				pWindowInfo[i].id);
+			i2+=lstrlen(buffer+i2);
+			sprintf(buffer+i2,"\t\tCreateDialog=%s\r\n",pWindowInfo[i].HandleName);
+			i2+=lstrlen(buffer+i2);
+			if(bAvailUserProc[i]){
+				sprintf(buffer+i2,"\t\tSetWindowLongPtr(%s,GWLP_WNDPROC,AddressOf(%s) As LONG_PTR)\r\n",
+					pWindowInfo[i].HandleName,
+					pWindowInfo[i].CallBackName);
+			}
+			else{
+				sprintf(buffer+i2,"\t\tSetWindowLongPtr(%s,GWLP_WNDPROC,AddressOf(EventCall_%s) As LONG_PTR)\r\n",
+					pWindowInfo[i].HandleName,
+					pWindowInfo[i].name);
+			}
+			i2+=lstrlen(buffer+i2);
+			sprintf(buffer+i2,"\t\tSendMessage(%s,WM_INITDIALOG,0,0)\r\n",pWindowInfo[i].HandleName);
+			i2+=lstrlen(buffer+i2);
+			if(pWindowInfo[i].IconResName){
+				sprintf(buffer+i2,"\t\tSendMessage(%s,WM_SETICON,ICON_SMALL,LoadIcon(GetModuleHandle(0),MAKEINTRESOURCE(%s)) As LPARAM)\r\n",pWindowInfo[i].HandleName,pWindowInfo[i].IconResName);
+				i2+=lstrlen(buffer+i2);
+			}
+			sprintf(buffer+i2,"\tEnd If\r\n",pWindowInfo[i].name);
+			i2+=lstrlen(buffer+i2);
+		}
+		while(i2>65535*(size-1)){
+			size++;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size);
+		}
+	}
+	lstrcpy(buffer+i2,"End Function\r\n");
+	i2+=lstrlen(buffer+i2);
+
+
+	///////////////////////
+	// 保存（Callback.wbp）
+	sprintf(temporary,"%sCallback.wbp",ProjectInfo.dir);
+	WriteBuffer(temporary,buffer,i2);
+
+
+
+	lstrcpy(buffer,"'このファイルはウィンドウ定義ファイル（*.wnd）をもとに生成されています\r\n\r\n");
+	i2=lstrlen(buffer);
+
+	lstrcpy(buffer+i2,"Dim _RadSys_wcl As WNDCLASSEX\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"FillMemory(VarPtr(_RadSys_wcl),Len(_RadSys_wcl),0)\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_wcl.cbSize=Len(_RadSys_wcl)\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_wcl.hInstance=GetModuleHandle(0)\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_wcl.style=CS_HREDRAW or CS_VREDRAW or CS_DBLCLKS\r\n");
+	i2+=lstrlen(buffer+i2);
+	lstrcpy(buffer+i2,"_RadSys_wcl.hCursor=LoadCursor(NULL,MAKEINTRESOURCE(IDC_ARROW))\r\n");
+	i2+=lstrlen(buffer+i2);
+
+	for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+		if(pWindowInfo[i].type==WNDTYPE_DEFAULT){
+			//////////////////////
+			//通常ウィンドウ作成
+
+			lstrcpy(buffer+i2,"\r\n");
+			i2+=2;
+
+			if(pWindowInfo[i].IconResName==0){
+				lstrcpy(buffer+i2,"_RadSys_wcl.hIcon=LoadIcon(NULL,MAKEINTRESOURCE(IDI_APPLICATION))\r\n");
+				i2+=lstrlen(buffer+i2);
+				lstrcpy(buffer+i2,"_RadSys_wcl.hIconSm=LoadIcon(NULL,MAKEINTRESOURCE(IDI_WINLOGO))\r\n");
+				i2+=lstrlen(buffer+i2);
+			}
+			else{
+				sprintf(buffer+i2,"_RadSys_wcl.hIcon=LoadIcon(_RadSys_wcl.hInstance,MAKEINTRESOURCE(%s))\r\n",pWindowInfo[i].IconResName);
+				i2+=lstrlen(buffer+i2);
+				sprintf(buffer+i2,"_RadSys_wcl.hIconSm=LoadIcon(_RadSys_wcl.hInstance,MAKEINTRESOURCE(%s))\r\n",pWindowInfo[i].IconResName);
+				i2+=lstrlen(buffer+i2);
+			}
+
+			sprintf(buffer+i2,"_RadSys_wcl.lpszClassName=\"NORMAL%d\"\r\n",i);
+			i2+=lstrlen(buffer+i2);
+			if(bAvailUserProc[i])
+				sprintf(buffer+i2,"_RadSys_wcl.lpfnWndProc=AddressOf(%s)\r\n",pWindowInfo[i].CallBackName);
+			else sprintf(buffer+i2,"_RadSys_wcl.lpfnWndProc=AddressOf(EventCall_%s)\r\n",pWindowInfo[i].name);
+			i2+=lstrlen(buffer+i2);
+			if(pWindowInfo[i].bgColor==COLOR_3DFACE)
+				lstrcpy(buffer+i2,"_RadSys_wcl.hbrBackground=h3DFaceBrush\r\n");
+			else if(pWindowInfo[i].bgColor==-(int)RGB(255,255,255))
+				lstrcpy(buffer+i2,"_RadSys_wcl.hbrBackground=GetStockObject(WHITE_BRUSH)\r\n");
+			else if(pWindowInfo[i].bgColor==-(int)RGB(0,0,0))
+				lstrcpy(buffer+i2,"_RadSys_wcl.hbrBackground=GetStockObject(BLACK_BRUSH)\r\n");
+			else if(pWindowInfo[i].bgColor<=0||
+				pWindowInfo[i].bgColor>=0x1000){
+				//色指定またはビットマップ
+				sprintf(buffer+i2,"_RadSys_wcl.hbrBackground=_RadSys_hBackBrush%d\r\n",i);
+			}
+			i2+=lstrlen(buffer+i2);
+			lstrcpy(buffer+i2,"RegisterClassEx(_RadSys_wcl)\r\n");
+			i2+=lstrlen(buffer+i2);
+			sprintf(buffer+i2,"CreateWindowEx(&H%08x,\"%s%d\",\"%s\",&H%08x,%d,%d,%d,%d,0,0,GetModuleHandle(0),0)\r\n",
+				pWindowInfo[i].ExStyle,
+				pWindowInfo[i].ClassName,i,
+				pWindowInfo[i].caption,
+				pWindowInfo[i].style,
+				pWindowInfo[i].pos.x,
+				pWindowInfo[i].pos.y,
+				pWindowInfo[i].size.cx,
+				pWindowInfo[i].size.cy);
+			i2+=lstrlen(buffer+i2);
+		}
+
+		while(i2>65535*(size-1)){
+			size++;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,65535*size);
+		}
+	}
+
+
+	/////////////////////////
+	// 保存（MakeWindow.wbp）
+	sprintf(temporary,"%sMakeWindow.wbp",ProjectInfo.dir);
+	WriteBuffer(temporary,buffer,i2);
+	HeapDefaultFree(buffer);
+}
+int GetSaveMenuData(char *buffer,int SpaceNum,MENU_INFO *pMenuInfo,int ItemNum){
+	int i,i2;
+	char spaces[MAX_PATH];
+
+	memset(spaces,' ',SpaceNum*4);
+	spaces[SpaceNum*4]=0;
+
+	for(i=0,i2=0;i<ItemNum;i++){
+		if(pMenuInfo[i].pMenuInfo){
+			sprintf(buffer+i2,"%sPOPUP     = \"%s\",%d\r\n",spaces,pMenuInfo[i].caption,pMenuInfo[i].state);
+			i2+=lstrlen(buffer+i2);
+			i2+=GetSaveMenuData(buffer+i2,SpaceNum+1,pMenuInfo[i].pMenuInfo,pMenuInfo[i].NumberOfMenu);
+			sprintf(buffer+i2,"%sEND\r\n",spaces);
+			i2+=lstrlen(buffer+i2);
+		}
+		else if(pMenuInfo[i].type==MFT_STRING){
+			sprintf(buffer+i2,"%sITEM      = %s,\"%s\",%d\r\n",spaces,pMenuInfo[i].IdName,pMenuInfo[i].caption,pMenuInfo[i].state);
+			i2+=lstrlen(buffer+i2);
+		}
+		else if(pMenuInfo[i].type==MFT_SEPARATOR){
+			sprintf(buffer+i2,"%sSEPARATOR\r\n",spaces);
+			i2+=lstrlen(buffer+i2);
+		}
+	}
+	return i2;
+}
+void SaveWindowFile(char *path,WINDOW_INFO *pWindowInfo,int NumberOfWindowInfo){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3,size;
+	char *buffer,*temporary;
+
+	size=2;
+	buffer=(char *)HeapAlloc(hHeap,0,GENERAL_SIZE*size);
+	for(i=0,i2=0;i<NumberOfWindowInfo;i++){
+		sprintf(buffer+i2,"WINDOW:%s\r\n",pWindowInfo[i].name);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    HANDLE    = %s\r\n",pWindowInfo[i].HandleName);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    POINT     = %d,%d\r\n",pWindowInfo[i].pos.x,pWindowInfo[i].pos.y);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    SIZE      = %d,%d\r\n",pWindowInfo[i].size.cx,pWindowInfo[i].size.cy);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    CAPTION   = \"%s\"\r\n",pWindowInfo[i].caption);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    STYLE     = &H%08x\r\n",pWindowInfo[i].style);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    EXSTYLE   = &H%08x\r\n",pWindowInfo[i].ExStyle);
+		i2+=lstrlen(buffer+i2);
+		if(pWindowInfo[i].MenuID){
+			sprintf(buffer+i2,"    MENUID    = %s\r\n",pWindowInfo[i].MenuID);
+			i2+=lstrlen(buffer+i2);
+		}
+		sprintf(buffer+i2,"    ID        = %d\r\n",pWindowInfo[i].id);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    BGCOLOR   = %d\r\n",pWindowInfo[i].bgColor);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    FONT      = %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,\"%s\"\r\n",
+			pWindowInfo[i].LogFont.lfHeight,
+			pWindowInfo[i].LogFont.lfWidth,
+			pWindowInfo[i].LogFont.lfEscapement,
+			pWindowInfo[i].LogFont.lfOrientation,
+			pWindowInfo[i].LogFont.lfWeight,
+			pWindowInfo[i].LogFont.lfItalic,
+			pWindowInfo[i].LogFont.lfUnderline,
+			pWindowInfo[i].LogFont.lfStrikeOut,
+			pWindowInfo[i].LogFont.lfCharSet,
+			pWindowInfo[i].LogFont.lfOutPrecision,
+			pWindowInfo[i].LogFont.lfClipPrecision,
+			pWindowInfo[i].LogFont.lfQuality,
+			pWindowInfo[i].LogFont.lfPitchAndFamily,
+			pWindowInfo[i].LogFont.lfFaceName);
+		i2+=lstrlen(buffer+i2);
+		if(pWindowInfo[i].IconResName){
+			sprintf(buffer+i2,"    ICONID    = %s\r\n",pWindowInfo[i].IconResName);
+			i2+=lstrlen(buffer+i2);
+		}
+		sprintf(buffer+i2,"    CLASS     = \"%s\"\r\n",pWindowInfo[i].ClassName);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    CALLBACK  = %s\r\n",pWindowInfo[i].CallBackName);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    TYPE      = %d\r\n",pWindowInfo[i].type);
+		i2+=lstrlen(buffer+i2);
+		sprintf(buffer+i2,"    FILEPATH  = %s\r\n",pWindowInfo[i].filepath);
+		i2+=lstrlen(buffer+i2);
+		for(i3=0;i3<pWindowInfo[i].NumberOfChildWindows;i3++){
+			temporary=SetCaptionSequence(pWindowInfo[i].pChildInfo[i3].caption);
+			sprintf(buffer+i2,"    ITEM      = %s,%d,%d,%d,%d,\"%s\",&H%08x,&H%08x,%d",
+				pWindowInfo[i].pChildInfo[i3].IdName,
+				pWindowInfo[i].pChildInfo[i3].pos.x,pWindowInfo[i].pChildInfo[i3].pos.y,
+				pWindowInfo[i].pChildInfo[i3].size.cx,pWindowInfo[i].pChildInfo[i3].size.cy,
+				temporary,
+				pWindowInfo[i].pChildInfo[i3].style,
+				pWindowInfo[i].pChildInfo[i3].ExStyle,
+				pWindowInfo[i].pChildInfo[i3].Control
+			);
+			i2+=lstrlen(buffer+i2);
+			HeapDefaultFree(temporary);
+			if(pWindowInfo[i].pChildInfo[i3].Control==CT_IMAGEBOX){
+				sprintf(buffer+i2,",%d,\"%s\"",pWindowInfo[i].pChildInfo[i3].ImageCtrlInfo.type,pWindowInfo[i].pChildInfo[i3].ImageCtrlInfo.path);
+				i2+=lstrlen(buffer+i2);
+			}
+			lstrcpy(buffer+i2,"\r\n");
+			i2+=lstrlen(buffer+i2);
+			if(i2-GENERAL_SIZE<GENERAL_SIZE){
+				size++;
+				buffer=(char *)HeapReAlloc(hHeap,0,buffer,GENERAL_SIZE*size);
+			}
+		}
+		sprintf(buffer+i2,"END\r\n",pWindowInfo[i].name);
+		i2+=lstrlen(buffer+i2);
+		if(i2-GENERAL_SIZE<GENERAL_SIZE){
+			size++;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,GENERAL_SIZE*size);
+		}
+	}
+	for(i=0;i<ProjectInfo.NumberOfMenu;i++){
+		sprintf(buffer+i2,"MENU:%s\r\n",ProjectInfo.pMenuInfo[i].IdName);
+		i2+=lstrlen(buffer+i2);
+		i2+=GetSaveMenuData(buffer+i2,1,ProjectInfo.pMenuInfo[i].pMenuInfo,ProjectInfo.pMenuInfo[i].NumberOfMenu);
+		sprintf(buffer+i2,"END\r\n",pWindowInfo[i].name);
+		i2+=lstrlen(buffer+i2);
+		if(i2-GENERAL_SIZE<GENERAL_SIZE){
+			size++;
+			buffer=(char *)HeapReAlloc(hHeap,0,buffer,GENERAL_SIZE*size);
+		}
+	}
+	WriteBuffer(path,buffer,i2);
+	HeapDefaultFree(buffer);
+
+	extern PROJECTINFO ProjectInfo;
+	ProjectInfo.ModifyOfMaterial=0;
+}
+
+MENU_INFO *GetMenuData(char *buffer,int *pPos,int *pMenuNum){
+	extern HANDLE hHeap;
+	int i,i2,i3,i4;
+	char temporary[MAX_PATH],*temp2,temp3[MAX_PATH];
+	MENU_INFO *pMenuInfo;
+
+	temp2=(char *)HeapAlloc(hHeap,0,lstrlen(buffer)+1);
+
+	*pMenuNum=0;
+	pMenuInfo=(MENU_INFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+
+	for(i=*pPos;;i++){
+		if(buffer[i]=='\0') return 0;
+		if((buffer[i]=='\r'&&buffer[i+1]=='\n')||i==0){
+			if(buffer[i]=='\r'&&buffer[i+1]=='\n')  i+=2;
+			for(i2=0;;i++,i2++){
+				if(!IsVariableChar(buffer[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+			if(i2==0){
+				i--;
+				continue;
+			}
+			if(buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temp2[i2]=0;
+						break;
+					}
+					temp2[i2]=buffer[i];
+				}
+			}
+			else{
+				temp2[0]=0;
+				i2=0;
+			}
+
+
+			if(lstrcmpi(temporary,"POPUP")==0){
+				(*pMenuNum)++;
+				pMenuInfo=(MENU_INFO *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,pMenuInfo,(*pMenuNum)*sizeof(MENU_INFO));
+				i3=*pMenuNum-1;
+
+				i4=GetOneParameter(temp2,0,temp3);
+				RemoveStringQuotes(temp3);
+				pMenuInfo[i3].caption=(char *)HeapAlloc(hHeap,0,lstrlen(temp3)+1);
+				lstrcpy(pMenuInfo[i3].caption,temp3);
+
+				i4=GetOneParameter(temp2,i4,temp3);
+				pMenuInfo[i3].state=GetValue(temp3);
+
+				pMenuInfo[i3].pMenuInfo=GetMenuData(buffer,&i,&pMenuInfo[i3].NumberOfMenu);
+			}
+			else if(lstrcmpi(temporary,"ITEM")==0){
+				(*pMenuNum)++;
+				pMenuInfo=(MENU_INFO *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,pMenuInfo,(*pMenuNum)*sizeof(MENU_INFO));
+				i3=*pMenuNum-1;
+
+				i4=GetOneParameter(temp2,0,temp3);
+				pMenuInfo[i3].IdName=(char *)HeapAlloc(hHeap,0,lstrlen(temp3)+1);
+				lstrcpy(pMenuInfo[i3].IdName,temp3);
+
+				i4=GetOneParameter(temp2,i4,temp3);
+				RemoveStringQuotes(temp3);
+				pMenuInfo[i3].caption=(char *)HeapAlloc(hHeap,0,lstrlen(temp3)+1);
+				lstrcpy(pMenuInfo[i3].caption,temp3);
+
+				i4=GetOneParameter(temp2,i4,temp3);
+				pMenuInfo[i3].state=GetValue(temp3);
+
+				pMenuInfo[i3].type=0;
+			}
+			else if(lstrcmpi(temporary,"SEPARATOR")==0){
+				(*pMenuNum)++;
+				pMenuInfo=(MENU_INFO *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,pMenuInfo,(*pMenuNum)*sizeof(MENU_INFO));
+				i3=*pMenuNum-1;
+
+				pMenuInfo[i3].type=MFT_SEPARATOR;
+			}
+			else if(lstrcmpi(temporary,"END")==0) break;
+			i--;
+		}
+	}
+	*pPos=i;
+
+	HeapDefaultFree(temp2);
+
+	return pMenuInfo;
+}
+_int8 OpenWindowFile(char *path){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	int i,i2,i3,i4,i5;
+	char *buffer,temporary[MAX_PATH],*temp2,temp3[MAX_PATH];
+	CHILDINFO *pChildInfo;
+
+	buffer=ReadBuffer(path);
+	if(!buffer) return 0;
+	temp2=(char *)HeapAlloc(hHeap,0,lstrlen(buffer)+1);
+	ChangeOrSignToDivision(temp2,buffer);
+	KillSpaces(temp2,buffer);
+	//temp2はこの後の処理の一時保存バッファにも利用するので解放しない
+
+	ProjectInfo.NumberOfMenu=0;
+	ProjectInfo.pMenuInfo=(MENU_INFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+
+	ProjectInfo.NumberOfWindows=0;
+	ProjectInfo.pWindowInfo=(WINDOW_INFO *)HeapAlloc(hHeap,0,1);
+
+	for(i=0,i3=0;;i++){
+		if(buffer[i]=='\0') break;
+		if((buffer[i]=='\r'&&buffer[i+1]=='\n')||i==0){
+			if(buffer[i]=='\r'&&buffer[i+1]=='\n')  i+=2;
+			for(i2=0;;i++,i2++){
+				if(!IsVariableChar(buffer[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=buffer[i];
+			}
+			if(i2==0){
+				i--;
+				continue;
+			}
+			if(buffer[i]==':'||buffer[i]=='='){
+				for(i++,i2=0;;i++,i2++){
+					if((buffer[i]=='\r'&&buffer[i+1]=='\n')||buffer[i]=='\0'){
+						temp2[i2]=0;
+						break;
+					}
+					temp2[i2]=buffer[i];
+				}
+			}
+			else{
+				temp2[0]=0;
+				i2=0;
+			}
+
+
+			//////////////
+			//ウィンドウ
+			if(lstrcmpi(temporary,"WINDOW")==0&&i3==0){
+				ProjectInfo.NumberOfWindows++;
+				ProjectInfo.pWindowInfo=(WINDOW_INFO *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,ProjectInfo.pWindowInfo,ProjectInfo.NumberOfWindows*sizeof(WINDOW_INFO));
+				i4=ProjectInfo.NumberOfWindows-1;
+				i3=1;
+
+				ProjectInfo.pWindowInfo[i4].name=(char *)HeapAlloc(hHeap,0,i2+1);
+				lstrcpy(ProjectInfo.pWindowInfo[i4].name,temp2);
+
+				ProjectInfo.pWindowInfo[i4].NumberOfChildWindows=0;
+				ProjectInfo.pWindowInfo[i4].pChildInfo=(CHILDINFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+			}
+			else if(lstrcmpi(temporary,"HANDLE")==0&&i3==1){
+				ProjectInfo.pWindowInfo[i4].HandleName=(char *)HeapAlloc(hHeap,0,i2+1);
+				lstrcpy(ProjectInfo.pWindowInfo[i4].HandleName,temp2);
+			}
+			else if(lstrcmpi(temporary,"POINT")==0&&i3==1){
+				sscanf(temp2,"%d,%d",
+					&ProjectInfo.pWindowInfo[i4].pos.x,
+					&ProjectInfo.pWindowInfo[i4].pos.y);
+				if(ProjectInfo.pWindowInfo[i4].pos.x==-1) ProjectInfo.pWindowInfo[i4].pos.x=CW_USEDEFAULT;
+				if(ProjectInfo.pWindowInfo[i4].pos.y==-1) ProjectInfo.pWindowInfo[i4].pos.y=CW_USEDEFAULT;
+			}
+			else if(lstrcmpi(temporary,"SIZE")==0&&i3==1){
+				sscanf(temp2,"%d,%d",
+					&ProjectInfo.pWindowInfo[i4].size.cx,
+					&ProjectInfo.pWindowInfo[i4].size.cy);
+			}
+			else if(lstrcmpi(temporary,"CAPTION")==0&&i3==1){
+				if(temp2[0]=='\"'&&temp2[lstrlen(temp2)-1]=='\"'){
+					temp2[lstrlen(temp2)-1]=0;
+					ProjectInfo.pWindowInfo[i4].caption=(char *)HeapAlloc(hHeap,0,i2+1);
+					lstrcpy(ProjectInfo.pWindowInfo[i4].caption,temp2+1);
+				}
+			}
+			else if(lstrcmpi(temporary,"STYLE")==0&&i3==1) ProjectInfo.pWindowInfo[i4].style=GetValue(temp2);
+			else if(lstrcmpi(temporary,"EXSTYLE")==0&&i3==1) ProjectInfo.pWindowInfo[i4].ExStyle=GetValue(temp2);
+			else if(lstrcmpi(temporary,"MENUID")==0&&i3==1){
+				ProjectInfo.pWindowInfo[i4].MenuID=(char *)HeapAlloc(hHeap,0,i2+1);
+				lstrcpy(ProjectInfo.pWindowInfo[i4].MenuID,temp2);
+			}
+			else if(lstrcmpi(temporary,"ID")==0&&i3==1) ProjectInfo.pWindowInfo[i4].id=GetValue(temp2);
+			else if(lstrcmpi(temporary,"BGCOLOR")==0&&i3==1){
+				ProjectInfo.pWindowInfo[i4].bgColor=GetValue(temp2);
+				if(ProjectInfo.dwVersion<=3){
+					//プロジェクトバージョンが3以前のときは新値に変換する
+					if(ProjectInfo.pWindowInfo[i4].bgColor==-1)
+						ProjectInfo.pWindowInfo[i4].bgColor=-(int)RGB(255,255,255);
+				}
+			}
+			else if(lstrcmpi(temporary,"FONT")==0&&i3==1){
+				i5=GetOneParameter(temp2,0,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfHeight=GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfWidth=GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfEscapement=GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfOrientation=GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfWeight=GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfItalic=(BYTE)GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfUnderline=(BYTE)GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfStrikeOut=(BYTE)GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfCharSet=(BYTE)GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfOutPrecision=(BYTE)GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfClipPrecision=(BYTE)GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfQuality=(BYTE)GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				ProjectInfo.pWindowInfo[i4].LogFont.lfPitchAndFamily=(BYTE)GetValue(temp3);
+
+				i5=GetOneParameter(temp2,i5,temp3);
+				RemoveStringQuotes(temp3);
+				lstrcpy(ProjectInfo.pWindowInfo[i4].LogFont.lfFaceName,temp3);
+			}
+			else if(lstrcmpi(temporary,"ICONID")==0&&i3==1){
+				ProjectInfo.pWindowInfo[i4].IconResName=(char *)HeapAlloc(hHeap,0,i2+1);
+				lstrcpy(ProjectInfo.pWindowInfo[i4].IconResName,temp2);
+			}
+			else if(lstrcmpi(temporary,"CLASS")==0&&i3==1){
+				if(temp2[0]=='\"'&&temp2[lstrlen(temp2)-1]=='\"'){
+					temp2[lstrlen(temp2)-1]=0;
+					ProjectInfo.pWindowInfo[i4].ClassName=(char *)HeapAlloc(hHeap,0,i2+1);
+					lstrcpy(ProjectInfo.pWindowInfo[i4].ClassName,temp2+1);
+				}
+			}
+			else if(lstrcmpi(temporary,"CALLBACK")==0&&i3==1){
+				ProjectInfo.pWindowInfo[i4].CallBackName=(char *)HeapAlloc(hHeap,0,i2+1);
+				lstrcpy(ProjectInfo.pWindowInfo[i4].CallBackName,temp2);
+			}
+
+			//以前のバージョンとの互換用
+			else if(lstrcmpi(temporary,"DLGTMP")==0&&i3==1) ProjectInfo.pWindowInfo[i4].type=GetValue(temp2);
+
+			else if(lstrcmpi(temporary,"TYPE")==0&&i3==1) ProjectInfo.pWindowInfo[i4].type=GetValue(temp2);
+			else if(lstrcmpi(temporary,"FILEPATH")==0&&i3==1){
+				ProjectInfo.pWindowInfo[i4].filepath=(char *)HeapAlloc(hHeap,0,i2+1);
+				lstrcpy(ProjectInfo.pWindowInfo[i4].filepath,temp2);
+			}
+			else if(lstrcmpi(temporary,"ITEM")==0&&i3==1){
+				ProjectInfo.pWindowInfo[i4].pChildInfo=(CHILDINFO *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,ProjectInfo.pWindowInfo[i4].pChildInfo,(ProjectInfo.pWindowInfo[i4].NumberOfChildWindows+1)*sizeof(CHILDINFO));
+				pChildInfo=&ProjectInfo.pWindowInfo[i4].pChildInfo[ProjectInfo.pWindowInfo[i4].NumberOfChildWindows];
+
+				//ID
+				i5=GetOneParameter(temp2,0,temp3);
+				pChildInfo->IdName=(char *)HeapAlloc(hHeap,0,lstrlen(temp3)+1);
+				lstrcpy(pChildInfo->IdName,temp3);
+
+				//位置
+				i5=GetOneParameter(temp2,i5,temp3);
+				pChildInfo->pos.x=GetValue(temp3);
+				i5=GetOneParameter(temp2,i5,temp3);
+				pChildInfo->pos.y=GetValue(temp3);
+				i5=GetOneParameter(temp2,i5,temp3);
+				pChildInfo->size.cx=GetValue(temp3);
+				i5=GetOneParameter(temp2,i5,temp3);
+				pChildInfo->size.cy=GetValue(temp3);
+
+				//テキスト
+				i5=GetOneParameter(temp2,i5,temp3);
+				RemoveStringQuotes(temp3);
+				RestoreCaptionSequence(temp3);
+				pChildInfo->caption=(char *)HeapAlloc(hHeap,0,lstrlen(temp3)+1);
+				lstrcpy(pChildInfo->caption,temp3);
+
+				//スタイル
+				i5=GetOneParameter(temp2,i5,temp3);
+				pChildInfo->style=GetValue(temp3);
+
+				//拡張スタイル
+				i5=GetOneParameter(temp2,i5,temp3);
+				pChildInfo->ExStyle=GetValue(temp3);
+
+				//クラス
+				i5=GetOneParameter(temp2,i5,temp3);
+				pChildInfo->Control=GetValue(temp3);
+
+				if(pChildInfo->Control==CT_IMAGEBOX){
+					//イメージ ボックスの場合
+					i5=GetOneParameter(temp2,i5,temp3);
+					pChildInfo->ImageCtrlInfo.type=GetValue(temp3);
+					i5=GetOneParameter(temp2,i5,temp3);
+					RemoveStringQuotes(temp3);
+					pChildInfo->ImageCtrlInfo.path=(char *)HeapAlloc(hHeap,0,lstrlen(temp3)+1);
+					lstrcpy(pChildInfo->ImageCtrlInfo.path,temp3);
+				}
+
+				ProjectInfo.pWindowInfo[i4].NumberOfChildWindows++;
+			}
+
+
+			////////////
+			//メニュー
+			else if(lstrcmpi(temporary,"MENU")==0&&i3==0){
+				ProjectInfo.NumberOfMenu++;
+				ProjectInfo.pMenuInfo=(MENU_INFO *)HeapReAlloc(hHeap,HEAP_ZERO_MEMORY,ProjectInfo.pMenuInfo,ProjectInfo.NumberOfMenu*sizeof(MENU_INFO));
+				i4=ProjectInfo.NumberOfMenu-1;
+
+				//ID名
+				ProjectInfo.pMenuInfo[i4].IdName=(char *)HeapAlloc(hHeap,0,lstrlen(temp2)+1);
+				lstrcpy(ProjectInfo.pMenuInfo[i4].IdName,temp2);
+				ProjectInfo.pMenuInfo[i4].pMenuInfo=GetMenuData(buffer,&i,&ProjectInfo.pMenuInfo[i4].NumberOfMenu);
+				if(!ProjectInfo.pMenuInfo[i4].pMenuInfo){
+					//"ウィンドウ定義ファイルが壊れています。\n\n%s"
+					sprintf(temporary,STRING_ERROR_BROKEN_WNDFILE,path);
+					MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+
+					HeapDefaultFree(temp2);
+					HeapDefaultFree(buffer);
+					return 0;
+				}
+			}
+
+
+			else if(lstrcmpi(temporary,"END")==0&&i3) i3=0;
+			else{
+				//"ウィンドウ定義ファイルが壊れています。\n\n%s"
+				sprintf(temporary,STRING_ERROR_BROKEN_WNDFILE,path);
+				MessageBox(hOwner,temporary,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+
+				HeapDefaultFree(temp2);
+				HeapDefaultFree(buffer);
+				return 0;
+			}
+			i--;
+		}
+	}
+
+	HeapDefaultFree(temp2);
+	HeapDefaultFree(buffer);
+	return 1;
+}
+
+struct NEW_WINDOW{
+	char name[MAX_PATH];
+	char HandleName[MAX_PATH];
+	char CallBackName[MAX_PATH];
+	BOOL type;
+};
+NEW_WINDOW NewWindow;
+BOOL CALLBACK DlgProject_NewWindow(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	char temporary[MAX_PATH],temp2[MAX_PATH];
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+			SendDlgItemMessage(hwnd,IDC_AUTOSET,BM_SETCHECK,BST_CHECKED,0);
+			SendMessage(hwnd,WM_COMMAND,IDC_AUTOSET,0);
+			SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_SETCHECK,BST_CHECKED,0);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					GetDlgItemText(hwnd,IDC_WINDOWNAME,NewWindow.name,MAX_PATH);
+					GetDlgItemText(hwnd,IDC_WINDOWHANDLE,NewWindow.HandleName,MAX_PATH);
+					GetDlgItemText(hwnd,IDC_WINDOWPROC,NewWindow.CallBackName,MAX_PATH);
+					if(SendDlgItemMessage(hwnd,IDC_DEFWINDOW,BM_GETCHECK,0,0))
+						NewWindow.type=WNDTYPE_DEFAULT;
+					else if(SendDlgItemMessage(hwnd,IDC_MODALDLG,BM_GETCHECK,0,0))
+						NewWindow.type=WNDTYPE_MODALDLG;
+					else if(SendDlgItemMessage(hwnd,IDC_MODELESSDLG,BM_GETCHECK,0,0))
+						NewWindow.type=WNDTYPE_MODELESSDLG;
+					EndDialog(hwnd,1);
+					return 1;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					return 1;
+				case IDC_WINDOWNAME:
+					if(HIWORD(wParam)==EN_CHANGE) SendMessage(hwnd,WM_COMMAND,IDC_AUTOSET,0);
+					return 1;
+				case IDC_AUTOSET:
+					if(SendDlgItemMessage(hwnd,IDC_AUTOSET,BM_GETCHECK,0,0)){
+						SendDlgItemMessage(hwnd,IDC_WINDOWHANDLE,EM_SETREADONLY,1,0);
+						SendDlgItemMessage(hwnd,IDC_WINDOWPROC,EM_SETREADONLY,1,0);
+						GetDlgItemText(hwnd,IDC_WINDOWNAME,temporary,MAX_PATH);
+						if(temporary[0]){
+							sprintf(temp2,"h%s",temporary);
+							SetDlgItemText(hwnd,IDC_WINDOWHANDLE,temp2);
+							sprintf(temp2,"%sProc",temporary);
+							SetDlgItemText(hwnd,IDC_WINDOWPROC,temp2);
+						}
+						else{
+							SetDlgItemText(hwnd,IDC_WINDOWHANDLE,"");
+							SetDlgItemText(hwnd,IDC_WINDOWPROC,"");
+						}
+					}
+					else{
+						SendDlgItemMessage(hwnd,IDC_WINDOWHANDLE,EM_SETREADONLY,0,0);
+						SendDlgItemMessage(hwnd,IDC_WINDOWPROC,EM_SETREADONLY,0,0);
+					}
+					return 1;
+			}
+			break;
+	}
+	return 0;
+}
+void GetDefaultWindowFont(LOGFONT *LogFont){
+	LogFont->lfHeight=-12;
+	LogFont->lfWidth=0;
+	LogFont->lfEscapement=0;
+	LogFont->lfOrientation=0;
+	LogFont->lfWeight=FW_REGULAR;
+	LogFont->lfItalic=0;
+	LogFont->lfUnderline=0;
+	LogFont->lfStrikeOut=0;
+	LogFont->lfCharSet=SHIFTJIS_CHARSET;
+	LogFont->lfOutPrecision=OUT_STROKE_PRECIS;
+	LogFont->lfClipPrecision=CLIP_STROKE_PRECIS;
+	LogFont->lfQuality=DRAFT_QUALITY;
+	LogFont->lfPitchAndFamily=FF_SWISS;
+	lstrcpy(LogFont->lfFaceName,"ＭＳ Ｐゴシック");
+}
+void Project_Window_Insert(void){
+	extern HANDLE hHeap;
+	extern PROJECTINFO ProjectInfo;
+	int i;
+	char temporary[MAX_PATH],temp2[1024],*pTemp;
+
+	if(!DialogBox(hResInst,MAKEINTRESOURCE(IDD_PROJECT_NEWWINDOW),hOwner,DlgProject_NewWindow)) return;
+
+	//重複チェック
+	sprintf(temporary,"%s.sbp",NewWindow.name);
+	if(ProjectInfo.pobj_DBFileInfo->dupli_check(temporary)){
+		sprintf(temp2,"\"%s\" ファイルは既にプロジェクト内に存在します。",temporary);
+		MessageBox(hOwner,temp2,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+		return;
+	}
+	for(i=0;i<ProjectInfo.NumberOfWindows;i++){
+		if(lstrcmpi(NewWindow.name,ProjectInfo.pWindowInfo[i].name)==0){
+			//"\"%s\" ウィンドウは既にプロジェクト内に存在します。"
+			sprintf(temporary,STRING_DUPLICATIONERROR_WINDOW_IN_PROJECT,ProjectInfo.pWindowInfo[i].name);
+			MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+			return;
+		}
+		if(lstrcmpi(NewWindow.HandleName,ProjectInfo.pWindowInfo[i].HandleName)==0){
+			//"\"%s\" ハンドルは既にプロジェクト内に存在します。"
+			sprintf(temporary,STRING_DUPLICATIONERROR_HANDLE_IN_PROJECT,ProjectInfo.pWindowInfo[i].HandleName);
+			MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+			return;
+		}
+		if(lstrcmpi(NewWindow.CallBackName,ProjectInfo.pWindowInfo[i].CallBackName)==0){
+			//"\"%s\" プロシージャは既にプロジェクト内に存在します。"
+			sprintf(temporary,STRING_DUPLICATIONERROR_PROC_IN_PROJECT,ProjectInfo.pWindowInfo[i].CallBackName);
+			MessageBox(hOwner,temporary,STRING_ERROR,MB_OK|MB_ICONEXCLAMATION);
+			return;
+		}
+	}
+
+	//ProjectInfo.pWindowInfo構造体に追加
+	ProjectInfo.pWindowInfo=(WINDOW_INFO *)HeapReAlloc(hHeap,0,ProjectInfo.pWindowInfo,(ProjectInfo.NumberOfWindows+1)*sizeof(WINDOW_INFO));
+
+
+	///////////////////////////////////////
+	//ProjectInfo.pWindowInfo構造体を設定
+
+	//ウィンドウ名
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].name=(char *)HeapAlloc(hHeap,0,lstrlen(NewWindow.name)+1);
+	lstrcpy(ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].name,NewWindow.name);
+
+	//ハンドル名
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].HandleName=(char *)HeapAlloc(hHeap,0,lstrlen(NewWindow.HandleName)+1);
+	lstrcpy(ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].HandleName,NewWindow.HandleName);
+
+	//位置情報
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].pos.x=-1;
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].pos.y=-1;
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].size.cx=480;
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].size.cy=360;
+
+	//ウィンドウテキスト
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].caption=(char *)HeapAlloc(hHeap,0,lstrlen(NewWindow.name)+1);
+	lstrcpy(ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].caption,NewWindow.name);
+
+	//スタイル
+	switch(NewWindow.type){
+		case WNDTYPE_DEFAULT:
+			//通常ウィンドウ
+			ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].style=WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|WS_MAXIMIZEBOX;
+			break;
+		case WNDTYPE_MODALDLG:
+		case WNDTYPE_MODELESSDLG:
+			//ダイアログ テンプレート（最大化、最小化ボタンをなくして、細枠にする）
+			ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].style=WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU;
+			break;
+	}
+
+	//拡張スタイル
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].ExStyle=0;
+
+	//メニュー
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].MenuID=0;
+
+	//ID
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].id=0;
+
+	//背景色
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].bgColor=COLOR_3DFACE;
+
+	//フォント
+	GetDefaultWindowFont(&ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].LogFont);
+
+	//アイコン
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].IconResName=0;
+
+	//クラス名
+	lstrcpy(temporary,"NORMAL");
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].ClassName=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+	lstrcpy(ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].ClassName,temporary);
+
+	//コールバック関数名
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].CallBackName=(char *)HeapAlloc(hHeap,0,lstrlen(NewWindow.CallBackName)+1);
+	lstrcpy(ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].CallBackName,NewWindow.CallBackName);
+
+	//タイプ識別
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].type=NewWindow.type;
+
+	//子ウィンドウ情報
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].NumberOfChildWindows=0;
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].pChildInfo=(CHILDINFO *)HeapAlloc(hHeap,HEAP_ZERO_MEMORY,1);
+
+
+	//メッセージ処理ファイル名
+	sprintf(temporary,"%s.ab",ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].name);
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].filepath=(char *)HeapAlloc(hHeap,0,lstrlen(temporary)+1);
+	lstrcpy(ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].filepath,temporary);
+
+
+	//////////////////////////
+	// メッセージ処理ファイル
+	//////////////////////////
+
+	//テンプレートを読み込む
+#if defined(JPN)
+	//日本語ファイル
+	sprintf(temporary,"%sSubOperation\\new_window_template.sbp",pj_editor_Dir);
+#else
+	//英語ファイル
+	sprintf(temporary,"%sSubOperation\\new_window_template_e.sbp",pj_editor_Dir);
+#endif
+	pTemp=ReadBuffer(temporary);
+
+	//#name#をプロジェクト名に置換
+	pTemp=PermutationWndPgmTemplate(pTemp,
+		ProjectInfo.name,
+		NewWindow.name,
+		NewWindow.HandleName,
+		NewWindow.CallBackName);
+
+	sprintf(temporary,"%s%s.ab",ProjectInfo.dir,ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].name);
+
+	//書き込み
+	WriteBuffer(temporary,pTemp,lstrlen(pTemp));
+	Project_File_Insert(temporary);
+
+	HeapDefaultFree(pTemp);
+
+
+	//////////////////////
+	//ツリービューに追加
+
+	extern HWND hMaterialTreeView;
+	TV_INSERTSTRUCT tv;
+	tv.hInsertAfter=TVI_SORT;
+	tv.item.mask=TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+	tv.item.iImage=2;
+	tv.item.iSelectedImage=2;
+	tv.hParent=ProjectInfo.hWindowTreeItem;
+	tv.item.pszText=ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].name;
+
+	ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].hTreeItem=TreeView_InsertItem(hMaterialTreeView,&tv);
+
+	TreeView_SelectItem(hMaterialTreeView,ProjectInfo.pWindowInfo[ProjectInfo.NumberOfWindows].hTreeItem);
+
+
+	ProjectInfo.NumberOfWindows++;
+	ProjectInfo.ModifyOfMaterial=1;
+
+	NewRadWindow(ProjectInfo.NumberOfWindows-1);
+}
+void Project_Window_Delete(int WndInfoNum){
+	extern HANDLE hHeap;
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	extern PROJECTINFO ProjectInfo;
+	int i;
+
+	//ウィンドウが開かれている場合は閉じる
+	for(i=0;i<MAX_WNDNUM;i++){
+		if(MdiInfo[i].hwnd&&lstrcmpi(ProjectInfo.pWindowInfo[WndInfoNum].name,MdiInfo[i].path)==0){
+			SendMessage(MdiInfo[i].hwnd,WM_CLOSE,0,0);
+			break;
+		}
+	}
+
+	//ウィンドウ情報のメモリを解放
+	HeapDefaultFree(ProjectInfo.pWindowInfo[WndInfoNum].name);
+	HeapDefaultFree(ProjectInfo.pWindowInfo[WndInfoNum].filepath);
+	HeapDefaultFree(ProjectInfo.pWindowInfo[WndInfoNum].HandleName);
+	HeapDefaultFree(ProjectInfo.pWindowInfo[WndInfoNum].caption);
+	HeapDefaultFree(ProjectInfo.pWindowInfo[WndInfoNum].ClassName);
+	HeapDefaultFree(ProjectInfo.pWindowInfo[WndInfoNum].CallBackName);
+
+	//子ウィンドウのメモリを解放
+	for(i=0;i<ProjectInfo.pWindowInfo[WndInfoNum].NumberOfChildWindows;i++){
+		HeapDefaultFree(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].IdName);
+		HeapDefaultFree(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo[i].caption);
+	}
+	HeapDefaultFree(ProjectInfo.pWindowInfo[WndInfoNum].pChildInfo);
+
+	//ツリービューから削除
+	extern HWND hMaterialTreeView;
+	TreeView_DeleteItem(hMaterialTreeView,ProjectInfo.pWindowInfo[WndInfoNum].hTreeItem);
+
+	//ProjectInfo.pWindowInfo構造体から削除
+	ProjectInfo.NumberOfWindows--;
+	for(i=WndInfoNum;i<ProjectInfo.NumberOfWindows;i++) ProjectInfo.pWindowInfo[i]=ProjectInfo.pWindowInfo[i+1];
+	if(ProjectInfo.NumberOfWindows==0) ProjectInfo.pWindowInfo=(WINDOW_INFO *)HeapReAlloc(hHeap,0,ProjectInfo.pWindowInfo,1);
+	else ProjectInfo.pWindowInfo=(WINDOW_INFO *)HeapReAlloc(hHeap,0,ProjectInfo.pWindowInfo,ProjectInfo.NumberOfWindows*sizeof(WINDOW_INFO));
+
+	ProjectInfo.ModifyOfMaterial=1;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/analysis.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/analysis.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/analysis.cpp	(revision 178)
@@ -0,0 +1,766 @@
+#include "common.h"
+
+BOOL GetVarFormatString(char *buffer,char *array,char *array2,char *NestMember,int *pRefType){
+	extern int cp;
+	int i,i2,i3;
+	char cPare_Open,cPare_Close;
+
+	array[0]=0;
+	array2[0]=0;
+	NestMember[0]=0;
+	*pRefType=0;
+	for(i=0;;i++){
+		if(buffer[i]=='\"'){
+			for(i++;;i++){
+				if(IsDBCSLeadByte(buffer[i])){
+					i++;
+					continue;
+				}
+				if(buffer[i]=='\"') break;
+			}
+		}
+		if(buffer[i]=='['||buffer[i]=='('){
+			if(buffer[i]=='['){
+				cPare_Open='[';
+				cPare_Close=']';
+			}
+			else{
+				cPare_Open='(';
+				cPare_Close=')';
+			}
+			buffer[i]=0;
+			for(i++,i2=0;;i++,i2++){
+				if(buffer[i]==cPare_Open){
+					if(cPare_Open=='[') i3=GetStringInBracket(array+i2,buffer+i);
+					else i3=GetStringInPare(array+i2,buffer+i);
+					i+=i3-1;
+					i2+=i3-1;
+					continue;
+				}
+				if(buffer[i]==cPare_Close){
+					array[i2]=0;
+					break;
+				}
+				array[i2]=buffer[i];
+			}
+			if(buffer[i+1]==cPare_Open){
+				for(i+=2,i2=0;;i++,i2++){
+					if(buffer[i]==cPare_Open){
+						if(cPare_Open=='[') i3=GetStringInBracket(array2+i2,buffer+i);
+						else i3=GetStringInPare(array2+i2,buffer+i);
+						i+=i3-1;
+						i2+=i3-1;
+						continue;
+					}
+					if(buffer[i]==cPare_Close){
+						array2[i2]=0;
+						break;
+					}
+					array2[i2]=buffer[i];
+				}
+				if(buffer[i+1]==cPare_Open){
+					return 0;
+				}
+			}
+			continue;
+		}
+		if(buffer[i]=='.'){
+			lstrcpy(NestMember,buffer+i+1);
+			*pRefType=DEF_OBJECT;
+			buffer[i]=0;
+			break;
+		}
+		if(buffer[i]=='-'&&buffer[i+1]=='>'){
+			lstrcpy(NestMember,buffer+i+2);
+			*pRefType=DEF_PTR_OBJECT;
+			buffer[i]=0;
+			break;
+		}
+		if(buffer[i]=='\0') break;
+	}
+	return 1;
+}
+
+int GetTypeFixed(char *TypeName){
+	if(lstrcmpi(TypeName,"Double")==0)			return DEF_DOUBLE;
+	else if(lstrcmpi(TypeName,"Single")==0)		return DEF_SINGLE;
+	else if(lstrcmpi(TypeName,"DWORD")==0)		return DEF_DWORD;
+	else if(lstrcmpi(TypeName,"Long")==0)		return DEF_LONG;
+	else if(lstrcmpi(TypeName,"WORD")==0)		return DEF_WORD;
+	else if(lstrcmpi(TypeName,"Integer")==0)	return DEF_INTEGER;
+	else if(lstrcmpi(TypeName,"Byte")==0)		return DEF_BYTE;
+	else if(lstrcmpi(TypeName,"String")==0)		return DEF_STRING;
+	else if(lstrcmpi(TypeName,"Any")==0)		return DEF_ANY;
+	else if(lstrcmpi(TypeName,"VoidPtr")==0)	return DEF_PTR_VOID;
+	else if(TypeName[0]=='*'){
+		if(TypeName[1]=='*') return DEF_LONG;
+		else return DEF_PTR_OBJECT;
+	}
+	return DEF_OBJECT;
+}
+
+
+
+//////////////////////////////////////////////////////////////
+// ここから、クラス、構造体の即席構文解析を行うための関数郡
+//////////////////////////////////////////////////////////////
+
+BOOL CheckReferType(char *ClassName,BOOL bArray,char *VarArray,int VarRefType){
+	int type;
+
+	type=GetTypeFixed(ClassName);
+	if(!(type==DEF_OBJECT||type==DEF_PTR_OBJECT)) return 0;
+
+
+	//文字"*"を取り除く
+	if(type==DEF_PTR_OBJECT) SlideString(ClassName+1,-1);
+
+	if(type==DEF_OBJECT){
+		//実体オブジェクトを参照するとき
+
+		//配列のチェック
+		if(bArray){
+			if(VarArray[0]=='\0') return 0;
+		}
+		if(VarArray[0]){
+			if(!bArray) return 0;
+		}
+
+		if(type!=VarRefType) return 0;
+	}
+	else if(type==DEF_PTR_OBJECT){
+		//ポインタが示すオブジェクトを参照するとき
+
+		if(bArray){
+			if(VarArray[0]=='\0'||VarRefType==DEF_OBJECT) return 0;
+		}
+		else{
+			if(VarRefType==DEF_OBJECT){
+				//"."参照
+				if(VarArray[0]=='\0') return 0;
+			}
+			else{
+				//"->"参照
+				if(VarArray[0]) return 0;
+			}
+		}
+	}
+
+	return 1;
+}
+
+BOOL GetOriginalClassNameFromBuf(char *pBuf,char *ClassName){
+	int i,i2;
+	char temporary[VN_SIZE];
+
+	for(i=0;;i++){
+		while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+		if(memicmp(pBuf+i,"TypeDef",7)==0&&(pBuf[i+7]==' '||pBuf[i+7]=='\t')){
+			i+=8;
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+			for(i2=0;;i++,i2++){
+				if(!IsVariableChar(pBuf[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=pBuf[i];
+			}
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+			if(pBuf[i]=='='){
+				if(lstrcmp(temporary,ClassName)==0){
+					//TypeDef宣言の型名が一致したとき
+					i++;
+					while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+					for(i2=0;;i++,i2++){
+						if(!(IsVariableChar(pBuf[i])||pBuf[i]=='*')){
+							temporary[i2]=0;
+							break;
+						}
+						temporary[i2]=pBuf[i];
+					}
+
+					lstrcpy(ClassName,temporary);
+					return 1;
+				}
+			}
+		}
+
+		//次の行をサーチ
+		for(;;i++){
+			i2=IsCommandDelimitation(pBuf,i);
+			if(i2){
+				if(i2==2) i++;
+				break;
+			}
+		}
+
+		if(pBuf[i]=='\0') break;
+	}
+	return 0;
+}
+void GetOriginalClassName(char *ClassName){
+	extern char *pHeaderBuf;
+	extern char *pUserSource;
+	BOOL bRet;
+	int i;
+
+	do{
+		for(i=0;;i++){
+			if(ClassName[i]!='*') break;
+		}
+
+		//ユーザーソースコードからTypeDef宣言をサーチ
+		bRet=GetOriginalClassNameFromBuf(pUserSource,ClassName+i);
+		if(!bRet){
+			//basic.sbpからTypeDef宣言をサーチ
+			bRet=GetOriginalClassNameFromBuf(pHeaderBuf,ClassName+i);
+		}
+	}while(bRet);
+}
+
+int GetClassPos(char *pBuf,char *ClassName,DWORD *pdwClassType){
+	////////////////////////////////////////////////////////
+	// pBuf内からClassNameと一致するクラスの定義位置を取得
+	////////////////////////////////////////////////////////
+
+	int i,i2;
+	char temporary[VN_SIZE];
+
+	for(i=0;;i++){
+		while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+		if(memicmp(pBuf+i,"Class",5)==0&&(pBuf[i+5]==' '||pBuf[i+5]=='\t')||
+			memicmp(pBuf+i,"Interface",9)==0&&(pBuf[i+9]==' '||pBuf[i+9]=='\t')||
+			memicmp(pBuf+i,"Type",4)==0&&(pBuf[i+4]==' '||pBuf[i+4]=='\t')){
+
+			if(pBuf[i]=='c'||pBuf[i]=='C'){
+				//Class
+				i+=6;
+				*pdwClassType=ESC_CLASS;
+			}
+			else if(pBuf[i]=='i'||pBuf[i]=='I'){
+				//Interface
+				i+=10;
+				*pdwClassType=ESC_INTERFACE;
+			}
+			else{
+				//Type
+				i+=5;
+				*pdwClassType=ESC_TYPE;
+			}
+
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+			for(i2=0;;i++,i2++){
+				if(!IsVariableChar(pBuf[i])){
+					temporary[i2]=0;
+					break;
+				}
+				temporary[i2]=pBuf[i];
+			}
+			if(lstrcmp(temporary,ClassName)==0){
+				//クラス名が一致したとき
+
+				for(;;i++){
+					if(pBuf[i]=='\0') break;
+					i2=IsCommandDelimitation(pBuf,i);
+					if(i2){
+						i+=i2;
+						break;
+					}
+				}
+				JumpBlank(pBuf,&i);
+				break;
+			}
+		}
+
+		//次の行をサーチ
+		for(;;i++){
+			i2=IsCommandDelimitation(pBuf,i);
+			if(i2){
+				if(i2==2) i++;
+				break;
+			}
+		}
+
+		if(pBuf[i]=='\0') break;
+	}
+
+	return i;
+}
+BOOL GetClassNameFromClassMember(char *pBuf,int iPos,char *VarName,char *ClassName,BOOL *pbArray){
+	//////////////////////////////////////////////////////
+	// クラス内のメンバ変数のタイプ型であるクラス名の取得
+	//////////////////////////////////////////////////////
+
+	int i,i2;
+	char temporary[8192];
+	DWORD dwProc;
+
+	i=iPos;
+
+	while(1){
+		temporary[0]=0;
+		if(pBuf[i]=='\0') break;
+		if(memicmp(pBuf+i,"End",3)==0){
+			/*	End Class
+				End Interface
+				End Type
+				の検出 */
+			i2=i+3;
+			while(pBuf[i2]==' '||pBuf[i2]=='\t') i2++;
+
+			if(memicmp(pBuf+i2,"Class",5)==0&&(!IsVariableChar(pBuf[i2+5]))||
+				memicmp(pBuf+i2,"Interface",9)==0&&(!IsVariableChar(pBuf[i2+9]))||
+				memicmp(pBuf+i2,"Type",4)==0&&(!IsVariableChar(pBuf[i2+4]))) break;
+		}
+
+		if(memicmp(pBuf+i,"Abstract",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Virtual",7)==0&&(pBuf[i+7]==' '||pBuf[i+7]=='\t')||
+			memicmp(pBuf+i,"Override",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')||
+			memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')){
+			//メンバ関数のとき
+
+			if(pBuf[i]=='a'||pBuf[i]=='A'){
+				i+=9;
+				dwProc=ESC_ABSTRACT;
+			}
+			else{
+
+				if(pBuf[i]=='v'||pBuf[i]=='V'){
+					i+=8;
+					while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+				}
+				else if(pBuf[i]=='o'||pBuf[i]=='O'){
+					i+=9;
+					while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+				}
+
+				if(pBuf[i]=='f'||pBuf[i]=='F'){
+					i+=9;
+					dwProc=ESC_FUNCTION;
+				}
+				else if(pBuf[i]=='s'||pBuf[i]=='S'){
+					i+=4;
+					dwProc=ESC_SUB;
+				}
+			}
+
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		}
+		else{
+			//メンバ変数のとき
+			dwProc=0;
+		}
+
+		//変数名または関数名を取得
+		for(i2=0;;i++,i2++){
+			if(!IsVariableChar(pBuf[i])){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=pBuf[i];
+		}
+
+		if(dwProc==0){
+			if(lstrcmp(temporary,VarName)==0) break;
+		}
+
+		//次の行をサーチ
+		for(;;i++){
+			if(pBuf[i]=='\0') break;
+			i2=IsCommandDelimitation(pBuf,i);
+			if(i2){
+				i+=i2;
+				break;
+			}
+		}
+		JumpBlank(pBuf,&i);
+
+		if(dwProc){
+			//Abstract定義以外はEnd Sub、End Functionをサーチする
+			if(dwProc==ESC_ABSTRACT) continue;
+
+			while(1){
+				if(pBuf[i]=='\0') break;
+
+				if(memicmp(pBuf+i,"End",3)==0){
+					/*	End Sub
+						End Function
+						の検出 */
+					i+=3;
+					while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+					if(memicmp(pBuf+i,"Sub",3)==0&&(!IsVariableChar(pBuf[i+3]))||
+						memicmp(pBuf+i,"Function",8)==0&&(!IsVariableChar(pBuf[i+8]))) break;
+				}
+
+				//次の行をサーチ
+				for(;;i++){
+					if(pBuf[i]=='\0') break;
+					i2=IsCommandDelimitation(pBuf,i);
+					if(i2){
+						i+=i2;
+						break;
+					}
+				}
+				JumpBlank(pBuf,&i);
+			}
+
+			//次の行をサーチ
+			for(;;i++){
+				if(pBuf[i]=='\0') break;
+				i2=IsCommandDelimitation(pBuf,i);
+				if(i2){
+					i+=i2;
+					break;
+				}
+			}
+			JumpBlank(pBuf,&i);
+		}
+	}
+
+	*pbArray=0;
+	if(temporary[0]){
+		while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		if(pBuf[i]=='['){
+			*pbArray=1;
+			for(i2=1,i++;;i++){
+				if(pBuf[i]=='\0') break;
+				if(pBuf[i]=='[') i2++;
+				if(pBuf[i]==']'){
+					i2--;
+					if(i2==0){
+						i++;
+						break;
+					}
+				}
+			}
+		}
+		if(pBuf[i]=='('){
+			*pbArray=1;
+			for(i2=1,i++;;i++){
+				if(pBuf[i]=='\0') break;
+				if(pBuf[i]=='(') i2++;
+				if(pBuf[i]==')'){
+					i2--;
+					if(i2==0){
+						i++;
+						break;
+					}
+				}
+			}
+		}
+
+		//"As ～" を解析
+		while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		if(memicmp(pBuf+i,"As",2)==0&&(pBuf[i+2]==' '||pBuf[i+2]=='\t')){
+			i+=3;
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+			for(i2=0;;i++,i2++){
+				if(!(IsVariableChar(pBuf[i])||pBuf[i]=='*')){
+					ClassName[i2]=0;
+					break;
+				}
+				ClassName[i2]=pBuf[i];
+			}
+		}
+		else ClassName[0]=0;
+
+		return 1;
+	}
+	return 0;
+}
+
+void GetCodeAreaType(char *pBuf,int iPos,int *piProcPos,char *NowClass){
+	///////////////////////////////////////////////
+	// コード領域（グローバル/ローカル）を判定する
+	//    ローカル領域のときはpiProcPosに関数の位置を格納する
+	//    クラス定義内のときはNowClassにクラス名を格納する
+	///////////////////////////////////////////////
+	int i,i2;
+
+	*piProcPos=-1;
+	for(i=0;;i++){
+		if(i>=iPos) break;
+
+		while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+		if(memicmp(pBuf+i,"Class",5)==0&&(pBuf[i+5]==' '||pBuf[i+5]=='\t')||
+			memicmp(pBuf+i,"Interface",9)==0&&(pBuf[i+9]==' '||pBuf[i+9]=='\t')||
+			memicmp(pBuf+i,"Type",4)==0&&(pBuf[i+4]==' '||pBuf[i+4]=='\t')){
+			//Class、Interface、Type
+			if(pBuf[i]=='c'||pBuf[i]=='C') i+=6;
+			else if(pBuf[i]=='i'||pBuf[i]=='I') i+=10;
+			else i+=5;
+
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+			for(i2=0;;i++,i2++){
+				if(!IsVariableChar(pBuf[i])){
+					NowClass[i2]=0;
+					break;
+				}
+				NowClass[i2]=pBuf[i];
+			}
+		}
+		else if(memicmp(pBuf+i,"Sub",3)==0&&(pBuf[i+3]==' '||pBuf[i+3]=='\t')||
+			memicmp(pBuf+i,"Function",8)==0&&(pBuf[i+8]==' '||pBuf[i+8]=='\t')){
+			//Sub、Function
+
+			*piProcPos=i;
+		}
+		else if(memicmp(pBuf+i,"End",3)==0){
+			i+=3;
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+			if(memicmp(pBuf+i,"Sub",3)==0&&(!IsVariableChar(pBuf[i+3]))||
+				memicmp(pBuf+i,"Function",8)==0&&(!IsVariableChar(pBuf[i+8]))){
+				//End Sub、End Function
+				*piProcPos=-1;
+			}
+			else if(memicmp(pBuf+i,"Class",5)==0&&(!IsVariableChar(pBuf[i+5]))||
+				memicmp(pBuf+i,"Interface",9)==0&&(!IsVariableChar(pBuf[i+9]))||
+				memicmp(pBuf+i,"Type",4)==0&&(!IsVariableChar(pBuf[i+4]))){
+				//End Class、End Interface、End Type
+				NowClass[0]=0;
+			}
+		}
+
+		//次の行をサーチ
+		for(;;i++){
+			i2=IsCommandDelimitation(pBuf,i);
+			if(i2){
+				if(i2==2) i++;
+				break;
+			}
+		}
+
+		if(pBuf[i]=='\0') break;
+	}
+}
+BOOL GetClassNameFromDim(char *pBuf,int *piPos,char *VarName,char *ClassName,BOOL *pbArray){
+	int i,i2;
+	char temporary[8192];
+
+	i=*piPos;
+
+	while(1){
+		while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+
+		if((memicmp(pBuf+i,"ByRef",5)==0||memicmp(pBuf+i,"ByVal",5)==0)&&
+			(pBuf[i+5]==' '||pBuf[i+5]=='\t')){
+			//ByRef/ByVal表記を飛び越す
+			i+=6;
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		}
+
+		for(i2=0;;i++,i2++){
+			if(!IsVariableChar(pBuf[i])){
+				temporary[i2]=0;
+				break;
+			}
+			temporary[i2]=pBuf[i];
+		}
+
+		if(lstrcmp(temporary,VarName)==0) break;
+
+		for(;;i++){
+			if(IsCommandDelimitation(pBuf,i)) break;
+			if(pBuf[i]==','){
+				i++;
+				break;
+			}
+		}
+
+		if(IsCommandDelimitation(pBuf,i)){
+			temporary[0]=0;
+			break;
+		}
+	}
+
+	*pbArray=0;
+	if(temporary[0]){
+		while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		if(pBuf[i]=='['){
+			*pbArray=1;
+			for(i2=1,i++;;i++){
+				if(pBuf[i]=='\0') break;
+				if(pBuf[i]=='[') i2++;
+				if(pBuf[i]==']'){
+					i2--;
+					if(i2==0){
+						i++;
+						break;
+					}
+				}
+			}
+		}
+
+		//"As ～" を解析
+		while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+		if(memicmp(pBuf+i,"As",2)==0&&(pBuf[i+2]==' '||pBuf[i+2]=='\t')){
+			i+=3;
+			while(pBuf[i]==' '||pBuf[i]=='\t') i++;
+			for(i2=0;;i++,i2++){
+				if(!(IsVariableChar(pBuf[i])||pBuf[i]=='*')){
+					ClassName[i2]=0;
+					break;
+				}
+				ClassName[i2]=pBuf[i];
+			}
+		}
+		else ClassName[0]=0;
+
+		*piPos=i;
+		return 1;
+	}
+
+	*piPos=i;
+	return 0;
+}
+BOOL GetVariableClassName(char *pEditBuf,int iPos,char *VarName,char *ClassName,BOOL *pbArray){
+	//////////////////////////////////////////
+	// 変数宣言コードをもとに、クラス名を取得
+	//////////////////////////////////////////
+
+	extern char *pHeaderBuf;
+	extern char *pUserSource;
+	int i,i2;
+	char NowClass[VN_SIZE];
+
+
+	// キャレット位置のコード領域を判定（クラス/ローカル/グローバル）
+	int iProcPos;
+	GetCodeAreaType(pEditBuf,iPos,&iProcPos,NowClass);
+
+
+	//////////////////////////////////////////
+	// 変数宣言コードをもとに、クラス名を取得
+	//////////////////////////////////////////
+
+	if(iProcPos!=-1){
+		//ローカル領域
+		i=iProcPos;
+
+		//関数パラメータをサーチ
+		for(;;i++){
+			if(pEditBuf[i]=='('){
+				i++;
+				if(GetClassNameFromDim(pEditBuf,&i,VarName,ClassName,pbArray)) return 1;
+			}
+
+			i2=IsCommandDelimitation(pEditBuf,i);
+			if(i2){
+				if(pEditBuf[i]=='\0') break;
+				i+=i2;
+				break;
+			}
+		}
+
+		//関数内ソースコードをサーチ
+		for(;;i++){
+			while(pEditBuf[i]==' '||pEditBuf[i]=='\t') i++;
+
+			if(memicmp(pEditBuf+i,"End",3)==0){
+				i+=3;
+				while(pEditBuf[i]==' '||pEditBuf[i]=='\t') i++;
+
+				if(memicmp(pEditBuf+i,"Sub",3)==0&&(!IsVariableChar(pEditBuf[i+3]))||
+					memicmp(pEditBuf+i,"Function",8)==0&&(!IsVariableChar(pEditBuf[i+3]))){
+					break;
+				}
+			}
+			else if(memicmp(pEditBuf+i,"Dim",3)==0&&(pEditBuf[i+3]==' '||pEditBuf[i+3]=='\t')){
+				i+=3;
+
+				if(GetClassNameFromDim(pEditBuf,&i,VarName,ClassName,pbArray)) return 1;
+			}
+			for(;;i++){
+				i2=IsCommandDelimitation(pEditBuf,i);
+				if(i2){
+					if(i2==2) i++;
+					break;
+				}
+			}
+
+			if(pEditBuf[i]=='\0') break;
+		}
+	}
+
+	if(NowClass[0]&&iProcPos!=-1){
+		//クラスメンバ関数領域
+		DWORD dwClassType;
+		char *pBuf;
+		i=GetClassPos(pUserSource,NowClass,&dwClassType);
+		if(pUserSource[i]=='\0'){
+			i=GetClassPos(pHeaderBuf,NowClass,&dwClassType);
+			if(pHeaderBuf[i]=='\0') pBuf=0;
+			else pBuf=pHeaderBuf;
+		}
+		else pBuf=pUserSource;
+
+		if(pBuf){
+			i=GetClassNameFromClassMember(pBuf,i,VarName,ClassName,pbArray);
+			if(i) return 1;
+		}
+	}
+
+	//グローバル領域
+	for(i=0;;i++){
+		while(pUserSource[i]==' '||pUserSource[i]=='\t') i++;
+
+		if(memicmp(pUserSource+i,"Dim",3)==0&&(pUserSource[i+3]==' '||pUserSource[i+3]=='\t')){
+			i+=3;
+
+			if(GetClassNameFromDim(pUserSource,&i,VarName,ClassName,pbArray)) return 1;
+		}
+
+		else if(memicmp(pUserSource+i,"Sub",3)==0&&(pUserSource[i+3]==' '||pUserSource[i+3]=='\t')||
+			memicmp(pUserSource+i,"Function",8)==0&&(pUserSource[i+8]==' '||pUserSource[i+8]=='\t')){
+			//Sub ～ End Sub、Function ～ End Function間を飛び越す
+			while(1){
+				//次の行をサーチ
+				for(;;i++){
+					if(pUserSource[i]=='\0') break;
+					i2=IsCommandDelimitation(pUserSource,i);
+					if(i2){
+						i+=i2;
+						break;
+					}
+				}
+				JumpBlank(pUserSource,&i);
+
+				if(pUserSource[i]=='\0') break;
+
+				if(memicmp(pUserSource+i,"End",3)==0){
+					/*	End Sub
+						End Function
+						の検出 */
+					i+=3;
+					while(pUserSource[i]==' '||pUserSource[i]=='\t') i++;
+
+					if(memicmp(pUserSource+i,"Sub",3)==0&&(!IsVariableChar(pUserSource[i+3]))||
+						memicmp(pUserSource+i,"Function",8)==0&&(!IsVariableChar(pUserSource[i+8]))) break;
+				}
+			}
+		}
+
+		//次の行をサーチ
+		for(;;i++){
+			i2=IsCommandDelimitation(pUserSource,i);
+			if(i2){
+				if(i2==2) i++;
+				break;
+			}
+		}
+
+		if(pUserSource[i]=='\0') break;
+	}
+
+	return 0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/common_msg_eng.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/common_msg_eng.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/common_msg_eng.h	(revision 178)
@@ -0,0 +1,88 @@
+///////////////////////////////////////////////////////////////
+// アプリケーションで使用する汎用テキストを定義しています
+//
+// 英語
+///////////////////////////////////////////////////////////////
+
+
+////////
+// 汎用
+////////
+#define STRING_NONE_				"None"
+#define STRING_DEFAULT			"Default"
+#define STRING_ERROR			"Error"
+#define STRING_PROJECT			"Project"
+#define STRING_RESOURCE			"Resource"
+#define STRING_SIZE				"Size"
+#define STRING_OPTION			"Options"
+#define STRING_PROJECTOPTION	"Project Options"
+
+
+////////
+// 単位
+////////
+#define STRING_UNIT_COLORS	"colors"
+#define STRING_MORNING		"A.M."
+#define STRING_AFTERNOON	"P.M."
+
+
+//////////////////
+// ファイルタイプ
+//////////////////
+#define STRING_FILETYPE_BASICPROGRAM	"Basic Program"
+#define STRING_FILETYPE_SUBPROGRAM		"Sub Program"
+#define STRING_FILETYPE_TEXT			"Text Document"
+#define STRING_FILETYPE_UNKNOWN			"Unknown"
+
+#define STRING_NEWFILE_BASICPROGRAM		"Basic source file (*.abp / *.bas)"
+#define STRING_NEWFILE_TEXT				"Text file (*.txt)"
+#define STRING_NEWFILE_ICON				"Icon file (*.ico)"
+#define STRING_NEWFILE_PROJECT			"Project (*.pj)"
+
+
+////////////////////////////////////////////////
+// ファイルオープンダイアログボックスのタイトル
+////////////////////////////////////////////////
+#define STRING_FILEOPENTITLE_DEFAULT			"Open the file"
+#define STRING_FILEOPENTITLE_INSERTEDPROJECT	"Open the file inserted in the project"
+#define STRING_FILEOPENTITLE_PROJECT			"Open the project file"
+#define STRING_FILEOPENTITLE_CURSOR				"Open the cursor file"
+#define STRING_FILEOPENTITLE_ICON				"Open the icon file"
+#define STRING_FILEOPENTITLE_BITMAP				"Open the bitmap file"
+
+#define STRING_FILESAVETITLE_DEFAULT			"Save As"
+
+#define STRING_DIRECTORY_SELECT					"Select the Directory."
+
+
+//////////////////////////
+// 保存チェックメッセージ
+//////////////////////////
+#define STRING_MODIFYCHECK_FILE		"\"%s\" file was modified. Save it?"
+
+
+///////////////////
+// 検索メッセージ
+///////////////////
+#define STRING_SEARCH_AGAIN		"Search again from head of the file?"
+#define STRING_SEARCH_NOTFOUND	"\"%s\" was not found."
+
+
+////////////////////////
+// 汎用エラーメッセージ
+////////////////////////
+#define STRING_ERROR_MUST_IDNAME		"You must enter the id name."
+#define STRING_ERROR_MUST_CAPTION		"You must enter the caption."
+#define STRING_ERROR_CANT_FILEOPEN		"I cannot read the file \"%s\"."
+#define STRING_ERROR_CANT_FILESAVE		"I cannot write to file \"%s\"."
+#define STRING_FILE_OVERWRIDE			"\"%s\" file already exists. Overwrite it?"
+#define STRING_ERROR_MAXLENGTH			"The length of text is max. You cannot input more text."
+#define STRING_ERROR_NOBASICCOMPILER	"BasicCompiler was not found."
+#define STRING_ERROR_PROJECTTOPCHAR		"The head character of a project name must be the alphabet(A-Z,a-Z) or the underbar(_)."
+#define STRING_ERROR_PROJECTNAME		 "Illegal character found from the project name"
+
+
+/////////////////////
+// その他メッセージ
+/////////////////////
+#define STRING_TOOLBAR_RESET		"Reset the state of the toolbar.\nReally?"
Index: tag/abdev(2007.06.20)/ProjectEditor/common_msg_jpn.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/common_msg_jpn.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/common_msg_jpn.h	(revision 178)
@@ -0,0 +1,88 @@
+///////////////////////////////////////////////////////////////
+// アプリケーションで使用する汎用テキストを定義しています
+//
+// 日本語
+///////////////////////////////////////////////////////////////
+
+
+////////
+// 汎用
+////////
+#define STRING_NONE_				"なし"
+#define STRING_DEFAULT			"デフォルト"
+#define STRING_ERROR			"エラー"
+#define STRING_PROJECT			"プロジェクト"
+#define STRING_RESOURCE			"リソース"
+#define STRING_SIZE				"サイズ"
+#define STRING_OPTION			"オプション"
+#define STRING_PROJECTOPTION	"プロジェクト オプション"
+
+
+////////
+// 単位
+////////
+#define STRING_UNIT_COLORS	"色"	
+#define STRING_MORNING		"午前"
+#define STRING_AFTERNOON	"午後"
+
+
+//////////////////
+// ファイルタイプ
+//////////////////
+#define STRING_FILETYPE_BASICPROGRAM	"Basic プログラム"
+#define STRING_FILETYPE_SUBPROGRAM		"サブ プログラム"
+#define STRING_FILETYPE_TEXT			"テキスト ドキュメント"
+#define STRING_FILETYPE_UNKNOWN			"不明"
+
+#define STRING_NEWFILE_BASICPROGRAM		"Basicプログラム (*.abp *.bas)"
+#define STRING_NEWFILE_TEXT				"標準テキスト（*.txt)"
+#define STRING_NEWFILE_ICON				"アイコン（*.ico)"
+#define STRING_NEWFILE_PROJECT			"プロジェクト（*.pj)"
+
+
+////////////////////////////////////////////////
+// ファイルオープンダイアログボックスのタイトル
+////////////////////////////////////////////////
+#define STRING_FILEOPENTITLE_DEFAULT			"ファイルを指定してください"
+#define STRING_FILEOPENTITLE_INSERTEDPROJECT	"プロジェクトへ挿入するファイルを指定してください"
+#define STRING_FILEOPENTITLE_PROJECT			"プロジェクト ファイルを指定してください"
+#define STRING_FILEOPENTITLE_CURSOR				"カーソル ファイルを指定してください"
+#define STRING_FILEOPENTITLE_ICON				"アイコン ファイルを指定してください"
+#define STRING_FILEOPENTITLE_BITMAP				"ビットマップ ファイルを指定してください"
+
+#define STRING_FILESAVETITLE_DEFAULT			"保存先のファイルを指定してください"
+
+#define STRING_DIRECTORY_SELECT					"ディレクトリを選択して下さい"
+
+
+//////////////////////////
+// 保存チェックメッセージ
+//////////////////////////
+#define STRING_MODIFYCHECK_FILE		"\"%s\" ファイルは変更されています。保存しますか？"
+
+
+///////////////////
+// 検索メッセージ
+///////////////////
+#define STRING_SEARCH_AGAIN		"ファイルの最初から検索しますか？"
+#define STRING_SEARCH_NOTFOUND	"文字列 \"%s\" が見つかりません"
+
+
+////////////////////////
+// 汎用エラーメッセージ
+////////////////////////
+#define STRING_ERROR_MUST_IDNAME		"ID名を入力して下さい。"
+#define STRING_ERROR_MUST_CAPTION		"キャプションを入力して下さい。"
+#define STRING_ERROR_CANT_FILEOPEN		"\"%s\" ファイルの読み込みに失敗しました。"
+#define STRING_ERROR_CANT_FILESAVE		"\"%s\" ファイルへの書き込みに失敗しました。"
+#define STRING_FILE_OVERWRIDE			"\"%s\" ファイルは既に存在しています。上書きしますか？"
+#define STRING_ERROR_MAXLENGTH			"これ以上、テキストを入力することができません"
+#define STRING_ERROR_NOBASICCOMPILER	"BasicCompiler が見つかりません"
+#define STRING_ERROR_PROJECTTOPCHAR		"プロジェクト名の先頭文字はアルファベット（A～Z、a～z）またはアンダーバー（_）でなければなりません。"
+#define STRING_ERROR_PROJECTNAME		"プロジェクト名に不正な文字コードが含まれています。"
+
+
+/////////////////////
+// その他メッセージ
+/////////////////////
+#define STRING_TOOLBAR_RESET		"ツールバーの配置をすべて初期状態に戻します。\nよろしいですか？"
Index: tag/abdev(2007.06.20)/ProjectEditor/manifest.xml
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/manifest.xml	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/manifest.xml	(revision 178)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+	<description>Description</description>
+	<dependency>
+		<dependentAssembly>
+			<assemblyIdentity
+				type="win32"
+				name="Microsoft.Windows.Common-Controls"
+				version="6.0.0.0"
+				processorArchitecture="x86"
+				publicKeyToken="6595b64144ccf1df"
+				language="*" />
+		</dependentAssembly>
+	</dependency>
+</assembly>
Index: tag/abdev(2007.06.20)/ProjectEditor/menu.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/menu.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/menu.cpp	(revision 178)
@@ -0,0 +1,577 @@
+#include "common.h"
+
+HFONT hMenuFont;
+
+
+
+CMenuItemData::CMenuItemData(int item_index,int itemID,char *str,CMenuEx *pobj_ThisMenu,CSubMenuEx *pobj_SubMenu){
+	this->item_index=item_index;
+	this->itemID=itemID;
+	if(str){
+		this->str=(char *)HeapAlloc(hHeap,0,lstrlen(str)+1);
+		lstrcpy(this->str,str);
+	}
+	else this->str=0;
+	this->pobj_ThisMenu=pobj_ThisMenu;
+	this->pobj_SubMenu=pobj_SubMenu;
+
+
+	hIcon=0;
+	hGrayIcon=0;
+}
+CMenuItemData::~CMenuItemData(){
+	//メニュー文字列
+	if(str)
+		HeapDefaultFree(str);
+
+	//サブメニュー オブジェクトを破棄
+	if(pobj_SubMenu)
+		delete pobj_SubMenu;
+
+	//アイコン
+	if(hIcon) DestroyIcon(hIcon);
+
+	//淡色アイコン
+	if(hGrayIcon) DestroyIcon(hGrayIcon);
+}
+
+
+
+CMenuEx *pobj_MainMenu;
+
+CMenuEx::CMenuEx(HMENU hmenu){
+	hMenu=hmenu;
+
+	ppobj_MenuItemData=(CMenuItemData **)HeapAlloc(hHeap,0,1);
+	iMenuItemNum=0;
+}
+CMenuEx::~CMenuEx(){
+	int i;
+
+	//itemDataを解放
+	for(i=0;i<iMenuItemNum;i++){
+		delete ppobj_MenuItemData[i];
+	}
+	HeapDefaultFree(ppobj_MenuItemData);
+
+	DestroyMenu(hMenu);
+}
+
+void CMenuEx::EnableItem(UINT uIDEnableItem,UINT uEnable){
+	//メニューアイテムの有効化/無効化
+	EnableMenuItem(hMenu,uIDEnableItem,uEnable);
+}
+void CMenuEx::CheckMenu(UINT idItem,BOOL bChecked){
+	//メニューアイテムのチェックマークON/OFF
+	MENUITEMINFO MenuItemInfo;
+	MenuItemInfo.cbSize=sizeof(MENUITEMINFO);
+	MenuItemInfo.fMask=MIIM_STATE;
+	if(bChecked) MenuItemInfo.fState=MFS_CHECKED;
+	else MenuItemInfo.fState=MFS_UNCHECKED;
+
+	SetMenuItemInfo(hMenu,idItem,0,&MenuItemInfo);
+}
+BOOL CMenuEx::IsCheck(UINT idItem){
+	MENUITEMINFO MenuItemInfo;
+	MenuItemInfo.cbSize=sizeof(MENUITEMINFO);
+	MenuItemInfo.fMask=MIIM_STATE;
+	GetMenuItemInfo(hMenu,idItem,0,&MenuItemInfo);
+	if(MenuItemInfo.fState&MFS_CHECKED) return 1;
+	return 0;
+}
+void CMenuEx::RenameMenuItem(int item_index,char *str){
+	ppobj_MenuItemData[item_index]->str=(char *)HeapReAlloc(hHeap,0,ppobj_MenuItemData[item_index]->str,lstrlen(str)+1);
+	lstrcpy(ppobj_MenuItemData[item_index]->str,str);
+}
+void CMenuEx::RenameMenuItemByID(int itemID,char *str){
+	int i;
+	for(i=0;i<iMenuItemNum;i++){
+		if(ppobj_MenuItemData[i]->itemID==itemID){
+			RenameMenuItem(i,str);
+			return;
+		}
+	}
+}
+void CMenuEx::RemoveItem(int item_index){
+	//メニューアイテムの消去
+	//※ポップアップメニューの消去には対応していない
+
+	::RemoveMenu(hMenu,item_index,MF_BYPOSITION);
+
+	//メニューアイテム拡張データオブジェクトを破棄
+	delete ppobj_MenuItemData[item_index];
+
+
+	iMenuItemNum--;
+
+	int i;
+	for(i=item_index;i<iMenuItemNum;i++){
+		ppobj_MenuItemData[i]=ppobj_MenuItemData[i+1];
+	}
+}
+void CMenuEx::InsertItem(int item_index,int itemID,char *str){
+	//メニューアイテムの挿入
+
+	CMenuItemData *pobj_MenuItemData;
+	pobj_MenuItemData=AddMenuExItemData(item_index,itemID,str,this,0);
+
+	MENUITEMINFO mii;
+	memset(&mii,0,sizeof(MENUITEMINFO));
+	mii.cbSize=sizeof(MENUITEMINFO);
+	mii.fMask=MIIM_TYPE|MIIM_ID|MIIM_DATA;
+	mii.fType=MFT_OWNERDRAW;
+	mii.wID=itemID;
+	mii.dwTypeData=str;
+	mii.dwItemData=(ULONG_PTR)pobj_MenuItemData;
+	InsertMenuItem(hMenu,item_index,1,&mii);
+}
+
+BOOL CMenuEx::SetIcon(int itemID,HICON hIcon){
+	//アイコンをセット
+	int i;
+	for(i=0;i<iMenuItemNum;i++){
+		if(ppobj_MenuItemData[i]->itemID==itemID){
+			ppobj_MenuItemData[i]->hIcon=hIcon;
+
+
+			/////////////////////////
+			// 淡色アイコンを作成
+			/////////////////////////
+
+			ppobj_MenuItemData[i]->hGrayIcon=CreateGrayIcon(hIcon);
+			return 1;
+		}
+		if(ppobj_MenuItemData[i]->pobj_SubMenu){
+			BOOL bResult;
+			bResult=ppobj_MenuItemData[i]->pobj_SubMenu->SetIcon(itemID,hIcon);
+			if(bResult) return 1;
+		}
+	}
+	return 0;
+}
+
+CMenuItemData *CMenuEx::AddMenuExItemData(int item_index,int itemID,char *str,CMenuEx *pobj_ThisMenu,CSubMenuEx *pobj_SubMenu){
+	CMenuItemData *pobj_MenuItemData;
+	pobj_MenuItemData=new CMenuItemData(item_index,itemID,str,pobj_ThisMenu,pobj_SubMenu);
+
+
+	ppobj_MenuItemData=(CMenuItemData **)HeapReAlloc(hHeap,0,ppobj_MenuItemData,(iMenuItemNum+1)*sizeof(CMenuItemData *));
+
+	int i;
+	for(i=iMenuItemNum;i>item_index;i--){
+		ppobj_MenuItemData[i]=ppobj_MenuItemData[i-1];
+	}
+
+	ppobj_MenuItemData[item_index]=pobj_MenuItemData;
+
+	iMenuItemNum++;
+
+	return pobj_MenuItemData;
+}
+void CMenuEx::InitOwnerDraw(BOOL bParent){
+	char temporary[MAX_PATH];
+	MENUITEMINFO mii;
+	mii.cbSize=sizeof(MENUITEMINFO);
+	mii.fMask=MIIM_TYPE|MIIM_ID|MIIM_SUBMENU|MIIM_DATA;
+
+	int nCount;
+	nCount=GetMenuItemCount(hMenu);
+
+	int i;
+	for(i=0;i<nCount;i++){
+		mii.dwTypeData=temporary;
+		mii.cch=MAX_PATH;
+		GetMenuItemInfo(hMenu,i,1,&mii);
+
+		char *temp2=0;
+		if(mii.fType==MFT_STRING) temp2=temporary;
+
+		int fType_Separator;
+		if(mii.fType==MFT_SEPARATOR) fType_Separator=MFT_SEPARATOR;
+		else fType_Separator=0;
+
+		CSubMenuEx *pobj_SubMenu;
+		if(mii.hSubMenu){
+			pobj_SubMenu=new CSubMenuEx(mii.hSubMenu);
+			pobj_SubMenu->InitOwnerDraw(0);
+		}
+		else pobj_SubMenu=0;
+
+		//拡張データをメモリに退避
+		CMenuItemData *pobj_MenuItemData;
+		pobj_MenuItemData=AddMenuExItemData(i,mii.wID,temp2,this,pobj_SubMenu);
+
+		mii.fType=MFT_OWNERDRAW | fType_Separator;
+		mii.dwItemData=(ULONG_PTR)pobj_MenuItemData;
+		SetMenuItemInfo(hMenu,i,1,&mii);
+	}
+}
+void CMenuEx::GetItemSize(int item_index,SIZE *pSize){
+	if(ppobj_MenuItemData[item_index]->str){
+		HDC hdc;
+		hdc = GetDC(GetDesktopWindow());
+		HFONT hOldFont;
+		hOldFont = (HFONT)SelectObject(hdc, hMenuFont);
+
+		GetTextExtentPoint32(hdc,
+			ppobj_MenuItemData[item_index]->str,
+			lstrlen(ppobj_MenuItemData[item_index]->str),
+			pSize);
+
+		SelectObject(hdc,hOldFont);
+		ReleaseDC(GetDesktopWindow(),hdc);
+	}
+	else{
+		//セパレータのとき
+		pSize->cx=50;
+		pSize->cy=10;
+	}
+}
+
+BOOL CMenuEx::OwnerDrawSubMenu(HMENU hSubMenu,HDC hdc,RECT *pRect,BOOL bSelect,int item_index){
+	int i;
+	for(i=0;i<iMenuItemNum;i++){
+		if(ppobj_MenuItemData[i]->pobj_SubMenu){
+			if(hSubMenu==ppobj_MenuItemData[i]->pobj_SubMenu->hMenu){
+				ppobj_MenuItemData[i]->pobj_SubMenu->OwnerDrawMenu(hdc,pRect,bSelect,item_index);
+				return 1;
+			}
+			else{
+				BOOL bResult;
+				bResult=ppobj_MenuItemData[i]->pobj_SubMenu->OwnerDrawSubMenu(hSubMenu,hdc,pRect,bSelect,item_index);
+				if(bResult) return 1;
+			}
+		}
+	}
+	return 0;
+}
+void CMenuEx::OwnerDrawMenu(HDC hdc,RECT *pRect,BOOL bSelect,int item_index){
+	/////////////////////////////////
+	// 親メニューのオーナー描画
+	/////////////////////////////////
+
+
+	COLORREF BackColor,TextColor;
+
+	RECT rc;
+
+	if(bSelect){
+		//選択状態にある場合
+		HPEN hPen,hOldPen;
+		hPen=CreatePen(PS_SOLID,0,MENUCOLOR_SELECT_LINE);
+		hOldPen=(HPEN)SelectObject(hdc,hPen);
+
+		HBRUSH hBrush,hOldBrush;
+		hBrush=CreateSolidBrush(MENUCOLOR_SELECT_BACK);
+		hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+
+		pRect->left++;
+		pRect->top++;
+		Rectangle(hdc,pRect);
+		pRect->left--;
+
+		SelectObject(hdc,hOldPen);
+		SelectObject(hdc,hOldBrush);
+
+		DeleteObject(hPen);
+		DeleteObject(hBrush);
+
+		TextColor=MENUCOLOR_TEXT;
+	}
+	else{
+		POINT pos;
+		GetCursorPos(&pos);
+		GetWindowRect(hOwner,&rc);
+		pos.x-=rc.left;
+		pos.y-=rc.top;
+		if(HitTest(pRect,&pos)){
+			//ホットイメージで表示
+			HPEN hPen,hOldPen;
+			hPen=CreatePen(PS_SOLID,0,MENUCOLOR_HOT_LINE);
+			hOldPen=(HPEN)SelectObject(hdc,hPen);
+
+			HBRUSH hBrush,hOldBrush;
+			hBrush=CreateSolidBrush(MENUCOLOR_HOT_BACK);
+			hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+
+			pRect->left++;
+			pRect->top++;
+			Rectangle(hdc,pRect);
+			pRect->left--;
+			pRect->top--;
+
+			SelectObject(hdc,hOldPen);
+			SelectObject(hdc,hOldBrush);
+
+			DeleteObject(hPen);
+			DeleteObject(hBrush);
+
+			TextColor=MENUCOLOR_TEXT;
+		}
+		else{
+			BackColor=MENUCOLOR_DEFAULT_BACK;
+			TextColor=MENUCOLOR_TEXT;
+
+			//背景を塗りつぶす
+			HBRUSH hBrush;
+			hBrush=CreateSolidBrush(BackColor);
+			FillRect(hdc,pRect,hBrush);
+			DeleteObject(hBrush);
+		}
+	}
+
+
+	if(ppobj_MenuItemData[item_index]->str){
+		rc=*pRect;
+		rc.top+=1;
+
+		SetBkMode(hdc, TRANSPARENT);
+		SetTextColor(hdc, TextColor);
+
+		HFONT hOldFont;
+		hOldFont=(HFONT)SelectObject(hdc,hMenuFont);
+
+		DrawText(hdc,ppobj_MenuItemData[item_index]->str,-1,&rc,DT_CENTER|DT_VCENTER|DT_SINGLELINE);
+
+		SelectObject(hdc,hOldFont);
+	}
+	else{
+		//セパレータのとき
+	}
+}
+
+
+CSubMenuEx::CSubMenuEx(HMENU hMenu):CMenuEx(hMenu){
+}
+void CSubMenuEx::GetItemSize(int item_index,SIZE *pSize){
+	if(ppobj_MenuItemData[item_index]->str){
+		HDC hdc;
+		hdc = GetDC(GetDesktopWindow());
+		HFONT hOldFont;
+		hOldFont = (HFONT)SelectObject(hdc, hMenuFont);
+
+		GetTextExtentPoint32(hdc,
+			ppobj_MenuItemData[item_index]->str,
+			lstrlen(ppobj_MenuItemData[item_index]->str),
+			pSize);
+
+		SelectObject(hdc,hOldFont);
+		ReleaseDC(GetDesktopWindow(),hdc);
+
+		pSize->cx+=50;
+		if(pSize->cy<22) pSize->cy=22;
+	}
+	else{
+		//セパレータのとき
+		pSize->cx=50;
+		pSize->cy=10;
+	}
+}
+
+void CSubMenuEx::OwnerDrawMenu(HDC hdc,RECT *pRect,BOOL bSelect,int item_index){
+	//////////////////////////////////
+	// サブメニューのオーナー描画
+	//////////////////////////////////
+
+	RECT rc;
+	COLORREF BackColor,TextColor;
+	int i;
+
+	///////////////////////////////
+	// 左側のグラデーションを描画
+	///////////////////////////////
+
+	SIZE size;
+	size.cx=22;
+	size.cy=pRect->bottom-pRect->top;
+	HBITMAP hBmp;
+	hBmp=CreateHorzGradationBitmap(&size,RGB(254,254,251),RGB(196,196,173));
+
+	HDC memdc;
+	memdc=CreateCompatibleDC(hdc);
+	SelectObject(memdc,hBmp);
+	BitBlt(hdc,pRect->left,pRect->top,size.cx,size.cy,memdc,0,0,SRCCOPY);
+	DeleteDC(memdc);
+	DeleteObject(hBmp);
+
+
+	if(ppobj_MenuItemData[item_index]->str==0){
+		//セパレータのとき
+		HPEN hPen,hOldPen;
+		hPen=CreatePen(PS_SOLID,0,MENUCOLOR_DEFAULT_LINE);
+		hOldPen=(HPEN)SelectObject(hdc,hPen);
+
+		MoveToEx(hdc,pRect->left+24,pRect->top+(pRect->bottom-pRect->top)/2,NULL);
+		LineTo(hdc,pRect->right,pRect->top+(pRect->bottom-pRect->top)/2);
+
+		SelectObject(hdc,hOldPen);
+		DeleteObject(hPen);
+		return;
+	}
+
+
+	//アイテムの状態を取得
+	MENUITEMINFO mii;
+	mii.cbSize=sizeof(MENUITEMINFO);
+	mii.fMask=MIIM_STATE;
+	GetMenuItemInfo(hMenu,item_index,1,&mii);
+
+
+	if(bSelect&&(mii.fState&MFS_DISABLED)==0){
+		//ホットイメージで表示
+		BackColor=MENUCOLOR_HOT_BACK;
+
+		HPEN hPen,hOldPen;
+		hPen=CreatePen(PS_SOLID,0,MENUCOLOR_HOT_LINE);
+		hOldPen=(HPEN)SelectObject(hdc,hPen);
+
+		HBRUSH hBrush,hOldBrush;
+		hBrush=CreateSolidBrush(BackColor);
+		hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+
+		Rectangle(hdc,pRect);
+
+		SelectObject(hdc,hOldPen);
+		SelectObject(hdc,hOldBrush);
+
+		DeleteObject(hPen);
+		DeleteObject(hBrush);
+	}
+	else{
+		//マウスカーソルの座標を取得
+		POINT pos;
+		GetCursorPos(&pos);
+
+		//親ウィンドウのウィンドウ左上からの相対座標に変換
+		//（クライアント座標ではないところに注意）
+		GetWindowRect(WindowFromDC(hdc),&rc);
+		ScreenToClient(WindowFromDC(hdc),&pos);
+
+		if(bSelect&&HitTest(pRect,&pos)==0){
+			//淡色状態
+			BackColor=MENUCOLOR_SELECT_BACK;
+
+			HPEN hPen,hOldPen;
+			hPen=CreatePen(PS_SOLID,0,MENUCOLOR_SELECT_LINE);
+			hOldPen=(HPEN)SelectObject(hdc,hPen);
+
+			HBRUSH hBrush,hOldBrush;
+			hBrush=CreateSolidBrush(BackColor);
+			hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+
+			Rectangle(hdc,pRect);
+
+			SelectObject(hdc,hOldPen);
+			SelectObject(hdc,hOldBrush);
+
+			DeleteObject(hPen);
+			DeleteObject(hBrush);
+		}
+		else{
+			BackColor=GetSysColor(COLOR_MENU);
+
+			rc=*pRect;
+			rc.left=pRect->left+22;
+			rc.right=pRect->right;
+
+			//背景を塗りつぶす
+			HBRUSH hBrush;
+			hBrush=CreateSolidBrush(BackColor);
+			FillRect(hdc,&rc,hBrush);
+			DeleteObject(hBrush);
+		}
+	}
+
+
+	if(mii.fState&MFS_CHECKED){
+		//チェックマークの外枠を描画
+		rc=*pRect;
+		rc.top++;
+		rc.right=rc.left+20;
+		rc.bottom--;
+
+		HPEN hPen,hOldPen;
+		hPen=CreatePen(PS_SOLID,0,MENUCOLOR_HOT_LINE);
+		hOldPen=(HPEN)SelectObject(hdc,hPen);
+
+		HBRUSH hBrush,hOldBrush;
+		hBrush=CreateSolidBrush(BackColor);
+		hOldBrush=(HBRUSH)SelectObject(hdc,hBrush);
+
+		Rectangle(hdc,&rc);
+
+		SelectObject(hdc,hOldPen);
+		SelectObject(hdc,hOldBrush);
+
+		DeleteObject(hPen);
+		DeleteObject(hBrush);
+
+
+		//チェックマークを描画
+		int BaseX=rc.left,BaseY=rc.top;
+		for(i=0;i<3;i++){
+			SetPixel(hdc,BaseX+6+i,BaseY+9+i,MENUCOLOR_TEXT);
+			SetPixel(hdc,BaseX+6+i,BaseY+10+i,MENUCOLOR_TEXT);
+		}
+		for(i=0;i<4;i++){
+			SetPixel(hdc,BaseX+9+i,BaseY+10-i,MENUCOLOR_TEXT);
+			SetPixel(hdc,BaseX+9+i,BaseY+11-i,MENUCOLOR_TEXT);
+		}
+	}
+	else{
+		if(ppobj_MenuItemData[item_index]->hIcon){
+			//アイコンを描画
+			HICON hIcon;
+			if(mii.fState&MFS_DISABLED) hIcon=ppobj_MenuItemData[item_index]->hGrayIcon;
+			else hIcon=ppobj_MenuItemData[item_index]->hIcon;
+
+			DrawIconEx(hdc,pRect->left+1,pRect->top+3,hIcon,16,16,0,NULL,DI_NORMAL);
+		}
+	}
+
+
+
+	//メイン文字列とショートカットキー文字列を分別
+	char szMain[255],szShortcut[255];
+	for(i=0;;i++){
+		if(ppobj_MenuItemData[item_index]->str[i]=='\t'){
+			szMain[i]=0;
+
+			lstrcpy(szShortcut,ppobj_MenuItemData[item_index]->str+i+1);
+			break;
+		}
+		szMain[i]=ppobj_MenuItemData[item_index]->str[i];
+		if(ppobj_MenuItemData[item_index]->str[i]=='\0'){
+			szShortcut[0]=0;
+			break;
+		}
+	}
+
+	rc=*pRect;
+	rc.left=pRect->left+26;
+	rc.right=pRect->right;
+
+	HFONT hOldFont;
+	hOldFont=(HFONT)SelectObject(hdc,hMenuFont);
+
+	if(mii.fState&MFS_DISABLED){
+		//淡色カラー
+		TextColor=MENUCOLOR_GRAY_TEXT;
+	}
+	else{
+		//通常カラー
+		TextColor=MENUCOLOR_TEXT;
+	}
+
+	SetBkMode(hdc, TRANSPARENT);
+	SetTextColor(hdc, TextColor);
+
+	DrawText(hdc,szMain,-1,&rc,DT_VCENTER|DT_LEFT|DT_SINGLELINE);
+
+	if(szShortcut[0]){
+		rc.left=rc.right-45;
+		DrawText(hdc,szShortcut,-1,&rc,DT_VCENTER|DT_LEFT|DT_SINGLELINE);
+	}
+
+	SelectObject(hdc,hOldFont);
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/menu.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/menu.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/menu.h	(revision 178)
@@ -0,0 +1,89 @@
+
+
+#define LIGHT_RGB(rgb,ratio) RGB(\
+	LOBYTE(LOWORD(rgb))+(BYTE)((double)(255-LOBYTE(LOWORD(rgb)))*ratio),\
+	HIBYTE(LOWORD(rgb))+(BYTE)((double)(255-HIBYTE(LOWORD(rgb)))*ratio),\
+	LOBYTE(HIWORD(rgb))+(BYTE)((double)(255-LOBYTE(HIWORD(rgb)))*ratio))
+
+
+#define MENUCOLOR_TEXT			GetSysColor(COLOR_WINDOWTEXT)				//テキストの色
+#define MENUCOLOR_GRAY_TEXT		GetSysColor(COLOR_GRAYTEXT)		//淡色テキストの色
+#define MENUCOLOR_DEFAULT_LINE	GetSysColor(COLOR_3DDKSHADOW)	//通常時の線の色
+#define MENUCOLOR_DEFAULT_BACK	GetSysColor(COLOR_3DFACE)		//通常時の背景色
+#define MENUCOLOR_HOT_LINE		GetSysColor(COLOR_ACTIVECAPTION)			//ホット状態の線の色
+#define MENUCOLOR_HOT_BACK		LIGHT_RGB(MENUCOLOR_HOT_LINE,0.7)		//ホット状態の背景色
+#define MENUCOLOR_SELECT_LINE	MENUCOLOR_DEFAULT_LINE	//選択状態の線の色
+#define MENUCOLOR_SELECT_BACK	GetSysColor(COLOR_MENU)	//選択状態の背景色
+
+
+extern HFONT hMenuFont;
+
+
+class CSubMenuEx;
+class CMenuEx;
+
+class CMenuItemData{
+public:
+	int item_index;
+	int itemID;
+	LPSTR str;
+
+	CMenuEx *pobj_ThisMenu;
+	CSubMenuEx *pobj_SubMenu;
+
+	HICON hIcon;
+	HICON hGrayIcon;
+
+	CMenuItemData(int item_index,int itemID,char *str,CMenuEx *pobj_ThisMenu,CSubMenuEx *pobj_SubMenu);
+	~CMenuItemData();
+};
+
+class CMenuEx{
+public:
+	HMENU hMenu;
+
+	CMenuEx(HMENU hmenu);
+	~CMenuEx();
+
+
+	//拡張メニューデータ
+	CMenuItemData **ppobj_MenuItemData;
+	int iMenuItemNum;
+	CMenuItemData *AddMenuExItemData(int item_index,int itemID,char *str,CMenuEx *pobj_ThisMenu,CSubMenuEx *pobj_SubMenu);
+
+
+
+	void EnableItem(UINT uIDEnableItem,UINT uEnable);
+
+	void CheckMenu(UINT idItem,BOOL bChecked);
+	BOOL IsCheck(UINT idItem);
+
+	void RenameMenuItem(int item_index,char *str);
+	void RenameMenuItemByID(int itemID,char *str);
+
+	void RemoveItem(int item_index);
+	void InsertItem(int item_index,int itemID,char *str);
+
+
+	//アイコン表示拡張
+	BOOL SetIcon(int itemID,HICON hIcon);
+
+
+private:
+	CSubMenuEx *AddSubMenu(HMENU hSubMenu);
+public:
+	// オーナー描画関連
+	void InitOwnerDraw(BOOL bParent);
+	virtual void GetItemSize(int item_index,SIZE *pSize);
+	BOOL OwnerDrawSubMenu(HMENU hSubMenu,HDC hdc,RECT *pRect,BOOL bSelect,int item_index);
+	virtual void OwnerDrawMenu(HDC hdc,RECT *pRect,BOOL bSelect,int item_index);
+};
+
+class CSubMenuEx:public CMenuEx{
+public:
+	CSubMenuEx(HMENU hMenu);
+	virtual void GetItemSize(int item_index,SIZE *pSize);
+	virtual void OwnerDrawMenu(HDC hdc,RECT *pRect,BOOL bSelect,int item_index);
+};
+
+extern CMenuEx *pobj_MainMenu;
Index: tag/abdev(2007.06.20)/ProjectEditor/nkf_class.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/nkf_class.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/nkf_class.cpp	(revision 178)
@@ -0,0 +1,207 @@
+#include "common.h"
+
+//文字コード変換用クラスライブラリ
+CNkf nkf;
+
+CNkf::CNkf(){
+	char temporary[MAX_PATH];
+	sprintf(temporary,"%sSubOperation\\nkf32.dll",pj_editor_Dir);
+
+	hLib=LoadLibrary(temporary);
+
+	pGetNkfVersion=(GetNkfVersion)GetProcAddress(hLib,"GetNkfVersion");
+	pSetNkfOption=(SetNkfOption)GetProcAddress(hLib,"SetNkfOption");
+	pNkfConvert=(NkfConvert)GetProcAddress(hLib,"NkfConvert");
+	pNkfGetKanjiCode=(NkfGetKanjiCode)GetProcAddress(hLib,"NkfGetKanjiCode");
+}
+
+CNkf::~CNkf(){
+	FreeLibrary(hLib);
+}
+
+
+char *CNkf::RestoreBuffer(char *buffer,int iCharCode){
+	/////////////////////
+	// 文字コードを復元
+	// ※内部表現はShift-JIS
+	/////////////////////
+	extern HANDLE hHeap;
+	char *pBuf;
+
+	pBuf=(char *)HeapAlloc(hHeap,0,lstrlen(buffer)*2+1);
+
+	switch(iCharCode){
+		case NKF_SHIFT_JIS:
+			lstrcpy(pBuf,buffer);
+			break;
+		case NKF_EUC:
+			pSetNkfOption("-ex");
+			pNkfConvert(pBuf,buffer);
+			break;
+		case NKF_ISO_2022_JP:
+			pSetNkfOption("-jx");
+			pNkfConvert(pBuf,buffer);
+			break;
+		case NKF_UTF_8:
+			pSetNkfOption("-wx");
+			pNkfConvert(pBuf,buffer);
+			break;
+	}
+
+	return pBuf;
+}
+
+void CNkf::GetCharCodeName(int iCharCode,char *name){
+	switch(iCharCode){
+		case NKF_SHIFT_JIS:
+			lstrcpy(name,"Shift-JIS");
+			break;
+		case NKF_EUC:
+			lstrcpy(name,"EUC");
+			break;
+		case NKF_ISO_2022_JP:
+			lstrcpy(name,"JIS");
+			break;
+		case NKF_UTF_8:
+			lstrcpy(name,"UTF-8");
+			break;
+	}
+}
+
+char *CNkf::ToCRLF(int iLfCode,char *buffer){
+	extern HANDLE hHeap;
+	int i,i2;
+
+	char *temp;
+	temp=(char *)HeapAlloc(hHeap,0,lstrlen(buffer)*2+1);
+
+	for(i=0,i2=0;;i++,i2++){
+		if(buffer[i]=='\0'){
+			temp[i2]=0;
+			break;
+		}
+		if(iLfCode==LFCODE_LF){
+			if(buffer[i]=='\n'){
+				temp[i2++]='\r';
+				temp[i2]='\n';
+				continue;
+			}
+		}
+		else if(iLfCode==LFCODE_CR){
+			if(buffer[i]=='\r'){
+				temp[i2++]='\r';
+				temp[i2]='\n';
+				continue;
+			}
+		}
+
+		temp[i2]=buffer[i];
+	}
+
+	return temp;
+}
+void CNkf::ToLF(char *buffer){
+	extern HANDLE hHeap;
+	int i,i2;
+
+	for(i=0,i2=0;;i++,i2++){
+		if(buffer[i]=='\r'&&buffer[i+1]=='\n'){
+			buffer[i2]='\n';
+			i++;
+			continue;
+		}
+
+		buffer[i2]=buffer[i];
+		if(buffer[i]=='\0') break;
+	}
+}
+void CNkf::ToCR(char *buffer){
+	extern HANDLE hHeap;
+	int i,i2;
+
+	for(i=0,i2=0;;i++,i2++){
+		if(buffer[i]=='\r'&&buffer[i+1]=='\n'){
+			buffer[i2]='\r';
+			i++;
+			continue;
+		}
+
+		buffer[i2]=buffer[i];
+		if(buffer[i]=='\0') break;
+	}
+}
+
+void CNkf::GetLfCodeName(int iLfCode,char *name){
+	switch(iLfCode){
+		case LFCODE_CRLF:
+			lstrcpy(name,"CRLF");
+			break;
+		case LFCODE_LF:
+			lstrcpy(name,"LF");
+			break;
+		case LFCODE_CR:
+			lstrcpy(name,"CR");
+			break;
+	}
+}
+
+
+
+BOOL CALLBACK nkfDlgCodeSave(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+	extern MDIINFO MdiInfo[MAX_WNDNUM];
+	static int WndNum;
+	HWND hList;
+
+	switch(message){
+		case WM_INITDIALOG:
+			SetPosCenter(hwnd);
+
+			WndNum=GetWndNum(GetWindow(hClient,GW_CHILD));
+			if(WndNum==-1){
+				//ウィンドウの取得に失敗
+				EndDialog(hwnd,0);
+				break;
+			}
+			if(!IS_DOCUMENT_TEXT(MdiInfo[WndNum].DocType)){
+				//テキストドキュメントでないとき
+				EndDialog(hwnd,0);
+				break;
+			}
+
+			hList=GetDlgItem(hwnd,IDC_LIST_CHARCODE);
+			SendMessage(hList,LB_ADDSTRING,0,(long)"Shift-JIS");
+			SendMessage(hList,LB_ADDSTRING,0,(long)"EUC");
+			SendMessage(hList,LB_ADDSTRING,0,(long)"JIS");
+			SendMessage(hList,LB_ADDSTRING,0,(long)"UTF-8");
+			SendMessage(hList,LB_SETCURSEL,MdiInfo[WndNum].pMdiTextEdit->iCharCode,0);
+
+			hList=GetDlgItem(hwnd,IDC_LIST_LFCODE);
+			SendMessage(hList,LB_ADDSTRING,0,(long)"CRLF(Windows)");
+			SendMessage(hList,LB_ADDSTRING,0,(long)"LF(Unix)");
+			SendMessage(hList,LB_ADDSTRING,0,(long)"CR(Macintosh)");
+			SendMessage(hList,LB_SETCURSEL,MdiInfo[WndNum].pMdiTextEdit->iLfCode,0);
+			break;
+		case WM_COMMAND:
+			switch(LOWORD(wParam)){
+				case IDOK:
+					//文字コードを取得
+					MdiInfo[WndNum].pMdiTextEdit->iCharCode=
+						(int)SendDlgItemMessage(hwnd,IDC_LIST_CHARCODE,LB_GETCURSEL,0,0);
+
+					//改行コードを取得
+					MdiInfo[WndNum].pMdiTextEdit->iLfCode=
+						(int)SendDlgItemMessage(hwnd,IDC_LIST_LFCODE,LB_GETCURSEL,0,0);
+
+					//保存
+					if(!SaveDocument(GetWindow(hClient,GW_CHILD),NULL)) return 0;
+
+					EndDialog(hwnd,1);
+					break;
+				case IDCANCEL:
+					EndDialog(hwnd,0);
+					break;
+			}
+			break;
+	}
+	return 0;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/nkf_class.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/nkf_class.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/nkf_class.h	(revision 178)
@@ -0,0 +1,45 @@
+
+typedef void (CALLBACK *GetNkfVersion)(LPSTR verStr);
+typedef int (CALLBACK *SetNkfOption)(LPCSTR optStr);
+typedef void (CALLBACK *NkfConvert)(LPSTR outStr, LPCSTR inStr);
+typedef int (CALLBACK *NkfGetKanjiCode)(VOID);
+
+class CNkf{
+	HINSTANCE hLib;
+public:
+	CNkf();
+	~CNkf();
+	GetNkfVersion pGetNkfVersion;
+	SetNkfOption pSetNkfOption;
+	NkfConvert pNkfConvert;
+	NkfGetKanjiCode pNkfGetKanjiCode;
+
+	char *RestoreBuffer(char *buffer,int iCharCode);
+	void GetCharCodeName(int iCharCode,char *name);
+
+	char *ToCRLF(int iLfCode,char *buffer);
+	void ToLF(char *buffer);
+	void ToCR(char *buffer);
+	void GetLfCodeName(int iLfCode,char *name);
+};
+extern CNkf nkf;
+
+
+//文字コード
+#define NKF_SHIFT_JIS		0
+#define NKF_EUC				1
+#define NKF_ISO_2022_JP		2
+#define NKF_UTF_8			3
+
+#define NKF_CODE_MIN		NKF_SHIFT_JIS
+#define NKF_CODE_MAX		NKF_UTF_8
+
+
+//改行コード
+#define LFCODE_CRLF	0	//Windows
+#define LFCODE_LF	1	//Unix
+#define LFCODE_CR	2	//Macintosh
+
+
+//関数郡
+BOOL CALLBACK nkfDlgCodeSave(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);
Index: tag/abdev(2007.06.20)/ProjectEditor/pj_msg_eng.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/pj_msg_eng.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/pj_msg_eng.h	(revision 178)
@@ -0,0 +1,49 @@
+///////////////////////////////////////////////////////////////
+// プロジェクト管理で使用する汎用テキストを定義しています
+//
+// 英語
+///////////////////////////////////////////////////////////////
+
+
+//////////////////
+// 削除メッセージ
+//////////////////
+#define STRING_PJ_CHECK_DELETECURSOR	"Delete the Cursor(%s) from the Project?"
+#define STRING_PJ_CHECK_DELETEBITMAP	"Delete the Bitmap(%s) from the Project?"
+#define STRING_PJ_CHECK_DELETEICON		"Delete the Icon(%s) from the Project?"
+#define STRING_PJ_CHECK_DELETEMENU		"Delete the Menu(%s) from the Project?"
+#define STRING_PJ_CHECK_DELETEWINDOW	"Delete the Window(%s) from the Project?"
+
+
+////////////////////////
+// 重複エラーメッセージ
+////////////////////////
+#define STRING_DUPLICATIONERROR_ID_IN_PROJECT		"\"%s\" ID already exists in a project."
+#define STRING_DUPLICATIONERROR_FILE_IN_PROJECT		"\"%s\" file already exists in a project."
+#define STRING_DUPLICATIONERROR_WINDOW_IN_PROJECT	"\"%s\" window already exists in a project."
+#define STRING_DUPLICATIONERROR_HANDLE_IN_PROJECT	"\"%s\" handle already exists in a project."
+#define STRING_DUPLICATIONERROR_PROC_IN_PROJECT		"\"%s\" procedure already exists in a project."
+
+
+//////////////////////////
+// 保存チェックメッセージ
+//////////////////////////
+#define STRING_MODIFYCHECK_PROJECT	"\"%s\" project was modified. Save it?"
+
+
+//////////////////////////
+// その他エラーメッセージ
+//////////////////////////
+#define STRING_ERROR_CANT_MAINFILE		"This is a main source file in the project. You can't delete it from the project."
+#define STRING_ERROR_MAKEDIRECTORY		"Creation of the directory did not succeed."
+#define STRING_ERROR_PROJECT_OVERWRITE	"The project already exists. Overwrite it?"
+#define STRING_ERROR_BROKEN_PROJECT		"The project file was corrupted."
+#define STRING_ERROR_NOFILE				"A file does not exist in a project."
+#define STRING_ERROR_BROKEN_WNDFILE		"The file(*.wnd) was corrupted.\n\n%s"
+
+
+//////////////////
+// その他
+//////////////////
+#define STRING_PROJECT_SAVING	"Writing the project..."
+#define STRING_RENAME_ID		"Rename ID"
Index: tag/abdev(2007.06.20)/ProjectEditor/pj_msg_jpn.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/pj_msg_jpn.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/pj_msg_jpn.h	(revision 178)
@@ -0,0 +1,49 @@
+///////////////////////////////////////////////////////////////
+// プロジェクト管理で使用する汎用テキストを定義しています
+//
+// 日本語
+///////////////////////////////////////////////////////////////
+
+
+//////////////////
+// 削除メッセージ
+//////////////////
+#define STRING_PJ_CHECK_DELETECURSOR	"%s カーソルをプロジェクトから削除します。よろしいですか？"
+#define STRING_PJ_CHECK_DELETEBITMAP	"%s ビットマップをプロジェクトから削除します。よろしいですか？"
+#define STRING_PJ_CHECK_DELETEICON		"%s アイコンをプロジェクトから削除します。よろしいですか？"
+#define STRING_PJ_CHECK_DELETEMENU		"%s メニューをプロジェクトから削除します。よろしいですか？"
+#define STRING_PJ_CHECK_DELETEWINDOW	"%s ウィンドウをプロジェクトから削除します。よろしいですか？"
+
+
+////////////////////////
+// 重複エラーメッセージ
+////////////////////////
+#define STRING_DUPLICATIONERROR_ID_IN_PROJECT		"ID \"%s\" は既にプロジェクト内に存在します。"
+#define STRING_DUPLICATIONERROR_FILE_IN_PROJECT		"\"%s\" ファイルは既にプロジェクト内に存在します。"
+#define STRING_DUPLICATIONERROR_WINDOW_IN_PROJECT	"\"%s\" ウィンドウは既にプロジェクト内に存在します。"
+#define STRING_DUPLICATIONERROR_HANDLE_IN_PROJECT	"\"%s\" ハンドルは既にプロジェクト内に存在します。"
+#define STRING_DUPLICATIONERROR_PROC_IN_PROJECT		"\"%s\" プロシージャは既にプロジェクト内に存在します。"
+
+
+//////////////////////////
+// 保存チェックメッセージ
+//////////////////////////
+#define STRING_MODIFYCHECK_PROJECT	"\"%s\" プロジェクトは変更されています。保存しますか？"
+
+
+//////////////////////////
+// その他エラーメッセージ
+//////////////////////////
+#define STRING_ERROR_CANT_MAINFILE		"このファイルはプロジェクトのメイン ファイルです。プロジェクト内から削除することはできません。"
+#define STRING_ERROR_MAKEDIRECTORY		"ディレクトリの作成に失敗しました"
+#define STRING_ERROR_PROJECT_OVERWRITE	"指定したディレクトリにはすでにプロジェクトが存在します。上書きしますか？"
+#define STRING_ERROR_BROKEN_PROJECT		"プロジェクト ファイルが壊れています。"
+#define STRING_ERROR_NOFILE				"プログラム ファイルがプロジェクトに存在しません。"
+#define STRING_ERROR_BROKEN_WNDFILE		"ウィンドウ定義ファイルが壊れています。\n\n%s"
+
+
+//////////////////
+// その他
+//////////////////
+#define STRING_PROJECT_SAVING	"プロジェクトを保存中..."
+#define STRING_RENAME_ID		"IDの変更"
Index: tag/abdev(2007.06.20)/ProjectEditor/rad_msg_eng.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/rad_msg_eng.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/rad_msg_eng.h	(revision 178)
@@ -0,0 +1,104 @@
+///////////////////////////////////////////////////////////////
+// RADツールの各種プロパティで利用するテキストを定義しています
+//
+// 英語
+///////////////////////////////////////////////////////////////
+
+//位置
+#define STRING_LEFT		"Left"
+#define STRING_RIGHT	"Right"
+#define STRING_TOP		"Top"
+#define STRING_BOTTOM	"Bottom"
+#define STRING_CENTER	"Center"
+
+//方向
+#define STRING_DIRECTION_HORIZONTAL	"Horizontal"
+#define STRING_DIRECTION_VERTICAL	"Vertical"
+
+//ソート
+#define STRING_SORT_ASCENDING	"Ascending"
+#define STRING_SORT_DESCENDING	"Descending"
+
+//オーナー描画
+#define STRING_OWNERDRAW_FIXED		"Fixed"
+#define STRING_OWNERDRAW_VARIABLE	"Variable"
+
+//ウィンドウ識別名入力ダイアログの警告メッセージ
+#define STRING_WINDOW_RENAME_MUST_WINDOWNAME	"You must enter identification name of the window."
+#define STRING_WINDOW_RENAME_MUST_HANDLENAME	"You must enter handle name of the window."
+#define STRING_WINDOW_RENAME_MUST_PROCEDURENAME	"You must enter procedure name of the window."
+#define STRING_WINDOW_RENAME_CHECK				"If you change these names, you must change identification names in source code if necessary. Are you ok?"
+
+//ウィンドウプロパティに必要なテキスト
+#define STRING_WINDOWPROP_BGCOLOR1				"3D FACE (Default)"
+#define STRING_WINDOWPROP_BGCOLOR2				"Color Option"
+#define STRING_WINDOWPROP_ICONDEFAULT			"Windows Logo (Default)"
+#define STRING_WINDOWPROP_STYLE_OVERLAPPED		"Overlapped"
+#define STRING_WINDOWPROP_STYLE_POPUP			"Popup"
+#define STRING_WINDOWPROP_STYLE_CHILD			"Child"
+#define STRING_WINDOWPROP_STYLE_FRAME_NONE		"None Frame"
+#define STRING_WINDOWPROP_STYLE_FRAME_THICK		"Thick Frame"
+#define STRING_WINDOWPROP_STYLE_FRAME_BORDER	"Border Frame"
+
+//アイテムID入力ダイアログの警告メッセージ
+#define STRING_ITEM_RENAME_MUST_ID	"Must enter id name of the control item."
+#define STRING_ITEM_RENAME_CHECK	"If you change these names, you must change identification names in source code if necessary. Are you ok?"
+
+//コンボボックスプロパティに必要なテキスト
+#define STRING_COMBOBOXPROP_STYLE_DROPDOWN				"Drop Down"
+#define STRING_COMBOBOXPROP_STYLE_DROPDOWNLIST			"Drop Down List"
+
+//イメージボックスプロパティに必要なテキスト
+#define STRING_IMAGEBOXPROP_STYLE_FRAME_BLACK	"Frame (Black)"
+#define STRING_IMAGEBOXPROP_STYLE_FRAME_GRAY	"Frame (Gray)"
+#define STRING_IMAGEBOXPROP_STYLE_FRAME_WHITE	"Frame (White)"
+#define STRING_IMAGEBOXPROP_STYLE_FRAME_ETCHED	"Frame (Etched)"
+#define STRING_IMAGEBOXPROP_STYLE_RECT_BLACK	"Rectangle (Black)"
+#define STRING_IMAGEBOXPROP_STYLE_RECT_GRAY		"Rectangle (Gray)"
+#define STRING_IMAGEBOXPROP_STYLE_RECT_WHITE	"Rectangle (White)"
+#define STRING_IMAGEBOXPROP_STYLE_ICON			"Icon"
+#define STRING_IMAGEBOXPROP_STYLE_BITMAP		"Bitmap"
+#define STRING_IMAGEBOXPROP_STYLE_FROMFILE		"File path:"
+#define STRING_IMAGEBOXPROP_STYLE_FROMRESOURCE	"Resource ID:"
+#define STRING_IMAGEBOXPROP_GETPATH_ICON		"Open Icon File"
+#define STRING_IMAGEBOXPROP_GETPATH_BITMAP		"Open Bitmap File"
+
+//リストビュープロパティに必要なテキスト
+#define STRING_LISTVIEWPROP_STYLE_ICON		"Icon"
+#define STRING_LISTVIEWPROP_STYLE_SMALLICON	"Small Icon"
+#define STRING_LISTVIEWPROP_STYLE_LIST		"List"
+#define STRING_LISTVIEWPROP_STYLE_REPORT	"Report"
+
+//リストボックスプロパティに必要なテキスト
+#define STRING_LISTBOXPROP_STYLE_SEL_SINGLE		"Single"
+#define STRING_LISTBOXPROP_STYLE_SEL_MULTI		"Multiple"
+#define STRING_LISTBOXPROP_STYLE_SEL_EXTENDED	"Extended"
+
+//スクロールバープロパティに必要なテキスト
+#define STRING_SCROLLBARPROP_STYLE_FREE				"Free"
+#define STRING_SCROLLBARPROP_STYLE_TOPORLEFT		"Top/Left"
+#define STRING_SCROLLBARPROP_STYLE_BOTTOMORRIGHT	"Bottom/Right"
+
+//トラックバープロパティに必要なテキスト
+#define STRING_TRACKBARPROP_STYLE_POSITION_BOTH				"Both"
+#define STRING_TRACKBARPROP_STYLE_POSITION_TOPORLEFT		"Top/Left"
+#define STRING_TRACKBARPROP_STYLE_POSITION_BOTTOMORRIGHT	"Bottom/Right"
+
+
+/////////////////////
+// その他メッセージ
+/////////////////////
+#define STRING_RAD_ERROR_CANT_CHILDTEST	"A test command cannot be used for child window."
+
+
+//////////////////////////////////
+// メニューエディタ用のメッセージ
+//////////////////////////////////
+#define STRING_MENUEDIT_MAKE_NEWMENU			"New Menu"
+#define STRING_MENUEDIT_RENAME_MENUID			"Rename Menu ID"
+#define STRING_MENUEDIT_DUPLICATIONERROR		"Menu \"%s\" already exists in a project."
+#define STRING_MENUEDIT_DELETECHECK				"If this operation is performed, child menu items will be deleted at the same time."
+#define STRING_MENUEDIT_MUSTSELECT_NEW_ITEM	"You must select position to insert the new menu item."
+#define STRING_MENUEDIT_INSERTTYPE_YESNO		"If you push \"yes\" button, the menu item is created in popup. If you push \"no\" button, the menu item is created in the same level with the popup."
+#define STRING_MENUEDIT_MUSTSELECT_DELETE_MENUITEM	"You must select menu item to delete."
+#define STRING_MENUEDIT_MUSTSELECT_MOVE_MENUITEM	"You must select menu item to move."
Index: tag/abdev(2007.06.20)/ProjectEditor/rad_msg_jpn.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/rad_msg_jpn.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/rad_msg_jpn.h	(revision 178)
@@ -0,0 +1,105 @@
+///////////////////////////////////////////////////////////////
+// RADツールの各種プロパティで利用するテキストを定義しています
+//
+// 日本語
+///////////////////////////////////////////////////////////////
+
+//位置
+#define STRING_LEFT		"左端"
+#define STRING_RIGHT	"右端"
+#define STRING_TOP		"上端"
+#define STRING_BOTTOM	"下端"
+#define STRING_CENTER	"中央"
+
+//方向
+#define STRING_DIRECTION_HORIZONTAL	"水平方向"
+#define STRING_DIRECTION_VERTICAL	"垂直方向"
+
+//ソート
+#define STRING_SORT_ASCENDING	"昇順"
+#define STRING_SORT_DESCENDING	"降順"
+
+//オーナー描画
+#define STRING_OWNERDRAW_FIXED		"固定"
+#define STRING_OWNERDRAW_VARIABLE	"可変"
+
+
+//ウィンドウ識別名入力ダイアログの警告メッセージ
+#define STRING_WINDOW_RENAME_MUST_WINDOWNAME	"ウィンドウ識別名を入力して下さい。"
+#define STRING_WINDOW_RENAME_MUST_HANDLENAME	"ハンドル名を入力して下さい。"
+#define STRING_WINDOW_RENAME_MUST_PROCEDURENAME	"プロシージャ名を入力して下さい。"
+#define STRING_WINDOW_RENAME_CHECK				"これらのウィンドウ識別名を変更すると、ソースコード内の識別子は手動で変換する必要があります。変更しますか？"
+
+//ウィンドウプロパティに必要なテキスト
+#define STRING_WINDOWPROP_BGCOLOR1				"3D FACE（標準）"
+#define STRING_WINDOWPROP_BGCOLOR2				"色指定"
+#define STRING_WINDOWPROP_ICONDEFAULT			"Windowsロゴ（標準）"
+#define STRING_WINDOWPROP_STYLE_OVERLAPPED		"オーバーラップ"
+#define STRING_WINDOWPROP_STYLE_POPUP			"ポップアップ"
+#define STRING_WINDOWPROP_STYLE_CHILD			"チャイルド"
+#define STRING_WINDOWPROP_STYLE_FRAME_NONE		"枠無し"
+#define STRING_WINDOWPROP_STYLE_FRAME_THICK		"細枠"
+#define STRING_WINDOWPROP_STYLE_FRAME_BORDER	"サイズ変更枠"
+
+//アイテムID入力ダイアログの警告メッセージ
+#define STRING_ITEM_RENAME_MUST_ID	"ID名を入力して下さい。"
+#define STRING_ITEM_RENAME_CHECK	"アイテムのID名を変更すると、ソースコード内のID名は手動で変換する必要があります。変更しますか？"
+
+//コンボボックスプロパティに必要なテキスト
+#define STRING_COMBOBOXPROP_STYLE_DROPDOWN				"ドロップ ダウン"
+#define STRING_COMBOBOXPROP_STYLE_DROPDOWNLIST			"ドロップ ダウン リスト"
+
+//イメージボックスプロパティに必要なテキスト
+#define STRING_IMAGEBOXPROP_STYLE_FRAME_BLACK	"フレーム（黒）"
+#define STRING_IMAGEBOXPROP_STYLE_FRAME_GRAY	"フレーム（灰色）"
+#define STRING_IMAGEBOXPROP_STYLE_FRAME_WHITE	"フレーム（白）"
+#define STRING_IMAGEBOXPROP_STYLE_FRAME_ETCHED	"フレーム（縁取り）"
+#define STRING_IMAGEBOXPROP_STYLE_RECT_BLACK	"四角形（黒）"
+#define STRING_IMAGEBOXPROP_STYLE_RECT_GRAY		"四角形（灰色）"
+#define STRING_IMAGEBOXPROP_STYLE_RECT_WHITE	"四角形（白）"
+#define STRING_IMAGEBOXPROP_STYLE_ICON			"アイコン"
+#define STRING_IMAGEBOXPROP_STYLE_BITMAP		"ビットマップ"
+#define STRING_IMAGEBOXPROP_STYLE_FROMFILE		"ファイル指定:"
+#define STRING_IMAGEBOXPROP_STYLE_FROMRESOURCE	"リソース指定:"
+#define STRING_IMAGEBOXPROP_GETPATH_ICON		"アイコン ファイルを指定してください"
+#define STRING_IMAGEBOXPROP_GETPATH_BITMAP		"ビットマップ ファイルを指定してください"
+
+//リストビュープロパティに必要なテキスト
+#define STRING_LISTVIEWPROP_STYLE_ICON		"アイコン"
+#define STRING_LISTVIEWPROP_STYLE_SMALLICON	"小さいアイコン"
+#define STRING_LISTVIEWPROP_STYLE_LIST		"リスト"
+#define STRING_LISTVIEWPROP_STYLE_REPORT	"レポート"
+
+//リストボックスプロパティに必要なテキスト
+#define STRING_LISTBOXPROP_STYLE_SEL_SINGLE		"シングル"
+#define STRING_LISTBOXPROP_STYLE_SEL_MULTI		"マルチ"
+#define STRING_LISTBOXPROP_STYLE_SEL_EXTENDED	"拡張"
+
+//スクロールバープロパティに必要なテキスト
+#define STRING_SCROLLBARPROP_STYLE_FREE				"指定無し"
+#define STRING_SCROLLBARPROP_STYLE_TOPORLEFT		"上/左"
+#define STRING_SCROLLBARPROP_STYLE_BOTTOMORRIGHT	"下/右"
+
+//トラックバープロパティに必要なテキスト
+#define STRING_TRACKBARPROP_STYLE_POSITION_BOTH				"両方"
+#define STRING_TRACKBARPROP_STYLE_POSITION_TOPORLEFT		"上/左"
+#define STRING_TRACKBARPROP_STYLE_POSITION_BOTTOMORRIGHT	"下/右"
+
+
+/////////////////////////////////
+// その他RADツール用のメッセージ
+/////////////////////////////////
+#define STRING_RAD_ERROR_CANT_CHILDTEST	"チャイルドウィンドウをテスト表示することはできません"
+
+
+//////////////////////////////////
+// メニューエディタ用のメッセージ
+//////////////////////////////////
+#define STRING_MENUEDIT_MAKE_NEWMENU			"新規メニュー"
+#define STRING_MENUEDIT_RENAME_MENUID			"メニューIDの変更"
+#define STRING_MENUEDIT_DUPLICATIONERROR		"\"%s\" メニューは既にプロジェクト内に存在します。"
+#define STRING_MENUEDIT_DELETECHECK				"この操作を行うとポップアップされるメニュー アイテムも削除されます。"
+#define STRING_MENUEDIT_MUSTSELECT_NEW_ITEM		"新しいメニュー アイテムの挿入位置を選択して下さい"
+#define STRING_MENUEDIT_INSERTTYPE_YESNO		"ポップアップ アイテムを作成する場合は \"はい\" を、ポップアップと同じ階層にメニュー アイテムを作成する場合は \"いいえ\" を押して下さい。"
+#define STRING_MENUEDIT_MUSTSELECT_DELETE_MENUITEM	"削除するメニュー アイテムを選択して下さい"
+#define STRING_MENUEDIT_MUSTSELECT_MOVE_MENUITEM	"移動するメニュー アイテムを選択して下さい"
Index: tag/abdev(2007.06.20)/ProjectEditor/rebar.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/rebar.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/rebar.cpp	(revision 178)
@@ -0,0 +1,335 @@
+#include "Common.h"
+
+
+/////////////////////////////////////////////////////////////
+// Note. レバーコントロールを新たに追加する場合は、
+//      "レバー追加" で検索をかけ、適切なコードを埋め込む
+/////////////////////////////////////////////////////////////
+
+
+CDBRebarBand::CDBRebarBand(){
+	iMaxBandNum=0;
+}
+CDBRebarBand::~CDBRebarBand(){}
+
+void CDBRebarBand::add(int band_id,AddBandProc add_proc){
+	BandId[iMaxBandNum]=band_id;
+	pAddProc[iMaxBandNum]=add_proc;
+	iMaxBandNum++;
+}
+
+HWND CDBRebarBand::call_add(int band_id,int num,char *lpszText){
+	int i;
+	for(i=0;i<iMaxBandNum;i++){
+		if(BandId[i]==band_id) break;
+	}
+	if(i==iMaxBandNum) return 0;
+
+	return pAddProc[i](hRebar,num,lpszText);
+}
+
+
+HWND AddDocCombo(HWND hRebar,int num,char *lpszText);
+HWND AddStandardToolbar(HWND hRebar,int num,char *lpszText);
+HWND AddReleaseToolbar(HWND hRebar,int num,char *lpszText);
+HWND AddDebuggerToolbar(HWND hRebar,int num,char *lpszText);
+HWND AddBand_SelectCompiler(HWND hRebar,int num,char *lpszText);
+HWND AddBand_WebSearch(HWND hRebar,int num,char *lpszText);
+
+
+CMainRebar *pobj_Rebar=0;
+
+
+void CMainRebar::SetupRebar(HWND hwnd){
+	int i;
+
+	//レバーコントロールを生成
+	hRebar=CreateWindowEx(WS_EX_TOOLWINDOW,REBARCLASSNAME,NULL,
+		WS_CHILD|WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_BORDER|WS_VISIBLE|
+		CCS_ADJUSTABLE|RBS_BANDBORDERS|RBS_DBLCLKTOGGLE ,
+		0,0,0,0,hwnd,NULL,hInst,NULL);
+
+	pobj_DBRebarBand->hRebar=hRebar;
+
+	REBARINFO RebarInfo;
+	ZeroMemory(&RebarInfo,sizeof(RebarInfo));
+	RebarInfo.cbSize=sizeof(REBARINFO);
+	SendMessage(hRebar,RB_SETBARINFO,0,(long)&RebarInfo);
+
+	//バンドを挿入
+	REBARBANDINFO RebarBand;
+	ZeroMemory(&RebarBand,sizeof(REBARBANDINFO));
+	RebarBand.cbSize=sizeof(REBARBANDINFO);
+	RebarBand.fMask=RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE|RBBIM_ID;
+	RebarBand.cxMinChild=23;
+	RebarBand.cyMinChild=22;
+	if(pobj_nv->bNoGripper) RebarBand.fStyle=RBBS_CHILDEDGE|RBBS_NOGRIPPER;
+	else RebarBand.fStyle=RBBS_CHILDEDGE;
+	for(i=0;i<MAX_REBARBANDS;i++){
+		if(pobj_nv->SaveRebar[i].RebarID==0) break;
+
+		//レバー上にのせる子ウィンドウを生成
+		char szText[255];
+		HWND hChild;
+		hChild=pobj_DBRebarBand->call_add(pobj_nv->SaveRebar[i].RebarID,i,szText);
+
+		//レバーバンドを追加
+		RebarBand.lpText=szText;
+		RebarBand.hwndChild=hChild;
+		RebarBand.cx=pobj_nv->SaveRebar[i].RebarLength;
+		RebarBand.wID=pobj_nv->SaveRebar[i].RebarID;
+		RebarBand.fStyle|=pobj_nv->SaveRebar[i].IsBandBreak;
+		SendMessage(hRebar,RB_INSERTBAND,-1,(LPARAM)&RebarBand);
+		RebarBand.fStyle^=pobj_nv->SaveRebar[i].IsBandBreak;
+	}
+}
+
+CMainRebar::CMainRebar(HWND hwnd_parent){
+	hParent=hwnd_parent;
+
+	pobj_DBRebarBand=new CDBRebarBand();
+
+	pobj_DBRebarBand->add(
+		ID_DOCCOMBO,
+		AddDocCombo);
+
+	pobj_DBRebarBand->add(
+		ID_STANDARDTOOLBAR,
+		AddStandardToolbar);
+
+	pobj_DBRebarBand->add(
+		ID_RELEASETOOLBAR,
+		AddReleaseToolbar);
+
+	pobj_DBRebarBand->add(
+		ID_DEBUGGERTOOLBAR,
+		AddDebuggerToolbar);
+
+	pobj_DBRebarBand->add(
+		ID_SELECTCOMPILERCOMBO,
+		AddBand_SelectCompiler);
+
+	pobj_DBRebarBand->add(
+		ID_WEB_SEARCH,
+		AddBand_WebSearch);
+
+	//
+	//レバーバンドを追加する場合はこの行を編集する（レバー追加）
+	//
+
+
+	SetupRebar(hParent);
+}
+CMainRebar::~CMainRebar(){
+	SaveRebarState();
+	DestroyWindow(hRebar);
+
+	delete pobj_DBRebarBand;
+	pobj_DBRebarBand=0;
+}
+
+void CMainRebar::ResetInitRebar(){
+	DestroyWindow(hRebar);
+	ResetRebarData();
+	SetupRebar(hParent);
+}
+void CMainRebar::ResetRebar(){
+	SaveRebarState();
+	DestroyWindow(hRebar);
+	SetupRebar(hParent);
+}
+
+void CMainRebar::SaveRebarState(void){
+	int i,BandNum;
+	REBARBANDINFO BandInfo;
+
+	ZeroMemory(&BandInfo,sizeof(REBARBANDINFO));
+	BandInfo.cbSize=sizeof(REBARBANDINFO);
+	BandInfo.fMask=RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE|RBBIM_ID;
+	BandNum=SendMessage(hRebar,RB_GETBANDCOUNT,0,0);
+	for(i=0;i<BandNum;i++){
+		SendMessage(hRebar,RB_GETBANDINFO,i,(long)&BandInfo);
+		if(BandInfo.fStyle&RBBS_BREAK) pobj_nv->SaveRebar[i].IsBandBreak=RBBS_BREAK;
+		else pobj_nv->SaveRebar[i].IsBandBreak=0;
+		pobj_nv->SaveRebar[i].RebarID=BandInfo.wID;
+		pobj_nv->SaveRebar[i].RebarLength=BandInfo.cx;
+	}
+}
+
+void CMainRebar::ChangeRebarBand(int BandID){
+	int i;
+	REBARBANDINFO RebarBand;
+
+	//ツールバーが固定されている場合は解除する
+	if(pobj_nv->bNoGripper) SendMessage(hOwner,WM_COMMAND,IDM_NOGRIPPER,0);
+
+	SAVEREBAR *psr;
+	psr=pobj_nv->SaveRebar;
+
+	for(i=0;i<MAX_REBARBANDS;i++){
+		if(psr[i].RebarID==0) break;
+		if(psr[i].RebarID==BandID){
+			SendMessage(hRebar,RB_DELETEBAND,SendMessage(hRebar,RB_IDTOINDEX,BandID,0),0);
+			memcpy(&psr[i],&psr[i+1],(MAX_REBARBANDS-i-1)*sizeof(SAVEREBAR));
+			psr[MAX_REBARBANDS-1].RebarID=0;
+			if(psr[0].RebarID==0){
+				DestroyWindow(hRebar);
+				SetupRebar(hOwner);
+
+				//メニュー状態を設定
+				ResetState_DocMenu();
+
+				ResizeOwnerWnd();
+			}
+			return;
+		}
+	}
+	if(i>=MAX_REBARBANDS) return;
+	psr[i].IsBandBreak=1;
+	psr[i].RebarID=BandID;
+	psr[i].RebarLength=0;
+	ZeroMemory(&RebarBand,sizeof(REBARBANDINFO));
+	RebarBand.cbSize=sizeof(REBARBANDINFO);
+	RebarBand.fMask=RBBIM_TEXT|RBBIM_STYLE|RBBIM_CHILD|RBBIM_CHILDSIZE|RBBIM_SIZE|RBBIM_ID;
+	RebarBand.fStyle=RBBS_CHILDEDGE;
+	RebarBand.cxMinChild=0;
+	RebarBand.cyMinChild=22;
+
+	//レバー上にのせる子ウィンドウを生成
+	char szText[255];
+	HWND hChild;
+	hChild=pobj_DBRebarBand->call_add(pobj_nv->SaveRebar[i].RebarID,i,szText);
+
+	//レバーバンドを追加
+	RebarBand.lpText=szText;
+	RebarBand.hwndChild=hChild;
+	RebarBand.cx=pobj_nv->SaveRebar[i].RebarLength;
+	RebarBand.wID=pobj_nv->SaveRebar[i].RebarID;
+	RebarBand.fStyle|=pobj_nv->SaveRebar[i].IsBandBreak;
+	SendMessage(hRebar,RB_INSERTBAND,-1,(LPARAM)&RebarBand);
+	RebarBand.fStyle^=pobj_nv->SaveRebar[i].IsBandBreak;
+
+	//メニュー状態を設定
+	ResetState_DocMenu();
+}
+
+void CMainRebar::menu_popup(HWND hwnd,int PosX,int PosY){
+	//レバーコントロールの表示設定メニューを表示
+	int i;
+	POINT MousePos;
+	MENUITEMINFO MenuItemInfo;
+
+	//メニューのチェック項目をセット
+	extern HMENU hRebarMenu;
+	MenuItemInfo.cbSize=sizeof(MENUITEMINFO);
+	MenuItemInfo.fMask=MIIM_STATE;
+	MenuItemInfo.fState=MFS_UNCHECKED;
+	SetMenuItemInfo(hRebarMenu,IDM_DOCSELECTBAND,0,&MenuItemInfo);
+	SetMenuItemInfo(hRebarMenu,IDM_STANDARDBAND,0,&MenuItemInfo);
+	SetMenuItemInfo(hRebarMenu,IDM_BANDMENU_WEB_SEARCH,0,&MenuItemInfo);
+#ifndef THETEXT
+	//ProjectEditorのみ
+	SetMenuItemInfo(hRebarMenu,IDM_RELEASEBAND,0,&MenuItemInfo);
+	SetMenuItemInfo(hRebarMenu,IDM_DEBUGBAND,0,&MenuItemInfo);
+	SetMenuItemInfo(hRebarMenu,IDM_SELECTCOMPILERBAND,0,&MenuItemInfo);
+#endif
+
+	
+	MenuItemInfo.fState=MFS_CHECKED;
+	for(i=0;i<MAX_REBARBANDS;i++){
+		if(pobj_nv->SaveRebar[i].RebarID==0) break;
+
+		if(pobj_nv->SaveRebar[i].RebarID==ID_DOCCOMBO)
+			SetMenuItemInfo(hRebarMenu,IDM_DOCSELECTBAND,0,&MenuItemInfo);
+
+		if(pobj_nv->SaveRebar[i].RebarID==ID_STANDARDTOOLBAR)
+			SetMenuItemInfo(hRebarMenu,IDM_STANDARDBAND,0,&MenuItemInfo);
+
+		if(pobj_nv->SaveRebar[i].RebarID==ID_WEB_SEARCH)
+			SetMenuItemInfo(hRebarMenu,IDM_BANDMENU_WEB_SEARCH,0,&MenuItemInfo);
+
+#ifndef THETEXT
+	//ProjectEditorのみ
+		if(pobj_nv->SaveRebar[i].RebarID==ID_RELEASETOOLBAR)
+			SetMenuItemInfo(hRebarMenu,IDM_RELEASEBAND,0,&MenuItemInfo);
+
+		if(pobj_nv->SaveRebar[i].RebarID==ID_DEBUGGERTOOLBAR)
+			SetMenuItemInfo(hRebarMenu,IDM_DEBUGBAND,0,&MenuItemInfo);
+
+		if(pobj_nv->SaveRebar[i].RebarID==ID_SELECTCOMPILERCOMBO)
+			SetMenuItemInfo(hRebarMenu,IDM_SELECTCOMPILERBAND,0,&MenuItemInfo);
+#endif
+
+	}
+	if(pobj_nv->bNoGripper) MenuItemInfo.fState=MFS_CHECKED;
+	else MenuItemInfo.fState=MFS_UNCHECKED;
+	SetMenuItemInfo(hRebarMenu,IDM_NOGRIPPER,0,&MenuItemInfo);
+
+	//ポップアップメニューを表示
+	MousePos.x=PosX;
+	MousePos.y=PosY;
+	ClientToScreen(hwnd,&MousePos);
+	TrackPopupMenu(hRebarMenu,TPM_LEFTALIGN|TPM_RIGHTBUTTON,MousePos.x,MousePos.y,0,hOwner,NULL);
+}
+
+
+
+
+
+
+WNDPROC OldDocComboProc;
+WNDPROC OldStandardToolbarProc;
+WNDPROC OldDebuggerToolbarProc;
+WNDPROC OldSelectCompilerComboProc;
+WNDPROC OldWebSearchProc,OldWebSearchEditProc;
+
+void ResetRebarData(void){
+	SAVEREBAR *psr;
+	psr=pobj_nv->SaveRebar;
+	int num=0;
+
+#ifdef THETEXT
+
+	//スタンダードツールバー
+	psr[num].RebarID=ID_STANDARDTOOLBAR;
+	psr[num].RebarLength=BMPNUM_STANDARDTOOLBAR*23+SEPNUM_STANDARDTOOLBAR*8+15;
+	psr[num].IsBandBreak=0;
+	num++;
+
+	//WebSearchコンボボックス
+	psr[num].RebarID=ID_WEB_SEARCH;
+	psr[num].RebarLength=100;
+	psr[num].IsBandBreak=0;
+	num++;
+#else
+
+	//スタンダードツールバー
+	psr[num].RebarID=ID_STANDARDTOOLBAR;
+	psr[num].RebarLength=BMPNUM_STANDARDTOOLBAR*23+SEPNUM_STANDARDTOOLBAR*8+15;
+	psr[num].IsBandBreak=0;
+	num++;
+
+	//プラットフォーム選択ツールバー
+	psr[num].RebarID=ID_SELECTCOMPILERCOMBO;
+	psr[num].RebarLength=100;
+	psr[num].IsBandBreak=0;
+	num++;
+
+	//デバッガツールバー
+	psr[num].RebarID=ID_DEBUGGERTOOLBAR;
+	psr[num].RebarLength=BMPNUM_DEBUGGERTOOLBAR*23+SEPNUM_DEBUGGERTOOLBAR*8+15;
+	psr[num].IsBandBreak=0;
+	num++;
+
+	//リリースビルドツールバー
+	psr[num].RebarID=ID_RELEASETOOLBAR;
+	psr[num].RebarLength=2*23+15;
+	psr[num].IsBandBreak=0;
+	num++;
+#endif
+
+
+	psr[num].RebarID=0;
+
+	pobj_nv->bNoGripper=1;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/reg_exp.cpp
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/reg_exp.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/reg_exp.cpp	(revision 178)
@@ -0,0 +1,111 @@
+#include "common.h"
+
+CRegExp obj_RegExp;
+
+CRegExp::CRegExp(){
+	char temporary[MAX_PATH];
+	sprintf(temporary,"%sSubOperation\\BREGEXP.DLL",pj_editor_Dir);
+
+	hLib=LoadLibrary(temporary);
+
+	BMatch=(PFUNC_BMatch)GetProcAddress(hLib,"BMatch");
+	BSubst=(PFUNC_BSubst)GetProcAddress(hLib,"BSubst");
+	BTrans=(PFUNC_BTrans)GetProcAddress(hLib,"BTrans");
+	BSplit=(PFUNC_BSplit)GetProcAddress(hLib,"BSplit");
+	BRegfree=(PFUNC_BRegfree)GetProcAddress(hLib,"BRegfree");
+	BRegexpVersion=(PFUNC_BRegexpVersion)GetProcAddress(hLib,"BRegexpVersion");
+}
+CRegExp::~CRegExp(){
+	FreeLibrary(hLib);
+}
+
+char *CRegExp::compare(HWND hFindDlg,char *buffer,char *exp,BOOL IsBigSmall, bool isWordUnit ,int *pLength){
+	BREGEXP *rxp=0;
+	char msg[255];
+
+	char *pTemp;
+	pTemp=(char *)HeapAlloc(hHeap,0,lstrlen(exp)+255);
+	if(strstr(exp,"/")){
+		if(strstr(exp,"#")){
+			sprintf(pTemp,"m@(%s)@",exp);
+		}
+		else sprintf(pTemp,"m#(%s)#",exp);
+	}
+	else sprintf(pTemp,"m/(%s)/",exp);
+
+	//Shift-JISで表現
+	lstrcat(pTemp,"k");
+
+	//大文字・小文字
+	if(!IsBigSmall) lstrcat(pTemp,"i");
+
+	int result;
+	result=BMatch(pTemp,buffer,buffer+lstrlen(buffer),&rxp,msg);
+
+	HeapDefaultFree(pTemp);
+
+	if(!result){
+		if(rxp) BRegfree(rxp);
+		return 0;
+	}
+	else if(result==-1){
+		if(rxp) BRegfree(rxp);
+		MessageBox(hFindDlg,msg,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+		return (char *)-1;
+	}
+
+	*pLength=(rxp->outendp) - (rxp->outp);
+	if((*pLength)==0) return 0;
+
+	pTemp=ComparisonString(buffer,(char *)rxp->outp,false, isWordUnit);
+
+	if(rxp) BRegfree(rxp);
+
+	return pTemp;
+}
+char *CRegExp::GetPermuStr(HWND hFindDlg,char *buffer,char *exp,char *szPermu,BOOL IsBigSmall){
+	BREGEXP *rxp=0;
+	char msg[255];
+
+	char *pTemp;
+	pTemp=(char *)HeapAlloc(hHeap,0,lstrlen(exp)+255);
+	if(strstr(exp,"/")||strstr(szPermu,"/")){
+		if(strstr(exp,"#")||strstr(szPermu,"#")){
+			sprintf(pTemp,"s@%s@%s@",exp,szPermu);
+		}
+		else sprintf(pTemp,"s#%s#%s#",exp,szPermu);
+	}
+	else sprintf(pTemp,"s/%s/%s/",exp,szPermu);
+
+	//Shift-JISで表現
+	lstrcat(pTemp,"k");
+
+	//大文字・小文字
+	if(!IsBigSmall) lstrcat(pTemp,"i");
+
+	int result;
+	result=BSubst(pTemp,buffer,buffer+lstrlen(buffer),&rxp,msg);
+
+	HeapDefaultFree(pTemp);
+
+	if(!result){
+		if(rxp) BRegfree(rxp);
+		return 0;
+	}
+	else if(result==-1){
+		if(rxp) BRegfree(rxp);
+		MessageBox(hFindDlg,msg,APPLICATION_NAME,MB_OK|MB_ICONEXCLAMATION);
+		return (char *)-1;
+	}
+
+	int length;
+	length=(rxp->outendp) - (rxp->outp);
+
+	pTemp=(char *)HeapAlloc(hHeap,0,length+1);
+	memcpy(pTemp,rxp->outp,length);
+	pTemp[length]=0;
+
+	if(rxp) BRegfree(rxp);
+
+	return pTemp;
+}
Index: tag/abdev(2007.06.20)/ProjectEditor/resource.h
===================================================================
--- tag/abdev(2007.06.20)/ProjectEditor/resource.h	(revision 178)
+++ tag/abdev(2007.06.20)/ProjectEditor/resource.h	(revision 178)
@@ -0,0 +1,466 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by ProjectEditor.rc
+//
+#define IDCANCEL5                       13
+#define IDR_MAINMENU                    101
+#define IDR_ACCELERATOR1                105
+#define IDR_STANDARDTOOLBAR             106
+#define IDD_ABOUT                       108
+#define IDR_BASICTOOLBAR                111
+#define IDI_MAIN                        114
+#define IDI_BASICPROGRAM                118
+#define IDD_FIND                        119
+#define IDR_EDITMENU                    122
+#define IDD_MAKELINENUM                 124
+#define IDD_FINDALL                     126
+#define IDR_REBARMENU                   127
+#define IDD_SETWHOLE                    128
+#define IDD_PERMUTATION                 129
+#define IDD_NEWFILE                     130
+#define IDI_TEXTDOCUMENT                131
+#define IDD_SETEDITOR                   132
+#define IDD_SETTOOLBAR                  133
+#define IDD_NEWPROJECT_PAGE1            136
+#define IDB_BASE_NORMAL                 138
+#define IDB_BASE_PROMPT                 139
+#define IDD_NEWPROJECT_PAGE3            140
+#define IDD_PROJECT_VIEW                145
+#define IDR_PROJECTVIEW_FILETREEMENU    146
+#define IDR_PROJECTVIEW_FILETREEROOTMENU 147
+#define IDI_FOLDER_CLOSE                148
+#define IDI_FOLDER_OPEN                 149
+#define IDD_PROJECT_FILEPROPERTY        150
+#define IDI_WINDOW                      151
+#define IDR_PROJECTVIEW_MATERIALTREEMENU 153
+#define IDR_PROJECTVIEW_WINDOWTREEROOTMENU 157
+#define IDD_RAD_CTRLBUTTONS             158
+#define IDD_PROJECT_NEWWINDOW           161
+#define IDR_RADCONTEXTMENU              164
+#define IDD_RAD_PROP_WINDOW             166
+#define IDD_RAD_PROP_BUTTON             167
+#define IDD_RAD_PROP_WINDOW_RENAME      170
+#define IDD_RAD_EVENTCODE               171
+#define IDD_RAD_PROP_ITEM_RENAMEID      172
+#define IDD_RAD_PROP_WINDOW_EXSTYLE     174
+#define IDD_RAD_PROP_ITEM_EXSTYLE       176
+#define IDD_RAD_PROP_EDIT               177
+#define IDD_RAD_PROP_STATIC             178
+#define IDD_RAD_PROP_CHECKBOX           180
+#define IDD_RAD_PROP_RADIOBUTTON        182
+#define IDB_RADIOBUTTON                 183
+#define IDD_RAD_PROP_SCROLLBAR          184
+#define IDB_TITLE_BUTTON_CLOSE          189
+#define IDD_RAD_PROP_ITEM_RENAMECAPTION 190
+#define IDD_RAD_PROP_LISTBOX            192
+#define IDD_RAD_PROP_LISTVIEW           194
+#define IDD_RAD_PROP_TREEVIEW           198
+#define IDD_RAD_PROP_IMAGEBOX           201
+#define IDR_PROJECTVIEW_PROCEDURETREEMENU 202
+#define IDI_PROCEDURE                   203
+#define IDD_RAD_PROP_COMBOBOX           204
+#define IDD_RAD_PROP_GROUPBOX           208
+#define IDD_RAD_PROP_UPDOWN             211
+#define IDD_RAD_PROP_PROGRESSBAR        212
+#define IDD_RAD_PROP_TRACKBAR           214
+#define IDD_PROJECT_MENUEDIT            216
+#define IDD_PROJECT_NEWMENU             217
+#define IDD_INPUTID                     217
+#define IDD_PROJECT_OPTION              218
+#define IDD_PJ_OPTION2                  218
+#define IDD_NEWPROJECT_PAGE             219
+#define IDD_NEWPROJECT_PAGE2            219
+#define IDD_PROJECT_MENURENAME          220
+#define IDR_CONTROL                     221
+#define IDD_RAD_CHOOSECHILD             223
+#define IDD_RAD_PROP_CHILD              224
+#define IDD_SETRAD                      225
+#define IDI_FILE_PJ                     226
+#define IDD_SETFILELINK                 227
+#define IDI_FILE_BAS                    229
+#define IDI_FILE_SBP                    230
+#define IDI_MENU                        231
+#define IDI_FILE_ICON                   233
+#define IDI_FILE_BMP                    234
+#define IDI_FILE_CURSOR                 236
+#define IDB_TITLE                       238
+#define IDD_RAD_SUPPORT                 239
+#define IDD_PJ_OPTION1                  241
+#define IDB_PARAMHINT_QUESTION          243
+#define IDB_PARAMHINT_QUESTION2         244
+#define IDD_ICONEDIT_TOOL               246
+#define IDD_ICONEDIT_COLOR              247
+#define IDD_ICONEDIT_BUTTONS            248
+#define IDR_ICONTOOLBAR                 257
+#define IDD_ICONEDIT_ICONTYPE           259
+#define IDC_CURSOR_PEN                  260
+#define IDC_CURSOR_FILL                 261
+#define IDI_MEMBER_PRIVATE_FUNCTION     262
+#define IDI_MEMBER_PUBLIC_FUNCTION      263
+#define IDI_MEMBER_PRIVATE_VARIABLE     264
+#define IDI_MEMBER_PUBLIC_VARIABLE      265
+#define IDB_BASE_DOSPROMPT              266
+#define IDB_BASE_NON                    267
+#define IDB_BASE_DIRECTX                268
+#define IDC_FINDSTR                     1001
+#define IDC_FINDINWINDOW                1002
+#define IDC_FINDALL                     1003
+#define IDC_ISBIGSMALL                  1004
+#define IDC_SHOWITEM                    1018
+#define IDC_FINDLIST                    1020
+#define IDC_EDITLINE                    1022
+#define IDC_NEWLINE                     1023
+#define IDC_RESETTOOLBAR                1027
+#define IDC_PERMUTATIONSTR              1034
+#define IDC_PERMUTATIONNEXT             1036
+#define IDC_PERMUTATIONALL              1037
+#define IDC_FIND                        1038
+#define IDC_FILETYPELIST                1039
+#define IDC_SETFONT                     1041
+#define IDC_TABSIZE                     1042
+#define IDC_PARAMHINT                   1043
+#define IDC_ISAUTOINDENT                1044
+#define IDC_PROJECTNAME                 1053
+#define IDC_DIRPATH                     1054
+#define IDC_EXE_PROMPTBASE              1055
+#define IDC_EXE_WINDOWBASE              1056
+#define IDC_EXE_NOBASE                  1057
+#define IDC_IMAGE_WINDOW                1058
+#define IDC_IMAGE_PROMPT                1059
+#define IDC_HELPTEXT_OFBASE             1060
+#define IDC_BUTTON1                     1061
+#define IDC_PATHBROWSE                  1061
+#define IDC_RENAMEWINDOW                1061
+#define IDC_HINTFONT                    1061
+#define IDC_LINKFILE                    1061
+#define IDC_TEST                        1061
+#define IDC_ADD_ICONTYPE                1061
+#define IDC_PROJECTINFO                 1062
+#define IDC_DELETE_ICONTYPE             1062
+#define IDC_TAB_PROJECTINFO             1066
+#define IDC_SHOWHELLOWORLD              1068
+#define IDC_USING_FILE                  1069
+#define IDC_DEFINED_FILE                1070
+#define IDC_UPDATE_TIME                 1071
+#define IDC_FILETYPE                    1072
+#define IDC_TOOL_MOUSE                  1075
+#define IDC_TOOL_STATIC                 1076
+#define IDC_TOOL_BUTTON                 1077
+#define IDC_TOOL_EDIT                   1078
+#define IDC_TOOL_CHECKBOX               1079
+#define IDC_WINDOWNAME                  1080
+#define IDC_TOOL_RADIOBUTTON            1080
+#define IDC_WINDOWHANDLE                1081
+#define IDC_TOOL_GROUPBOX               1081
+#define IDC_WINDOWPROC                  1082
+#define IDC_TOOL_HSCROLLBAR             1082
+#define IDC_AUTOSET                     1083
+#define IDC_TOOL_VSCROLLBAR             1083
+#define IDC_TOOL_COMBOBOX               1084
+#define IDC_TOOL_LISTBOX                1085
+#define IDC_TOOL_UPDOWN                 1086
+#define IDC_TOOL_LISTVIEW               1087
+#define IDC_TOOL_TREEVIEW               1088
+#define IDC_CAPTION                     1090
+#define IDC_TOOL_IMAGEBOX               1091
+#define IDC_BGCOLOR                     1091
+#define IDC_TOOL_PROGRESSBAR            1092
+#define IDC_TOOL_TRACKBAR               1093
+#define IDC_IDNAME                      1095
+#define IDC_WINDOWSTYLE                 1097
+#define IDC_STYLE_HSCROLLBAR            1098
+#define IDC_STYLE_VSCROLLBAR            1099
+#define IDC_STYLE_CLIPSIBLINGS          1100
+#define IDC_STYLE_CLIPCHILDREN          1101
+#define IDC_STYLE_SYSMENU               1102
+#define IDC_STYLE_CAPTION               1104
+#define IDC_STYLE_MINIMIZE              1105
+#define IDC_STYLE_MAXIMIZE              1106
+#define IDC_STYLE_VISIBLE               1107
+#define IDC_STYLE_MAXIMIZEBOX           1108
+#define IDC_STYLE_MINIMIZEBOX           1109
+#define IDC_BORDERSTYLE                 1110
+#define IDC_STYLE_DISABLED              1111
+#define IDC_EXSTYLE                     1113
+#define IDC_PROCEDURENAME               1116
+#define IDC_EVENTLIST                   1117
+#define IDC_STYLE_GROUP                 1118
+#define IDC_STYLE_TABSTOP               1119
+#define IDC_BS_DEFPUSHBUTTON            1120
+#define IDC_BS_OWNERDRAW                1121
+#define IDC_BS_ICON                     1122
+#define IDC_BS_BITMAP                   1123
+#define IDC_BS_MULTILINE                1124
+#define IDC_BS_NOTIFY                   1125
+#define IDC_BS_HPOS                     1126
+#define IDC_BS_VPOS                     1127
+#define IDC_RENAMEID                    1128
+#define IDC_RENAMECAPTION               1129
+#define IDC_EXSTYLE_NOPARENTNOTIFY      1129
+#define IDC_EXSTYLE_TOPMOST             1130
+#define IDC_EXSTYLE_ACCEPTFILES         1131
+#define IDC_EXSTYLE_TRANSPARENT         1133
+#define IDC_EXSTYLE_TOOLWINDOW          1134
+#define IDC_EXSTYLE_DLGMODALFRAME       1135
+#define IDC_EXSTYLE_CLIENTEDGE          1136
+#define IDC_EXSTYLE_STATICEDGE          1137
+#define IDC_EXSTYLE_CONTEXTHELP         1138
+#define IDC_EXSTYLE_CONTROLPARENT       1139
+#define IDC_ES_MULTILINE                1161
+#define IDC_ES_NUMBER                   1162
+#define IDC_STYLE_HSCROLL               1163
+#define IDC_ES_AUTOHSCROLL              1164
+#define IDC_STYLE_VSCROLL               1165
+#define IDC_ES_AUTOVSCROLL              1166
+#define IDC_ES_PASSWORD                 1167
+#define IDC_ES_NOHIDESEL                1168
+#define IDC_ES_OEMCONVERT               1169
+#define IDC_ES_WANTRETURN               1170
+#define IDC_ES_UPPERCASE                1171
+#define IDC_ES_LOWERCASE                1172
+#define IDC_ES_READONLY                 1173
+#define IDC_ES_TEXTPOS                  1174
+#define IDC_LBS_SELECT                  1175
+#define IDC_LBS_OWNERDRAW               1176
+#define IDC_LVS_SORT                    1177
+#define IDC_SS_NOPREFIX                 1178
+#define IDC_SS_LEFTNOWORDWRAP           1179
+#define IDC_SS_NOTIFY                   1180
+#define IDC_SS_TEXTPOS                  1182
+#define IDC_BS_AUTO                     1184
+#define IDC_BS_3STATE                   1185
+#define IDC_BS_LEFTTEXT                 1187
+#define IDC_BS_PUSHLIKE                 1188
+#define IDC_SBS_POSITION                1207
+#define IDC_LBS_HASSTRINGS              1221
+#define IDC_LBS_SORT                    1223
+#define IDC_LBS_NOTIFY                  1224
+#define IDC_LBS_MULTICOLUMN             1225
+#define IDC_LBS_DISABLENOSCROLL         1226
+#define IDC_LBS_NOREDRAW                1227
+#define IDC_LBS_USETABSTOPS             1228
+#define IDC_LBS_WANTKEYBOARDINPUT       1229
+#define IDC_LVS_VIEW                    1240
+#define IDC_LVS_POSITION                1241
+#define IDC_LVS_SHOWSELALWAYS           1243
+#define IDC_LVS_SINGLESEL               1244
+#define IDC_LVS_AUTOARRANGE             1245
+#define IDC_LVS_NOLABELWRAP             1246
+#define IDC_LVS_EDITLABELS              1247
+#define IDC_LVS_NOSCROLL                1248
+#define IDC_LVS_NOCOLUMNHEADER          1249
+#define IDC_LVS_NOSORTHEADER            1250
+#define IDC_LVS_OWNERDRAWFIXED          1251
+#define IDC_LVS_SHAREIMAGELISTS         1252
+#define IDC_TVS_HASBUTTONS              1264
+#define IDC_TVS_HASLINES                1266
+#define IDC_TVS_LINESATROOT             1267
+#define IDC_TVS_EDITLABELS              1268
+#define IDC_TVS_DISABLEDRAGDROP         1269
+#define IDC_TVS_SHOWSELALWAYS           1270
+#define IDC_TVS_NOSCROLL                1271
+#define IDC_TVS_NOTOOLTIPS              1272
+#define IDC_TVS_CHECKBOXES              1273
+#define IDC_TVS_FULLROWSELECT           1274
+#define IDC_TVS_TRACKSELECT             1275
+#define IDC_TVS_SINGLEEXPAND            1276
+#define IDC_IMAGE_FILE                  1278
+#define IDC_IMAGE_TYPE                  1281
+#define IDC_SS_CENTERIMAGE              1283
+#define IDC_SS_RIGHTJUST                1284
+#define IDC_CBS_TYPE                    1288
+#define IDC_CBS_HASSTRINGS              1289
+#define IDC_CBS_SORT                    1290
+#define IDC_CBS_NOINTEGRALHEIGHT        1292
+#define IDC_CBS_OEMCONVERT              1293
+#define IDC_CBS_AUTOHSCROLL             1294
+#define IDC_CBS_DISABLENOSCROLL         1295
+#define IDC_CBS_UPPERCASE               1296
+#define IDC_CBS_LOWERCASE               1297
+#define IDC_CBS_OWNERDRAW               1301
+#define IDC_BS_POSITION                 1307
+#define IDC_UDS_AUTOBUDDY               1314
+#define IDC_UDS_SETBUDDYINT             1315
+#define IDC_UDS_NOTHOUSANDS             1316
+#define IDC_UDS_WRAP                    1317
+#define IDC_UDS_ARROWKEYS               1318
+#define IDC_UDS_SITUATION               1319
+#define IDC_UDS_ATTACH                  1320
+#define IDC_PROGRESS3                   1327
+#define IDC_PBS_SMOOTH                  1328
+#define IDC_PBS_VERTICAL                1329
+#define IDC_SLIDER2                     1331
+#define IDC_TBS_SITUATION               1332
+#define IDC_TBS_POINT                   1333
+#define IDC_TBS_NOTICKS                 1334
+#define IDC_TBS_AUTOTICKS               1335
+#define IDC_TBS_ENABLESELRANGE          1336
+#define IDC_SLIDER3                     1337
+#define IDC_HANDLE                      1339
+#define IDC_PATH                        1340
+#define IDC_CHANGEPATH                  1341
+#define IDC_IMAGE_SITUATION             1342
+#define IDC_WINDOWMENU                  1343
+#define IDC_ICONRES                     1344
+#define IDC_UP                          1347
+#define IDC_DOWN                        1348
+#define IDC_CHECKED                     1349
+#define IDC_DISABLED                    1350
+#define IDC_INSERTMENUITEM              1352
+#define IDC_DELETEMENUITEM              1353
+#define IDC_POPUP                       1356
+#define IDC_SEPARATOR                   1357
+#define IDC_DEFWINDOW                   1358
+#define IDC_API_MMSYS                   1362
+#define IDC_DEFAULT                     1363
+#define IDC_API_MMSYS2                  1363
+#define IDC_MMSYS                       1364
+#define IDC_MENU                        1365
+#define IDC_API_COMMCTRL                1368
+#define IDC_RENAME                      1369
+#define IDC_IDSTATIC                    1370
+#define IDC_CAPTIONSTATIC               1371
+#define IDC_STATUSBAR                   1373
+#define IDC_STATIC_HINTFONT             1374
+#define IDC_CHECK3                      1377
+#define IDC_SBP                         1377
+#define IDC_WINDOWLIST                  1380
+#define IDC_STATIC_HANDLE               1383
+#define IDC_SAVECHECK                   1384
+#define IDC_SUPPORT_COMMENT             1386
+#define IDC_LINEADJUST                  1387
+#define IDC_BAS                         1391
+#define IDC_ABP                         1392
+#define IDC_PJ                          1393
+#define IDC_MODALDLG                    1394
+#define IDC_MODELESSDLG                 1395
+#define IDC_DLL                         1397
+#define IDC_EXE_DOSPROMPTBASE           1399
+#define IDC_API_RICHEDIT                1401
+#define IDC_FILE                        1402
+#define IDC_RESOURCE                    1403
+#define IDC_RESCOMBO                    1404
+#define IDC_STATIC_ICON                 1405
+#define IDC_API_WINSOCK                 1406
+#define IDC_XPOS                        1408
+#define IDC_YPOS                        1409
+#define IDC_WIDTH                       1410
+#define IDC_HEIGHT                      1411
+#define IDC_SPIN1                       1414
+#define IDC_SPIN2                       1415
+#define IDC_EDIT_RELEASE                1415
+#define IDC_SPIN3                       1416
+#define IDC_EDIT_DEBUG                  1416
+#define IDC_ADDTOPROJECT                1416
+#define IDC_SPIN4                       1417
+#define IDC_FILENAME                    1417
+#define IDC_STATIC_FILENAME             1418
+#define IDC_CLIP                        1419
+#define IDC_ICONTYPECOMBO               1420
+#define IDC_STATIC_COLOR                1422
+#define IDC_NOWCOLOR                    1423
+#define IDC_TYPELIST                    1425
+#define IDC_COMPLEMENT                  1427
+#define IDC_STATIC_SETFONT              1428
+#define IDC_STATIC_TABSIZE              1429
+#define IDC_EXE_DIRECTX                 1432
+#define IDC_IMAGE_DOSPROMPT             1433
+#define IDC_IMAGE_NON                   1434
+#define IDC_IMAGE_DIRECTX               1435
+#define IDM_EXIT                        40001
+#define IDM_NEW                         40002
+#define IDM_OPEN                        40003
+#define IDM_CLOSE                       40004
+#define IDM_SAVE                        40008
+#define IDM_NEWSAVE                     40009
+#define IDM_UNDO                        40010
+#define IDM_CUT                         40011
+#define IDM_COPY                        40012
+#define IDM_PASTE                       40013
+#define IDM_DELETE                      40014
+#define IDM_ABOUT                       40015
+#define IDM_WINDOWCHARGE                40017
+#define IDM_ALLSAVE                     40020
+#define IDM_ALLSELECT                   40021
+#define IDM_FIND                        40024
+#define IDM_REDO                        40034
+#define IDM_TOPIC                       40037
+#define ID_MENUITEM40038                40038
+#define IDM_DOCSELECTBAND               40039
+#define IDM_STANDARDBAND                40040
+#define IDM_BASICBAND                   40041
+#define IDM_SET                         40042
+#define IDM_PERMUTATION                 40044
+#define IDM_DSHOMEPAGE                  40047
+#define IDM_ACTBDL                      40048
+#define IDM_PROJECT_OPEN                40051
+#define IDM_PROJECT_CLOSE               40052
+#define IDM_PROJECT_SAVE                40053
+#define IDM_PROJECTVIEW                 40054
+#define IDM_FILETREE_PROPERTY           40057
+#define IDM_FILETREE_OPEN               40058
+#define IDM_FILETREE_INSERT             40059
+#define IDM_FILETREE_DELETE             40060
+#define IDM_WINDOWTREE_OPEN             40062
+#define IDM_MATERIALTREE_OPEN           40062
+#define IDM_WINDOWTREE_DELETE           40063
+#define IDM_MATERIALTREE_DELETE         40063
+#define IDM_WINDOWTREE_PROPERTY         40064
+#define IDM_WINDOWTREE_INSERT           40065
+#define IDM_MATERIALTREE_INSERT         40065
+#define IDM_MATERIALTREE_INSERTWINDOW   40065
+#define IDM_RAD_ITEM_DELETE             40067
+#define IDM_RAD_WINDOW_EVENTCODE        40069
+#define IDM_ACCEL_UNDO                  -25466
+#define IDM_ACCEL_REDO                  -25465
+#define IDM_PROCEDURETREE_SHOW          40072
+#define IDM_RAD_WINDOW_MENUEVENTCODE    40074
+#define IDM_MENUTREE_RENAMEID           40075
+#define IDM_PROJECT_OPTION              40076
+#define IDM_TOPMOST                     40077
+#define ID_BUTTON40079                  40079
+#define ID_BUTTON40080                  40080
+#define ID_BUTTON40081                  40081
+#define ID_BUTTON40082                  40082
+#define ID_BUTTON40083                  40083
+#define ID_BUTTON40084                  40084
+#define ID_BUTTON40085                  40085
+#define ID_BUTTON40086                  40086
+#define ID_BUTTON40087                  40087
+#define ID_BUTTON40088                  40088
+#define ID_BUTTON40089                  40089
+#define ID_BUTTON40090                  40090
+#define ID_BUTTON40091                  40091
+#define ID_BUTTON40092                  40092
+#define ID_BUTTON40093                  40093
+#define ID_BUTTON40094                  40094
+#define ID_BUTTON40095                  40095
+#define ID_BUTTON40097                  40097
+#define IDM_DEBUG                       40101
+#define IDM_RELEASECOMPILE              40106
+#define IDM_DEBUGCOMPILE                40108
+#define IDM_MATERIALTREE_INSERTICON     40109
+#define IDM_MATERIALTREE_INSERTMENU     40110
+#define IDM_MATERIALTREE_ICON_SETMAIN   40113
+#define IDM_MATERIALTREE_INSERTBITMAP   40115
+#define IDM_MATERIALTREE_INSERTCURSOR   40116
+#define IDM_NOGRIPPER                   40117
+#define IDC_TOOL_SELECT                 40119
+#define IDC_TOOL_PEN                    40120
+#define IDC_TOOL_LINE                   40121
+#define IDC_TOOL_RECTANGLE              40123
+#define IDC_TOOL_ELLIPSE                40124
+#define IDC_TOOL_FILL                   40126
+#define IDC_TOOL_FILLRECT               40127
+#define IDC_TOOL_FILLRECT2              40128
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        269
+#define _APS_NEXT_COMMAND_VALUE         40129
+#define _APS_NEXT_CONTROL_VALUE         1435
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
Index: tag/abdev(2007.06.20)/abcompiler32.sln
===================================================================
--- tag/abdev(2007.06.20)/abcompiler32.sln	(revision 178)
+++ tag/abdev(2007.06.20)/abcompiler32.sln	(revision 178)
@@ -0,0 +1,32 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\jenga\projects\common\common.vcproj", "{F01805B6-65B4-4708-88F4-A5E07DEA9FBD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicCompiler32", "BasicCompiler32\BasicCompiler.vcproj", "{11F0E9AB-EAEC-4616-A9DD-838073342CBB}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smoothie", "..\jenga\projects\smoothie\smoothie.vcproj", "{996D6B55-6503-4427-84AB-351784EAFB71}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{F01805B6-65B4-4708-88F4-A5E07DEA9FBD}.Debug|Win32.ActiveCfg = Debug(x86)|Win32
+		{F01805B6-65B4-4708-88F4-A5E07DEA9FBD}.Debug|Win32.Build.0 = Debug(x86)|Win32
+		{F01805B6-65B4-4708-88F4-A5E07DEA9FBD}.Release|Win32.ActiveCfg = Release(x86)|Win32
+		{F01805B6-65B4-4708-88F4-A5E07DEA9FBD}.Release|Win32.Build.0 = Release(x86)|Win32
+		{11F0E9AB-EAEC-4616-A9DD-838073342CBB}.Debug|Win32.ActiveCfg = Debug|Win32
+		{11F0E9AB-EAEC-4616-A9DD-838073342CBB}.Debug|Win32.Build.0 = Debug|Win32
+		{11F0E9AB-EAEC-4616-A9DD-838073342CBB}.Release|Win32.ActiveCfg = Release|Win32
+		{11F0E9AB-EAEC-4616-A9DD-838073342CBB}.Release|Win32.Build.0 = Release|Win32
+		{996D6B55-6503-4427-84AB-351784EAFB71}.Debug|Win32.ActiveCfg = Debug(x86)|Win32
+		{996D6B55-6503-4427-84AB-351784EAFB71}.Debug|Win32.Build.0 = Debug(x86)|Win32
+		{996D6B55-6503-4427-84AB-351784EAFB71}.Release|Win32.ActiveCfg = Release(x86)|Win32
+		{996D6B55-6503-4427-84AB-351784EAFB71}.Release|Win32.Build.0 = Release(x86)|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: tag/abdev(2007.06.20)/abcompiler64.sln
===================================================================
--- tag/abdev(2007.06.20)/abcompiler64.sln	(revision 178)
+++ tag/abdev(2007.06.20)/abcompiler64.sln	(revision 178)
@@ -0,0 +1,32 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual C++ Express 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BasicCompiler", "BasicCompiler64\BasicCompiler.vcproj", "{864B921B-423B-4F9E-9E6B-31B15968EDF9}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "common", "..\jenga\projects\common\common.vcproj", "{F01805B6-65B4-4708-88F4-A5E07DEA9FBD}"
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "smoothie", "..\jenga\projects\smoothie\smoothie.vcproj", "{996D6B55-6503-4427-84AB-351784EAFB71}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Win32 = Debug|Win32
+		Release|Win32 = Release|Win32
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{864B921B-423B-4F9E-9E6B-31B15968EDF9}.Debug|Win32.ActiveCfg = Debug|Win32
+		{864B921B-423B-4F9E-9E6B-31B15968EDF9}.Debug|Win32.Build.0 = Debug|Win32
+		{864B921B-423B-4F9E-9E6B-31B15968EDF9}.Release|Win32.ActiveCfg = Release|Win32
+		{864B921B-423B-4F9E-9E6B-31B15968EDF9}.Release|Win32.Build.0 = Release|Win32
+		{F01805B6-65B4-4708-88F4-A5E07DEA9FBD}.Debug|Win32.ActiveCfg = Debug(amd64)|Win32
+		{F01805B6-65B4-4708-88F4-A5E07DEA9FBD}.Debug|Win32.Build.0 = Debug(amd64)|Win32
+		{F01805B6-65B4-4708-88F4-A5E07DEA9FBD}.Release|Win32.ActiveCfg = Release(amd64)|Win32
+		{F01805B6-65B4-4708-88F4-A5E07DEA9FBD}.Release|Win32.Build.0 = Release(amd64)|Win32
+		{996D6B55-6503-4427-84AB-351784EAFB71}.Debug|Win32.ActiveCfg = Debug(amd64)|Win32
+		{996D6B55-6503-4427-84AB-351784EAFB71}.Debug|Win32.Build.0 = Debug(amd64)|Win32
+		{996D6B55-6503-4427-84AB-351784EAFB71}.Release|Win32.ActiveCfg = Release(amd64)|Win32
+		{996D6B55-6503-4427-84AB-351784EAFB71}.Release|Win32.Build.0 = Release(amd64)|Win32
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: tag/abdev(2007.06.20)/icon_res/StdAfx.cpp
===================================================================
--- tag/abdev(2007.06.20)/icon_res/StdAfx.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/icon_res/StdAfx.cpp	(revision 178)
@@ -0,0 +1,8 @@
+// stdafx.cpp : 標準インクルードファイルを含むソース ファイル
+//              icon_res.pch 生成されるプリコンパイル済ヘッダー
+//              stdafx.obj 生成されるプリコンパイル済タイプ情報
+
+#include "stdafx.h"
+
+// TODO: STDAFX.H に含まれていて、このファイルに記述されていない
+// ヘッダーファイルを追加してください。
Index: tag/abdev(2007.06.20)/icon_res/StdAfx.h
===================================================================
--- tag/abdev(2007.06.20)/icon_res/StdAfx.h	(revision 178)
+++ tag/abdev(2007.06.20)/icon_res/StdAfx.h	(revision 178)
@@ -0,0 +1,24 @@
+// stdafx.h : 標準のシステム インクルード ファイル、
+//            または参照回数が多く、かつあまり変更されない
+//            プロジェクト専用のインクルード ファイルを記述します。
+//
+
+#if !defined(AFX_STDAFX_H__359C4D68_7507_4291_84FE_5004032BABD8__INCLUDED_)
+#define AFX_STDAFX_H__359C4D68_7507_4291_84FE_5004032BABD8__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+
+
+// この位置にヘッダーを挿入してください
+#define WIN32_LEAN_AND_MEAN		// Windows ヘッダーから殆ど使用されないスタッフを除外します
+
+#include <windows.h>
+
+// TODO: プログラムで必要なヘッダー参照を追加してください。
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ は前行の直前に追加の宣言を挿入します。
+
+#endif // !defined(AFX_STDAFX_H__359C4D68_7507_4291_84FE_5004032BABD8__INCLUDED_)
Index: tag/abdev(2007.06.20)/icon_res/icon_res.cpp
===================================================================
--- tag/abdev(2007.06.20)/icon_res/icon_res.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/icon_res/icon_res.cpp	(revision 178)
@@ -0,0 +1,13 @@
+// icon_res.cpp : DLL アプリケーション用のエントリ ポイントを定義します。
+//
+
+#include "stdafx.h"
+
+BOOL APIENTRY DllMain( HANDLE hModule, 
+                       DWORD  ul_reason_for_call, 
+                       LPVOID lpReserved
+					 )
+{
+    return TRUE;
+}
+
Index: tag/abdev(2007.06.20)/icon_res/icon_res.dsp
===================================================================
--- tag/abdev(2007.06.20)/icon_res/icon_res.dsp	(revision 178)
+++ tag/abdev(2007.06.20)/icon_res/icon_res.dsp	(revision 178)
@@ -0,0 +1,291 @@
+# Microsoft Developer Studio Project File - Name="icon_res" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** 編集しないでください **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=icon_res - Win32 TheText_Release
+!MESSAGE これは有効なﾒｲｸﾌｧｲﾙではありません。 このﾌﾟﾛｼﾞｪｸﾄをﾋﾞﾙﾄﾞするためには NMAKE を使用してください。
+!MESSAGE [ﾒｲｸﾌｧｲﾙのｴｸｽﾎﾟｰﾄ] ｺﾏﾝﾄﾞを使用して実行してください
+!MESSAGE 
+!MESSAGE NMAKE /f "icon_res.mak".
+!MESSAGE 
+!MESSAGE NMAKE の実行時に構成を指定できます
+!MESSAGE ｺﾏﾝﾄﾞ ﾗｲﾝ上でﾏｸﾛの設定を定義します。例:
+!MESSAGE 
+!MESSAGE NMAKE /f "icon_res.mak" CFG="icon_res - Win32 TheText_Release"
+!MESSAGE 
+!MESSAGE 選択可能なﾋﾞﾙﾄﾞ ﾓｰﾄﾞ:
+!MESSAGE 
+!MESSAGE "icon_res - Win32 TheText_Release" ("Win32 (x86) Dynamic-Link Library" 用)
+!MESSAGE "icon_res - Win32 AB_Release" ("Win32 (x86) Dynamic-Link Library" 用)
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "icon_res - Win32 TheText_Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "icon_res___Win32_TheText_Release0"
+# PROP BASE Intermediate_Dir "icon_res___Win32_TheText_Release0"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "icon_res___Win32_TheText_Release0"
+# PROP Intermediate_Dir "icon_res___Win32_TheText_Release0"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICON_RES_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICON_RES_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x411 /d "NDEBUG"
+# ADD RSC /l 0x411 /d "NDEBUG" /d "THETEXT"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../TheText/SubOperation/icon_res.dll"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../TheText/SubOperation/icon_res.dll"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Cmds=copy D:\BasicProject\TheText\SubOperation\icon_res.dll D:\BasicProject\TheText_Standard\SubOperation\icon_res.dll
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "icon_res - Win32 AB_Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "icon_res___Win32_AB_Release0"
+# PROP BASE Intermediate_Dir "icon_res___Win32_AB_Release0"
+# PROP BASE Ignore_Export_Lib 0
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "icon_res___Win32_AB_Release0"
+# PROP Intermediate_Dir "icon_res___Win32_AB_Release0"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICON_RES_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ICON_RES_EXPORTS" /Yu"stdafx.h" /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x411 /d "NDEBUG"
+# ADD RSC /l 0x411 /d "NDEBUG" /d "ACTIVEBASIC"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../TheText/SubOperation/icon_res.dll"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../ActiveBasic/SubOperation/icon_res.dll"
+
+!ENDIF 
+
+# Begin Target
+
+# Name "icon_res - Win32 TheText_Release"
+# Name "icon_res - Win32 AB_Release"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\icon_res.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_res.rc
+# End Source File
+# Begin Source File
+
+SOURCE=.\StdAfx.cpp
+# ADD BASE CPP /Yc"stdafx.h"
+# ADD CPP /Yc"stdafx.h"
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\StdAfx.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\icon_ab\attach.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\BreakPoint.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\breakpoint_flag.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\community_find.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\community_forum.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\community_forum_secret.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\community_main.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\community_private_msg.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\DebugRun.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_allsave.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_conv_alpha_big.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_conv_alpha_small.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_conv_half.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_conv_hiragana.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_conv_katakana.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_conv_multi.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_copy.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_cut.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\menu_debugcompile.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_find.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_help.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_new.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_open.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_option.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_paste.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_preview.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_print.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_redo.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\menu_releasecompile.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_rightturn.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\menu_run.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_save.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_stringcount.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_topmost.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon\menu_undo.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\Pause.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\StepIn.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\StepOver.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\StepToCursor.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon_ab\Stop.ico
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\ReadMe.txt
+# End Source File
+# End Target
+# End Project
Index: tag/abdev(2007.06.20)/icon_res/icon_res.dsw
===================================================================
--- tag/abdev(2007.06.20)/icon_res/icon_res.dsw	(revision 178)
+++ tag/abdev(2007.06.20)/icon_res/icon_res.dsw	(revision 178)
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# 警告: このﾜｰｸｽﾍﾟｰｽ ﾌｧｲﾙ を編集または削除しないでください!
+
+###############################################################################
+
+Project: "icon_res"=.\icon_res.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Index: tag/abdev(2007.06.20)/icon_res/icon_res.rc
===================================================================
--- tag/abdev(2007.06.20)/icon_res/icon_res.rc	(revision 178)
+++ tag/abdev(2007.06.20)/icon_res/icon_res.rc	(revision 178)
@@ -0,0 +1,129 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// 日本語 resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
+#ifdef _WIN32
+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
+#pragma code_page(932)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_ALLSAVE             ICON    DISCARDABLE     "icon\\menu_allsave.ico"
+IDI_COPY                ICON    DISCARDABLE     "icon\\menu_copy.ico"
+IDI_CUT                 ICON    DISCARDABLE     "icon\\menu_cut.ico"
+IDI_FIND                ICON    DISCARDABLE     "icon\\menu_find.ico"
+IDI_NEW                 ICON    DISCARDABLE     "icon\\menu_new.ico"
+IDI_OPEN                ICON    DISCARDABLE     "icon\\menu_open.ico"
+IDI_PASTE               ICON    DISCARDABLE     "icon\\menu_paste.ico"
+IDI_REDO                ICON    DISCARDABLE     "icon\\menu_redo.ico"
+IDI_SAVE                ICON    DISCARDABLE     "icon\\menu_save.ico"
+IDI_UNDO                ICON    DISCARDABLE     "icon\\menu_undo.ico"
+IDI_PRINT               ICON    DISCARDABLE     "icon\\menu_print.ico"
+IDI_PREVIEW             ICON    DISCARDABLE     "icon\\menu_preview.ico"
+IDI_TOPMOST             ICON    DISCARDABLE     "icon\\menu_topmost.ico"
+IDI_OPTION              ICON    DISCARDABLE     "icon\\menu_option.ico"
+IDI_RIGHTTURN           ICON    DISCARDABLE     "icon\\menu_rightturn.ico"
+IDI_HELP                ICON    DISCARDABLE     "icon\\menu_help.ico"
+#if defined(APSTUDIO_INVOKED) || defined(ACTIVEBASIC)
+#if defined(APSTUDIO_INVOKED)
+IDI_RELEASERUN$(ACTIVEBASIC) ICON    DISCARDABLE     "icon_ab\\menu_run.ico"
+#else
+IDI_RELEASERUN          ICON    DISCARDABLE     "icon_ab\\menu_run.ico"
+#endif
+#endif
+#if defined(APSTUDIO_INVOKED) || defined(ACTIVEBASIC)
+#if defined(APSTUDIO_INVOKED)
+IDI_DEBUGCOMPILE$(ACTIVEBASIC) ICON    DISCARDABLE     "icon_ab\\menu_debugcompile.ico"
+#else
+IDI_DEBUGCOMPILE        ICON    DISCARDABLE     "icon_ab\\menu_debugcompile.ico"
+#endif
+#endif
+#if defined(APSTUDIO_INVOKED) || defined(ACTIVEBASIC)
+#if defined(APSTUDIO_INVOKED)
+IDI_RELEASECOMPILE$(ACTIVEBASIC) ICON    DISCARDABLE     "icon_ab\\menu_releasecompile.ico"
+#else
+IDI_RELEASECOMPILE      ICON    DISCARDABLE     "icon_ab\\menu_releasecompile.ico"
+#endif
+#endif
+IDI_CONV_MULTI          ICON    DISCARDABLE     "icon\\menu_conv_multi.ico"
+IDI_CONV_ALPHA_BIG      ICON    DISCARDABLE     "icon\\menu_conv_alpha_big.ico"
+IDI_CONV_ALPHA_SMALL    ICON    DISCARDABLE     "icon\\menu_conv_alpha_small.ico"
+IDI_CONV_HALF           ICON    DISCARDABLE     "icon\\menu_conv_half.ico"
+IDI_CONV_HIRAGANA       ICON    DISCARDABLE     "icon\\menu_conv_hiragana.ico"
+IDI_CONV_KATAKANA       ICON    DISCARDABLE     "icon\\menu_conv_katakana.ico"
+IDI_STRINGCOUNT         ICON    DISCARDABLE     "icon\\menu_stringcount.ico"
+IDI_BREAKPOINT          ICON    DISCARDABLE     "icon_ab\\BreakPoint.ico"
+IDI_DEBUGRUN            ICON    DISCARDABLE     "icon_ab\\DebugRun.ico"
+IDI_DEBUGPAUSE          ICON    DISCARDABLE     "icon_ab\\Pause.ico"
+IDI_STEPIN              ICON    DISCARDABLE     "icon_ab\\StepIn.ico"
+IDI_STEPOVER            ICON    DISCARDABLE     "icon_ab\\StepOver.ico"
+IDI_STEPTOCURSOR        ICON    DISCARDABLE     "icon_ab\\StepToCursor.ico"
+IDI_DEBUGSTOP           ICON    DISCARDABLE     "icon_ab\\Stop.ico"
+IDI_ATTACH              ICON    DISCARDABLE     "icon_ab\\attach.ico"
+IDI_COMMUNITY_PRIVATEMSG ICON    DISCARDABLE     "icon_ab\\community_private_msg.ico"
+IDI_COMMUNITY_FIND      ICON    DISCARDABLE     "icon_ab\\community_find.ico"
+IDI_COMMUNITY_FORUM     ICON    DISCARDABLE     "icon_ab\\community_forum.ico"
+IDI_COMMUNITY_MAIN      ICON    DISCARDABLE     "icon_ab\\community_main.ico"
+IDI_COMMUNITY_FORUM_SECRET ICON    DISCARDABLE     "icon_ab\\community_forum_secret.ico"
+IDI_BREAKPOINT_FLAG     ICON    DISCARDABLE     "icon_ab\\breakpoint_flag.ico"
+#endif    // 日本語 resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
Index: tag/abdev(2007.06.20)/icon_res/resource.h
===================================================================
--- tag/abdev(2007.06.20)/icon_res/resource.h	(revision 178)
+++ tag/abdev(2007.06.20)/icon_res/resource.h	(revision 178)
@@ -0,0 +1,55 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by icon_res.rc
+//
+#define IDI_ALLSAVE                     101
+#define IDI_COPY                        102
+#define IDI_CUT                         103
+#define IDI_FIND                        104
+#define IDI_NEW                         105
+#define IDI_OPEN                        106
+#define IDI_PASTE                       107
+#define IDI_REDO                        108
+#define IDI_SAVE                        109
+#define IDI_UNDO                        110
+#define IDI_PRINT                       111
+#define IDI_PREVIEW                     112
+#define IDI_TOPMOST                     113
+#define IDI_OPTION                      115
+#define IDI_RIGHTTURN                   116
+#define IDI_HELP                        117
+#define IDI_RELEASERUN                  118
+#define IDI_DEBUGCOMPILE                119
+#define IDI_RELEASECOMPILE              120
+#define IDI_CONV_MULTI                  121
+#define IDI_CONV_ALPHA_BIG              122
+#define IDI_CONV_ALPHA_SMALL            123
+#define IDI_CONV_HALF                   124
+#define IDI_CONV_HIRAGANA               125
+#define IDI_CONV_KATAKANA               126
+#define IDI_STRINGCOUNT                 127
+#define IDI_BREAKPOINT                  128
+#define IDI_DEBUGRUN                    129
+#define IDI_DEBUGPAUSE                  130
+#define IDI_STEPIN                      131
+#define IDI_STEPOVER                    132
+#define IDI_STEPTOCURSOR                133
+#define IDI_DEBUGSTOP                   134
+#define IDI_ATTACH                      136
+#define IDI_COMMUNITY_PRIVATEMSG        137
+#define IDI_COMMUNITY_FIND              138
+#define IDI_COMMUNITY_FORUM             139
+#define IDI_COMMUNITY_MAIN              140
+#define IDI_COMMUNITY_FORUM_SECRET      141
+#define IDI_BREAKPOINT_FLAG             142
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        143
+#define _APS_NEXT_COMMAND_VALUE         40001
+#define _APS_NEXT_CONTROL_VALUE         1000
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
Index: tag/abdev(2007.06.20)/res/res.cpp
===================================================================
--- tag/abdev(2007.06.20)/res/res.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/res/res.cpp	(revision 178)
@@ -0,0 +1,15 @@
+#include <windows.h>
+
+BOOL WINAPI DllMain(HANDLE hDLL,DWORD dwReason,LPVOID lpReserved){
+	switch(dwReason){
+		case DLL_PROCESS_ATTACH:
+			break;
+		case DLL_PROCESS_DETACH:
+			break;
+		case DLL_THREAD_ATTACH:
+		case DLL_THREAD_DETACH:
+		default:
+			break;
+	}
+	return TRUE;
+}
Index: tag/abdev(2007.06.20)/res/res.dsp
===================================================================
--- tag/abdev(2007.06.20)/res/res.dsp	(revision 178)
+++ tag/abdev(2007.06.20)/res/res.dsp	(revision 178)
@@ -0,0 +1,314 @@
+# Microsoft Developer Studio Project File - Name="res" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** 編集しないでください **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=res - Win32 Debug
+!MESSAGE これは有効なﾒｲｸﾌｧｲﾙではありません。 このﾌﾟﾛｼﾞｪｸﾄをﾋﾞﾙﾄﾞするためには NMAKE を使用してください。
+!MESSAGE [ﾒｲｸﾌｧｲﾙのｴｸｽﾎﾟｰﾄ] ｺﾏﾝﾄﾞを使用して実行してください
+!MESSAGE 
+!MESSAGE NMAKE /f "res.mak".
+!MESSAGE 
+!MESSAGE NMAKE の実行時に構成を指定できます
+!MESSAGE ｺﾏﾝﾄﾞ ﾗｲﾝ上でﾏｸﾛの設定を定義します。例:
+!MESSAGE 
+!MESSAGE NMAKE /f "res.mak" CFG="res - Win32 Debug"
+!MESSAGE 
+!MESSAGE 選択可能なﾋﾞﾙﾄﾞ ﾓｰﾄﾞ:
+!MESSAGE 
+!MESSAGE "res - Win32 Release" ("Win32 (x86) Dynamic-Link Library" 用)
+!MESSAGE "res - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" 用)
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "res - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RES_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RES_EXPORTS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x411 /d "NDEBUG"
+# ADD RSC /l 0x411 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../ActiveBasic/SubOperation/res.dll"
+
+!ELSEIF  "$(CFG)" == "res - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RES_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RES_EXPORTS" /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x411 /d "_DEBUG"
+# ADD RSC /l 0x411 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "res - Win32 Release"
+# Name "res - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\res.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\res.rc
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\base_directx.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\base_dosprompt.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\base_non.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\base_prompt.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\base_window.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\BasicProgram.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\ToolbarIcon_Debugger\BreakPoint.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\cursor_arrow_to_right.cur
+# End Source File
+# Begin Source File
+
+SOURCE=.\cursor_fill.cur
+# End Source File
+# Begin Source File
+
+SOURCE=.\cursor_pen.cur
+# End Source File
+# Begin Source File
+
+SOURCE=.\ToolbarIcon_Debugger\DebugCompile.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\ToolbarIcon_Debugger\DebugRun.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_bmp.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_icon.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\folder_close.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\folder_open.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\html_general_parameter.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\html_parameter.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\ico00001.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\ico00002.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icon1.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\member_private_function.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\member_private_variable.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\member_public_function.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\member_public_variable.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\menu.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\newfile_abp.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\newfile_html.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\newfile_icon.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\newfile_project.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\newfile_sbp.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\newfile_text.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\pair_statement.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\ToolbarIcon_Debugger\Pause.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\Procedure.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\program_folder.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\ToolbarIcon_Debugger\StepIn.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\ToolbarIcon_Debugger\StepOver.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\ToolbarIcon_Debugger\StepToCursor.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\ToolbarIcon_Debugger\Stop.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\TextDocument.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\TOOLBAR1.BMP
+# End Source File
+# Begin Source File
+
+SOURCE=.\toolbar2.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\toolbar_basic_disabled.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\toolbar_debugger.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\toolbar_icon.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\toolbar_standard.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\toolbar_standard_disabled.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Window.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\zoomin.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\zoomout.ico
+# End Source File
+# End Group
+# End Target
+# End Project
Index: tag/abdev(2007.06.20)/res/res.dsw
===================================================================
--- tag/abdev(2007.06.20)/res/res.dsw	(revision 178)
+++ tag/abdev(2007.06.20)/res/res.dsw	(revision 178)
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# 警告: このﾜｰｸｽﾍﾟｰｽ ﾌｧｲﾙ を編集または削除しないでください!
+
+###############################################################################
+
+Project: "res"=.\res.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Index: tag/abdev(2007.06.20)/res/res.rc
===================================================================
--- tag/abdev(2007.06.20)/res/res.rc	(revision 178)
+++ tag/abdev(2007.06.20)/res/res.rc	(revision 178)
@@ -0,0 +1,2252 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// 日本語 resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
+#ifdef _WIN32
+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
+#pragma code_page(932)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_MAINMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "ファイル(&F)"
+    BEGIN
+        MENUITEM "新規作成(&N)\tCtrl+N",        IDM_NEW
+        MENUITEM "ファイルを開く(&O)\tCtrl+O",  IDM_OPEN
+        MENUITEM "ファイルを閉じる(&C)",        IDM_CLOSE
+        MENUITEM SEPARATOR
+        MENUITEM "プロジェクトを開く（&P)",     IDM_PROJECT_OPEN
+        MENUITEM "プロジェクトの保存(&Q)",      IDM_PROJECT_SAVE
+        MENUITEM "プロジェクトを閉じる（&R)",   IDM_PROJECT_CLOSE
+        MENUITEM "プロジェクト フォルダを開く(&F)", IDM_PROJECT_FOLDER_OPEN
+        MENUITEM SEPARATOR
+        MENUITEM "上書き保存(&S)\tCtrl+S",      IDM_SAVE
+        MENUITEM "名前を付けて保存(&A)",        IDM_NEWSAVE
+        MENUITEM "文字コードを指定して保存(&D)", IDM_CODE_SAVE
+        MENUITEM "すべて保存(&V)",              IDM_ALLSAVE
+        MENUITEM SEPARATOR
+        MENUITEM "ページ設定(&U)",              IDM_PAGESET
+        MENUITEM "プレビュー(&R)",              IDM_PREVIEW
+        MENUITEM "印刷(&P)",                    IDM_PRINTOUT
+        MENUITEM SEPARATOR
+        POPUP "FileHistory"
+        BEGIN
+            MENUITEM "dummy",                       ID_MENUITEM40167
+        END
+        POPUP "ProjectHistory"
+        BEGIN
+            MENUITEM "dummy",                       ID_MENUITEM40168
+        END
+        MENUITEM SEPARATOR
+        MENUITEM "終了(&X)",                    IDM_EXIT
+    END
+    POPUP "編集(&E)"
+    BEGIN
+        MENUITEM "元に戻す(&U)\tCtrl+Z",        IDM_UNDO
+        MENUITEM "やり直し(&R)\tCtrl+Y",        IDM_REDO
+        MENUITEM SEPARATOR
+        MENUITEM "切り取り(&T)\tCtrl+X",        IDM_CUT
+        MENUITEM "コピー(&C)\tCtrl+C",          IDM_COPY
+        MENUITEM "貼り付け(&P)\tCtrl+V",        IDM_PASTE
+        MENUITEM "削除(&D)\tDel",               IDM_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "すべて選択(&A)\tCtrl+A",      IDM_ALLSELECT
+        MENUITEM SEPARATOR
+        MENUITEM "検索(&F)\tCtrl+F",            IDM_FIND
+        MENUITEM "置換(&S)\tCtrl+H",            IDM_PERMUTATION
+        MENUITEM SEPARATOR
+        POPUP "文字列の変換"
+        BEGIN
+            MENUITEM "アルファベット大文字 → アルファベット小文字(&A)", 
+                                                    IDM_CONV_ALPHA_SMALL
+            MENUITEM "アルファベット小文字 → アルファベット大文字(&L)", 
+                                                    IDM_CONV_ALPHA_BIG
+            MENUITEM SEPARATOR
+            MENUITEM "全角 → 半角(&H)",            IDM_CONV_HALF
+            MENUITEM "半角 → 全角(&M)",            IDM_CONV_MULTI
+            MENUITEM "全角ひらがな → 全角カタカナ(&K)", IDM_CONV_KATAKANA
+            MENUITEM "全角カタカナ → 全角ひらがな(&R)", IDM_CONV_HIRAGANA
+            MENUITEM SEPARATOR
+            MENUITEM "TAB → 空白(&S)",             IDM_CONV_SPACE
+            MENUITEM "空白 → TAB(&T)",             IDM_CONV_TAB
+            MENUITEM SEPARATOR
+            MENUITEM "インデントの自動調整(&I)",    IDM_CODEFORMAT
+        END
+    END
+    POPUP "表示(&V)"
+    BEGIN
+        MENUITEM "プロジェクト ビュー(&V)",     IDM_PROJECTVIEW
+        MENUITEM "プロジェクト オプション(&P)", IDM_PROJECT_OPTION
+        MENUITEM SEPARATOR
+        MENUITEM "常に手前に表示(&T)",          IDM_TOPMOST
+        MENUITEM SEPARATOR
+        MENUITEM "オプション(&O)",              IDM_SET
+    END
+    POPUP "リリース(&B)"
+    BEGIN
+        MENUITEM "リリース ビルド(&B)\tF6",     IDM_RELEASECOMPILE
+        MENUITEM "実行(&R)",                    IDM_RELEASERUN
+    END
+    POPUP "デバッグ(&D)"
+    BEGIN
+        MENUITEM "プロセスへアタッチ(&A)",      IDM_ATTACH
+        MENUITEM SEPARATOR
+        MENUITEM "デバッグ ビルド(&D)\tF7",     IDM_DEBUGCOMPILE
+        MENUITEM "デバッグ実行(&R)\tF8",        IDM_DEBUG
+        MENUITEM SEPARATOR
+        MENUITEM "ブレークポイントの設置/解除(&B)\tF9", IDM_BREAKPOINT
+        MENUITEM "ステップ イン(&I)\tF10",      IDM_STEP_IN, GRAYED
+        MENUITEM "ステップ オーバー(&O)\tF11",  IDM_STEP_OVER, GRAYED
+        MENUITEM "カーソル行まで実行(&C)\tCtrl+F11", IDM_STEP_CURSOR, GRAYED
+        MENUITEM SEPARATOR
+        MENUITEM "一時中断(&P)",                IDM_DEBUG_PAUSE, GRAYED
+        MENUITEM "デバッグを中止(&S)",          IDM_DEBUG_STOP, GRAYED
+    END
+    POPUP "コミュニティ(&C)"
+    BEGIN
+        MENUITEM "コミュニティを表示(&C)",      IDM_COMMUNITY
+        MENUITEM "コミュニティ内を検索(&S)",    IDM_COMMU_SEARCH
+        MENUITEM "プライベート メッセージを読む(&M)", IDM_COMMU_PM
+        MENUITEM SEPARATOR
+        POPUP "フォーラムへ移動(&F)"
+        BEGIN
+            MENUITEM "プログラミング質問版(&P)",    ID_COMMU_FORUM1
+            MENUITEM "実践コードモジュール(&C)",    ID_COMMU_FORUM2
+            MENUITEM "アナウンス(D)",               ID_COMMU_FORUM3
+            MENUITEM SEPARATOR
+            MENUITEM "バグ報告(&B)",                ID_COMMU_FORUM4
+            MENUITEM "仕様提案(&S)",                ID_COMMU_FORUM5
+            MENUITEM SEPARATOR
+            MENUITEM "ライブラリ開発(Members)(&L)", ID_COMMU_FORUM6
+            MENUITEM SEPARATOR
+            MENUITEM "要望＆お問い合わせ(&N)",      ID_COMMU_FORUM7
+            MENUITEM "雑談所(&F)",                  ID_COMMU_FORUM8
+        END
+    END
+    POPUP "ヘルプ(&H)"
+    BEGIN
+        MENUITEM "トピック(&T)\tF1",            IDM_TOPIC
+        MENUITEM SEPARATOR
+        POPUP "ホームページを表示(&H)"
+        BEGIN
+            MENUITEM "activebasic.com(&H)",         IDM_AB_WEBSITE
+            MENUITEM "最新版をダウンロード(&D)",    IDM_ACTBDL
+        END
+        MENUITEM SEPARATOR
+        MENUITEM "バージョン情報(&A)",          IDM_ABOUT
+    END
+END
+
+IDR_EDITMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "EditMenu"
+    BEGIN
+        MENUITEM "元に戻す(&U)",                IDM_UNDO
+        MENUITEM "やり直し(&R)",                IDM_REDO
+        MENUITEM SEPARATOR
+        MENUITEM "切り取り(&T)",                IDM_CUT
+        MENUITEM "コピー(&C)",                  IDM_COPY
+        MENUITEM "貼り付け(&P)",                IDM_PASTE
+        MENUITEM "削除(&D)",                    IDM_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "すべて選択(&A)",              IDM_ALLSELECT
+    END
+END
+
+IDR_REBARMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "RebarMenu"
+    BEGIN
+        MENUITEM "ドキュメント セレクト(&S)",   IDM_DOCSELECTBAND
+        MENUITEM "スタンダード(&T)",            IDM_STANDARDBAND
+        MENUITEM "リリース ビルド(&B)",         IDM_RELEASEBAND
+        MENUITEM "デバッガ(&D)",                IDM_DEBUGBAND
+        MENUITEM "プラットフォーム セレクト(&P)", IDM_SELECTCOMPILERBAND
+        MENUITEM "Web検索(&W)",                 IDM_BANDMENU_WEB_SEARCH
+        MENUITEM SEPARATOR
+        MENUITEM "ツールバーを固定する(&F)",    IDM_NOGRIPPER
+        MENUITEM SEPARATOR
+        MENUITEM "リセット(&R)",                IDM_RESET_REBAR
+    END
+END
+
+IDR_PROJECTVIEW_FILETREEMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "FileTreeRoot"
+    BEGIN
+        MENUITEM "ファイルを挿入(&I)",          IDM_FILETREE_INSERT
+    END
+    POPUP "FileTree"
+    BEGIN
+        MENUITEM "開く(&O)",                    IDM_FILETREE_OPEN
+        MENUITEM SEPARATOR
+        MENUITEM "プロジェクトから削除(&D)",    IDM_FILETREE_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "プロパティ(&P)",              IDM_FILETREE_PROPERTY
+    END
+END
+
+IDR_PROJECTVIEW_MATERIALTREEMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "BitmapRoot"
+    BEGIN
+        MENUITEM "ビットマップを挿入(&I)",      IDM_MATERIALTREE_INSERTBITMAP
+
+    END
+    POPUP "BitmapTree"
+    BEGIN
+        MENUITEM "削除(&D)",                    IDM_MATERIALTREE_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "IDを変更(&E)",                IDM_MENUTREE_RENAMEID
+    END
+    POPUP "CursorRoot"
+    BEGIN
+        MENUITEM "カーソルを挿入(&I)",          IDM_MATERIALTREE_INSERTCURSOR
+
+    END
+    POPUP "CursorTree"
+    BEGIN
+        MENUITEM "削除(&D)",                    IDM_MATERIALTREE_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "IDを変更(&E)",                IDM_MENUTREE_RENAMEID
+    END
+    POPUP "IconRoot"
+    BEGIN
+        MENUITEM "アイコンを挿入(&I)",          IDM_MATERIALTREE_INSERTICON
+    END
+    POPUP "IconTree"
+    BEGIN
+        MENUITEM "開く（&O)",                   IDM_MATERIALTREE_OPEN
+        MENUITEM "メインに設定(&M)",            IDM_MATERIALTREE_ICON_SETMAIN
+
+        MENUITEM SEPARATOR
+        MENUITEM "削除(&D)",                    IDM_MATERIALTREE_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "IDを変更(&E)",                IDM_MENUTREE_RENAMEID
+    END
+    POPUP "MenuRoot"
+    BEGIN
+        MENUITEM "メニューを挿入(&I)",          IDM_MATERIALTREE_INSERTMENU
+    END
+    POPUP "MenuTree"
+    BEGIN
+        MENUITEM "開く(&O)",                    IDM_MATERIALTREE_OPEN
+        MENUITEM SEPARATOR
+        MENUITEM "削除(&D)",                    IDM_MATERIALTREE_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "メニューIDを変更(&E)",        IDM_MENUTREE_RENAMEID
+    END
+    POPUP "WindowRoot"
+    BEGIN
+        MENUITEM "ウィンドウを挿入（&I)",       IDM_MATERIALTREE_INSERTWINDOW
+
+    END
+    POPUP "WindowTree"
+    BEGIN
+        MENUITEM "開く(&O)",                    IDM_MATERIALTREE_OPEN
+        MENUITEM SEPARATOR
+        MENUITEM "削除(&D)",                    IDM_MATERIALTREE_DELETE
+    END
+END
+
+IDR_RADCONTEXTMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "Window"
+    BEGIN
+        MENUITEM "イベント コード(&C)",         IDM_RAD_WINDOW_EVENTCODE
+        MENUITEM "メニューによるイベント(&M)",  IDM_RAD_WINDOW_MENUEVENTCODE
+    END
+    POPUP "Item"
+    BEGIN
+        MENUITEM "イベント コード(&C)",         IDM_RAD_WINDOW_EVENTCODE
+        MENUITEM SEPARATOR
+        MENUITEM "削除(&D)",                    IDM_RAD_ITEM_DELETE
+    END
+END
+
+IDR_PROJECTVIEW_PROCEDURETREEMENU MENU DISCARDABLE 
+BEGIN
+    MENUITEM "ProcedureTreeRoot",           65535
+    POPUP "ProcedureTree"
+    BEGIN
+        MENUITEM "表示する(&S)",                IDM_PROCEDURETREE_SHOW
+    END
+END
+
+IDR_TABMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "tabmenu"
+    BEGIN
+        POPUP "タブの色(&L)"
+        BEGIN
+            MENUITEM "灰色(&G)",                    IDM_GRAY
+            MENUITEM "白(&W)",                      IDM_WHITE
+            MENUITEM "赤(&R)",                      IDM_RED
+            MENUITEM "緑(&E)",                      IDM_GREEN
+            MENUITEM "青(&B)",                      IDM_BLUE
+            MENUITEM "黄色(&Y)",                    IDM_YELLOW
+            MENUITEM SEPARATOR
+            MENUITEM "ユーザー設定(&U)",            IDM_USER_COLOR
+        END
+        MENUITEM SEPARATOR
+        MENUITEM "保存(&S)",                    IDM_SAVE
+        MENUITEM "閉じる(&C)",                  IDM_CLOSE
+        MENUITEM "このウィンドウ以外をすべて閉じる(&A)", 
+                                                IDM_ALLCLOSE_OMIT_MYSELF
+        MENUITEM SEPARATOR
+        MENUITEM "絶対パスをコピー(&P)",        IDM_PATH_COPY
+        MENUITEM "フォルダを開く(&F)",          IDM_FOLDER_OPEN
+        MENUITEM SEPARATOR
+        MENUITEM "ファイルを削除(&D)",          IDM_DELETE_FILE
+    END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE 
+BEGIN
+    "A",            IDM_ALLSELECT,          VIRTKEY, CONTROL, NOINVERT
+    "C",            IDM_COPY,               VIRTKEY, CONTROL, NOINVERT
+    "F",            IDM_FIND,               VIRTKEY, CONTROL, NOINVERT
+    "H",            IDM_PERMUTATION,        VIRTKEY, CONTROL, NOINVERT
+    "N",            IDM_NEW,                VIRTKEY, CONTROL, NOINVERT
+    "O",            IDM_OPEN,               VIRTKEY, CONTROL, NOINVERT
+    "S",            IDM_SAVE,               VIRTKEY, CONTROL, NOINVERT
+    "V",            IDM_PASTE,              VIRTKEY, CONTROL, NOINVERT
+    VK_F1,          IDM_TOPIC,              VIRTKEY, NOINVERT
+    VK_F10,         IDM_STEP_IN,            VIRTKEY, NOINVERT
+    VK_F11,         IDM_STEP_OVER,          VIRTKEY, NOINVERT
+    VK_F11,         IDM_STEP_CURSOR,        VIRTKEY, CONTROL, NOINVERT
+    VK_F5,          IDM_WEB_SEARCH,         VIRTKEY, NOINVERT
+    VK_F6,          IDM_RELEASECOMPILE,     VIRTKEY, NOINVERT
+    VK_F7,          IDM_DEBUGCOMPILE,       VIRTKEY, NOINVERT
+    VK_F8,          IDM_DEBUG,              VIRTKEY, NOINVERT
+    VK_F9,          IDM_BREAKPOINT,         VIRTKEY, NOINVERT
+    "X",            IDM_CUT,                VIRTKEY, CONTROL, NOINVERT
+    "Y",            IDM_ACCEL_REDO,         VIRTKEY, CONTROL, NOINVERT
+    "Z",            IDM_ACCEL_UNDO,         VIRTKEY, CONTROL, NOINVERT
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Toolbar
+//
+
+IDR_STANDARDTOOLBAR TOOLBAR DISCARDABLE  16, 15
+BEGIN
+    BUTTON      IDM_NEW
+    BUTTON      IDM_OPEN
+    BUTTON      IDM_SAVE
+    BUTTON      IDM_ALLSAVE
+    BUTTON      IDM_CUT
+    BUTTON      IDM_COPY
+    BUTTON      IDM_PASTE
+    BUTTON      IDM_UNDO
+    BUTTON      IDM_REDO
+    BUTTON      IDM_FIND
+END
+
+IDR_DEBUGGERTOOLBAR TOOLBAR DISCARDABLE  16, 15
+BEGIN
+    BUTTON      IDM_DEBUG
+    BUTTON      IDM_DEBUGCOMPILE
+    BUTTON      IDM_RELEASECOMPILE
+END
+
+IDR_CONTROL TOOLBAR DISCARDABLE  16, 15
+BEGIN
+    BUTTON      IDC_TOOL_MOUSE
+    BUTTON      IDC_TOOL_STATIC
+    BUTTON      IDC_TOOL_EDIT
+    BUTTON      IDC_TOOL_GROUPBOX
+    BUTTON      IDC_TOOL_COMBOBOX
+    BUTTON      IDC_TOOL_LISTBOX
+    BUTTON      IDC_TOOL_BUTTON
+    BUTTON      IDC_TOOL_CHECKBOX
+    BUTTON      IDC_TOOL_RADIOBUTTON
+    BUTTON      IDC_TOOL_LISTVIEW
+    BUTTON      IDC_TOOL_TREEVIEW
+    BUTTON      IDC_TOOL_HSCROLLBAR
+    BUTTON      IDC_TOOL_VSCROLLBAR
+    BUTTON      IDC_TOOL_UPDOWN
+    BUTTON      IDC_TOOL_IMAGEBOX
+    BUTTON      IDC_TOOL_TRACKBAR
+    BUTTON      IDC_TOOL_PROGRESSBAR
+    BUTTON      ID_BUTTON40097
+END
+
+IDR_ICONTOOLBAR TOOLBAR DISCARDABLE  16, 15
+BEGIN
+    BUTTON      IDC_TOOL_SELECT
+    BUTTON      IDC_TOOL_PEN
+    BUTTON      IDC_TOOL_LINE
+    BUTTON      IDC_TOOL_FILL
+    BUTTON      IDC_TOOL_RECTANGLE
+    BUTTON      IDC_TOOL_FILLRECT
+    BUTTON      IDC_TOOL_FILLRECT2
+    BUTTON      IDC_TOOL_ELLIPSE
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDR_STANDARDTOOLBAR     BITMAP  DISCARDABLE     "toolbar_standard.bmp"
+IDR_DEBUGGERTOOLBAR     BITMAP  DISCARDABLE     "toolbar2.bmp"
+IDB_BASE_NORMAL         BITMAP  DISCARDABLE     "base_window.bmp"
+IDB_BASE_PROMPT         BITMAP  DISCARDABLE     "base_prompt.bmp"
+IDB_RADIOBUTTON         BITMAP  DISCARDABLE     "radiobutton.bmp"
+IDB_TITLE_BUTTON_CLOSE  BITMAP  DISCARDABLE     "title_button_close.bmp"
+IDR_CONTROL             BITMAP  DISCARDABLE     "toolbar_control.bmp"
+IDB_TITLE               BITMAP  DISCARDABLE     "title.bmp"
+IDB_PARAMHINT_QUESTION  BITMAP  DISCARDABLE     "ParamHint_Question.bmp"
+IDB_PARAMHINT_QUESTION2 BITMAP  DISCARDABLE     "ParamHint_Question2.bmp"
+IDR_ICONTOOLBAR         BITMAP  DISCARDABLE     "toolbar_icon.bmp"
+IDB_BASE_DOSPROMPT      BITMAP  DISCARDABLE     "base_dosprompt.bmp"
+IDB_BASE_NON            BITMAP  DISCARDABLE     "base_non.bmp"
+IDB_BASE_DIRECTX        BITMAP  DISCARDABLE     "base_directx.bmp"
+IDR_STANDARDTOOLBAR_DISABLED BITMAP  DISCARDABLE     "toolbar_standard_disabled.bmp"
+IDR_DEBUGGERTOOLBAR_DISABLED BITMAP  DISCARDABLE     "toolbar_basic_disabled.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUT DIALOG DISCARDABLE  0, 0, 239, 236
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ActiveBasic のバージョン情報"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "閉じる",IDCANCEL,182,215,50,14
+    ICON            IDI_MAIN,IDC_STATIC,29,21,20,20
+    LTEXT           "Copyright(C) 1999-2007 Discoversoft",IDC_STATIC,28,56,
+                    111,8
+    LTEXT           "ActiveBasic",IDC_STATIC_NAME,52,24,127,8
+    LTEXT           "Version",IDC_STATIC_VERSION,52,36,112,8
+    GROUPBOX        "ablibに関する情報",IDC_STATIC,7,82,225,123
+    LTEXT           "  ActiveBasicに付属する標準ライブラリは、開発者グループに属するライブラリ開発チームの皆様によって開発が進められています。",
+                    IDC_STATIC,13,96,213,19
+    EDITTEXT        IDC_DEV_GROUP,13,119,213,69,ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | 
+                    WS_VSCROLL
+    GROUPBOX        "IDEのバージョン情報",IDC_STATIC,7,7,225,67
+    LTEXT           "※順不同",IDC_STATIC,14,192,28,8
+END
+
+IDD_FIND DIALOG DISCARDABLE  0, 0, 235, 89
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "検索"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LTEXT           "文字列(&N):",IDC_STATIC,7,11,32,8
+    COMBOBOX        IDC_FINDSTR,44,7,121,64,CBS_DROPDOWN | CBS_AUTOHSCROLL | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "大文字小文字を区別する(&C)",IDC_ISBIGSMALL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,22,34,98,10
+    CONTROL         "単語単位(&W)",IDC_ISWORDUNIT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,22,48,53,10
+    CONTROL         "正規表現(&E)",IDC_REGEXP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,22,62,52,10
+    DEFPUSHBUTTON   "次を検索(&F)",IDOK,178,7,50,14
+    PUSHBUTTON      "すべて検索(&A)",IDC_FINDALL,178,23,50,14
+    PUSHBUTTON      "キャンセル",IDCANCEL,178,68,50,14
+END
+
+IDD_FINDALL DIALOG DISCARDABLE  0, 0, 186, 93
+STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
+CAPTION "検索結果"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    PUSHBUTTON      "該当を表示(&S)",IDC_SHOWITEM,2,2,50,14
+    PUSHBUTTON      "閉じる",IDCANCEL,55,2,50,14
+    LISTBOX         IDC_FINDLIST,0,17,186,76,LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_OPTION_WHOLE DIALOG DISCARDABLE  0, 0, 231, 182
+STYLE WS_CHILD | WS_DISABLED | WS_CAPTION | WS_SYSMENU
+CAPTION "全般"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LTEXT           "拡張子をもとに、ファイルの関連付けを行います。",
+                    IDC_STATIC,73,45,151,20
+    LTEXT           "-",IDC_STATIC,61,45,8,8
+    CONTROL         "プロジェクトをコンパイルする時に保存確認をする",
+                    IDC_SAVECHECK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,
+                    158,10
+    CONTROL         "ドキュメントを保存したときにタブを先頭に再配置する",
+                    IDC_SAVE_TAB_TO_HEAD,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,7,23,167,10
+    PUSHBUTTON      "関連付け",IDC_LINKFILE,7,41,50,14
+END
+
+IDD_PERMUTATION DIALOG DISCARDABLE  0, 0, 267, 111
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "置換"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LTEXT           "検索する文字列(&N):",IDC_STATIC,7,10,57,8
+    LTEXT           "置換後の文字列(&P):",IDC_STATIC,7,27,59,8
+    COMBOBOX        IDC_FINDSTR,68,7,134,69,CBS_DROPDOWN | CBS_AUTOHSCROLL | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_PERMUTATIONSTR,68,25,134,70,CBS_DROPDOWN | 
+                    CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+    CONTROL         "大文字小文字を区別する(&C)",IDC_ISBIGSMALL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,38,53,98,10
+    CONTROL         "単語単位(&W)",IDC_ISWORDUNIT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,38,67,53,10
+    CONTROL         "正規表現(&E)",IDC_REGEXP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,38,81,52,10
+    DEFPUSHBUTTON   "次を検索(&F)",IDC_FIND,210,7,50,14,WS_GROUP
+    PUSHBUTTON      "次を置換(&R)",IDC_PERMUTATIONNEXT,210,24,50,14
+    PUSHBUTTON      "すべて置換(&A)",IDC_PERMUTATIONALL,210,41,50,14
+    PUSHBUTTON      "閉じる",IDCANCEL,210,90,50,14
+END
+
+IDD_NEWFILE DIALOG DISCARDABLE  0, 0, 282, 166
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "新規作成"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CONTROL         "List1",IDC_FILETYPELIST,"SysListView32",LVS_SINGLESEL | 
+                    LVS_SHOWSELALWAYS | WS_BORDER | WS_TABSTOP,91,17,184,92
+    DEFPUSHBUTTON   "OK",IDOK,171,145,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,225,145,50,14
+    CONTROL         "プロジェクトへ追加",IDC_ADDTOPROJECT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,93,148,70,10
+    EDITTEXT        IDC_FILENAME,127,125,148,14,ES_AUTOHSCROLL
+    LTEXT           "ファイル名:",IDC_STATIC_FILENAME,91,128,32,8
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,116,268,1
+    CONTROL         "Tree1",IDC_CATEGORY_TREE,"SysTreeView32",TVS_HASLINES | 
+                    TVS_LINESATROOT | TVS_SHOWSELALWAYS | WS_BORDER | 
+                    WS_TABSTOP,7,17,81,92
+    LTEXT           "カテゴリ",IDC_STATIC,7,7,24,8
+    LTEXT           "ドキュメント タイプ",IDC_STATIC,91,7,53,8
+END
+
+IDD_OPTION_EDITOR DIALOG DISCARDABLE  0, 0, 251, 258
+STYLE WS_CHILD | WS_DISABLED | WS_CAPTION | WS_SYSMENU
+CAPTION "エディタ"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    GROUPBOX        "コーディング サポート",IDC_STATIC,7,66,237,80
+    GROUPBOX        "全般",IDC_STATIC,7,7,237,53
+    LTEXT           "タブ サイズ:",IDC_STATIC_TABSIZE,13,44,35,8
+    LTEXT           "フォント:",IDC_STATIC_SETFONT,13,23,24,8
+    LTEXT           "ヒント フォント:",IDC_STATIC_HINTFONT,118,180,42,8,
+                    WS_DISABLED
+    LTEXT           "行前までのステートメントに対応させる",
+                    IDC_STATIC_PAIRSTATEMENT,63,129,111,8
+    GROUPBOX        "パラメータ ヒント",IDC_STATIC,7,154,237,51
+    GROUPBOX        "検索・置換",IDC_STATIC,7,213,237,38
+    PUSHBUTTON      "font",IDC_SETFONT,69,19,50,14
+    EDITTEXT        IDC_TABSIZE,69,40,25,14,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "ルーラーを表示する(&R)",IDC_RULER,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,137,18,83,10
+    CONTROL         "行番号を表示する(&L)",IDC_LINENUMBER,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,137,30,77,10
+    CONTROL         "カーソル行を強調表示する(&C)",IDC_CARETLINE_BACKGROUND,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,137,42,103,10
+    CONTROL         "自動インデント(&I)",IDC_ISAUTOINDENT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,13,77,65,10
+    CONTROL         "貼り付け時にインデント調整を行う(&P)",IDC_PASTEINDENT,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,89,122,10
+    CONTROL         "メンバ補完を有効にする(&M)",IDC_COMPLEMENT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,13,101,95,10
+    CONTROL         "ペア ステートメント補完を有効にする(&S)",
+                    IDC_PAIRSTATEMENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    13,113,131,10
+    EDITTEXT        IDC_BACKNUM,37,125,23,14,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "表示する(&H)",IDC_PARAMHINT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,13,166,51,10
+    CONTROL         "ポップアップ(&O)",IDC_POPUP,"Button",BS_AUTORADIOBUTTON | 
+                    WS_DISABLED,35,180,61,10
+    CONTROL         "ステータス バー(&B)",IDC_STATUSBAR,"Button",
+                    BS_AUTORADIOBUTTON | WS_DISABLED,35,192,71,10
+    PUSHBUTTON      "hintfont",IDC_HINTFONT,170,176,50,14,WS_DISABLED
+    CONTROL         "アプリケーション終了時に検索・置換文字列を保存する(&V)",
+                    IDC_SAVE_FINDSTR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    13,230,183,10
+END
+
+IDD_OPTION_TOOLBAR DIALOG DISCARDABLE  0, 0, 187, 93
+STYLE WS_CHILD | WS_DISABLED | WS_CAPTION | WS_SYSMENU
+CAPTION "ツールバー"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    PUSHBUTTON      "リセット(&R)",IDC_RESETTOOLBAR,19,24,50,14
+END
+
+IDD_NEWPROJECT_PAGE1 DIALOGEX 0, 0, 310, 177
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ステップ1 （プロジェクトを作成）"
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    CONTROL         138,IDC_IMAGE_WINDOW,"Static",SS_BITMAP,7,7,73,64
+    CONTROL         139,IDC_IMAGE_PROMPT,"Static",SS_BITMAP | NOT WS_VISIBLE,
+                    18,15,73,64
+    LTEXT           "Static",IDC_HELPTEXT_OFBASE,28,141,275,29,0,
+                    WS_EX_STATICEDGE
+    LTEXT           "プロジェクト名(&N):",IDC_STATIC,99,11,52,8
+    LTEXT           "ディレクトリ(&D):",IDC_STATIC,107,28,44,8
+    GROUPBOX        "アプリケーション タイプ（Win32)",IDC_STATIC,95,49,131,
+                    86
+    LTEXT           "説明:",IDC_STATIC,7,141,16,8
+    EDITTEXT        IDC_PROJECTNAME,153,7,69,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_DIRPATH,153,25,107,14,ES_AUTOHSCROLL
+    PUSHBUTTON      "参照(&B)",IDC_PATHBROWSE,271,25,32,14
+    CONTROL         "EXE - ノーマル ウィンドウ ベース",IDC_EXE_WINDOWBASE,
+                    "Button",BS_AUTORADIOBUTTON,102,61,112,10
+    CONTROL         "EXE - N88プロンプト ベース",IDC_EXE_PROMPTBASE,"Button",
+                    BS_AUTORADIOBUTTON,102,73,98,10
+    CONTROL         "EXE - DOSプロンプト ベース",IDC_EXE_DOSPROMPTBASE,
+                    "Button",BS_AUTORADIOBUTTON,102,85,99,10
+    CONTROL         "EXE - ベースなし",IDC_EXE_NOBASE,"Button",
+                    BS_AUTORADIOBUTTON,102,97,67,10
+    CONTROL         "EXE - DirectX対応アプリケーション",IDC_EXE_DIRECTX,
+                    "Button",BS_AUTORADIOBUTTON,102,109,119,10
+    CONTROL         "DLL - プロシージャ ライブラリ",IDC_DLL,"Button",
+                    BS_AUTORADIOBUTTON,102,121,103,10
+    CONTROL         """Hello world!"" 表示",IDC_SHOWHELLOWORLD,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,230,56,73,10
+    CONTROL         266,IDC_IMAGE_DOSPROMPT,"Static",SS_BITMAP | NOT 
+                    WS_VISIBLE,7,23,73,64
+    CONTROL         267,IDC_IMAGE_NON,"Static",SS_BITMAP | NOT WS_VISIBLE,18,
+                    31,73,64
+    CONTROL         268,IDC_IMAGE_DIRECTX,"Static",SS_BITMAP | NOT 
+                    WS_VISIBLE,7,39,73,64
+END
+
+IDD_NEWPROJECT_PAGE3 DIALOG DISCARDABLE  0, 0, 310, 177
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ステップ3 （プロジェクト情報の確認）"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    EDITTEXT        IDC_PROJECTINFO,7,7,296,163,ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | 
+                    WS_VSCROLL | WS_HSCROLL
+END
+
+IDD_PROJECT_FILEPROPERTY DIALOGEX 0, 0, 230, 77
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_TOOLWINDOW
+CAPTION "Source File プロパティ"
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    LTEXT           "使用ファイル:",IDC_STATIC,7,10,39,8
+    LTEXT           "定義:",IDC_STATIC,7,30,16,8
+    LTEXT           "最終更新日時:",IDC_STATIC,7,50,43,8
+    LTEXT           "形式:",IDC_STATIC,7,62,16,8
+    LTEXT           "time",IDC_UPDATE_TIME,55,50,168,8
+    LTEXT           "type",IDC_FILETYPE,55,62,168,8
+    EDITTEXT        IDC_USING_FILE,55,7,168,14,ES_AUTOHSCROLL | ES_READONLY
+    EDITTEXT        IDC_DEFINED_FILE,55,25,168,14,ES_AUTOHSCROLL | 
+                    ES_READONLY
+END
+
+IDD_RAD_CTRLBUTTONS DIALOG DISCARDABLE  0, 0, 88, 90
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+END
+
+IDD_PROJECT_NEWWINDOW DIALOG DISCARDABLE  0, 0, 171, 153
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "新規ウィンドウ"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LTEXT           "ウィンドウ名:",IDC_STATIC,13,11,36,8
+    LTEXT           "ハンドル:",IDC_STATIC,13,60,26,8
+    LTEXT           "プロシージャ:",IDC_STATIC,13,77,39,8
+    GROUPBOX        "詳細",IDC_STATIC,7,29,96,64
+    GROUPBOX        "タイプ",IDC_STATIC,7,99,157,47
+    EDITTEXT        IDC_WINDOWNAME,56,7,40,14,ES_AUTOHSCROLL
+    CONTROL         "自動設定",IDC_AUTOSET,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,13,42,43,10
+    EDITTEXT        IDC_WINDOWHANDLE,56,56,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_WINDOWPROC,56,73,40,14,ES_AUTOHSCROLL
+    CONTROL         "通常ウィンドウ",IDC_DEFWINDOW,"Button",
+                    BS_AUTORADIOBUTTON,13,111,57,10
+    CONTROL         "ダイアログ テンプレート（モーダル）",IDC_MODALDLG,
+                    "Button",BS_AUTORADIOBUTTON,13,122,117,10
+    CONTROL         "ダイアログ テンプレート（モードレス）",IDC_MODELESSDLG,
+                    "Button",BS_AUTORADIOBUTTON,13,133,121,10
+    DEFPUSHBUTTON   "作成",IDOK,114,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,114,24,50,14
+END
+
+IDD_RAD_PROP_WINDOW DIALOG DISCARDABLE  0, 0, 87, 484
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ウィンドウ プロパティ -",IDC_STATIC,0,3,86,8
+    LTEXT           "キャプション:",IDC_STATIC,3,59,38,8
+    LTEXT           "フォント:",IDC_STATIC,3,91,24,8
+    LTEXT           "背景:",IDC_STATIC,3,110,16,8
+    LTEXT           "ハンドル:",IDC_STATIC_HANDLE,3,42,26,8
+    LTEXT           "Handle",IDC_HANDLE,30,42,50,8
+    LTEXT           "識別名:",IDC_STATIC,3,18,23,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,187,85,219
+    LTEXT           "メニュー:",IDC_STATIC,4,128,26,8
+    GROUPBOX        "タイプ",IDC_STATIC,0,412,86,48
+    EDITTEXT        IDC_WINDOWNAME,1,28,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEWINDOW,68,27,18,14
+    EDITTEXT        IDC_CAPTION,1,69,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,68,18,14
+    PUSHBUTTON      "",IDC_SETFONT,28,88,58,14
+    COMBOBOX        IDC_WINDOWMENU,1,138,84,75,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_WINDOWSTYLE,4,199,80,60,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_BORDERSTYLE,4,213,80,60,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "タイトルバー",IDC_STYLE_CAPTION,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,231,52,10
+    CONTROL         "システムメニュー",IDC_STYLE_SYSMENU,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,242,66,10
+    CONTROL         "最小化ボタン",IDC_STYLE_MINIMIZEBOX,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,253,54,10
+    CONTROL         "最大化ボタン",IDC_STYLE_MAXIMIZEBOX,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,264,54,10
+    CONTROL         "最小化",IDC_STYLE_MINIMIZE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,282,37,10
+    CONTROL         "最大化",IDC_STYLE_MAXIMIZE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,293,37,10
+    CONTROL         "水平スクロールバー",IDC_STYLE_HSCROLLBAR,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,311,71,10
+    CONTROL         "垂直スクロールバー",IDC_STYLE_VSCROLLBAR,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,322,71,10
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,340,64,10
+    CONTROL         "兄弟ウィンドウをクリップ",IDC_STYLE_CLIPSIBLINGS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,351,80,10
+    CONTROL         "子ウィンドウをクリップ",IDC_STYLE_CLIPCHILDREN,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,362,78,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,373,30,10
+    PUSHBUTTON      "拡張スタイルを設定",IDC_EXSTYLE,4,389,78,13
+    CONTROL         "通常ウィンドウ",IDC_DEFWINDOW,"Button",
+                    BS_AUTORADIOBUTTON,4,424,57,10
+    CONTROL         "モーダル ダイアログ",IDC_MODALDLG,"Button",
+                    BS_AUTORADIOBUTTON,4,435,80,10
+    CONTROL         "モードレス ダイアログ",IDC_MODELESSDLG,"Button",
+                    BS_AUTORADIOBUTTON,4,446,78,10
+    LTEXT           "アイコン:",IDC_STATIC_ICON,4,155,26,8
+    COMBOBOX        IDC_ICONRES,1,165,84,75,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_BGCOLOR,20,107,65,150,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+END
+
+IDD_RAD_PROP_BUTTON DIALOG DISCARDABLE  0, 0, 87, 293
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- Button プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,74,85,212
+    LTEXT           "水平方向の配置:",IDC_STATIC,4,208,50,8
+    LTEXT           "垂直方向の配置",IDC_STATIC,4,237,49,8
+    LTEXT           "キャプション:",IDC_STATIC,3,45,38,8
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,54,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,85,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,96,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,107,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,118,52,10
+    CONTROL         "標準のボタン",IDC_BS_DEFPUSHBUTTON,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,136,54,10
+    CONTROL         "オーナー描画",IDC_BS_OWNERDRAW,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,147,56,10
+    CONTROL         "アイコン",IDC_BS_ICON,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,158,39,10
+    CONTROL         "ビットマップ",IDC_BS_BITMAP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,169,49,10
+    CONTROL         "複数行",IDC_BS_MULTILINE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,180,37,10
+    CONTROL         "通知",IDC_BS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,191,30,10
+    COMBOBOX        IDC_BS_HPOS,11,217,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_BS_VPOS,11,246,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,266,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_WINDOW_RENAME DIALOG DISCARDABLE  0, 0, 170, 99
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "識別設定"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LTEXT           "ウィンドウ名:",IDC_STATIC,13,11,36,8
+    LTEXT           "ハンドル:",IDC_STATIC,13,60,26,8
+    LTEXT           "プロシージャ:",IDC_STATIC,13,77,39,8
+    GROUPBOX        "詳細",IDC_STATIC,7,29,96,64
+    EDITTEXT        IDC_WINDOWNAME,56,7,40,14,ES_AUTOHSCROLL
+    CONTROL         "自動設定",IDC_AUTOSET,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,13,42,43,10
+    EDITTEXT        IDC_WINDOWHANDLE,56,56,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_WINDOWPROC,56,73,40,14,ES_AUTOHSCROLL
+    DEFPUSHBUTTON   "OK",IDOK,113,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,113,24,50,14
+END
+
+IDD_RAD_EVENTCODE DIALOGEX 0, 0, 283, 205
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "イベント処理"
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    LTEXT           "",IDC_PROCEDURENAME,7,167,205,31,0,WS_EX_STATICEDGE
+    LTEXT           "プロシージャ",IDC_STATIC,7,156,38,8
+    CONTROL         "List1",IDC_EVENTLIST,"SysListView32",LVS_REPORT | 
+                    LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | 
+                    WS_TABSTOP,7,7,269,133
+    CONTROL         "Default",IDC_DEFAULT,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,159,143,37,10
+    CONTROL         "Menu",IDC_MENU,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,199,143,37,10
+    CONTROL         "MMSYS",IDC_MMSYS,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,238,143,37,10
+    DEFPUSHBUTTON   "コーディング",IDOK,225,167,50,14
+    PUSHBUTTON      "キャンセル",IDCANCEL,225,184,50,14
+END
+
+IDD_RAD_PROP_ITEM_RENAMEID DIALOG DISCARDABLE  0, 0, 165, 45
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ID名を変更"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    EDITTEXT        IDC_IDNAME,20,7,78,14,ES_AUTOHSCROLL
+    LTEXT           "ID:",IDC_STATIC,7,11,8,8
+    DEFPUSHBUTTON   "OK",IDOK,107,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,107,24,50,14
+END
+
+IDD_RAD_PROP_WINDOW_EXSTYLE DIALOG DISCARDABLE  0, 0, 199, 127
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "拡張スタイル"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CONTROL         "最前面ウィンドウ",IDC_EXSTYLE_TOPMOST,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,7,64,10
+    CONTROL         "ドラッグ＆ドロップを許可",IDC_EXSTYLE_ACCEPTFILES,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,18,86,10
+    CONTROL         "透過ウィンドウ",IDC_EXSTYLE_TRANSPARENT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,29,57,10
+    CONTROL         "ツールウィンドウ",IDC_EXSTYLE_TOOLWINDOW,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,40,63,10
+    CONTROL         "クライアント境界線",IDC_EXSTYLE_CLIENTEDGE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,58,70,10
+    CONTROL         "スタティック境界線",IDC_EXSTYLE_STATICEDGE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,69,70,10
+    CONTROL         "親ウィンドウに通知しない",IDC_EXSTYLE_NOPARENTNOTIFY,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,87,88,10
+    CONTROL         "コンテキスト ヘルプ",IDC_EXSTYLE_CONTEXTHELP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,98,73,10
+    CONTROL         "Tabキーによる子ウィンドウの移動を許可",
+                    IDC_EXSTYLE_CONTROLPARENT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,7,109,133,10
+    DEFPUSHBUTTON   "OK",IDOK,142,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,142,24,50,14
+END
+
+IDD_RAD_PROP_ITEM_EXSTYLE DIALOG DISCARDABLE  0, 0, 187, 77
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "拡張スタイル"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CONTROL         "ドラッグ＆ドロップを許可",IDC_EXSTYLE_ACCEPTFILES,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,86,10
+    CONTROL         "透過ウィンドウ",IDC_EXSTYLE_TRANSPARENT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,19,57,10
+    CONTROL         "モーダル フレーム",IDC_EXSTYLE_DLGMODALFRAME,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,37,70,10
+    CONTROL         "クライアント境界線",IDC_EXSTYLE_CLIENTEDGE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,48,70,10
+    CONTROL         "スタティック境界線",IDC_EXSTYLE_STATICEDGE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,59,70,10
+    DEFPUSHBUTTON   "OK",IDOK,130,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,130,24,50,14
+END
+
+IDD_RAD_PROP_EDIT DIALOG DISCARDABLE  0, 0, 87, 368
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- Edit プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,74,85,285
+    LTEXT           "テキストの配置:",IDC_STATIC,4,304,47,8
+    LTEXT           "キャプション:",IDC_STATIC,3,45,38,8
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,54,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,85,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,96,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,107,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,118,52,10
+    CONTROL         "複数行",IDC_ES_MULTILINE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,136,37,10
+    CONTROL         "番号",IDC_ES_NUMBER,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,147,30,10
+    CONTROL         "水平スクロール バー",IDC_STYLE_HSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,165,77,10
+    CONTROL         "水平オート スクロール",IDC_ES_AUTOHSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,176,81,10
+    CONTROL         "垂直スクロール バー",IDC_STYLE_VSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,187,77,10
+    CONTROL         "垂直オート スクロール",IDC_ES_AUTOVSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,198,81,10
+    CONTROL         "パスワード",IDC_ES_PASSWORD,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,216,47,10
+    CONTROL         "常に選択を表示",IDC_ES_NOHIDESEL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,227,62,10
+    CONTROL         "OEM変換",IDC_ES_OEMCONVERT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,238,43,10
+    CONTROL         "改行を許可",IDC_ES_WANTRETURN,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,249,49,10
+    CONTROL         "大文字変換",IDC_ES_UPPERCASE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,267,50,10
+    CONTROL         "小文字変換",IDC_ES_LOWERCASE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,278,50,10
+    CONTROL         "読み取り専用",IDC_ES_READONLY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,289,55,10
+    COMBOBOX        IDC_ES_TEXTPOS,11,315,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,338,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_STATIC DIALOG DISCARDABLE  0, 0, 87, 233
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- Static プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,74,85,153
+    LTEXT           "テキストの配置:",IDC_STATIC,4,173,47,8
+    LTEXT           "キャプション:",IDC_STATIC,3,45,38,8
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,54,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,85,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,96,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,107,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,118,52,10
+    CONTROL         "プリフィックスなし",IDC_SS_NOPREFIX,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,136,66,10
+    CONTROL         "折り返しなし",IDC_SS_LEFTNOWORDWRAP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,147,51,10
+    CONTROL         "通知",IDC_SS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,158,30,10
+    COMBOBOX        IDC_SS_TEXTPOS,11,184,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,207,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_CHECKBOX DIALOG DISCARDABLE  0, 0, 87, 320
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- CheckBox プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,74,85,240
+    LTEXT           "水平方向の配置:",IDC_STATIC,4,237,50,8
+    LTEXT           "垂直方向の配置",IDC_STATIC,4,266,49,8
+    LTEXT           "キャプション:",IDC_STATIC,3,45,38,8
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,54,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,85,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,96,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,107,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,118,52,10
+    CONTROL         "自動チェック",IDC_BS_AUTO,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,136,52,10
+    CONTROL         "3 ステート",IDC_BS_3STATE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,147,46,10
+    CONTROL         "プッシュ ボタン型",IDC_BS_PUSHLIKE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,158,66,10
+    CONTROL         "左揃えテキスト",IDC_BS_LEFTTEXT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,169,60,10
+    CONTROL         "アイコン",IDC_BS_ICON,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,187,39,10
+    CONTROL         "ビットマップ",IDC_BS_BITMAP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,198,49,10
+    CONTROL         "複数行",IDC_BS_MULTILINE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,209,37,10
+    CONTROL         "通知",IDC_BS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,220,30,10
+    COMBOBOX        IDC_BS_HPOS,11,246,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_BS_VPOS,11,275,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,295,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_RADIOBUTTON DIALOG DISCARDABLE  0, 0, 87, 310
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- RadioButton プロパティ -",IDC_STATIC,0,3,86,8
+    LTEXT           "キャプション:",IDC_STATIC,3,45,38,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,74,85,230
+    LTEXT           "水平方向の配置:",IDC_STATIC,4,226,50,8
+    LTEXT           "垂直方向の配置",IDC_STATIC,4,255,49,8
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,54,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,85,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,96,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,107,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,118,52,10
+    CONTROL         "自動チェック",IDC_BS_AUTO,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,136,52,10
+    CONTROL         "プッシュ ボタン型",IDC_BS_PUSHLIKE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,147,66,10
+    CONTROL         "左揃えテキスト",IDC_BS_LEFTTEXT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,158,60,10
+    CONTROL         "アイコン",IDC_BS_ICON,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,176,39,10
+    CONTROL         "ビットマップ",IDC_BS_BITMAP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,187,49,10
+    CONTROL         "複数行",IDC_BS_MULTILINE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,198,37,10
+    CONTROL         "通知",IDC_BS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,209,30,10
+    COMBOBOX        IDC_BS_HPOS,11,235,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_BS_VPOS,11,264,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,284,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_SCROLLBAR DIALOG DISCARDABLE  0, 0, 87, 148
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ScrollBar プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,45,85,96
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "配置:",IDC_STATIC,4,106,16,8
+    EDITTEXT        IDC_IDNAME,1,25,63,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,56,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,67,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,78,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,89,52,10
+    COMBOBOX        IDC_SBS_POSITION,23,104,60,54,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,123,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_ITEM_RENAMECAPTION DIALOG DISCARDABLE  0, 0, 163, 45
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "キャプション変更"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    EDITTEXT        IDC_CAPTION,7,17,90,14,ES_AUTOHSCROLL
+    LTEXT           "キャプション:",IDC_STATIC,7,7,38,8
+    DEFPUSHBUTTON   "OK",IDOK,107,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,107,24,50,14
+END
+
+IDD_RAD_PROP_LISTBOX DIALOG DISCARDABLE  0, 0, 87, 325
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ListBox プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,44,85,275
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "選択:",IDC_STATIC,4,103,16,8
+    LTEXT           "オーナー描画:",IDC_STATIC,4,132,42,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,55,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,66,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,77,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,88,52,10
+    COMBOBOX        IDC_LBS_SELECT,11,113,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_LBS_OWNERDRAW,11,142,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "文字列あり",IDC_LBS_HASSTRINGS,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,163,48,10
+    CONTROL         "複数列",IDC_LBS_MULTICOLUMN,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,174,37,10
+    CONTROL         "ソート",IDC_LBS_SORT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,192,33,10
+    CONTROL         "通知",IDC_LBS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,203,30,10
+    CONTROL         "水平スクロール バー",IDC_STYLE_HSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,221,77,10
+    CONTROL         "垂直スクロール バー",IDC_STYLE_VSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,232,78,10
+    CONTROL         "スクロールバーを表示",IDC_LBS_DISABLENOSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,243,79,10
+    CONTROL         "再描画しない",IDC_LBS_NOREDRAW,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,261,54,10
+    CONTROL         "タブ ストップを使用",IDC_LBS_USETABSTOPS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,272,71,10
+    CONTROL         "キーボード入力を検出",IDC_LBS_WANTKEYBOARDINPUT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,283,80,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,299,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_LISTVIEW DIALOG DISCARDABLE  0, 0, 87, 348
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ListView プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,44,85,297
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "表示:",IDC_STATIC,4,103,16,8
+    LTEXT           "配置:",IDC_STATIC,4,132,16,8
+    LTEXT           "ソート:",IDC_STATIC,4,161,19,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,55,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,66,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,77,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,88,52,10
+    COMBOBOX        IDC_LVS_VIEW,11,113,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_LVS_POSITION,11,142,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_LVS_SORT,11,171,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    CONTROL         "単一選択",IDC_LVS_SINGLESEL,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,192,43,10
+    CONTROL         "自動整列",IDC_LVS_AUTOARRANGE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,203,43,10
+    CONTROL         "ラベルを折り返さない",IDC_LVS_NOLABELWRAP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,214,77,10
+    CONTROL         "ラベルの編集",IDC_LVS_EDITLABELS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,225,55,10
+    CONTROL         "スクロールしない",IDC_LVS_NOSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,243,65,10
+    CONTROL         "ｶﾗﾑにﾍｯﾀﾞをつけない",IDC_LVS_NOCOLUMNHEADER,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,254,78,10
+    CONTROL         "ヘッダをソートしない",IDC_LVS_NOSORTHEADER,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,265,79,10
+    CONTROL         "選択を常に表示",IDC_LVS_SHOWSELALWAYS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,276,62,10
+    CONTROL         "オーナー描画固定",IDC_LVS_OWNERDRAWFIXED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,296,70,10
+    CONTROL         "共有イメージリスト",IDC_LVS_SHAREIMAGELISTS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,307,80,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,323,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_TREEVIEW DIALOG DISCARDABLE  0, 0, 87, 292
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- TreeView プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,45,85,240
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,63,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,56,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,67,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,78,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,89,52,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,265,78,13,BS_MULTILINE
+    CONTROL         "ボタンあり",IDC_TVS_HASBUTTONS,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,105,45,10
+    CONTROL         "線を表示",IDC_TVS_HASLINES,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,116,42,10
+    CONTROL         "ルートにも線を表示",IDC_TVS_LINESATROOT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,127,73,10
+    CONTROL         "ラベルの編集",IDC_TVS_EDITLABELS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,145,55,10
+    CONTROL         "ﾄﾞﾗｯｸﾞ && ﾄﾞﾛｯﾌﾟを無効",IDC_TVS_DISABLEDRAGDROP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,156,80,10
+    CONTROL         "選択を常に表示",IDC_TVS_SHOWSELALWAYS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,167,62,10
+    CONTROL         "スクロールなし",IDC_TVS_NOSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,185,59,10
+    CONTROL         "ツールヒントなし",IDC_TVS_NOTOOLTIPS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,196,62,10
+    CONTROL         "チェック ボックス",IDC_TVS_CHECKBOXES,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,216,64,10
+    CONTROL         "全行選択",IDC_TVS_FULLROWSELECT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,227,43,10
+    CONTROL         "トラック選択",IDC_TVS_TRACKSELECT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,238,51,10
+    CONTROL         "シングル拡張",IDC_TVS_SINGLEEXPAND,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,249,55,10
+END
+
+IDD_RAD_PROP_IMAGEBOX DIALOG DISCARDABLE  0, 0, 87, 233
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ImageBox プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,45,85,182
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "タイプ:",IDC_STATIC,4,108,19,8
+    EDITTEXT        IDC_IDNAME,1,25,63,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,56,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,67,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,78,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,89,52,10
+    COMBOBOX        IDC_IMAGE_TYPE,25,106,58,140,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,207,78,13,BS_MULTILINE
+    EDITTEXT        IDC_PATH,4,150,58,14,ES_AUTOHSCROLL | ES_READONLY | NOT 
+                    WS_VISIBLE
+    LTEXT           "image situation",IDC_IMAGE_SITUATION,4,140,73,8,NOT 
+                    WS_VISIBLE
+    PUSHBUTTON      "...",IDC_CHANGEPATH,64,150,18,14,NOT WS_VISIBLE
+    CONTROL         "通知",IDC_SS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,170,30,10
+    CONTROL         "中央配置",IDC_SS_CENTERIMAGE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,181,43,10
+    CONTROL         "右に揃える",IDC_SS_RIGHTJUST,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,192,48,10
+    CONTROL         "ファイル",IDC_FILE,"Button",BS_AUTORADIOBUTTON | NOT 
+                    WS_VISIBLE,5,125,35,10
+    CONTROL         "リソース",IDC_RESOURCE,"Button",BS_AUTORADIOBUTTON | 
+                    NOT WS_VISIBLE,45,125,36,10
+    COMBOBOX        IDC_RESCOMBO,4,150,79,71,CBS_DROPDOWNLIST | CBS_SORT | 
+                    NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_RAD_PROP_COMBOBOX DIALOG DISCARDABLE  0, 0, 87, 312
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ComboBox プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,44,85,261
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "タイプ:",IDC_STATIC,4,103,19,8
+    LTEXT           "オーナー描画:",IDC_STATIC,4,132,42,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,55,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,66,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,77,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,88,52,10
+    COMBOBOX        IDC_CBS_TYPE,11,113,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_CBS_OWNERDRAW,11,142,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "文字列あり",IDC_CBS_HASSTRINGS,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,163,48,10
+    CONTROL         "ソート",IDC_CBS_SORT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,181,33,10
+    CONTROL         "サイズ調整",IDC_CBS_NOINTEGRALHEIGHT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,192,49,10
+    CONTROL         "OEM 変換",IDC_CBS_OEMCONVERT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,203,46,10
+    CONTROL         "垂直スクロール バー",IDC_STYLE_VSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,221,78,10
+    CONTROL         "水平オート スクロール",IDC_CBS_AUTOHSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,232,81,10
+    CONTROL         "スクロールバーを表示",IDC_CBS_DISABLENOSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,243,79,10
+    CONTROL         "大文字変換",IDC_CBS_UPPERCASE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,261,50,10
+    CONTROL         "小文字変換",IDC_CBS_LOWERCASE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,272,50,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,286,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_GROUPBOX DIALOG DISCARDABLE  0, 0, 87, 227
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- GroupBox プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,74,85,147
+    LTEXT           "水平方向の配置:",IDC_STATIC,4,134,50,8
+    LTEXT           "キャプション:",IDC_STATIC,3,45,38,8
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,54,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,85,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,96,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,107,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,118,52,10
+    COMBOBOX        IDC_BS_POSITION,11,145,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "アイコン",IDC_BS_ICON,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,165,39,10
+    CONTROL         "ビットマップ",IDC_BS_BITMAP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,176,49,10
+    CONTROL         "通知",IDC_BS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,187,30,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,201,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_UPDOWN DIALOG DISCARDABLE  0, 0, 87, 246
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- UpDown プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,44,85,196
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "方向:",IDC_STATIC,4,103,16,8
+    LTEXT           "アタッチ",IDC_STATIC,4,132,24,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,55,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,66,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,77,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,88,52,10
+    COMBOBOX        IDC_UDS_SITUATION,11,113,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_UDS_ATTACH,11,142,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "自動関連付け",IDC_UDS_AUTOBUDDY,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,163,57,10
+    CONTROL         "数値の自動表示",IDC_UDS_SETBUDDYINT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,174,64,10
+    CONTROL         "桁区切りなし",IDC_UDS_NOTHOUSANDS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,185,53,10
+    CONTROL         "ワードラップ",IDC_UDS_WRAP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,196,51,10
+    CONTROL         "方向キー",IDC_UDS_ARROWKEYS,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,207,41,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,221,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_PROGRESSBAR DIALOG DISCARDABLE  0, 0, 87, 156
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ProgressBar プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,45,85,106
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,63,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,56,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,67,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,78,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,89,52,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,132,78,13,BS_MULTILINE
+    CONTROL         "垂直方向",IDC_PBS_VERTICAL,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,105,43,10
+    CONTROL         "スムーズ",IDC_PBS_SMOOTH,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,116,43,10
+END
+
+IDD_RAD_PROP_TRACKBAR DIALOG DISCARDABLE  0, 0, 87, 224
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- TrackBar プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,44,85,173
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "方向:",IDC_STATIC,4,103,16,8
+    LTEXT           "ポイント:",IDC_STATIC,4,132,24,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,55,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,66,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,77,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,88,52,10
+    COMBOBOX        IDC_TBS_SITUATION,11,113,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_TBS_POINT,11,142,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    CONTROL         "マークなし",IDC_TBS_NOTICKS,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,163,46,10
+    CONTROL         "マーク自動設定",IDC_TBS_AUTOTICKS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,174,62,10
+    CONTROL         "選択可能",IDC_TBS_ENABLESELRANGE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,185,43,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,199,78,13,BS_MULTILINE
+END
+
+IDD_PROJECT_MENUEDIT DIALOG DISCARDABLE  0, 0, 87, 191
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- メニュー エディタ -",IDC_STATIC,0,3,86,8
+    LTEXT           "キャプション:",IDC_CAPTIONSTATIC,3,45,38,8
+    LTEXT           "ID:",IDC_IDSTATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAME,68,24,18,43
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "↑",IDC_UP,26,170,14,14
+    PUSHBUTTON      "↓",IDC_DOWN,43,170,14,14
+    CONTROL         "チェック",IDC_CHECKED,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,98,38,10
+    CONTROL         "無効",IDC_DISABLED,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,109,30,10
+    PUSHBUTTON      "挿入",IDC_INSERTMENUITEM,5,132,76,14
+    PUSHBUTTON      "削除",IDC_DELETEMENUITEM,5,150,76,14
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,2,124,83,1
+    CHECKBOX        "ポップアップ",IDC_POPUP,4,76,51,10
+    CONTROL         "セパレータ",IDC_SEPARATOR,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,87,47,10
+END
+
+IDD_INPUTID DIALOG DISCARDABLE  0, 0, 170, 45
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "新規メニュー"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LTEXT           "メニュー ID:",IDC_STATIC,7,11,35,8
+    EDITTEXT        IDC_IDNAME,44,7,63,14,ES_AUTOHSCROLL
+    DEFPUSHBUTTON   "OK",IDOK,112,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,112,24,50,14
+END
+
+IDD_PJ_OPTION2 DIALOG DISCARDABLE  0, 0, 259, 180
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Win32API"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CONTROL         "コモン コントロールを使用する（api_commctrl.sbp）",
+                    IDC_API_COMMCTRL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,
+                    7,159,10
+    CONTROL         "マルチメディアAPIを使用する（api_mmsys.sbp）",
+                    IDC_API_MMSYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,20,
+                    150,10
+    CONTROL         "リッチエディット コントロールを使用する（api_richedit.sbp）",
+                    IDC_API_RICHEDIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,
+                    33,181,10
+    CONTROL         "ソケットAPIを使用する（api_winsock2.sbp）",
+                    IDC_API_WINSOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,
+                    46,136,10
+END
+
+IDD_NEWPROJECT_PAGE2 DIALOG DISCARDABLE  0, 0, 310, 177
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ステップ2 （プロジェクト オプション）"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    GROUPBOX        "Win32API",IDC_STATIC,7,46,189,64
+    CONTROL         "コモン コントロールを使用する（api_commctrl.sbp）",
+                    IDC_API_COMMCTRL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    13,59,159,10
+    CONTROL         "マルチメディアAPIを使用する（api_mmsys.sbp）",
+                    IDC_API_MMSYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,
+                    71,150,10
+    CONTROL         "リッチエディット コントロールを使用する（api_richedit.sbp）",
+                    IDC_API_RICHEDIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    13,83,181,10
+    CONTROL         "ソケットAPIを使用する（api_winsock2.sbp）",
+                    IDC_API_WINSOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,
+                    95,136,10
+    GROUPBOX        "一般",IDC_STATIC,7,7,189,31
+    CONTROL         "Unicode文字セットを使用する",IDC_UNICODE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,13,21,101,10
+END
+
+IDD_PROJECT_MENURENAME DIALOG DISCARDABLE  0, 0, 167, 69
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "メニューID、キャプション設定"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    EDITTEXT        IDC_CAPTION,7,48,90,14,ES_AUTOHSCROLL
+    LTEXT           "キャプション",IDC_STATIC,7,38,36,8
+    DEFPUSHBUTTON   "OK",IDOK,110,30,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,110,47,50,14
+    EDITTEXT        IDC_IDNAME,7,17,90,14,ES_AUTOHSCROLL
+    LTEXT           "ID",IDC_IDSTATIC,7,7,8,8
+END
+
+IDD_OPTION_RAD DIALOG DISCARDABLE  0, 0, 187, 93
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "RADツール"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CONTROL         "ライン アジャスタを有効にする",IDC_LINEADJUST,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,7,103,10
+END
+
+IDD_EXTENSION_LINK DIALOG DISCARDABLE  0, 0, 231, 216
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ファイルの関連付け"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "関連付ける",IDOK,173,178,50,14
+    PUSHBUTTON      "閉じる",IDCANCEL,173,195,50,14
+    LTEXT           "注意: 他のアプリケーションで使用する拡張子は削除してください。",
+                    IDC_STATIC,37,180,111,22
+    CONTROL         "List1",IDC_EXTENSION_LIST,"SysListView32",LVS_REPORT | 
+                    LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | 
+                    WS_TABSTOP,7,7,217,133
+    PUSHBUTTON      "新規(&N)",IDC_ADD_BUTTON,67,145,50,14
+    PUSHBUTTON      "削除(&D)",IDC_DELETE_BUTTON,173,145,50,14
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,170,217,1
+    PUSHBUTTON      "編集(&E)",IDC_EDIT_BUTTON,120,145,50,14
+END
+
+IDD_RAD_SUPPORT DIALOGEX 0, 0, 321, 37
+STYLE WS_CHILD
+EXSTYLE WS_EX_STATICEDGE
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    LTEXT           "X",IDC_STATIC,69,7,8,8
+    LTEXT           "Y",IDC_STATIC,69,23,8,8
+    LTEXT           "幅",IDC_STATIC,142,7,8,8
+    LTEXT           "高さ",IDC_STATIC,142,23,16,8
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDVERT,132,0,1,35
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDVERT,61,1,1,34
+    PUSHBUTTON      "テスト",IDC_TEST,6,11,50,14
+    EDITTEXT        IDC_XPOS,80,3,40,14,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "Spin1",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | 
+                    UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,248,4,9,
+                    14
+    EDITTEXT        IDC_YPOS,80,19,40,14,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "Spin1",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | 
+                    UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,248,21,
+                    9,14
+    EDITTEXT        IDC_WIDTH,161,3,40,14,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "Spin1",IDC_SPIN3,"msctls_updown32",UDS_SETBUDDYINT | 
+                    UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,262,5,9,
+                    14
+    EDITTEXT        IDC_HEIGHT,161,19,40,14,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "Spin1",IDC_SPIN4,"msctls_updown32",UDS_SETBUDDYINT | 
+                    UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,262,21,
+                    9,14
+END
+
+IDD_PJ_OPTION1 DIALOG DISCARDABLE  0, 0, 259, 180
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "一般"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    GROUPBOX        "出力ファイル",IDC_STATIC,7,7,198,79
+    EDITTEXT        IDC_EDIT_RELEASE,16,31,177,14,ES_AUTOHSCROLL
+    LTEXT           "Release:",IDC_STATIC,16,21,26,8
+    EDITTEXT        IDC_EDIT_DEBUG,16,61,177,14,ES_AUTOHSCROLL
+    LTEXT           "Debug:",IDC_STATIC,16,51,20,8
+    GROUPBOX        "コンパイル オプション",IDC_STATIC,7,97,199,39
+    CONTROL         "Unicode文字セットを使用する",IDC_UNICODE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,13,115,116,10
+END
+
+IDD_ICONEDIT_TOOL DIALOG DISCARDABLE  0, 0, 88, 266
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    COMBOBOX        IDC_ICONTYPECOMBO,10,12,69,104,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "追加",IDC_ADD_ICONTYPE,12,30,30,14
+    PUSHBUTTON      "削除",IDC_DELETE_ICONTYPE,46,30,30,14
+    GROUPBOX        "タイプ",IDC_STATIC,5,1,78,59
+    GROUPBOX        "ツール",IDC_STATIC,5,68,78,190
+END
+
+IDD_ICONEDIT_COLOR DIALOG DISCARDABLE  0, 0, 227, 43
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CONTROL         "",IDC_STATIC_COLOR,"Static",SS_BLACKFRAME | NOT 
+                    WS_VISIBLE,22,3,161,34
+    CONTROL         "",IDC_NOWCOLOR,"Static",SS_ETCHEDFRAME,3,3,16,17
+END
+
+IDD_ICONEDIT_BUTTONS DIALOG DISCARDABLE  0, 0, 59, 158
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+END
+
+IDD_ICONEDIT_ICONTYPE DIALOG DISCARDABLE  0, 0, 154, 73
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "アイコンタイプを選んでください"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,97,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,97,24,50,14
+    LISTBOX         IDC_TYPELIST,7,7,84,59,LBS_SORT | LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_OPTION_COLOR DIALOGEX 0, 0, 254, 182
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "カラーデザイン"
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    LTEXT           "指定する部分:",IDC_STATIC_PARTS,7,39,42,8
+    LTEXT           "サンプル:",IDC_STATIC,7,75,28,8
+    LTEXT           "テーマ:",IDC_STATIC,7,6,22,8
+    COMBOBOX        IDC_THEME,7,17,100,91,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_TARGET,7,49,100,91,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "",IDC_COLOR_BUTTON,"Button",BS_OWNERDRAW | WS_TABSTOP,
+                    111,49,20,12
+    CONTROL         "",IDC_SAMPLE,"Button",BS_OWNERDRAW | WS_TABSTOP,7,85,
+                    190,90,WS_EX_CLIENTEDGE
+END
+
+IDD_CODE_SAVE DIALOG DISCARDABLE  0, 0, 151, 110
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "文字コードを指定して保存"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LISTBOX         IDC_LIST_CHARCODE,7,17,64,86,LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL | WS_TABSTOP
+    LISTBOX         IDC_LIST_LFCODE,76,17,68,41,LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL | WS_TABSTOP
+    DEFPUSHBUTTON   "上書き保存",IDOK,86,72,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,86,89,50,14
+    LTEXT           "文字コード",IDC_STATIC,7,7,32,8
+    LTEXT           "改行コード",IDC_STATIC,77,7,32,8
+END
+
+IDD_PJ_OPTION4 DIALOG DISCARDABLE  0, 0, 259, 180
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "デバッグ"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    GROUPBOX        "コマンドライン",IDC_STATIC,7,7,248,91
+    EDITTEXT        IDC_CMD_LINE,13,20,234,65,ES_MULTILINE | ES_AUTOVSCROLL | 
+                    ES_AUTOHSCROLL
+    GROUPBOX        "デバッグセッションの実行可能ファイル（DLLのみ）",
+                    IDC_STATIC_DEBUG,7,109,248,55
+    EDITTEXT        IDC_EXE_PATH,14,125,234,14,ES_AUTOHSCROLL
+    PUSHBUTTON      "参照...",IDC_DIR,219,143,29,14
+END
+
+IDD_EXTENSION_ADD DIALOG DISCARDABLE  0, 0, 227, 106
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "拡張子を追加"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,117,85,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,170,85,50,14
+    EDITTEXT        IDC_EXTENSION,59,7,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_NOTE,59,26,80,14,ES_AUTOHSCROLL
+    LTEXT           "拡張子:",IDC_STATIC,7,11,23,8
+    LTEXT           "説明:",IDC_STATIC,7,30,16,8
+    LTEXT           "Windows検索:",IDC_STATIC,7,49,41,8
+    CONTROL         "有効",IDC_SEARCH_ON,"Button",BS_AUTORADIOBUTTON,66,49,
+                    30,10
+    CONTROL         "無効",IDC_SEARCH_OFF,"Button",BS_AUTORADIOBUTTON,98,49,
+                    30,10
+    LTEXT           "（例：txt）",IDC_STATIC,143,11,26,8
+    LTEXT           "（例：テキスト ドキュメント）",IDC_STATIC,143,30,77,8
+    LTEXT           "タブの色",IDC_STATIC_TABCOLOR,7,69,26,8
+    CONTROL         "",IDC_COLOR_BUTTON,"Button",BS_OWNERDRAW | WS_TABSTOP,
+                    59,67,20,12
+    LTEXT           "←ここをクリックして変更できます",IDC_STATIC_TABCOLOR2,
+                    83,69,114,8
+END
+
+IDD_OPTION_WEB DIALOG DISCARDABLE  0, 0, 250, 195
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Web検索"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    GROUPBOX        "ドメイン検索",IDC_STATIC,7,38,236,135
+    CONTROL         "List2",IDC_DOMAIN_LIST,"SysListView32",LVS_REPORT | 
+                    LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | 
+                    WS_TABSTOP,13,51,164,116
+    PUSHBUTTON      "新規(&N)",IDC_ADD,187,50,50,14
+    PUSHBUTTON      "削除(&D)",IDC_DELETE,187,68,50,14
+    CONTROL         "Ctrlキーによる単語リンクを有効にする",
+                    IDC_CTRLKEY_HYPERLINK,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,7,7,127,10
+    PUSHBUTTON      "編集(&E)",IDC_EDIT,187,86,50,14
+    CONTROL         "アプリケーション終了時にWeb検索文字列を保存する",
+                    IDC_SAVE_WEBFINDSTR,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,7,20,169,10
+END
+
+IDD_OPTION_WEB_DOMAIN_ADD DIALOG DISCARDABLE  0, 0, 245, 77
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Web検索用ドメインを追加"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,135,56,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,188,56,50,14
+    EDITTEXT        IDC_NAME,59,7,67,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_DOMAIN,59,26,113,14,ES_AUTOHSCROLL
+    LTEXT           "表示名:",IDC_STATIC,7,11,23,8
+    LTEXT           "ドメイン:",IDC_STATIC,7,30,23,8
+    LTEXT           "（例：辞書）",IDC_STATIC,176,11,32,8
+    LTEXT           "（例：ja.wikipedia.org）",IDC_STATIC,176,30,62,8
+END
+
+IDD_PREVIEW DIALOG DISCARDABLE  0, 0, 354, 429
+STYLE WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
+CAPTION "印刷プレビュー"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "閉じる",IDOK,13,7,50,14
+    PUSHBUTTON      "ページ設定",IDC_PAGESET,13,57,50,14
+    PUSHBUTTON      "フォント",IDC_FONT,13,79,50,14
+    PUSHBUTTON      "印刷",IDC_PRINT,278,7,50,14
+    PUSHBUTTON      "前へ",IDC_PREV,85,7,50,14
+    PUSHBUTTON      "次へ",IDC_NEXT,138,7,50,14
+    GROUPBOX        "設定",IDC_STATIC,7,43,62,121,BS_CENTER
+    CONTROL         "ページ番号",IDC_SHOWPAGENUM,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,13,111,49,10
+    EDITTEXT        IDC_PAGESTR,13,121,49,14,ES_AUTOHSCROLL
+    LTEXT           """&&n""がページ番号に置き換わります",IDC_STATIC,11,138,
+                    54,25
+    PUSHBUTTON      "Button2",IDC_ZOOMOUT,202,7,19,14,BS_ICON
+    PUSHBUTTON      "Button2",IDC_ZOOMIN,223,7,19,14,BS_ICON
+    LTEXT           "Static",IDC_ZOOMRATIO,244,12,31,8
+END
+
+IDD_PASSWORD DIALOG DISCARDABLE  0, 0, 187, 45
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ProjectEditor"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,130,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,130,24,50,14
+    LTEXT           "シリアルIDを入力してください",IDC_STATIC,7,7,84,8
+    EDITTEXT        IDC_PASSWORD,7,20,110,14,ES_AUTOHSCROLL
+END
+
+IDD_ATTACH DIALOG DISCARDABLE  0, 0, 362, 229
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "プロセスへアタッチ"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,305,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,305,24,50,14
+    CONTROL         "List1",IDC_PROCESSLIST,"SysListView32",LVS_REPORT | 
+                    LVS_SINGLESEL | WS_BORDER | WS_TABSTOP,7,7,285,215
+END
+
+IDD_PJ_OPTION3 DIALOG DISCARDABLE  0, 0, 259, 180
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "マニフェスト"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CONTROL         "マニフェストをリソースに埋め込む",IDC_RC_MANIFEST,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,138,25,114,10
+    LTEXT           "入力パス:",IDC_STATIC_PATH,7,11,29,8
+    EDITTEXT        IDC_PATH,39,7,213,14,ES_AUTOHSCROLL
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    IDD_ABOUT, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 232
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 229
+    END
+
+    IDD_FIND, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 228
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 82
+    END
+
+    IDD_FINDALL, DIALOG
+    BEGIN
+        TOPMARGIN, 2
+    END
+
+    IDD_OPTION_WHOLE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 224
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 175
+    END
+
+    IDD_PERMUTATION, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 260
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 104
+    END
+
+    IDD_NEWFILE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 275
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 159
+    END
+
+    IDD_OPTION_EDITOR, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 244
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 251
+    END
+
+    IDD_OPTION_TOOLBAR, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 180
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 86
+    END
+
+    IDD_NEWPROJECT_PAGE1, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 303
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 170
+    END
+
+    IDD_NEWPROJECT_PAGE3, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 303
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 170
+    END
+
+    IDD_PROJECT_FILEPROPERTY, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 223
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 70
+    END
+
+    IDD_RAD_CTRLBUTTONS, DIALOG
+    BEGIN
+        LEFTMARGIN, 1
+        RIGHTMARGIN, 87
+        TOPMARGIN, 1
+        BOTTOMMARGIN, 89
+    END
+
+    IDD_PROJECT_NEWWINDOW, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 164
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 146
+    END
+
+    IDD_RAD_PROP_WINDOW, DIALOG
+    BEGIN
+        RIGHTMARGIN, 86
+        BOTTOMMARGIN, 442
+    END
+
+    IDD_RAD_PROP_WINDOW_RENAME, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 163
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 92
+    END
+
+    IDD_RAD_EVENTCODE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 276
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 198
+    END
+
+    IDD_RAD_PROP_ITEM_RENAMEID, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 158
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 38
+    END
+
+    IDD_RAD_PROP_WINDOW_EXSTYLE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 192
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 120
+    END
+
+    IDD_RAD_PROP_ITEM_EXSTYLE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 180
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 70
+    END
+
+    IDD_RAD_PROP_ITEM_RENAMECAPTION, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 156
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 38
+    END
+
+    IDD_RAD_PROP_IMAGEBOX, DIALOG
+    BEGIN
+        BOTTOMMARGIN, 224
+    END
+
+    IDD_INPUTID, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 163
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 38
+    END
+
+    IDD_PJ_OPTION2, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 252
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 173
+    END
+
+    IDD_NEWPROJECT_PAGE2, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 303
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 170
+    END
+
+    IDD_PROJECT_MENURENAME, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 160
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 62
+    END
+
+    IDD_OPTION_RAD, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 180
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 86
+    END
+
+    IDD_EXTENSION_LINK, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 224
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 209
+    END
+
+    IDD_RAD_SUPPORT, DIALOG
+    BEGIN
+        BOTTOMMARGIN, 35
+    END
+
+    IDD_PJ_OPTION1, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 252
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 173
+    END
+
+    IDD_ICONEDIT_TOOL, DIALOG
+    BEGIN
+        BOTTOMMARGIN, 265
+    END
+
+    IDD_ICONEDIT_COLOR, DIALOG
+    BEGIN
+        RIGHTMARGIN, 187
+        BOTTOMMARGIN, 42
+    END
+
+    IDD_ICONEDIT_BUTTONS, DIALOG
+    BEGIN
+        BOTTOMMARGIN, 157
+    END
+
+    IDD_ICONEDIT_ICONTYPE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 147
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 66
+    END
+
+    IDD_OPTION_COLOR, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 247
+        TOPMARGIN, 6
+        BOTTOMMARGIN, 175
+    END
+
+    IDD_CODE_SAVE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 144
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 103
+    END
+
+    IDD_PJ_OPTION4, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 255
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 173
+    END
+
+    IDD_EXTENSION_ADD, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 220
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 99
+    END
+
+    IDD_OPTION_WEB, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 243
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 188
+    END
+
+    IDD_OPTION_WEB_DOMAIN_ADD, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 238
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 70
+    END
+
+    IDD_PREVIEW, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 347
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 422
+    END
+
+    IDD_PASSWORD, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 180
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 38
+    END
+
+    IDD_ATTACH, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 355
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 222
+    END
+
+    IDD_PJ_OPTION3, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 252
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 173
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_MAIN                ICON    DISCARDABLE     "icon1.ico"
+IDI_BASICPROGRAM        ICON    DISCARDABLE     "BasicProgram.ico"
+IDI_TEXTDOCUMENT        ICON    DISCARDABLE     "TextDocument.ico"
+IDI_FOLDER_CLOSE        ICON    DISCARDABLE     "folder_close.ico"
+IDI_FOLDER_OPEN         ICON    DISCARDABLE     "folder_open.ico"
+IDI_WINDOW              ICON    DISCARDABLE     "Window.ico"
+IDI_PROCEDURE           ICON    DISCARDABLE     "Procedure.ico"
+IDI_MENU                ICON    DISCARDABLE     "menu.ico"
+IDI_FILE_ICON           ICON    DISCARDABLE     "file_icon.ico"
+IDI_FILE_BMP            ICON    DISCARDABLE     "file_bmp.ico"
+IDI_FILE_CURSOR         ICON    DISCARDABLE     "ico00001.ico"
+IDI_MEMBER_PRIVATE_FUNCTION ICON    DISCARDABLE     "member_private_function.ico"
+IDI_MEMBER_PUBLIC_FUNCTION ICON    DISCARDABLE     "member_public_function.ico"
+IDI_MEMBER_PRIVATE_VARIABLE ICON    DISCARDABLE     "member_private_variable.ico"
+IDI_MEMBER_PUBLIC_VARIABLE ICON    DISCARDABLE     "member_public_variable.ico"
+IDI_PAIRSTATEMENT       ICON    DISCARDABLE     "pair_statement.ico"
+IDI_VOID                ICON    DISCARDABLE     "ico00002.ico"
+IDI_PROGRAM_FOLDER      ICON    DISCARDABLE     "program_folder.ico"
+IDI_HTML_PARAMETER      ICON    DISCARDABLE     "html_parameter.ico"
+IDI_HTML_GENERAL_PARAMETER ICON    DISCARDABLE     "html_general_parameter.ico"
+IDI_NEWFILE_TEXT        ICON    DISCARDABLE     "newfile_text.ico"
+IDI_NEWFILE_ABP         ICON    DISCARDABLE     "newfile_abp.ico"
+IDI_NEWFILE_HTML        ICON    DISCARDABLE     "newfile_html.ico"
+IDI_NEWFILE_PJ          ICON    DISCARDABLE     "newfile_project.ico"
+IDI_NEWFILE_SBP         ICON    DISCARDABLE     "newfile_sbp.ico"
+IDI_NEWFILE_ICON        ICON    DISCARDABLE     "newfile_icon.ico"
+IDI_ZOOMIN              ICON    DISCARDABLE     "zoomin.ico"
+IDI_ZOOMOUT             ICON    DISCARDABLE     "zoomout.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Cursor
+//
+
+IDC_CURSOR_PEN          CURSOR  DISCARDABLE     "cursor_pen.cur"
+IDC_CURSOR_FILL         CURSOR  DISCARDABLE     "cursor_fill.cur"
+IDC_CURSOR_ARROW_TO_RIGHT CURSOR  DISCARDABLE     "cursor_arrow_to_right.cur"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// String Table
+//
+
+STRINGTABLE DISCARDABLE 
+BEGIN
+    IDS_DEV_GROUP           "山本 大祐\r\nNoWest\r\nイグトランス\r\nOverTaker\r\ntak\r\nkonisi"
+END
+
+#endif    // 日本語 resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
Index: tag/abdev(2007.06.20)/res/resource.h
===================================================================
--- tag/abdev(2007.06.20)/res/resource.h	(revision 178)
+++ tag/abdev(2007.06.20)/res/resource.h	(revision 178)
@@ -0,0 +1,621 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by res.rc
+//
+#define IDS_DEV_GROUP                   1
+#define IDCANCEL5                       13
+#define IDR_MAINMENU                    101
+#define IDR_ACCELERATOR1                105
+#define IDR_STANDARDTOOLBAR             106
+#define IDD_ABOUT                       108
+#define IDR_BASICTOOLBAR                111
+#define IDR_DEBUGGERTOOLBAR             111
+#define IDI_MAIN                        114
+#define IDI_BASICPROGRAM                118
+#define IDD_FIND                        119
+#define IDR_EDITMENU                    122
+#define IDD_MAKELINENUM                 124
+#define IDD_FINDALL                     126
+#define IDR_REBARMENU                   127
+#define IDD_SETWHOLE                    128
+#define IDD_OPTION_WHOLE                128
+#define IDD_PERMUTATION                 129
+#define IDD_NEWFILE                     130
+#define IDI_TEXTDOCUMENT                131
+#define IDD_SETEDITOR                   132
+#define IDD_OPTION_EDITOR               132
+#define IDD_SETTOOLBAR                  133
+#define IDD_OPTION_TOOLBAR              133
+#define IDD_NEWPROJECT_PAGE1            136
+#define IDB_BASE_NORMAL                 138
+#define IDB_BASE_PROMPT                 139
+#define IDD_NEWPROJECT_PAGE3            140
+#define IDD_PROJECT_VIEW                145
+#define IDR_PROJECTVIEW_FILETREEMENU    146
+#define IDR_PROJECTVIEW_FILETREEROOTMENU 147
+#define IDI_FOLDER_CLOSE                148
+#define IDI_FOLDER_OPEN                 149
+#define IDD_PROJECT_FILEPROPERTY        150
+#define IDI_WINDOW                      151
+#define IDR_PROJECTVIEW_MATERIALTREEMENU 153
+#define IDR_PROJECTVIEW_WINDOWTREEROOTMENU 157
+#define IDD_RAD_CTRLBUTTONS             158
+#define IDD_PROJECT_NEWWINDOW           161
+#define IDR_RADCONTEXTMENU              164
+#define IDD_RAD_PROP_WINDOW             166
+#define IDD_RAD_PROP_BUTTON             167
+#define IDD_RAD_PROP_WINDOW_RENAME      170
+#define IDD_RAD_EVENTCODE               171
+#define IDD_RAD_PROP_ITEM_RENAMEID      172
+#define IDD_RAD_PROP_WINDOW_EXSTYLE     174
+#define IDD_RAD_PROP_ITEM_EXSTYLE       176
+#define IDD_RAD_PROP_EDIT               177
+#define IDD_RAD_PROP_STATIC             178
+#define IDD_RAD_PROP_CHECKBOX           180
+#define IDD_RAD_PROP_RADIOBUTTON        182
+#define IDB_RADIOBUTTON                 183
+#define IDD_RAD_PROP_SCROLLBAR          184
+#define IDB_TITLE_BUTTON_CLOSE          189
+#define IDD_RAD_PROP_ITEM_RENAMECAPTION 190
+#define IDD_RAD_PROP_LISTBOX            192
+#define IDD_RAD_PROP_LISTVIEW           194
+#define IDD_RAD_PROP_TREEVIEW           198
+#define IDD_RAD_PROP_IMAGEBOX           201
+#define IDR_PROJECTVIEW_PROCEDURETREEMENU 202
+#define IDI_PROCEDURE                   203
+#define IDD_RAD_PROP_COMBOBOX           204
+#define IDD_RAD_PROP_GROUPBOX           208
+#define IDD_RAD_PROP_UPDOWN             211
+#define IDD_RAD_PROP_PROGRESSBAR        212
+#define IDD_RAD_PROP_TRACKBAR           214
+#define IDD_PROJECT_MENUEDIT            216
+#define IDD_PROJECT_NEWMENU             217
+#define IDD_INPUTID                     217
+#define IDD_PROJECT_OPTION              218
+#define IDD_PJ_OPTION2                  218
+#define IDD_NEWPROJECT_PAGE             219
+#define IDD_NEWPROJECT_PAGE2            219
+#define IDD_PROJECT_MENURENAME          220
+#define IDR_CONTROL                     221
+#define IDD_RAD_CHOOSECHILD             223
+#define IDD_RAD_PROP_CHILD              224
+#define IDD_SETRAD                      225
+#define IDD_OPTION_RAD                  225
+#define IDI_FILE_PJ                     226
+#define IDD_SETFILELINK                 227
+#define IDD_OPTION_FILELINK             227
+#define IDD_EXTENSION_LINK              227
+#define IDI_FILE_BAS                    229
+#define IDI_FILE_SBP                    230
+#define IDI_MENU                        231
+#define IDI_FILE_ICON                   233
+#define IDI_FILE_BMP                    234
+#define IDI_FILE_CURSOR                 236
+#define IDB_TITLE                       238
+#define IDD_RAD_SUPPORT                 239
+#define IDD_PJ_OPTION1                  241
+#define IDB_PARAMHINT_QUESTION          243
+#define IDB_PARAMHINT_QUESTION2         244
+#define IDD_ICONEDIT_TOOL               246
+#define IDD_ICONEDIT_COLOR              247
+#define IDD_ICONEDIT_BUTTONS            248
+#define IDR_ICONTOOLBAR                 257
+#define IDD_ICONEDIT_ICONTYPE           259
+#define IDC_CURSOR_PEN                  260
+#define IDC_CURSOR_FILL                 261
+#define IDI_MEMBER_PRIVATE_FUNCTION     262
+#define IDI_MEMBER_PUBLIC_FUNCTION      263
+#define IDI_MEMBER_PRIVATE_VARIABLE     264
+#define IDI_MEMBER_PUBLIC_VARIABLE      265
+#define IDB_BASE_DOSPROMPT              266
+#define IDB_BASE_NON                    267
+#define IDB_BASE_DIRECTX                268
+#define IDI_PAIRSTATEMENT               269
+#define IDC_CURSOR_ARROW_TO_RIGHT       272
+#define IDD_OPTION_COLOR                273
+#define IDD_CODE_SAVE                   274
+#define IDI_ICON1                       275
+#define IDI_VOID                        275
+#define IDI_PROGRAM_FOLDER              276
+#define IDR_STANDARDTOOLBAR_DISABLED    283
+#define IDD_PJ_OPTION4                  284
+#define IDR_TABMENU                     285
+#define IDD_EXTENSION_ADD               286
+#define IDD_OPTION_WEB                  287
+#define IDI_HTML_PARAMETER              287
+#define IDD_OPTION_WEB_DOMAIN_ADD       288
+#define IDI_HTML_GENERAL_PARAMETER      288
+#define IDI_NEWFILE_TEXT                290
+#define IDI_NEWFILE_ABP                 291
+#define IDI_NEWFILE_HTML                292
+#define IDI_NEWFILE_PJ                  293
+#define IDI_NEWFILE_SBP                 294
+#define IDI_NEWFILE_ICON                295
+#define IDD_PREVIEW                     296
+#define IDI_ZOOMIN                      296
+#define IDI_ZOOMOUT                     297
+#define IDR_BASICTOOLBAR_DISABLED       298
+#define IDR_DEBUGGERTOOLBAR_DISABLED    298
+#define IDD_PASSWORD                    299
+#define IDD_ATTACH                      300
+#define IDD_PJ_OPTION5                  309
+#define IDD_PJ_OPTION3                  309
+#define IDC_FINDSTR                     1001
+#define IDC_FINDINWINDOW                1002
+#define IDC_FINDALL                     1003
+#define IDC_ISBIGSMALL                  1004
+#define IDC_SHOWITEM                    1018
+#define IDC_FINDLIST                    1020
+#define IDC_EDITLINE                    1022
+#define IDC_NEWLINE                     1023
+#define IDC_RESETTOOLBAR                1027
+#define IDC_PERMUTATIONSTR              1034
+#define IDC_PERMUTATIONNEXT             1036
+#define IDC_PERMUTATIONALL              1037
+#define IDC_FIND                        1038
+#define IDC_FILETYPELIST                1039
+#define IDC_SETFONT                     1041
+#define IDC_TABSIZE                     1042
+#define IDC_PARAMHINT                   1043
+#define IDC_ISAUTOINDENT                1044
+#define IDC_PROJECTNAME                 1053
+#define IDC_DIRPATH                     1054
+#define IDC_EXE_PROMPTBASE              1055
+#define IDC_EXE_WINDOWBASE              1056
+#define IDC_EXE_NOBASE                  1057
+#define IDC_IMAGE_WINDOW                1058
+#define IDC_IMAGE_PROMPT                1059
+#define IDC_HELPTEXT_OFBASE             1060
+#define IDC_BUTTON1                     1061
+#define IDC_PATHBROWSE                  1061
+#define IDC_RENAMEWINDOW                1061
+#define IDC_HINTFONT                    1061
+#define IDC_LINKFILE                    1061
+#define IDC_TEST                        1061
+#define IDC_ADD_ICONTYPE                1061
+#define IDC_SAMPLE                      1061
+#define IDC_DIR                         1061
+#define IDC_ADD_BUTTON                  1061
+#define IDC_ADD                         1061
+#define IDC_PAGESET                     1061
+#define IDC_GOPRO                       1061
+#define IDC_PROJECTINFO                 1062
+#define IDC_DELETE_ICONTYPE             1062
+#define IDC_DELETE                      1062
+#define IDC_EDIT                        1063
+#define IDC_TAB_PROJECTINFO             1066
+#define IDC_SHOWHELLOWORLD              1068
+#define IDC_USING_FILE                  1069
+#define IDC_DEFINED_FILE                1070
+#define IDC_UPDATE_TIME                 1071
+#define IDC_FILETYPE                    1072
+#define IDC_TOOL_MOUSE                  1075
+#define IDC_TOOL_STATIC                 1076
+#define IDC_TOOL_BUTTON                 1077
+#define IDC_TOOL_EDIT                   1078
+#define IDC_TOOL_CHECKBOX               1079
+#define IDC_WINDOWNAME                  1080
+#define IDC_TOOL_RADIOBUTTON            1080
+#define IDC_WINDOWHANDLE                1081
+#define IDC_TOOL_GROUPBOX               1081
+#define IDC_WINDOWPROC                  1082
+#define IDC_TOOL_HSCROLLBAR             1082
+#define IDC_AUTOSET                     1083
+#define IDC_TOOL_VSCROLLBAR             1083
+#define IDC_TOOL_COMBOBOX               1084
+#define IDC_TOOL_LISTBOX                1085
+#define IDC_TOOL_UPDOWN                 1086
+#define IDC_TOOL_LISTVIEW               1087
+#define IDC_TOOL_TREEVIEW               1088
+#define IDC_CAPTION                     1090
+#define IDC_TOOL_IMAGEBOX               1091
+#define IDC_BGCOLOR                     1091
+#define IDC_TOOL_PROGRESSBAR            1092
+#define IDC_TOOL_TRACKBAR               1093
+#define IDC_IDNAME                      1095
+#define IDC_WINDOWSTYLE                 1097
+#define IDC_STYLE_HSCROLLBAR            1098
+#define IDC_STYLE_VSCROLLBAR            1099
+#define IDC_STYLE_CLIPSIBLINGS          1100
+#define IDC_STYLE_CLIPCHILDREN          1101
+#define IDC_STYLE_SYSMENU               1102
+#define IDC_STYLE_CAPTION               1104
+#define IDC_STYLE_MINIMIZE              1105
+#define IDC_STYLE_MAXIMIZE              1106
+#define IDC_STYLE_VISIBLE               1107
+#define IDC_STYLE_MAXIMIZEBOX           1108
+#define IDC_STYLE_MINIMIZEBOX           1109
+#define IDC_BORDERSTYLE                 1110
+#define IDC_STYLE_DISABLED              1111
+#define IDC_EXSTYLE                     1113
+#define IDC_PROCEDURENAME               1116
+#define IDC_EVENTLIST                   1117
+#define IDC_STYLE_GROUP                 1118
+#define IDC_STYLE_TABSTOP               1119
+#define IDC_BS_DEFPUSHBUTTON            1120
+#define IDC_BS_OWNERDRAW                1121
+#define IDC_BS_ICON                     1122
+#define IDC_BS_BITMAP                   1123
+#define IDC_BS_MULTILINE                1124
+#define IDC_BS_NOTIFY                   1125
+#define IDC_BS_HPOS                     1126
+#define IDC_BS_VPOS                     1127
+#define IDC_RENAMEID                    1128
+#define IDC_RENAMECAPTION               1129
+#define IDC_EXSTYLE_NOPARENTNOTIFY      1129
+#define IDC_EXSTYLE_TOPMOST             1130
+#define IDC_EXSTYLE_ACCEPTFILES         1131
+#define IDC_EXSTYLE_TRANSPARENT         1133
+#define IDC_EXSTYLE_TOOLWINDOW          1134
+#define IDC_EXSTYLE_DLGMODALFRAME       1135
+#define IDC_EXSTYLE_CLIENTEDGE          1136
+#define IDC_EXSTYLE_STATICEDGE          1137
+#define IDC_EXSTYLE_CONTEXTHELP         1138
+#define IDC_EXSTYLE_CONTROLPARENT       1139
+#define IDC_ES_MULTILINE                1161
+#define IDC_ES_NUMBER                   1162
+#define IDC_STYLE_HSCROLL               1163
+#define IDC_ES_AUTOHSCROLL              1164
+#define IDC_STYLE_VSCROLL               1165
+#define IDC_ES_AUTOVSCROLL              1166
+#define IDC_ES_PASSWORD                 1167
+#define IDC_ES_NOHIDESEL                1168
+#define IDC_ES_OEMCONVERT               1169
+#define IDC_ES_WANTRETURN               1170
+#define IDC_ES_UPPERCASE                1171
+#define IDC_ES_LOWERCASE                1172
+#define IDC_ES_READONLY                 1173
+#define IDC_ES_TEXTPOS                  1174
+#define IDC_LBS_SELECT                  1175
+#define IDC_LBS_OWNERDRAW               1176
+#define IDC_LVS_SORT                    1177
+#define IDC_SS_NOPREFIX                 1178
+#define IDC_SS_LEFTNOWORDWRAP           1179
+#define IDC_SS_NOTIFY                   1180
+#define IDC_SS_TEXTPOS                  1182
+#define IDC_BS_AUTO                     1184
+#define IDC_BS_3STATE                   1185
+#define IDC_BS_LEFTTEXT                 1187
+#define IDC_BS_PUSHLIKE                 1188
+#define IDC_SBS_POSITION                1207
+#define IDC_LBS_HASSTRINGS              1221
+#define IDC_LBS_SORT                    1223
+#define IDC_LBS_NOTIFY                  1224
+#define IDC_LBS_MULTICOLUMN             1225
+#define IDC_LBS_DISABLENOSCROLL         1226
+#define IDC_LBS_NOREDRAW                1227
+#define IDC_LBS_USETABSTOPS             1228
+#define IDC_LBS_WANTKEYBOARDINPUT       1229
+#define IDC_LVS_VIEW                    1240
+#define IDC_LVS_POSITION                1241
+#define IDC_LVS_SHOWSELALWAYS           1243
+#define IDC_LVS_SINGLESEL               1244
+#define IDC_LVS_AUTOARRANGE             1245
+#define IDC_LVS_NOLABELWRAP             1246
+#define IDC_LVS_EDITLABELS              1247
+#define IDC_LVS_NOSCROLL                1248
+#define IDC_LVS_NOCOLUMNHEADER          1249
+#define IDC_LVS_NOSORTHEADER            1250
+#define IDC_LVS_OWNERDRAWFIXED          1251
+#define IDC_LVS_SHAREIMAGELISTS         1252
+#define IDC_TVS_HASBUTTONS              1264
+#define IDC_TVS_HASLINES                1266
+#define IDC_TVS_LINESATROOT             1267
+#define IDC_TVS_EDITLABELS              1268
+#define IDC_TVS_DISABLEDRAGDROP         1269
+#define IDC_TVS_SHOWSELALWAYS           1270
+#define IDC_TVS_NOSCROLL                1271
+#define IDC_TVS_NOTOOLTIPS              1272
+#define IDC_TVS_CHECKBOXES              1273
+#define IDC_TVS_FULLROWSELECT           1274
+#define IDC_TVS_TRACKSELECT             1275
+#define IDC_TVS_SINGLEEXPAND            1276
+#define IDC_IMAGE_FILE                  1278
+#define IDC_IMAGE_TYPE                  1281
+#define IDC_SS_CENTERIMAGE              1283
+#define IDC_SS_RIGHTJUST                1284
+#define IDC_CBS_TYPE                    1288
+#define IDC_CBS_HASSTRINGS              1289
+#define IDC_CBS_SORT                    1290
+#define IDC_CBS_NOINTEGRALHEIGHT        1292
+#define IDC_CBS_OEMCONVERT              1293
+#define IDC_CBS_AUTOHSCROLL             1294
+#define IDC_CBS_DISABLENOSCROLL         1295
+#define IDC_CBS_UPPERCASE               1296
+#define IDC_CBS_LOWERCASE               1297
+#define IDC_CBS_OWNERDRAW               1301
+#define IDC_BS_POSITION                 1307
+#define IDC_UDS_AUTOBUDDY               1314
+#define IDC_UDS_SETBUDDYINT             1315
+#define IDC_UDS_NOTHOUSANDS             1316
+#define IDC_UDS_WRAP                    1317
+#define IDC_UDS_ARROWKEYS               1318
+#define IDC_UDS_SITUATION               1319
+#define IDC_UDS_ATTACH                  1320
+#define IDC_PROGRESS3                   1327
+#define IDC_PBS_SMOOTH                  1328
+#define IDC_PBS_VERTICAL                1329
+#define IDC_SLIDER2                     1331
+#define IDC_TBS_SITUATION               1332
+#define IDC_TBS_POINT                   1333
+#define IDC_TBS_NOTICKS                 1334
+#define IDC_TBS_AUTOTICKS               1335
+#define IDC_TBS_ENABLESELRANGE          1336
+#define IDC_SLIDER3                     1337
+#define IDC_HANDLE                      1339
+#define IDC_PATH                        1340
+#define IDC_CHANGEPATH                  1341
+#define IDC_IMAGE_SITUATION             1342
+#define IDC_WINDOWMENU                  1343
+#define IDC_ICONRES                     1344
+#define IDC_UP                          1347
+#define IDC_DOWN                        1348
+#define IDC_CHECKED                     1349
+#define IDC_DISABLED                    1350
+#define IDC_INSERTMENUITEM              1352
+#define IDC_DELETEMENUITEM              1353
+#define IDC_POPUP                       1356
+#define IDC_SEPARATOR                   1357
+#define IDC_DEFWINDOW                   1358
+#define IDC_API_MMSYS                   1362
+#define IDC_DEFAULT                     1363
+#define IDC_API_MMSYS2                  1363
+#define IDC_MMSYS                       1364
+#define IDC_MENU                        1365
+#define IDC_API_COMMCTRL                1368
+#define IDC_RENAME                      1369
+#define IDC_IDSTATIC                    1370
+#define IDC_CAPTIONSTATIC               1371
+#define IDC_STATUSBAR                   1373
+#define IDC_STATIC_HINTFONT             1374
+#define IDC_CHECK3                      1377
+#define IDC_SBP                         1377
+#define IDC_WINDOWLIST                  1380
+#define IDC_STATIC_HANDLE               1383
+#define IDC_SAVECHECK                   1384
+#define IDC_SUPPORT_COMMENT             1386
+#define IDC_LINEADJUST                  1387
+#define IDC_BAS                         1391
+#define IDC_ABP                         1392
+#define IDC_PJ                          1393
+#define IDC_MODALDLG                    1394
+#define IDC_MODELESSDLG                 1395
+#define IDC_DLL                         1397
+#define IDC_EXE_DOSPROMPTBASE           1399
+#define IDC_API_RICHEDIT                1401
+#define IDC_FILE                        1402
+#define IDC_RESOURCE                    1403
+#define IDC_RESCOMBO                    1404
+#define IDC_STATIC_ICON                 1405
+#define IDC_API_WINSOCK                 1406
+#define IDC_XPOS                        1408
+#define IDC_YPOS                        1409
+#define IDC_WIDTH                       1410
+#define IDC_HEIGHT                      1411
+#define IDC_SPIN1                       1414
+#define IDC_SPIN2                       1415
+#define IDC_EDIT_RELEASE                1415
+#define IDC_SPIN3                       1416
+#define IDC_EDIT_DEBUG                  1416
+#define IDC_ADDTOPROJECT                1416
+#define IDC_SPIN4                       1417
+#define IDC_FILENAME                    1417
+#define IDC_STATIC_FILENAME             1418
+#define IDC_CLIP                        1419
+#define IDC_ICONTYPECOMBO               1420
+#define IDC_STATIC_COLOR                1422
+#define IDC_NOWCOLOR                    1423
+#define IDC_TYPELIST                    1425
+#define IDC_COMPLEMENT                  1427
+#define IDC_STATIC_SETFONT              1428
+#define IDC_STATIC_TABSIZE              1429
+#define IDC_EXE_DIRECTX                 1432
+#define IDC_IMAGE_DOSPROMPT             1433
+#define IDC_IMAGE_NON                   1434
+#define IDC_IMAGE_DIRECTX               1435
+#define IDC_PAIRSTATEMENT               1435
+#define IDC_BACKNUM                     1436
+#define IDC_STATIC_PAIRSTATEMENT        1439
+#define IDC_LINENUMBER                  1440
+#define IDC_CARETLINE_BACKGROUND        1441
+#define IDC_STATIC_VERSION              1442
+#define IDC_STRICT                      1443
+#define IDC_COMBO1                      1444
+#define IDC_TARGET                      1445
+#define IDC_THEME                       1446
+#define IDC_COLOR_BUTTON                1448
+#define IDC_STATIC_PARTS                1449
+#define IDC_LIST_CHARCODE               1451
+#define IDC_LIST_LFCODE                 1452
+#define IDC_STATIC_NAME                 1453
+#define IDC_CMD_LINE                    1454
+#define IDC_EXE_PATH                    1455
+#define IDC_STATIC_DEBUG                1456
+#define IDC_RULER                       1457
+#define IDC_EXTENSION_LIST              1458
+#define IDC_EDIT_BUTTON                 1459
+#define IDC_DELETE_BUTTON               1460
+#define IDC_EXTENSION                   1461
+#define IDC_NOTE                        1462
+#define IDC_SEARCH_ON                   1463
+#define IDC_SEARCH_OFF                  1464
+#define IDC_SAVE_TAB_TO_HEAD            1465
+#define IDC_DOMAIN_LIST                 1466
+#define IDC_CTRLKEY_HYPERLINK           1467
+#define IDC_NAME                        1468
+#define IDC_CATEGORY_TREE               1468
+#define IDC_DOMAIN                      1469
+#define IDC_REGEXP                      1471
+#define IDC_STATIC_TABCOLOR             1473
+#define IDC_STATIC_TABCOLOR2            1474
+#define IDC_SAVE_FINDSTR                1475
+#define IDC_SAVE_WEBFINDSTR             1476
+#define IDC_ZOOMOUT                     1477
+#define IDC_ZOOMIN                      1478
+#define IDC_ZOOMRATIO                   1479
+#define IDC_INPUT_PASSWORD              1480
+#define IDC_PASSWORD                    1481
+#define IDC_PROCESSLIST                 1482
+#define IDC_FONT                        1484
+#define IDC_PRINT                       1487
+#define IDC_RC_MANIFEST                 1487
+#define IDC_PREV                        1488
+#define IDC_NEXT                        1489
+#define IDC_STATIC_PATH                 1489
+#define IDC_SHOWPAGENUM                 1490
+#define IDC_DEV_GROUP                   1490
+#define IDC_PAGESTR                     1491
+#define IDC_PASTEINDENT                 1492
+#define IDC_UNICODE                     1494
+#define IDC_ISWORDUNIT                  1496
+#define IDM_EXIT                        40001
+#define IDM_NEW                         40002
+#define IDM_OPEN                        40003
+#define IDM_CLOSE                       40004
+#define IDM_SAVE                        40008
+#define IDM_NEWSAVE                     40009
+#define IDM_UNDO                        40010
+#define IDM_CUT                         40011
+#define IDM_COPY                        40012
+#define IDM_PASTE                       40013
+#define IDM_DELETE                      40014
+#define IDM_ABOUT                       40015
+#define IDM_WINDOWCHARGE                40017
+#define IDM_ALLSAVE                     40020
+#define IDM_ALLSELECT                   40021
+#define IDM_FIND                        40024
+#define IDM_REDO                        40034
+#define IDM_TOPIC                       40037
+#define ID_MENUITEM40038                40038
+#define IDM_DOCSELECTBAND               40039
+#define IDM_STANDARDBAND                40040
+#define IDM_BASICBAND                   40041
+#define IDM_DEBUGBAND                   40041
+#define IDM_SET                         40042
+#define IDM_PERMUTATION                 40044
+#define IDM_DSHOMEPAGE                  40047
+#define IDM_AB_WEBSITE                  40047
+#define IDM_ACTBDL                      40048
+#define IDM_PROJECT_OPEN                40051
+#define IDM_PROJECT_CLOSE               40052
+#define IDM_PROJECT_SAVE                40053
+#define IDM_PROJECTVIEW                 40054
+#define IDM_FILETREE_PROPERTY           40057
+#define IDM_FILETREE_OPEN               40058
+#define IDM_FILETREE_INSERT             40059
+#define IDM_FILETREE_DELETE             40060
+#define IDM_WINDOWTREE_OPEN             40062
+#define IDM_MATERIALTREE_OPEN           40062
+#define IDM_WINDOWTREE_DELETE           40063
+#define IDM_MATERIALTREE_DELETE         40063
+#define IDM_WINDOWTREE_PROPERTY         40064
+#define IDM_WINDOWTREE_INSERT           40065
+#define IDM_MATERIALTREE_INSERT         40065
+#define IDM_MATERIALTREE_INSERTWINDOW   40065
+#define IDM_RAD_ITEM_DELETE             40067
+#define IDM_RAD_WINDOW_EVENTCODE        40069
+#define IDM_ACCEL_UNDO                  -25466
+#define IDM_ACCEL_REDO                  -25465
+#define IDM_PROCEDURETREE_SHOW          40072
+#define IDM_RAD_WINDOW_MENUEVENTCODE    40074
+#define IDM_MENUTREE_RENAMEID           40075
+#define IDM_PROJECT_OPTION              40076
+#define IDM_TOPMOST                     40077
+#define ID_BUTTON40079                  40079
+#define ID_BUTTON40080                  40080
+#define ID_BUTTON40081                  40081
+#define ID_BUTTON40082                  40082
+#define ID_BUTTON40083                  40083
+#define ID_BUTTON40084                  40084
+#define ID_BUTTON40085                  40085
+#define ID_BUTTON40086                  40086
+#define ID_BUTTON40087                  40087
+#define ID_BUTTON40088                  40088
+#define ID_BUTTON40089                  40089
+#define ID_BUTTON40090                  40090
+#define ID_BUTTON40091                  40091
+#define ID_BUTTON40092                  40092
+#define ID_BUTTON40093                  40093
+#define ID_BUTTON40094                  40094
+#define ID_BUTTON40095                  40095
+#define ID_BUTTON40097                  40097
+#define IDM_DEBUG                       40101
+#define IDM_RELEASECOMPILE              40106
+#define IDM_DEBUGCOMPILE                40108
+#define IDM_MATERIALTREE_INSERTICON     40109
+#define IDM_MATERIALTREE_INSERTMENU     40110
+#define IDM_MATERIALTREE_ICON_SETMAIN   40113
+#define IDM_MATERIALTREE_INSERTBITMAP   40115
+#define IDM_MATERIALTREE_INSERTCURSOR   40116
+#define IDM_NOGRIPPER                   40117
+#define IDC_TOOL_SELECT                 40119
+#define IDC_TOOL_PEN                    40120
+#define IDC_TOOL_LINE                   40121
+#define IDC_TOOL_RECTANGLE              40123
+#define IDC_TOOL_ELLIPSE                40124
+#define IDC_TOOL_FILL                   40126
+#define IDC_TOOL_FILLRECT               40127
+#define IDC_TOOL_FILLRECT2              40128
+#define IDM_SELECTCOMPILERBAND          40133
+#define IDM_RESET_REBAR                 40134
+#define IDM_COMMU_PM                    40136
+#define ID_COMMU_FORUM1                 40138
+#define ID_COMMU_FORUM2                 40139
+#define ID_COMMU_FORUM4                 40140
+#define ID_COMMU_FORUM3                 40141
+#define ID_COMMU_FORUM5                 40142
+#define IDM_COMMUNITY                   40143
+#define IDM_CODE_SAVE                   40144
+#define IDM_COMMU_SEARCH                40148
+#define IDM_WEB_SEARCH                  40149
+#define IDM_BANDMENU_WEB_SEARCH         40150
+#define IDM_PROJECT_FOLDER_OPEN         40151
+#define IDM_ALLCLOSE_OMIT_MYSELF        40152
+#define IDM_PATH_COPY                   40153
+#define IDM_FOLDER_OPEN                 40154
+#define IDM_DELETE_FILE                 40155
+#define IDM_GRAY                        40157
+#define IDM_WHITE                       40158
+#define IDM_RED                         40159
+#define IDM_GREEN                       40160
+#define IDM_BLUE                        40161
+#define IDM_YELLOW                      40162
+#define IDM_USER_COLOR                  40163
+#define IDM_PRINTOUT                    40164
+#define IDM_PAGESET                     40165
+#define IDM_PREVIEW                     40166
+#define ID_MENUITEM40167                40167
+#define ID_MENUITEM40168                40168
+#define IDM_CONV_ALPHA_SMALL            40170
+#define IDM_CONV_ALPHA_BIG              40171
+#define IDM_CONV_HELF                   40172
+#define IDM_CONV_HALF                   40172
+#define IDM_CONV_MULTI                  40173
+#define IDM_CONV_KATAKANA               40174
+#define IDM_CONV_HIRAGANA               40175
+#define IDM_CONV_SPACE                  40176
+#define IDM_CONV_TAB                    40177
+#define IDM_ATTACH                      40178
+#define IDM_STEP_IN                     40180
+#define IDM_STEP_OVER                   40181
+#define IDM_STEP_CURSOR                 40184
+#define IDM_BREAKPOINT                  40185
+#define IDM_DEBUG_STOP                  40186
+#define IDM_DEBUG_PAUSE                 40187
+#define IDM_RELEASEBAND                 40189
+#define IDM_RELEASERUN                  40190
+#define ID_COMMU_FORUM6                 40191
+#define ID_COMMU_FORUM7                 40192
+#define ID_COMMU_FORUM8                 40193
+#define IDM_CODEFORMAT                  40194
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        311
+#define _APS_NEXT_COMMAND_VALUE         40195
+#define _APS_NEXT_CONTROL_VALUE         1497
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
Index: tag/abdev(2007.06.20)/res_TheText/res.cpp
===================================================================
--- tag/abdev(2007.06.20)/res_TheText/res.cpp	(revision 178)
+++ tag/abdev(2007.06.20)/res_TheText/res.cpp	(revision 178)
@@ -0,0 +1,15 @@
+#include <windows.h>
+
+BOOL WINAPI DllMain(HANDLE hDLL,DWORD dwReason,LPVOID lpReserved){
+	switch(dwReason){
+		case DLL_PROCESS_ATTACH:
+			break;
+		case DLL_PROCESS_DETACH:
+			break;
+		case DLL_THREAD_ATTACH:
+		case DLL_THREAD_DETACH:
+		default:
+			break;
+	}
+	return TRUE;
+}
Index: tag/abdev(2007.06.20)/res_TheText/res.dsp
===================================================================
--- tag/abdev(2007.06.20)/res_TheText/res.dsp	(revision 178)
+++ tag/abdev(2007.06.20)/res_TheText/res.dsp	(revision 178)
@@ -0,0 +1,275 @@
+# Microsoft Developer Studio Project File - Name="res" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** 編集しないでください **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=res - Win32 Debug
+!MESSAGE これは有効なﾒｲｸﾌｧｲﾙではありません。 このﾌﾟﾛｼﾞｪｸﾄをﾋﾞﾙﾄﾞするためには NMAKE を使用してください。
+!MESSAGE [ﾒｲｸﾌｧｲﾙのｴｸｽﾎﾟｰﾄ] ｺﾏﾝﾄﾞを使用して実行してください
+!MESSAGE 
+!MESSAGE NMAKE /f "res.mak".
+!MESSAGE 
+!MESSAGE NMAKE の実行時に構成を指定できます
+!MESSAGE ｺﾏﾝﾄﾞ ﾗｲﾝ上でﾏｸﾛの設定を定義します。例:
+!MESSAGE 
+!MESSAGE NMAKE /f "res.mak" CFG="res - Win32 Debug"
+!MESSAGE 
+!MESSAGE 選択可能なﾋﾞﾙﾄﾞ ﾓｰﾄﾞ:
+!MESSAGE 
+!MESSAGE "res - Win32 Release" ("Win32 (x86) Dynamic-Link Library" 用)
+!MESSAGE "res - Win32 Debug" ("Win32 (x86) Dynamic-Link Library" 用)
+!MESSAGE 
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF  "$(CFG)" == "res - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RES_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RES_EXPORTS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x411 /d "NDEBUG"
+# ADD RSC /l 0x411 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../TheText/SubOperation/res.dll"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Cmds=copy D:\BasicProject\TheText\SubOperation\res.dll D:\BasicProject\TheText_Standard\SubOperation\res.dll
+# End Special Build Tool
+
+!ELSEIF  "$(CFG)" == "res - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RES_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "RES_EXPORTS" /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x411 /d "_DEBUG"
+# ADD RSC /l 0x411 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+
+!ENDIF 
+
+# Begin Target
+
+# Name "res - Win32 Release"
+# Name "res - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\res.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\res.rc
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\base_directx.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\base_dosprompt.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\base_non.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\base_prompt.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\base_window.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\BasicProgram.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\cursor_arrow_to_right.cur
+# End Source File
+# Begin Source File
+
+SOURCE=.\cursor_fill.cur
+# End Source File
+# Begin Source File
+
+SOURCE=.\cursor_pen.cur
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_bas.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_bmp.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_icon.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_pj.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\file_sbp.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\folder_close.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\folder_open.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\html_general_parameter.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\html_parameter.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\ico00001.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\ico00002.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\main.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\member_private_function.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\member_private_variable.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\member_public_function.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\member_public_variable.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\menu.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\pair_statement.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\Procedure.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\program_folder.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\TextDocument.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\thetext_pro_image.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\TOOLBAR1.BMP
+# End Source File
+# Begin Source File
+
+SOURCE=.\toolbar2.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\toolbar_debugger.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\toolbar_icon.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\toolbar_standard.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\toolbar_standard_disabled.bmp
+# End Source File
+# Begin Source File
+
+SOURCE=.\Window.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\zoomin.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\zoomout.ico
+# End Source File
+# End Group
+# End Target
+# End Project
Index: tag/abdev(2007.06.20)/res_TheText/res.dsw
===================================================================
--- tag/abdev(2007.06.20)/res_TheText/res.dsw	(revision 178)
+++ tag/abdev(2007.06.20)/res_TheText/res.dsw	(revision 178)
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# 警告: このﾜｰｸｽﾍﾟｰｽ ﾌｧｲﾙ を編集または削除しないでください!
+
+###############################################################################
+
+Project: "res"=.\res.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
Index: tag/abdev(2007.06.20)/res_TheText/res.rc
===================================================================
--- tag/abdev(2007.06.20)/res_TheText/res.rc	(revision 178)
+++ tag/abdev(2007.06.20)/res_TheText/res.rc	(revision 178)
@@ -0,0 +1,2238 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// 日本語 resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_JPN)
+#ifdef _WIN32
+LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
+#pragma code_page(932)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "#include ""afxres.h""\r\n"
+    "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE 
+BEGIN
+    "\r\n"
+    "\0"
+END
+
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_MAINMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "ファイル(&F)"
+    BEGIN
+        MENUITEM "新規作成(&N)\tCtrl+N",        IDM_NEW
+        MENUITEM "ファイルを開く(&O)\tCtrl+O",  IDM_OPEN
+        MENUITEM "ファイルを閉じる(&C)",        IDM_CLOSE
+        MENUITEM SEPARATOR
+        MENUITEM "上書き保存(&S)\tCtrl+S",      IDM_SAVE
+        MENUITEM "名前を付けて保存(&A)",        IDM_NEWSAVE
+        MENUITEM "文字コードを指定して保存(&D)", IDM_CODE_SAVE
+        MENUITEM "すべて保存(&V)",              IDM_ALLSAVE
+        MENUITEM SEPARATOR
+        MENUITEM "ページ設定(&U)",              IDM_PAGESET
+        MENUITEM "プレビュー(&R)",              IDM_PREVIEW
+        MENUITEM "印刷(&P)",                    IDM_PRINTOUT
+        MENUITEM SEPARATOR
+        POPUP "FileHistory"
+        BEGIN
+            MENUITEM "dummy",                       ID_MENUITEM40180
+        END
+        MENUITEM SEPARATOR
+        MENUITEM "アプリケーションの終了(&X)",  IDM_EXIT
+    END
+    POPUP "編集(&E)"
+    BEGIN
+        MENUITEM "元に戻す(&U)\tCtrl+Z",        IDM_UNDO
+        MENUITEM "やり直し(&R)\tCtrl+Y",        IDM_REDO
+        MENUITEM SEPARATOR
+        MENUITEM "切り取り(&T)\tCtrl+X",        IDM_CUT
+        MENUITEM "コピー(&C)\tCtrl+C",          IDM_COPY
+        MENUITEM "貼り付け(&P)\tCtrl+V",        IDM_PASTE
+        MENUITEM "削除(&D)\tDel",               IDM_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "すべて選択(&A)\tCtrl+A",      IDM_ALLSELECT
+        MENUITEM SEPARATOR
+        MENUITEM "検索(&F)\tCtrl+F",            IDM_FIND
+        MENUITEM "置換(&S)\tCtrl+H",            IDM_PERMUTATION
+    END
+    POPUP "表示(&V)"
+    BEGIN
+        MENUITEM "常に手前に表示(&T)",          IDM_TOPMOST
+        MENUITEM SEPARATOR
+        MENUITEM "自動折り返し(&W)",            IDM_RIGHT_TURN
+        MENUITEM SEPARATOR
+        MENUITEM "オプション(&O)",              IDM_SET
+    END
+    POPUP "変換(&C)"
+    BEGIN
+        MENUITEM "アルファベット大文字 → アルファベット小文字(&A)", 
+                                                IDM_CONV_ALPHA_SMALL
+        MENUITEM "アルファベット小文字 → アルファベット大文字(&L)", 
+                                                IDM_CONV_ALPHA_BIG
+        MENUITEM SEPARATOR
+        MENUITEM "全角 → 半角(&H)",            IDM_CONV_HALF
+        MENUITEM "半角 → 全角(&M)",            IDM_CONV_MULTI
+        MENUITEM "全角ひらがな → 全角カタカナ(&K)", IDM_CONV_KATAKANA
+        MENUITEM "全角カタカナ → 全角ひらがな(&R)", IDM_CONV_HIRAGANA
+        MENUITEM SEPARATOR
+        MENUITEM "TAB → 空白(&S)",             IDM_CONV_SPACE
+        MENUITEM "空白 → TAB(&T)",             IDM_CONV_TAB
+        MENUITEM SEPARATOR
+        MENUITEM "自動折り返し改行コードを挿入(&U)", IDM_CONV_HASRETURN
+        MENUITEM "引用文に変換(&Q)",            IDM_CONV_QUOTE
+    END
+    POPUP "ツール(&T)"
+    BEGIN
+        MENUITEM "文字カウント(&O)",            IDM_STRING_COUNT
+    END
+    POPUP "ヘルプ(&H)"
+    BEGIN
+        MENUITEM "トピックス(&T)",              IDM_TOPIC
+        MENUITEM SEPARATOR
+        POPUP "ホームページを表示(&H)"
+        BEGIN
+            MENUITEM "Discoversoft のホームページ(&H)", IDM_DSHOMEPAGE
+        END
+        MENUITEM SEPARATOR
+        MENUITEM "バージョン情報(&A)",          IDM_ABOUT
+    END
+END
+
+IDR_EDITMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "EditMenu"
+    BEGIN
+        MENUITEM "元に戻す(&U)",                IDM_UNDO
+        MENUITEM "やり直し(&R)",                IDM_REDO
+        MENUITEM SEPARATOR
+        MENUITEM "切り取り(&T)",                IDM_CUT
+        MENUITEM "コピー(&C)",                  IDM_COPY
+        MENUITEM "貼り付け(&P)",                IDM_PASTE
+        MENUITEM "削除(&D)",                    IDM_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "すべて選択(&A)",              IDM_ALLSELECT
+        MENUITEM SEPARATOR
+        MENUITEM "選択範囲を文字カウント(&O)",  IDM_SEL_STRING_COUNT
+    END
+END
+
+IDR_REBARMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "RebarMenu"
+    BEGIN
+        MENUITEM "ドキュメント セレクト(&D)",   IDM_DOCSELECTBAND
+        MENUITEM "スタンダード(&S)",            IDM_STANDARDBAND
+        MENUITEM "Web検索(&W)",                 IDM_BANDMENU_WEB_SEARCH
+        MENUITEM SEPARATOR
+        MENUITEM "ツールバーを固定する(&F)",    IDM_NOGRIPPER
+        MENUITEM SEPARATOR
+        MENUITEM "リセット(&R)",                IDM_RESET_REBAR
+    END
+END
+
+IDR_PROJECTVIEW_FILETREEMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "FileTreeRoot"
+    BEGIN
+        MENUITEM "ファイルを挿入(&I)",          IDM_FILETREE_INSERT
+    END
+    POPUP "FileTree"
+    BEGIN
+        MENUITEM "開く(&O)",                    IDM_FILETREE_OPEN
+        MENUITEM SEPARATOR
+        MENUITEM "プロジェクトから削除(&D)",    IDM_FILETREE_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "プロパティ(&P)",              IDM_FILETREE_PROPERTY
+    END
+END
+
+IDR_PROJECTVIEW_MATERIALTREEMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "BitmapRoot"
+    BEGIN
+        MENUITEM "ビットマップを挿入(&I)",      IDM_MATERIALTREE_INSERTBITMAP
+
+    END
+    POPUP "BitmapTree"
+    BEGIN
+        MENUITEM "削除(&D)",                    IDM_MATERIALTREE_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "IDを変更(&E)",                IDM_MENUTREE_RENAMEID
+    END
+    POPUP "CursorRoot"
+    BEGIN
+        MENUITEM "カーソルを挿入(&I)",          IDM_MATERIALTREE_INSERTCURSOR
+
+    END
+    POPUP "CursorTree"
+    BEGIN
+        MENUITEM "削除(&D)",                    IDM_MATERIALTREE_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "IDを変更(&E)",                IDM_MENUTREE_RENAMEID
+    END
+    POPUP "IconRoot"
+    BEGIN
+        MENUITEM "アイコンを挿入(&I)",          IDM_MATERIALTREE_INSERTICON
+    END
+    POPUP "IconTree"
+    BEGIN
+        MENUITEM "開く（&O)",                   IDM_MATERIALTREE_OPEN
+        MENUITEM "メインに設定(&M)",            IDM_MATERIALTREE_ICON_SETMAIN
+
+        MENUITEM SEPARATOR
+        MENUITEM "削除(&D)",                    IDM_MATERIALTREE_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "IDを変更(&E)",                IDM_MENUTREE_RENAMEID
+    END
+    POPUP "MenuRoot"
+    BEGIN
+        MENUITEM "メニューを挿入(&I)",          IDM_MATERIALTREE_INSERTMENU
+    END
+    POPUP "MenuTree"
+    BEGIN
+        MENUITEM "開く(&O)",                    IDM_MATERIALTREE_OPEN
+        MENUITEM SEPARATOR
+        MENUITEM "削除(&D)",                    IDM_MATERIALTREE_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "メニューIDを変更(&E)",        IDM_MENUTREE_RENAMEID
+    END
+    POPUP "WindowRoot"
+    BEGIN
+        MENUITEM "ウィンドウを挿入（&I)",       IDM_MATERIALTREE_INSERTWINDOW
+
+    END
+    POPUP "WindowTree"
+    BEGIN
+        MENUITEM "開く(&O)",                    IDM_MATERIALTREE_OPEN
+        MENUITEM SEPARATOR
+        MENUITEM "削除(&D)",                    IDM_MATERIALTREE_DELETE
+    END
+END
+
+IDR_RADCONTEXTMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "Window"
+    BEGIN
+        MENUITEM "イベント コード(&C)",         IDM_RAD_WINDOW_EVENTCODE
+        MENUITEM "メニューによるイベント(&M)",  IDM_RAD_WINDOW_MENUEVENTCODE
+    END
+    POPUP "Item"
+    BEGIN
+        MENUITEM "イベント コード(&C)",         IDM_RAD_WINDOW_EVENTCODE
+        MENUITEM SEPARATOR
+        MENUITEM "削除(&D)",                    IDM_RAD_ITEM_DELETE
+    END
+END
+
+IDR_PROJECTVIEW_PROCEDURETREEMENU MENU DISCARDABLE 
+BEGIN
+    MENUITEM "ProcedureTreeRoot",           65535
+    POPUP "ProcedureTree"
+    BEGIN
+        MENUITEM "表示する(&S)",                IDM_PROCEDURETREE_SHOW
+    END
+END
+
+IDR_TABMENU MENU DISCARDABLE 
+BEGIN
+    POPUP "tabmenu"
+    BEGIN
+        POPUP "タブの色(&L)"
+        BEGIN
+            MENUITEM "灰色(&G)",                    IDM_GRAY
+            MENUITEM "白(&W)",                      IDM_WHITE
+            MENUITEM "赤(&R)",                      IDM_RED
+            MENUITEM "緑(&E)",                      IDM_GREEN
+            MENUITEM "青(&B)",                      IDM_BLUE
+            MENUITEM "黄色(&Y)",                    IDM_YELLOW
+            MENUITEM SEPARATOR
+            MENUITEM "ユーザー設定(&U)",            IDM_USER_COLOR
+        END
+        MENUITEM SEPARATOR
+        MENUITEM "保存(&S)",                    IDM_SAVE
+        MENUITEM "閉じる(&C)",                  IDM_CLOSE
+        MENUITEM "このウィンドウ以外をすべて閉じる(&A)", 
+                                                IDM_ALLCLOSE_OMIT_MYSELF
+        MENUITEM SEPARATOR
+        MENUITEM "絶対パスをコピー(&P)",        IDM_PATH_COPY
+        MENUITEM "フォルダを開く(&F)",          IDM_FOLDER_OPEN
+        MENUITEM SEPARATOR
+        MENUITEM "ファイルを削除(&D)",          IDM_DELETE_FILE
+    END
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Accelerator
+//
+
+IDR_ACCELERATOR1 ACCELERATORS DISCARDABLE 
+BEGIN
+    "A",            IDM_ALLSELECT,          VIRTKEY, CONTROL, NOINVERT
+    "C",            IDM_COPY,               VIRTKEY, CONTROL, NOINVERT
+    "F",            IDM_FIND,               VIRTKEY, CONTROL, NOINVERT
+    "H",            IDM_PERMUTATION,        VIRTKEY, CONTROL, NOINVERT
+    "N",            IDM_NEW,                VIRTKEY, CONTROL, NOINVERT
+    "O",            IDM_OPEN,               VIRTKEY, CONTROL, NOINVERT
+    "S",            IDM_SAVE,               VIRTKEY, CONTROL, NOINVERT
+    "V",            IDM_PASTE,              VIRTKEY, CONTROL, NOINVERT
+    VK_F1,          IDM_TOPIC,              VIRTKEY, NOINVERT
+    VK_F5,          IDM_WEB_SEARCH,         VIRTKEY, NOINVERT
+    "X",            IDM_CUT,                VIRTKEY, CONTROL, NOINVERT
+    "Y",            IDM_ACCEL_REDO,         VIRTKEY, CONTROL, NOINVERT
+    "Z",            IDM_ACCEL_UNDO,         VIRTKEY, CONTROL, NOINVERT
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Toolbar
+//
+
+IDR_STANDARDTOOLBAR TOOLBAR DISCARDABLE  16, 15
+BEGIN
+    BUTTON      IDM_NEW
+    BUTTON      IDM_OPEN
+    BUTTON      IDM_SAVE
+    BUTTON      IDM_ALLSAVE
+    BUTTON      IDM_CUT
+    BUTTON      IDM_COPY
+    BUTTON      IDM_PASTE
+    BUTTON      IDM_UNDO
+    BUTTON      IDM_REDO
+    BUTTON      IDM_FIND
+END
+
+IDR_BASICTOOLBAR TOOLBAR DISCARDABLE  16, 15
+BEGIN
+    BUTTON      IDM_DEBUG
+    BUTTON      IDM_DEBUGCOMPILE
+    BUTTON      IDM_RELEASECOMPILE
+END
+
+IDR_CONTROL TOOLBAR DISCARDABLE  16, 15
+BEGIN
+    BUTTON      IDC_TOOL_MOUSE
+    BUTTON      IDC_TOOL_STATIC
+    BUTTON      IDC_TOOL_EDIT
+    BUTTON      IDC_TOOL_GROUPBOX
+    BUTTON      IDC_TOOL_COMBOBOX
+    BUTTON      IDC_TOOL_LISTBOX
+    BUTTON      IDC_TOOL_BUTTON
+    BUTTON      IDC_TOOL_CHECKBOX
+    BUTTON      IDC_TOOL_RADIOBUTTON
+    BUTTON      IDC_TOOL_LISTVIEW
+    BUTTON      IDC_TOOL_TREEVIEW
+    BUTTON      IDC_TOOL_HSCROLLBAR
+    BUTTON      IDC_TOOL_VSCROLLBAR
+    BUTTON      IDC_TOOL_UPDOWN
+    BUTTON      IDC_TOOL_IMAGEBOX
+    BUTTON      IDC_TOOL_TRACKBAR
+    BUTTON      IDC_TOOL_PROGRESSBAR
+    BUTTON      ID_BUTTON40097
+END
+
+IDR_ICONTOOLBAR TOOLBAR DISCARDABLE  16, 15
+BEGIN
+    BUTTON      IDC_TOOL_SELECT
+    BUTTON      IDC_TOOL_PEN
+    BUTTON      IDC_TOOL_LINE
+    BUTTON      IDC_TOOL_FILL
+    BUTTON      IDC_TOOL_RECTANGLE
+    BUTTON      IDC_TOOL_FILLRECT
+    BUTTON      IDC_TOOL_FILLRECT2
+    BUTTON      IDC_TOOL_ELLIPSE
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
+IDR_STANDARDTOOLBAR     BITMAP  DISCARDABLE     "toolbar_standard.bmp"
+IDR_BASICTOOLBAR        BITMAP  DISCARDABLE     "toolbar2.bmp"
+IDB_BASE_NORMAL         BITMAP  DISCARDABLE     "base_window.bmp"
+IDB_BASE_PROMPT         BITMAP  DISCARDABLE     "base_prompt.bmp"
+IDB_RADIOBUTTON         BITMAP  DISCARDABLE     "radiobutton.bmp"
+IDB_TITLE_BUTTON_CLOSE  BITMAP  DISCARDABLE     "title_button_close.bmp"
+IDR_CONTROL             BITMAP  DISCARDABLE     "toolbar_control.bmp"
+IDB_TITLE               BITMAP  DISCARDABLE     "title.bmp"
+IDB_PARAMHINT_QUESTION  BITMAP  DISCARDABLE     "ParamHint_Question.bmp"
+IDB_PARAMHINT_QUESTION2 BITMAP  DISCARDABLE     "ParamHint_Question2.bmp"
+IDR_ICONTOOLBAR         BITMAP  DISCARDABLE     "toolbar_icon.bmp"
+IDB_BASE_DOSPROMPT      BITMAP  DISCARDABLE     "base_dosprompt.bmp"
+IDB_BASE_NON            BITMAP  DISCARDABLE     "base_non.bmp"
+IDB_BASE_DIRECTX        BITMAP  DISCARDABLE     "base_directx.bmp"
+IDR_STANDARDTOOLBAR_DISABLED BITMAP  DISCARDABLE     "toolbar_standard_disabled.bmp"
+IDB_THETEXT_PRO_IMAGE   BITMAP  DISCARDABLE     "thetext_pro_image.bmp"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_ABOUT DIALOG DISCARDABLE  0, 0, 238, 121
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "TheText のバージョン情報"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "閉じる",IDCANCEL,181,100,50,14
+    ICON            IDI_MAIN,IDC_STATIC,29,13,20,20
+    LTEXT           "Copyright(C) 1999-2006 Discoversoft",IDC_STATIC,28,51,
+                    111,8
+    LTEXT           "TheText",IDC_STATIC_NAME,53,15,141,8
+    LTEXT           "Version",IDC_STATIC_VERSION,53,26,112,8
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,70,224,1
+    LTEXT           "Static",IDC_NOTE,7,75,224,20
+    PUSHBUTTON      "Pro版",IDC_GOPRO,7,100,50,14,NOT WS_VISIBLE
+END
+
+IDD_FIND DIALOG DISCARDABLE  0, 0, 235, 84
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "検索"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LTEXT           "文字列(&N):",IDC_STATIC,7,11,32,8
+    COMBOBOX        IDC_FINDSTR,44,7,121,64,CBS_DROPDOWN | CBS_AUTOHSCROLL | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "大文字小文字を区別する(&C)",IDC_ISBIGSMALL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,23,32,98,10
+    CONTROL         "単語単位(&W)",IDC_ISWORDUNIT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,23,45,53,10
+    CONTROL         "正規表現(&E)",IDC_REGEXP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,23,58,52,10
+    DEFPUSHBUTTON   "次を検索(&F)",IDOK,178,7,50,14
+    PUSHBUTTON      "すべて検索(&A)",IDC_FINDALL,178,23,50,14
+    PUSHBUTTON      "キャンセル",IDCANCEL,178,63,50,14
+END
+
+IDD_FINDALL DIALOG DISCARDABLE  0, 0, 186, 93
+STYLE WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
+CAPTION "検索結果"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    PUSHBUTTON      "該当を表示(&S)",IDC_SHOWITEM,2,2,50,14
+    PUSHBUTTON      "閉じる",IDCANCEL,55,2,50,14
+    LISTBOX         IDC_FINDLIST,0,17,186,76,LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_OPTION_WHOLE DIALOG DISCARDABLE  0, 0, 195, 103
+STYLE WS_CHILD | WS_DISABLED | WS_CAPTION | WS_SYSMENU
+CAPTION "全般"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LTEXT           "拡張子をもとに、ファイルの関連付けを行います。",
+                    IDC_STATIC,68,34,103,20
+    LTEXT           "-",IDC_STATIC,61,34,8,8
+    CONTROL         "ドキュメントを保存したときにタブを先頭に再配置する",
+                    IDC_SAVE_TAB_TO_HEAD,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,7,7,167,10
+    PUSHBUTTON      "関連付け",IDC_LINKFILE,7,30,50,14
+END
+
+IDD_PERMUTATION DIALOG DISCARDABLE  0, 0, 267, 104
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "置換"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LTEXT           "検索する文字列(&N):",IDC_STATIC,7,10,57,8
+    LTEXT           "置換後の文字列(&P):",IDC_STATIC,7,27,59,8
+    COMBOBOX        IDC_FINDSTR,68,7,134,69,CBS_DROPDOWN | CBS_AUTOHSCROLL | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_PERMUTATIONSTR,68,25,134,70,CBS_DROPDOWN | 
+                    CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP
+    CONTROL         "大文字小文字を区別する(&C)",IDC_ISBIGSMALL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,39,51,98,10
+    CONTROL         "単語単位(&W)",IDC_ISWORDUNIT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,39,64,53,10
+    CONTROL         "正規表現(&E)",IDC_REGEXP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,39,77,52,10
+    DEFPUSHBUTTON   "次を検索(&F)",IDC_FIND,210,7,50,14,WS_GROUP
+    PUSHBUTTON      "次を置換(&R)",IDC_PERMUTATIONNEXT,210,24,50,14
+    PUSHBUTTON      "すべて置換(&A)",IDC_PERMUTATIONALL,210,41,50,14
+    PUSHBUTTON      "閉じる",IDCANCEL,210,83,50,14
+END
+
+IDD_NEWFILE DIALOG DISCARDABLE  0, 0, 207, 105
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "新規作成"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,150,67,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,150,84,50,14
+    LISTBOX         IDC_FILETYPELIST,7,7,117,91,LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "プロジェクトへ追加",IDC_ADDTOPROJECT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,129,14,70,10
+    EDITTEXT        IDC_FILENAME,129,43,71,14,ES_AUTOHSCROLL
+    LTEXT           "ファイル名:",IDC_STATIC_FILENAME,129,33,32,8
+END
+
+IDD_OPTION_EDITOR DIALOG DISCARDABLE  0, 0, 251, 174
+STYLE WS_CHILD | WS_DISABLED | WS_CAPTION | WS_SYSMENU
+CAPTION "エディタ"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    GROUPBOX        "全般",IDC_STATIC,7,7,237,77
+    LTEXT           "タブ サイズ(&T):",IDC_STATIC_TABSIZE,13,44,44,8
+    LTEXT           "フォント(&F):",IDC_STATIC_SETFONT,13,23,32,8
+    LTEXT           "自動折り返しのときの一行あたりの文字数:",IDC_STATIC,13,
+                    65,123,8
+    LTEXT           "文字（バイト）",IDC_STATIC,170,65,39,8
+    GROUPBOX        "入力サポート",IDC_STATIC,7,90,237,35
+    PUSHBUTTON      "font",IDC_SETFONT,69,19,50,14
+    EDITTEXT        IDC_TABSIZE,69,40,25,14,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "ルーラーを表示する",IDC_RULER,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,143,18,74,10
+    CONTROL         "行番号を表示する",IDC_LINENUMBER,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,143,30,69,10
+    CONTROL         "カーソル行を強調表示する",IDC_CARETLINE_BACKGROUND,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,143,42,94,10
+    EDITTEXT        IDC_MAX_ONELINE_TEXT_LENGTH,141,61,25,14,ES_NUMBER
+    CONTROL         "自動インデント(&I)",IDC_ISAUTOINDENT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,13,106,65,10
+    GROUPBOX        "検索・置換",IDC_STATIC,7,131,237,35
+    CONTROL         "アプリケーション終了時に検索・置換文字列を保存する",
+                    IDC_SAVE_FINDSTR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    13,147,174,10
+END
+
+IDD_OPTION_TOOLBAR DIALOG DISCARDABLE  0, 0, 187, 93
+STYLE WS_CHILD | WS_DISABLED | WS_CAPTION | WS_SYSMENU
+CAPTION "ツールバー"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    PUSHBUTTON      "リセット(&R)",IDC_RESETTOOLBAR,19,24,50,14
+END
+
+IDD_NEWPROJECT_PAGE1 DIALOGEX 0, 0, 310, 177
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ステップ1 （プロジェクトを作成）"
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    CONTROL         138,IDC_IMAGE_WINDOW,"Static",SS_BITMAP,7,7,73,64
+    CONTROL         139,IDC_IMAGE_PROMPT,"Static",SS_BITMAP | NOT WS_VISIBLE,
+                    18,15,73,64
+    LTEXT           "Static",IDC_HELPTEXT_OFBASE,28,141,275,29,0,
+                    WS_EX_STATICEDGE
+    LTEXT           "プロジェクト名(&N):",IDC_STATIC,99,11,52,8
+    LTEXT           "ディレクトリ(&D):",IDC_STATIC,107,28,44,8
+    GROUPBOX        "アプリケーション タイプ（Win32)",IDC_STATIC,95,49,131,
+                    86
+    LTEXT           "説明:",IDC_STATIC,7,141,16,8
+    EDITTEXT        IDC_PROJECTNAME,153,7,69,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_DIRPATH,153,25,107,14,ES_AUTOHSCROLL
+    PUSHBUTTON      "参照(&B)",IDC_PATHBROWSE,271,25,32,14
+    CONTROL         "EXE - ノーマル ウィンドウ ベース",IDC_EXE_WINDOWBASE,
+                    "Button",BS_AUTORADIOBUTTON,102,61,112,10
+    CONTROL         "EXE - N88プロンプト ベース",IDC_EXE_PROMPTBASE,"Button",
+                    BS_AUTORADIOBUTTON,102,73,98,10
+    CONTROL         "EXE - DOSプロンプト ベース",IDC_EXE_DOSPROMPTBASE,
+                    "Button",BS_AUTORADIOBUTTON,102,85,99,10
+    CONTROL         "EXE - ベースなし",IDC_EXE_NOBASE,"Button",
+                    BS_AUTORADIOBUTTON,102,97,67,10
+    CONTROL         "EXE - DirectX対応アプリケーション",IDC_EXE_DIRECTX,
+                    "Button",BS_AUTORADIOBUTTON,102,109,119,10
+    CONTROL         "DLL - プロシージャ ライブラリ",IDC_DLL,"Button",
+                    BS_AUTORADIOBUTTON,102,121,103,10
+    CONTROL         """Hello world!"" 表示",IDC_SHOWHELLOWORLD,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,230,56,73,10
+    CONTROL         266,IDC_IMAGE_DOSPROMPT,"Static",SS_BITMAP | NOT 
+                    WS_VISIBLE,7,23,73,64
+    CONTROL         267,IDC_IMAGE_NON,"Static",SS_BITMAP | NOT WS_VISIBLE,18,
+                    31,73,64
+    CONTROL         268,IDC_IMAGE_DIRECTX,"Static",SS_BITMAP | NOT 
+                    WS_VISIBLE,7,39,73,64
+END
+
+IDD_NEWPROJECT_PAGE3 DIALOG DISCARDABLE  0, 0, 310, 177
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ステップ3 （プロジェクト情報の確認）"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    EDITTEXT        IDC_PROJECTINFO,7,7,296,163,ES_MULTILINE | 
+                    ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | 
+                    WS_VSCROLL | WS_HSCROLL
+END
+
+IDD_PROJECT_FILEPROPERTY DIALOGEX 0, 0, 230, 77
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_TOOLWINDOW
+CAPTION "Source File プロパティ"
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    LTEXT           "使用ファイル:",IDC_STATIC,7,10,39,8
+    LTEXT           "定義:",IDC_STATIC,7,30,16,8
+    LTEXT           "最終更新日時:",IDC_STATIC,7,50,43,8
+    LTEXT           "形式:",IDC_STATIC,7,62,16,8
+    LTEXT           "time",IDC_UPDATE_TIME,55,50,168,8
+    LTEXT           "type",IDC_FILETYPE,55,62,168,8
+    EDITTEXT        IDC_USING_FILE,55,7,168,14,ES_AUTOHSCROLL | ES_READONLY
+    EDITTEXT        IDC_DEFINED_FILE,55,25,168,14,ES_AUTOHSCROLL | 
+                    ES_READONLY
+END
+
+IDD_RAD_CTRLBUTTONS DIALOG DISCARDABLE  0, 0, 88, 90
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+END
+
+IDD_PROJECT_NEWWINDOW DIALOG DISCARDABLE  0, 0, 171, 153
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "新規ウィンドウ"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LTEXT           "ウィンドウ名:",IDC_STATIC,13,11,36,8
+    LTEXT           "ハンドル:",IDC_STATIC,13,60,26,8
+    LTEXT           "プロシージャ:",IDC_STATIC,13,77,39,8
+    GROUPBOX        "詳細",IDC_STATIC,7,29,96,64
+    GROUPBOX        "タイプ",IDC_STATIC,7,99,157,47
+    EDITTEXT        IDC_WINDOWNAME,56,7,40,14,ES_AUTOHSCROLL
+    CONTROL         "自動設定",IDC_AUTOSET,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,13,42,43,10
+    EDITTEXT        IDC_WINDOWHANDLE,56,56,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_WINDOWPROC,56,73,40,14,ES_AUTOHSCROLL
+    CONTROL         "通常ウィンドウ",IDC_DEFWINDOW,"Button",
+                    BS_AUTORADIOBUTTON,13,111,57,10
+    CONTROL         "ダイアログ テンプレート（モーダル）",IDC_MODALDLG,
+                    "Button",BS_AUTORADIOBUTTON,13,122,117,10
+    CONTROL         "ダイアログ テンプレート（モードレス）",IDC_MODELESSDLG,
+                    "Button",BS_AUTORADIOBUTTON,13,133,121,10
+    DEFPUSHBUTTON   "作成",IDOK,114,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,114,24,50,14
+END
+
+IDD_RAD_PROP_WINDOW DIALOG DISCARDABLE  0, 0, 87, 484
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ウィンドウ プロパティ -",IDC_STATIC,0,3,86,8
+    LTEXT           "キャプション:",IDC_STATIC,3,59,38,8
+    LTEXT           "フォント:",IDC_STATIC,3,91,24,8
+    LTEXT           "背景:",IDC_STATIC,3,110,16,8
+    LTEXT           "ハンドル:",IDC_STATIC_HANDLE,3,42,26,8
+    LTEXT           "Handle",IDC_HANDLE,30,42,50,8
+    LTEXT           "識別名:",IDC_STATIC,3,18,23,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,187,85,219
+    LTEXT           "メニュー:",IDC_STATIC,4,128,26,8
+    GROUPBOX        "タイプ",IDC_STATIC,0,412,86,48
+    EDITTEXT        IDC_WINDOWNAME,1,28,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEWINDOW,68,27,18,14
+    EDITTEXT        IDC_CAPTION,1,69,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,68,18,14
+    PUSHBUTTON      "",IDC_SETFONT,28,88,58,14
+    COMBOBOX        IDC_WINDOWMENU,1,138,84,75,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_WINDOWSTYLE,4,199,80,60,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_BORDERSTYLE,4,213,80,60,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "タイトルバー",IDC_STYLE_CAPTION,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,231,52,10
+    CONTROL         "システムメニュー",IDC_STYLE_SYSMENU,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,242,66,10
+    CONTROL         "最小化ボタン",IDC_STYLE_MINIMIZEBOX,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,253,54,10
+    CONTROL         "最大化ボタン",IDC_STYLE_MAXIMIZEBOX,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,264,54,10
+    CONTROL         "最小化",IDC_STYLE_MINIMIZE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,282,37,10
+    CONTROL         "最大化",IDC_STYLE_MAXIMIZE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,293,37,10
+    CONTROL         "水平スクロールバー",IDC_STYLE_HSCROLLBAR,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,311,71,10
+    CONTROL         "垂直スクロールバー",IDC_STYLE_VSCROLLBAR,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,322,71,10
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,340,64,10
+    CONTROL         "兄弟ウィンドウをクリップ",IDC_STYLE_CLIPSIBLINGS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,351,80,10
+    CONTROL         "子ウィンドウをクリップ",IDC_STYLE_CLIPCHILDREN,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,362,78,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,373,30,10
+    PUSHBUTTON      "拡張スタイルを設定",IDC_EXSTYLE,4,389,78,13
+    CONTROL         "通常ウィンドウ",IDC_DEFWINDOW,"Button",
+                    BS_AUTORADIOBUTTON,4,424,57,10
+    CONTROL         "モーダル ダイアログ",IDC_MODALDLG,"Button",
+                    BS_AUTORADIOBUTTON,4,435,80,10
+    CONTROL         "モードレス ダイアログ",IDC_MODELESSDLG,"Button",
+                    BS_AUTORADIOBUTTON,4,446,78,10
+    LTEXT           "アイコン:",IDC_STATIC_ICON,4,155,26,8
+    COMBOBOX        IDC_ICONRES,1,165,84,75,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_BGCOLOR,20,107,65,150,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+END
+
+IDD_RAD_PROP_BUTTON DIALOG DISCARDABLE  0, 0, 87, 293
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- Button プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,74,85,212
+    LTEXT           "水平方向の配置:",IDC_STATIC,4,208,50,8
+    LTEXT           "垂直方向の配置",IDC_STATIC,4,237,49,8
+    LTEXT           "キャプション:",IDC_STATIC,3,45,38,8
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,54,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,85,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,96,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,107,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,118,52,10
+    CONTROL         "標準のボタン",IDC_BS_DEFPUSHBUTTON,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,136,54,10
+    CONTROL         "オーナー描画",IDC_BS_OWNERDRAW,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,147,56,10
+    CONTROL         "アイコン",IDC_BS_ICON,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,158,39,10
+    CONTROL         "ビットマップ",IDC_BS_BITMAP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,169,49,10
+    CONTROL         "複数行",IDC_BS_MULTILINE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,180,37,10
+    CONTROL         "通知",IDC_BS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,191,30,10
+    COMBOBOX        IDC_BS_HPOS,11,217,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_BS_VPOS,11,246,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,266,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_WINDOW_RENAME DIALOG DISCARDABLE  0, 0, 170, 99
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "識別設定"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LTEXT           "ウィンドウ名:",IDC_STATIC,13,11,36,8
+    LTEXT           "ハンドル:",IDC_STATIC,13,60,26,8
+    LTEXT           "プロシージャ:",IDC_STATIC,13,77,39,8
+    GROUPBOX        "詳細",IDC_STATIC,7,29,96,64
+    EDITTEXT        IDC_WINDOWNAME,56,7,40,14,ES_AUTOHSCROLL
+    CONTROL         "自動設定",IDC_AUTOSET,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,13,42,43,10
+    EDITTEXT        IDC_WINDOWHANDLE,56,56,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_WINDOWPROC,56,73,40,14,ES_AUTOHSCROLL
+    DEFPUSHBUTTON   "OK",IDOK,113,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,113,24,50,14
+END
+
+IDD_RAD_EVENTCODE DIALOGEX 0, 0, 283, 205
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "イベント処理"
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    LTEXT           "",IDC_PROCEDURENAME,7,167,205,31,0,WS_EX_STATICEDGE
+    LTEXT           "プロシージャ",IDC_STATIC,7,156,38,8
+    CONTROL         "List1",IDC_EVENTLIST,"SysListView32",LVS_REPORT | 
+                    LVS_SINGLESEL | LVS_NOSORTHEADER | WS_BORDER | 
+                    WS_TABSTOP,7,7,269,133
+    CONTROL         "Default",IDC_DEFAULT,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,159,143,37,10
+    CONTROL         "Menu",IDC_MENU,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,199,143,37,10
+    CONTROL         "MMSYS",IDC_MMSYS,"Button",BS_AUTORADIOBUTTON | 
+                    BS_PUSHLIKE,238,143,37,10
+    DEFPUSHBUTTON   "コーディング",IDOK,225,167,50,14
+    PUSHBUTTON      "キャンセル",IDCANCEL,225,184,50,14
+END
+
+IDD_RAD_PROP_ITEM_RENAMEID DIALOG DISCARDABLE  0, 0, 165, 45
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ID名を変更"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    EDITTEXT        IDC_IDNAME,20,7,78,14,ES_AUTOHSCROLL
+    LTEXT           "ID:",IDC_STATIC,7,11,8,8
+    DEFPUSHBUTTON   "OK",IDOK,107,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,107,24,50,14
+END
+
+IDD_RAD_PROP_WINDOW_EXSTYLE DIALOG DISCARDABLE  0, 0, 199, 127
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "拡張スタイル"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CONTROL         "最前面ウィンドウ",IDC_EXSTYLE_TOPMOST,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,7,64,10
+    CONTROL         "ドラッグ＆ドロップを許可",IDC_EXSTYLE_ACCEPTFILES,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,18,86,10
+    CONTROL         "透過ウィンドウ",IDC_EXSTYLE_TRANSPARENT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,29,57,10
+    CONTROL         "ツールウィンドウ",IDC_EXSTYLE_TOOLWINDOW,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,40,63,10
+    CONTROL         "クライアント境界線",IDC_EXSTYLE_CLIENTEDGE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,58,70,10
+    CONTROL         "スタティック境界線",IDC_EXSTYLE_STATICEDGE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,69,70,10
+    CONTROL         "親ウィンドウに通知しない",IDC_EXSTYLE_NOPARENTNOTIFY,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,87,88,10
+    CONTROL         "コンテキスト ヘルプ",IDC_EXSTYLE_CONTEXTHELP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,98,73,10
+    CONTROL         "Tabキーによる子ウィンドウの移動を許可",
+                    IDC_EXSTYLE_CONTROLPARENT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,7,109,133,10
+    DEFPUSHBUTTON   "OK",IDOK,142,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,142,24,50,14
+END
+
+IDD_RAD_PROP_ITEM_EXSTYLE DIALOG DISCARDABLE  0, 0, 187, 77
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "拡張スタイル"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CONTROL         "ドラッグ＆ドロップを許可",IDC_EXSTYLE_ACCEPTFILES,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,7,86,10
+    CONTROL         "透過ウィンドウ",IDC_EXSTYLE_TRANSPARENT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,19,57,10
+    CONTROL         "モーダル フレーム",IDC_EXSTYLE_DLGMODALFRAME,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,37,70,10
+    CONTROL         "クライアント境界線",IDC_EXSTYLE_CLIENTEDGE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,48,70,10
+    CONTROL         "スタティック境界線",IDC_EXSTYLE_STATICEDGE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,59,70,10
+    DEFPUSHBUTTON   "OK",IDOK,130,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,130,24,50,14
+END
+
+IDD_RAD_PROP_EDIT DIALOG DISCARDABLE  0, 0, 87, 368
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- Edit プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,74,85,285
+    LTEXT           "テキストの配置:",IDC_STATIC,4,304,47,8
+    LTEXT           "キャプション:",IDC_STATIC,3,45,38,8
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,54,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,85,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,96,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,107,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,118,52,10
+    CONTROL         "複数行",IDC_ES_MULTILINE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,136,37,10
+    CONTROL         "番号",IDC_ES_NUMBER,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,147,30,10
+    CONTROL         "水平スクロール バー",IDC_STYLE_HSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,165,77,10
+    CONTROL         "水平オート スクロール",IDC_ES_AUTOHSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,176,81,10
+    CONTROL         "垂直スクロール バー",IDC_STYLE_VSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,187,77,10
+    CONTROL         "垂直オート スクロール",IDC_ES_AUTOVSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,198,81,10
+    CONTROL         "パスワード",IDC_ES_PASSWORD,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,216,47,10
+    CONTROL         "常に選択を表示",IDC_ES_NOHIDESEL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,227,62,10
+    CONTROL         "OEM変換",IDC_ES_OEMCONVERT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,238,43,10
+    CONTROL         "改行を許可",IDC_ES_WANTRETURN,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,249,49,10
+    CONTROL         "大文字変換",IDC_ES_UPPERCASE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,267,50,10
+    CONTROL         "小文字変換",IDC_ES_LOWERCASE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,278,50,10
+    CONTROL         "読み取り専用",IDC_ES_READONLY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,289,55,10
+    COMBOBOX        IDC_ES_TEXTPOS,11,315,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,338,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_STATIC DIALOG DISCARDABLE  0, 0, 87, 233
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- Static プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,74,85,153
+    LTEXT           "テキストの配置:",IDC_STATIC,4,173,47,8
+    LTEXT           "キャプション:",IDC_STATIC,3,45,38,8
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,54,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,85,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,96,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,107,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,118,52,10
+    CONTROL         "プリフィックスなし",IDC_SS_NOPREFIX,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,136,66,10
+    CONTROL         "折り返しなし",IDC_SS_LEFTNOWORDWRAP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,147,51,10
+    CONTROL         "通知",IDC_SS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,158,30,10
+    COMBOBOX        IDC_SS_TEXTPOS,11,184,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,207,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_CHECKBOX DIALOG DISCARDABLE  0, 0, 87, 320
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- CheckBox プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,74,85,240
+    LTEXT           "水平方向の配置:",IDC_STATIC,4,237,50,8
+    LTEXT           "垂直方向の配置",IDC_STATIC,4,266,49,8
+    LTEXT           "キャプション:",IDC_STATIC,3,45,38,8
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,54,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,85,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,96,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,107,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,118,52,10
+    CONTROL         "自動チェック",IDC_BS_AUTO,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,136,52,10
+    CONTROL         "3 ステート",IDC_BS_3STATE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,147,46,10
+    CONTROL         "プッシュ ボタン型",IDC_BS_PUSHLIKE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,158,66,10
+    CONTROL         "左揃えテキスト",IDC_BS_LEFTTEXT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,169,60,10
+    CONTROL         "アイコン",IDC_BS_ICON,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,187,39,10
+    CONTROL         "ビットマップ",IDC_BS_BITMAP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,198,49,10
+    CONTROL         "複数行",IDC_BS_MULTILINE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,209,37,10
+    CONTROL         "通知",IDC_BS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,220,30,10
+    COMBOBOX        IDC_BS_HPOS,11,246,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_BS_VPOS,11,275,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,295,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_RADIOBUTTON DIALOG DISCARDABLE  0, 0, 87, 310
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- RadioButton プロパティ -",IDC_STATIC,0,3,86,8
+    LTEXT           "キャプション:",IDC_STATIC,3,45,38,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,74,85,230
+    LTEXT           "水平方向の配置:",IDC_STATIC,4,226,50,8
+    LTEXT           "垂直方向の配置",IDC_STATIC,4,255,49,8
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,54,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,85,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,96,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,107,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,118,52,10
+    CONTROL         "自動チェック",IDC_BS_AUTO,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,136,52,10
+    CONTROL         "プッシュ ボタン型",IDC_BS_PUSHLIKE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,147,66,10
+    CONTROL         "左揃えテキスト",IDC_BS_LEFTTEXT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,158,60,10
+    CONTROL         "アイコン",IDC_BS_ICON,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,176,39,10
+    CONTROL         "ビットマップ",IDC_BS_BITMAP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,187,49,10
+    CONTROL         "複数行",IDC_BS_MULTILINE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,198,37,10
+    CONTROL         "通知",IDC_BS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,209,30,10
+    COMBOBOX        IDC_BS_HPOS,11,235,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_BS_VPOS,11,264,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,284,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_SCROLLBAR DIALOG DISCARDABLE  0, 0, 87, 148
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ScrollBar プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,45,85,96
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "配置:",IDC_STATIC,4,106,16,8
+    EDITTEXT        IDC_IDNAME,1,25,63,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,56,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,67,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,78,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,89,52,10
+    COMBOBOX        IDC_SBS_POSITION,23,104,60,54,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,123,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_ITEM_RENAMECAPTION DIALOG DISCARDABLE  0, 0, 163, 45
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "キャプション変更"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    EDITTEXT        IDC_CAPTION,7,17,90,14,ES_AUTOHSCROLL
+    LTEXT           "キャプション:",IDC_STATIC,7,7,38,8
+    DEFPUSHBUTTON   "OK",IDOK,107,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,107,24,50,14
+END
+
+IDD_RAD_PROP_LISTBOX DIALOG DISCARDABLE  0, 0, 87, 325
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ListBox プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,44,85,275
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "選択:",IDC_STATIC,4,103,16,8
+    LTEXT           "オーナー描画:",IDC_STATIC,4,132,42,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,55,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,66,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,77,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,88,52,10
+    COMBOBOX        IDC_LBS_SELECT,11,113,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_LBS_OWNERDRAW,11,142,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "文字列あり",IDC_LBS_HASSTRINGS,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,163,48,10
+    CONTROL         "複数列",IDC_LBS_MULTICOLUMN,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,174,37,10
+    CONTROL         "ソート",IDC_LBS_SORT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,192,33,10
+    CONTROL         "通知",IDC_LBS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,203,30,10
+    CONTROL         "水平スクロール バー",IDC_STYLE_HSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,221,77,10
+    CONTROL         "垂直スクロール バー",IDC_STYLE_VSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,232,78,10
+    CONTROL         "スクロールバーを表示",IDC_LBS_DISABLENOSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,243,79,10
+    CONTROL         "再描画しない",IDC_LBS_NOREDRAW,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,261,54,10
+    CONTROL         "タブ ストップを使用",IDC_LBS_USETABSTOPS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,272,71,10
+    CONTROL         "キーボード入力を検出",IDC_LBS_WANTKEYBOARDINPUT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,283,80,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,299,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_LISTVIEW DIALOG DISCARDABLE  0, 0, 87, 348
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ListView プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,44,85,297
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "表示:",IDC_STATIC,4,103,16,8
+    LTEXT           "配置:",IDC_STATIC,4,132,16,8
+    LTEXT           "ソート:",IDC_STATIC,4,161,19,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,55,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,66,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,77,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,88,52,10
+    COMBOBOX        IDC_LVS_VIEW,11,113,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_LVS_POSITION,11,142,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_LVS_SORT,11,171,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    CONTROL         "単一選択",IDC_LVS_SINGLESEL,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,192,43,10
+    CONTROL         "自動整列",IDC_LVS_AUTOARRANGE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,203,43,10
+    CONTROL         "ラベルを折り返さない",IDC_LVS_NOLABELWRAP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,214,77,10
+    CONTROL         "ラベルの編集",IDC_LVS_EDITLABELS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,225,55,10
+    CONTROL         "スクロールしない",IDC_LVS_NOSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,243,65,10
+    CONTROL         "ｶﾗﾑにﾍｯﾀﾞをつけない",IDC_LVS_NOCOLUMNHEADER,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,254,78,10
+    CONTROL         "ヘッダをソートしない",IDC_LVS_NOSORTHEADER,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,265,79,10
+    CONTROL         "選択を常に表示",IDC_LVS_SHOWSELALWAYS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,276,62,10
+    CONTROL         "オーナー描画固定",IDC_LVS_OWNERDRAWFIXED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,296,70,10
+    CONTROL         "共有イメージリスト",IDC_LVS_SHAREIMAGELISTS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,307,80,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,323,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_TREEVIEW DIALOG DISCARDABLE  0, 0, 87, 292
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- TreeView プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,45,85,240
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,63,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,56,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,67,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,78,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,89,52,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,265,78,13,BS_MULTILINE
+    CONTROL         "ボタンあり",IDC_TVS_HASBUTTONS,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,105,45,10
+    CONTROL         "線を表示",IDC_TVS_HASLINES,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,116,42,10
+    CONTROL         "ルートにも線を表示",IDC_TVS_LINESATROOT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,127,73,10
+    CONTROL         "ラベルの編集",IDC_TVS_EDITLABELS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,145,55,10
+    CONTROL         "ﾄﾞﾗｯｸﾞ && ﾄﾞﾛｯﾌﾟを無効",IDC_TVS_DISABLEDRAGDROP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,156,80,10
+    CONTROL         "選択を常に表示",IDC_TVS_SHOWSELALWAYS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,167,62,10
+    CONTROL         "スクロールなし",IDC_TVS_NOSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,185,59,10
+    CONTROL         "ツールヒントなし",IDC_TVS_NOTOOLTIPS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,196,62,10
+    CONTROL         "チェック ボックス",IDC_TVS_CHECKBOXES,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,216,64,10
+    CONTROL         "全行選択",IDC_TVS_FULLROWSELECT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,227,43,10
+    CONTROL         "トラック選択",IDC_TVS_TRACKSELECT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,238,51,10
+    CONTROL         "シングル拡張",IDC_TVS_SINGLEEXPAND,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,249,55,10
+END
+
+IDD_RAD_PROP_IMAGEBOX DIALOG DISCARDABLE  0, 0, 87, 233
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ImageBox プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,45,85,182
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "タイプ:",IDC_STATIC,4,108,19,8
+    EDITTEXT        IDC_IDNAME,1,25,63,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,56,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,67,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,78,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,89,52,10
+    COMBOBOX        IDC_IMAGE_TYPE,25,106,58,140,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,207,78,13,BS_MULTILINE
+    EDITTEXT        IDC_PATH,4,150,58,14,ES_AUTOHSCROLL | ES_READONLY | NOT 
+                    WS_VISIBLE
+    LTEXT           "image situation",IDC_IMAGE_SITUATION,4,140,73,8,NOT 
+                    WS_VISIBLE
+    PUSHBUTTON      "...",IDC_CHANGEPATH,64,150,18,14,NOT WS_VISIBLE
+    CONTROL         "通知",IDC_SS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,170,30,10
+    CONTROL         "中央配置",IDC_SS_CENTERIMAGE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,181,43,10
+    CONTROL         "右に揃える",IDC_SS_RIGHTJUST,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,192,48,10
+    CONTROL         "ファイル",IDC_FILE,"Button",BS_AUTORADIOBUTTON | NOT 
+                    WS_VISIBLE,5,125,35,10
+    CONTROL         "リソース",IDC_RESOURCE,"Button",BS_AUTORADIOBUTTON | 
+                    NOT WS_VISIBLE,45,125,36,10
+    COMBOBOX        IDC_RESCOMBO,4,150,79,71,CBS_DROPDOWNLIST | CBS_SORT | 
+                    NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_RAD_PROP_COMBOBOX DIALOG DISCARDABLE  0, 0, 87, 312
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ComboBox プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,44,85,261
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "タイプ:",IDC_STATIC,4,103,19,8
+    LTEXT           "オーナー描画:",IDC_STATIC,4,132,42,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,55,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,66,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,77,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,88,52,10
+    COMBOBOX        IDC_CBS_TYPE,11,113,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    COMBOBOX        IDC_CBS_OWNERDRAW,11,142,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "文字列あり",IDC_CBS_HASSTRINGS,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,163,48,10
+    CONTROL         "ソート",IDC_CBS_SORT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,181,33,10
+    CONTROL         "サイズ調整",IDC_CBS_NOINTEGRALHEIGHT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,192,49,10
+    CONTROL         "OEM 変換",IDC_CBS_OEMCONVERT,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,203,46,10
+    CONTROL         "垂直スクロール バー",IDC_STYLE_VSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,221,78,10
+    CONTROL         "水平オート スクロール",IDC_CBS_AUTOHSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,232,81,10
+    CONTROL         "スクロールバーを表示",IDC_CBS_DISABLENOSCROLL,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,243,79,10
+    CONTROL         "大文字変換",IDC_CBS_UPPERCASE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,261,50,10
+    CONTROL         "小文字変換",IDC_CBS_LOWERCASE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,272,50,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,286,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_GROUPBOX DIALOG DISCARDABLE  0, 0, 87, 227
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- GroupBox プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,74,85,147
+    LTEXT           "水平方向の配置:",IDC_STATIC,4,134,50,8
+    LTEXT           "キャプション:",IDC_STATIC,3,45,38,8
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMECAPTION,68,54,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,85,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,96,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,107,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,118,52,10
+    COMBOBOX        IDC_BS_POSITION,11,145,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "アイコン",IDC_BS_ICON,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,165,39,10
+    CONTROL         "ビットマップ",IDC_BS_BITMAP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,176,49,10
+    CONTROL         "通知",IDC_BS_NOTIFY,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,187,30,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,201,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_UPDOWN DIALOG DISCARDABLE  0, 0, 87, 246
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- UpDown プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,44,85,196
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "方向:",IDC_STATIC,4,103,16,8
+    LTEXT           "アタッチ",IDC_STATIC,4,132,24,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,55,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,66,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,77,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,88,52,10
+    COMBOBOX        IDC_UDS_SITUATION,11,113,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_UDS_ATTACH,11,142,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "自動関連付け",IDC_UDS_AUTOBUDDY,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,163,57,10
+    CONTROL         "数値の自動表示",IDC_UDS_SETBUDDYINT,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,174,64,10
+    CONTROL         "桁区切りなし",IDC_UDS_NOTHOUSANDS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,185,53,10
+    CONTROL         "ワードラップ",IDC_UDS_WRAP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,196,51,10
+    CONTROL         "方向キー",IDC_UDS_ARROWKEYS,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,207,41,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,221,78,13,BS_MULTILINE
+END
+
+IDD_RAD_PROP_PROGRESSBAR DIALOG DISCARDABLE  0, 0, 87, 156
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- ProgressBar プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,45,85,106
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,63,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,56,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,67,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,78,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,89,52,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,132,78,13,BS_MULTILINE
+    CONTROL         "垂直方向",IDC_PBS_VERTICAL,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,105,43,10
+    CONTROL         "スムーズ",IDC_PBS_SMOOTH,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,116,43,10
+END
+
+IDD_RAD_PROP_TRACKBAR DIALOG DISCARDABLE  0, 0, 87, 224
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- TrackBar プロパティ -",IDC_STATIC,0,3,86,8
+    GROUPBOX        "スタイル",IDC_STATIC,1,44,85,173
+    LTEXT           "ID:",IDC_STATIC,3,15,8,8
+    LTEXT           "方向:",IDC_STATIC,4,103,16,8
+    LTEXT           "ポイント:",IDC_STATIC,4,132,24,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAMEID,68,24,18,14
+    CONTROL         "無効（使用不可）",IDC_STYLE_DISABLED,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,55,64,10
+    CONTROL         "可視",IDC_STYLE_VISIBLE,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,66,30,10
+    CONTROL         "グループ",IDC_STYLE_GROUP,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,77,42,10
+    CONTROL         "タブ ストップ",IDC_STYLE_TABSTOP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,88,52,10
+    COMBOBOX        IDC_TBS_SITUATION,11,113,67,62,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_TBS_POINT,11,142,67,62,CBS_DROPDOWNLIST | WS_VSCROLL | 
+                    WS_TABSTOP
+    CONTROL         "マークなし",IDC_TBS_NOTICKS,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,163,46,10
+    CONTROL         "マーク自動設定",IDC_TBS_AUTOTICKS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,174,62,10
+    CONTROL         "選択可能",IDC_TBS_ENABLESELRANGE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,4,185,43,10
+    PUSHBUTTON      "拡張スタイル",IDC_EXSTYLE,4,199,78,13,BS_MULTILINE
+END
+
+IDD_PROJECT_MENUEDIT DIALOG DISCARDABLE  0, 0, 87, 191
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CTEXT           "- メニュー エディタ -",IDC_STATIC,0,3,86,8
+    LTEXT           "キャプション:",IDC_CAPTIONSTATIC,3,45,38,8
+    LTEXT           "ID:",IDC_IDSTATIC,3,15,8,8
+    EDITTEXT        IDC_IDNAME,1,25,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "変更",IDC_RENAME,68,24,18,43
+    EDITTEXT        IDC_CAPTION,1,55,65,12,ES_AUTOHSCROLL | ES_READONLY
+    PUSHBUTTON      "↑",IDC_UP,26,170,14,14
+    PUSHBUTTON      "↓",IDC_DOWN,43,170,14,14
+    CONTROL         "チェック",IDC_CHECKED,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,98,38,10
+    CONTROL         "無効",IDC_DISABLED,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,109,30,10
+    PUSHBUTTON      "挿入",IDC_INSERTMENUITEM,5,132,76,14
+    PUSHBUTTON      "削除",IDC_DELETEMENUITEM,5,150,76,14
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,2,124,83,1
+    CHECKBOX        "ポップアップ",IDC_POPUP,4,76,51,10
+    CONTROL         "セパレータ",IDC_SEPARATOR,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,4,87,47,10
+END
+
+IDD_INPUTID DIALOG DISCARDABLE  0, 0, 170, 45
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "新規メニュー"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LTEXT           "メニュー ID:",IDC_STATIC,7,11,35,8
+    EDITTEXT        IDC_IDNAME,44,7,63,14,ES_AUTOHSCROLL
+    DEFPUSHBUTTON   "OK",IDOK,112,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,112,24,50,14
+END
+
+IDD_PJ_OPTION2 DIALOG DISCARDABLE  0, 0, 203, 83
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Win32API"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CONTROL         "コモン コントロールを使用する（api_commctrl.sbp）",
+                    IDC_API_COMMCTRL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,
+                    7,159,10
+    CONTROL         "マルチメディアAPIを使用する（api_mmsys.sbp）",
+                    IDC_API_MMSYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,19,
+                    150,10
+    CONTROL         "リッチエディット コントロールを使用する（api_richedit.sbp）",
+                    IDC_API_RICHEDIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,
+                    31,181,10
+    CONTROL         "ソケットAPIを使用する（api_winsock2.sbp）",
+                    IDC_API_WINSOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,7,
+                    43,136,10
+END
+
+IDD_NEWPROJECT_PAGE2 DIALOG DISCARDABLE  0, 0, 310, 177
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ステップ2 （プロジェクト オプション）"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    GROUPBOX        "Win32API",IDC_STATIC,7,46,189,64
+    CONTROL         "コモン コントロールを使用する（api_commctrl.sbp）",
+                    IDC_API_COMMCTRL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    13,59,159,10
+    CONTROL         "マルチメディアAPIを使用する（api_mmsys.sbp）",
+                    IDC_API_MMSYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,
+                    71,150,10
+    CONTROL         "リッチエディット コントロールを使用する（api_richedit.sbp）",
+                    IDC_API_RICHEDIT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+                    13,83,181,10
+    CONTROL         "ソケットAPIを使用する（api_winsock2.sbp）",
+                    IDC_API_WINSOCK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,
+                    95,136,10
+    CONTROL         "厳密な型チェックを行う（#strict指定）",IDC_STRICT,
+                    "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,13,
+                    21,130,10
+    GROUPBOX        "一般",IDC_STATIC,7,7,189,30
+END
+
+IDD_PROJECT_MENURENAME DIALOG DISCARDABLE  0, 0, 167, 69
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "メニューID、キャプション設定"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    EDITTEXT        IDC_CAPTION,7,48,90,14,ES_AUTOHSCROLL
+    LTEXT           "キャプション",IDC_STATIC,7,38,36,8
+    DEFPUSHBUTTON   "OK",IDOK,110,30,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,110,47,50,14
+    EDITTEXT        IDC_IDNAME,7,17,90,14,ES_AUTOHSCROLL
+    LTEXT           "ID",IDC_IDSTATIC,7,7,8,8
+END
+
+IDD_OPTION_RAD DIALOG DISCARDABLE  0, 0, 187, 93
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "RADツール"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CONTROL         "ライン アジャスタを有効にする",IDC_LINEADJUST,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,7,7,103,10
+END
+
+IDD_OPTION_FILELINK DIALOG DISCARDABLE  0, 0, 187, 117
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ファイルの関連付け"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "関連付ける",IDOK,130,79,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,130,96,50,14
+    GROUPBOX        "拡張子",IDC_STATIC,7,7,173,63
+    CONTROL         ".bas（Basicプログラム ファイル）",IDC_BAS,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,13,21,107,10
+    CONTROL         ".abp（Basicプログラム ファイル）",IDC_ABP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,13,32,107,10
+    CONTROL         ".sbp（サブ プログラム ファイル）",IDC_SBP,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,13,43,106,10
+    CONTROL         ".pj（プロジェクト ファイル）",IDC_PJ,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,13,54,89,10
+    LTEXT           "注意: 他のアプリケーションで使用する拡張子はチェックをはずして下さい。",
+                    IDC_STATIC,7,79,111,22
+END
+
+IDD_RAD_SUPPORT DIALOGEX 0, 0, 321, 37
+STYLE WS_CHILD
+EXSTYLE WS_EX_STATICEDGE
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    LTEXT           "X",IDC_STATIC,69,7,8,8
+    LTEXT           "Y",IDC_STATIC,69,23,8,8
+    LTEXT           "幅",IDC_STATIC,142,7,8,8
+    LTEXT           "高さ",IDC_STATIC,142,23,16,8
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDVERT,132,0,1,35
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDVERT,61,1,1,34
+    PUSHBUTTON      "テスト",IDC_TEST,6,11,50,14
+    EDITTEXT        IDC_XPOS,80,3,40,14,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "Spin1",IDC_SPIN1,"msctls_updown32",UDS_SETBUDDYINT | 
+                    UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,248,4,9,
+                    14
+    EDITTEXT        IDC_YPOS,80,19,40,14,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "Spin1",IDC_SPIN2,"msctls_updown32",UDS_SETBUDDYINT | 
+                    UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,248,21,
+                    9,14
+    EDITTEXT        IDC_WIDTH,161,3,40,14,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "Spin1",IDC_SPIN3,"msctls_updown32",UDS_SETBUDDYINT | 
+                    UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,262,5,9,
+                    14
+    EDITTEXT        IDC_HEIGHT,161,19,40,14,ES_AUTOHSCROLL | ES_NUMBER
+    CONTROL         "Spin1",IDC_SPIN4,"msctls_updown32",UDS_SETBUDDYINT | 
+                    UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS,262,21,
+                    9,14
+END
+
+IDD_PJ_OPTION1 DIALOG DISCARDABLE  0, 0, 203, 143
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "一般"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    GROUPBOX        "出力ファイル",IDC_STATIC,7,7,189,79
+    EDITTEXT        IDC_EDIT_RELEASE,13,31,177,14,ES_AUTOHSCROLL
+    LTEXT           "Release:",IDC_STATIC,13,21,26,8
+    EDITTEXT        IDC_EDIT_DEBUG,13,61,177,14,ES_AUTOHSCROLL
+    LTEXT           "Debug:",IDC_STATIC,13,51,20,8
+    GROUPBOX        "コンパイル オプション",IDC_STATIC,7,89,189,30
+    CONTROL         "厳密な型チェックを行う（#strict指定）",IDC_STRICT,
+                    "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,103,122,10
+END
+
+IDD_ICONEDIT_TOOL DIALOG DISCARDABLE  0, 0, 88, 266
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    COMBOBOX        IDC_ICONTYPECOMBO,10,12,69,104,CBS_DROPDOWNLIST | 
+                    WS_VSCROLL | WS_TABSTOP
+    PUSHBUTTON      "追加",IDC_ADD_ICONTYPE,12,30,30,14
+    PUSHBUTTON      "削除",IDC_DELETE_ICONTYPE,46,30,30,14
+    GROUPBOX        "タイプ",IDC_STATIC,5,1,78,59
+    GROUPBOX        "ツール",IDC_STATIC,5,68,78,190
+END
+
+IDD_ICONEDIT_COLOR DIALOG DISCARDABLE  0, 0, 227, 43
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    CONTROL         "",IDC_STATIC_COLOR,"Static",SS_BLACKFRAME | NOT 
+                    WS_VISIBLE,22,3,161,34
+    CONTROL         "",IDC_NOWCOLOR,"Static",SS_ETCHEDFRAME,3,3,16,17
+END
+
+IDD_ICONEDIT_BUTTONS DIALOG DISCARDABLE  0, 0, 59, 158
+STYLE WS_CHILD | WS_VISIBLE
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+END
+
+IDD_ICONEDIT_ICONTYPE DIALOG DISCARDABLE  0, 0, 154, 73
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "アイコンタイプを選んでください"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,97,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,97,24,50,14
+    LISTBOX         IDC_TYPELIST,7,7,84,59,LBS_SORT | LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL | WS_TABSTOP
+END
+
+IDD_OPTION_COLOR DIALOGEX 0, 0, 254, 182
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "デザイン"
+FONT 9, "ＭＳ Ｐゴシック", 0, 0, 0x1
+BEGIN
+    LTEXT           "指定する部分:",IDC_STATIC_PARTS,7,39,42,8
+    LTEXT           "サンプル:",IDC_STATIC,7,75,28,8
+    LTEXT           "テーマ:",IDC_STATIC,7,6,22,8
+    COMBOBOX        IDC_THEME,7,17,100,91,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    COMBOBOX        IDC_TARGET,7,49,100,91,CBS_DROPDOWNLIST | CBS_SORT | 
+                    WS_VSCROLL | WS_TABSTOP
+    CONTROL         "",IDC_COLOR_BUTTON,"Button",BS_OWNERDRAW | WS_TABSTOP,
+                    111,49,20,12
+    CONTROL         "",IDC_SAMPLE,"Button",BS_OWNERDRAW | WS_TABSTOP,7,85,
+                    190,90,WS_EX_CLIENTEDGE
+    PUSHBUTTON      "保存(&S)",IDC_SAVE,110,16,35,14
+END
+
+IDD_CODE_SAVE DIALOG DISCARDABLE  0, 0, 151, 110
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "文字コードを指定して保存"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    LISTBOX         IDC_LIST_CHARCODE,7,17,64,86,LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL | WS_TABSTOP
+    LISTBOX         IDC_LIST_LFCODE,76,17,68,41,LBS_NOINTEGRALHEIGHT | 
+                    WS_VSCROLL | WS_TABSTOP
+    DEFPUSHBUTTON   "上書き保存",IDOK,86,72,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,86,89,50,14
+    LTEXT           "文字コード",IDC_STATIC,7,7,32,8
+    LTEXT           "改行コード",IDC_STATIC,77,7,32,8
+END
+
+IDD_PJ_OPTION3 DIALOG DISCARDABLE  0, 0, 203, 132
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "デバッグ"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    GROUPBOX        "コマンドライン",IDC_STATIC,7,7,192,61
+    EDITTEXT        IDC_CMD_LINE,13,20,177,42,ES_MULTILINE
+    GROUPBOX        "デバッグセッションの実行可能ファイル（DLLのみ）",
+                    IDC_STATIC_DEBUG,7,74,192,51
+    EDITTEXT        IDC_EXE_PATH,13,88,177,14,ES_AUTOHSCROLL
+    PUSHBUTTON      "参照...",IDC_DIR,161,106,29,14
+END
+
+IDD_EXTENSION_LINK DIALOG DISCARDABLE  0, 0, 231, 216
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ファイルの種類設定と関連付け"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "関連付ける",IDOK,173,178,50,14
+    PUSHBUTTON      "閉じる",IDCANCEL,173,195,50,14
+    LTEXT           "注意: 他のアプリケーションで使用する拡張子はチェックを外してください。",
+                    IDC_STATIC,37,180,111,22
+    CONTROL         "List1",IDC_EXTENSION_LIST,"SysListView32",LVS_REPORT | 
+                    LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | 
+                    WS_TABSTOP,7,7,217,133
+    PUSHBUTTON      "新規(&N)",IDC_ADD_BUTTON,67,145,50,14
+    PUSHBUTTON      "削除(&D)",IDC_DELETE_BUTTON,173,145,50,14
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,170,217,1
+    PUSHBUTTON      "編集(&E)",IDC_EDIT_BUTTON,120,145,50,14
+END
+
+IDD_STRING_COUNT DIALOG DISCARDABLE  0, 0, 143, 85
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "文字カウント"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "閉じる",IDCANCEL,86,64,50,14
+    LTEXT           "総バイト数",IDC_STATIC,7,7,32,8
+    LTEXT           "文字数（スペースを含めない）",IDC_STATIC,7,18,86,8
+    LTEXT           "文字数（スペースを含む）",IDC_STATIC,7,29,74,8
+    LTEXT           "行数",IDC_STATIC,7,40,15,8
+    RTEXT           "byte",IDC_SCOUNT_BYTE,98,7,39,8
+    RTEXT           "omit space",IDC_SCOUNT_OMIT_SPACE,98,18,39,8
+    RTEXT           "with space",IDC_SCOUNT_WITH_SPACE,98,29,39,8
+    RTEXT           "linenum",IDC_SCOUNT_LINENUM,98,40,39,8
+    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,56,129,1
+END
+
+IDD_EXTENSION_ADD DIALOG DISCARDABLE  0, 0, 227, 108
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "拡張子を追加"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,117,87,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,170,87,50,14
+    EDITTEXT        IDC_EXTENSION,59,7,40,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_NOTE,59,26,80,14,ES_AUTOHSCROLL
+    LTEXT           "拡張子:",IDC_STATIC,7,11,23,8
+    LTEXT           "説明:",IDC_STATIC,7,30,16,8
+    LTEXT           "Windows検索:",IDC_STATIC,7,49,41,8
+    CONTROL         "有効",IDC_SEARCH_ON,"Button",BS_AUTORADIOBUTTON,66,49,
+                    30,10
+    CONTROL         "無効",IDC_SEARCH_OFF,"Button",BS_AUTORADIOBUTTON,98,49,
+                    30,10
+    LTEXT           "（例：txt）",IDC_STATIC,143,11,26,8
+    LTEXT           "（例：テキスト ドキュメント）",IDC_STATIC,143,30,77,8
+    LTEXT           "タブの色",IDC_STATIC_TABCOLOR,7,70,26,8
+    CONTROL         "",IDC_COLOR_BUTTON,"Button",BS_OWNERDRAW | WS_TABSTOP,
+                    60,67,20,12
+    LTEXT           "←ここをクリックして変更できます",IDC_STATIC_TABCOLOR2,
+                    84,70,123,8
+END
+
+IDD_OPTION_WEB DIALOG DISCARDABLE  0, 0, 250, 195
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Web検索"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    GROUPBOX        "ドメイン検索",IDC_STATIC,7,38,236,135
+    CONTROL         "List2",IDC_DOMAIN_LIST,"SysListView32",LVS_REPORT | 
+                    LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_BORDER | 
+                    WS_TABSTOP,13,51,164,116
+    PUSHBUTTON      "新規(&N)",IDC_ADD,187,50,50,14
+    PUSHBUTTON      "削除(&D)",IDC_DELETE,187,68,50,14
+    CONTROL         "Ctrlキーによる単語リンクを有効にする",
+                    IDC_CTRLKEY_HYPERLINK,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,7,7,127,10
+    PUSHBUTTON      "編集(&E)",IDC_EDIT,187,86,50,14
+    CONTROL         "アプリケーション終了時にWeb検索文字列を保存する",
+                    IDC_SAVE_WEBFINDSTR,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,7,20,169,10
+END
+
+IDD_OPTION_WEB_DOMAIN_ADD DIALOG DISCARDABLE  0, 0, 245, 77
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Web検索用ドメインを追加"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,135,56,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,188,56,50,14
+    EDITTEXT        IDC_NAME,59,7,67,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_DOMAIN,59,26,113,14,ES_AUTOHSCROLL
+    LTEXT           "表示名:",IDC_STATIC,7,11,23,8
+    LTEXT           "ドメイン:",IDC_STATIC,7,30,23,8
+    LTEXT           "（例：辞書）",IDC_STATIC,176,11,32,8
+    LTEXT           "（例：ja.wikipedia.org）",IDC_STATIC,176,30,62,8
+END
+
+IDD_PREVIEW DIALOG DISCARDABLE  0, 0, 354, 429
+STYLE WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
+CAPTION "印刷プレビュー"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "閉じる",IDOK,13,7,50,14
+    PUSHBUTTON      "ページ設定",IDC_PAGESET,13,57,50,14
+    PUSHBUTTON      "フォント",IDC_FONT,13,79,50,14
+    PUSHBUTTON      "印刷",IDC_PRINT,278,7,50,14
+    PUSHBUTTON      "前へ",IDC_PREV,85,7,50,14
+    PUSHBUTTON      "次へ",IDC_NEXT,138,7,50,14
+    GROUPBOX        "設定",IDC_STATIC,7,43,62,121,BS_CENTER
+    CONTROL         "ページ番号",IDC_SHOWPAGENUM,"Button",BS_AUTOCHECKBOX | 
+                    WS_TABSTOP,13,111,49,10
+    EDITTEXT        IDC_PAGESTR,13,121,49,14,ES_AUTOHSCROLL
+    LTEXT           """&&n""がページ番号に置き換わります",IDC_STATIC,11,138,
+                    54,25
+    PUSHBUTTON      "Button2",IDC_ZOOMIN,223,7,19,14,BS_ICON
+    PUSHBUTTON      "Button2",IDC_ZOOMOUT,202,7,19,14,BS_ICON
+    LTEXT           "100%",IDC_ZOOMRATIO,246,12,29,8
+END
+
+IDD_OPTION_THEME_SAVE DIALOG DISCARDABLE  0, 0, 195, 52
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "デザイン テーマの保存"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "保存する",IDOK,138,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,138,24,50,14
+    LTEXT           "テーマ名",IDC_STATIC,7,10,27,8
+    EDITTEXT        IDC_NAME,40,7,86,14,ES_AUTOHSCROLL
+    CONTROL         "上書きを許可する",IDC_OVERWRITE,"Button",
+                    BS_AUTOCHECKBOX | WS_TABSTOP,40,27,67,10
+END
+
+IDD_PASSWORD DIALOG DISCARDABLE  0, 0, 187, 45
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "TheText"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,130,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,130,24,50,14
+    EDITTEXT        IDC_PASSWORD,7,20,110,14,ES_AUTOHSCROLL
+    LTEXT           "シリアルIDを入力してください",IDC_STATIC,7,7,84,8
+END
+
+IDD_PROFESSIONAL_START DIALOG DISCARDABLE  0, 0, 251, 110
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "TheText Pro版について"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "引き続きTheTextを利用する",IDCANCEL,65,84,116,19
+    LTEXT           "  TheText Proをご利用いただき、ありがとうございます。シリアルIDを正常に認証致しました。\n  準備が整いましたので、引き続きTheTextをご利用ください。\n\n\n※このメッセージは初回のみ表示されるものです。",
+                    IDC_STATIC,94,13,148,65
+    CONTROL         302,IDC_STATIC,"Static",SS_BITMAP,7,7,79,65
+END
+
+IDD_RESERVE DIALOG DISCARDABLE  0, 0, 269, 214
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "ﾀﾞｲｱﾛｸﾞ"
+FONT 9, "ＭＳ Ｐゴシック"
+BEGIN
+    DEFPUSHBUTTON   "OK",IDOK,212,7,50,14
+    PUSHBUTTON      "ｷｬﾝｾﾙ",IDCANCEL,212,24,50,14
+    PUSHBUTTON      "Button1",IDD_PJ_OPTION4,7,7,50,14
+    PUSHBUTTON      "Button2",IDC_UNICODE,7,27,50,14
+    PUSHBUTTON      "IDC_PASTEINDENT",IDC_PASTEINDENT,7,48,50,14
+    PUSHBUTTON      "Button4",IDC_RC_MANIFEST,7,77,50,14
+    PUSHBUTTON      "Button5",IDC_STATIC_PATH,70,7,50,14
+    PUSHBUTTON      "Button6",IDM_STEP_IN,66,29,50,14
+    PUSHBUTTON      "Button7",IDM_STEP_OUT,75,53,50,14
+    PUSHBUTTON      "Button8",IDM_STEP_CURSOR,71,77,50,14
+    PUSHBUTTON      "Button9",IDM_DEBUG_PAUSE,138,7,50,14
+    PUSHBUTTON      "Button10",IDM_DEBUG_STOP,137,28,50,14
+    PUSHBUTTON      "Button11",IDM_RELEASERUN,139,43,50,14
+    PUSHBUTTON      "Button12",IDM_STEP_OVER,142,77,50,14
+    PUSHBUTTON      "Button13",IDM_BREAKPOINT,7,96,50,14
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE 
+BEGIN
+    IDD_ABOUT, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 231
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 114
+    END
+
+    IDD_FIND, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 228
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 77
+    END
+
+    IDD_FINDALL, DIALOG
+    BEGIN
+        TOPMARGIN, 2
+    END
+
+    IDD_OPTION_WHOLE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 188
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 96
+    END
+
+    IDD_PERMUTATION, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 260
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 97
+    END
+
+    IDD_NEWFILE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 200
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 98
+    END
+
+    IDD_OPTION_EDITOR, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 244
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 167
+    END
+
+    IDD_OPTION_TOOLBAR, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 180
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 86
+    END
+
+    IDD_NEWPROJECT_PAGE1, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 303
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 170
+    END
+
+    IDD_NEWPROJECT_PAGE3, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 303
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 170
+    END
+
+    IDD_PROJECT_FILEPROPERTY, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 223
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 70
+    END
+
+    IDD_RAD_CTRLBUTTONS, DIALOG
+    BEGIN
+        LEFTMARGIN, 1
+        RIGHTMARGIN, 87
+        TOPMARGIN, 1
+        BOTTOMMARGIN, 89
+    END
+
+    IDD_PROJECT_NEWWINDOW, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 164
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 146
+    END
+
+    IDD_RAD_PROP_WINDOW, DIALOG
+    BEGIN
+        RIGHTMARGIN, 86
+        BOTTOMMARGIN, 442
+    END
+
+    IDD_RAD_PROP_WINDOW_RENAME, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 163
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 92
+    END
+
+    IDD_RAD_EVENTCODE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 276
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 198
+    END
+
+    IDD_RAD_PROP_ITEM_RENAMEID, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 158
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 38
+    END
+
+    IDD_RAD_PROP_WINDOW_EXSTYLE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 192
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 120
+    END
+
+    IDD_RAD_PROP_ITEM_EXSTYLE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 180
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 70
+    END
+
+    IDD_RAD_PROP_ITEM_RENAMECAPTION, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 156
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 38
+    END
+
+    IDD_RAD_PROP_IMAGEBOX, DIALOG
+    BEGIN
+        BOTTOMMARGIN, 224
+    END
+
+    IDD_INPUTID, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 163
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 38
+    END
+
+    IDD_PJ_OPTION2, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 196
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 76
+    END
+
+    IDD_NEWPROJECT_PAGE2, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 303
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 170
+    END
+
+    IDD_PROJECT_MENURENAME, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 160
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 62
+    END
+
+    IDD_OPTION_RAD, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 180
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 86
+    END
+
+    IDD_OPTION_FILELINK, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 180
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 110
+    END
+
+    IDD_RAD_SUPPORT, DIALOG
+    BEGIN
+        BOTTOMMARGIN, 35
+    END
+
+    IDD_PJ_OPTION1, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 196
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 136
+    END
+
+    IDD_ICONEDIT_TOOL, DIALOG
+    BEGIN
+        BOTTOMMARGIN, 265
+    END
+
+    IDD_ICONEDIT_COLOR, DIALOG
+    BEGIN
+        RIGHTMARGIN, 187
+        BOTTOMMARGIN, 42
+    END
+
+    IDD_ICONEDIT_BUTTONS, DIALOG
+    BEGIN
+        BOTTOMMARGIN, 157
+    END
+
+    IDD_ICONEDIT_ICONTYPE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 147
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 66
+    END
+
+    IDD_OPTION_COLOR, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 246
+        TOPMARGIN, 6
+        BOTTOMMARGIN, 175
+    END
+
+    IDD_CODE_SAVE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 144
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 103
+    END
+
+    IDD_PJ_OPTION3, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 199
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 125
+    END
+
+    IDD_EXTENSION_LINK, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 224
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 209
+    END
+
+    IDD_STRING_COUNT, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 136
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 78
+    END
+
+    IDD_EXTENSION_ADD, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 220
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 101
+    END
+
+    IDD_OPTION_WEB, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 243
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 188
+    END
+
+    IDD_OPTION_WEB_DOMAIN_ADD, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 238
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 70
+    END
+
+    IDD_PREVIEW, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 347
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 422
+    END
+
+    IDD_OPTION_THEME_SAVE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 188
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 45
+    END
+
+    IDD_PASSWORD, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 180
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 38
+    END
+
+    IDD_PROFESSIONAL_START, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 244
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 103
+    END
+
+    IDD_RESERVE, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 262
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 207
+    END
+END
+#endif    // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_MAIN                ICON    DISCARDABLE     "main.ico"
+IDI_BASICPROGRAM        ICON    DISCARDABLE     "BasicProgram.ico"
+IDI_TEXTDOCUMENT        ICON    DISCARDABLE     "TextDocument.ico"
+IDI_FOLDER_CLOSE        ICON    DISCARDABLE     "folder_close.ico"
+IDI_FOLDER_OPEN         ICON    DISCARDABLE     "folder_open.ico"
+IDI_WINDOW              ICON    DISCARDABLE     "Window.ico"
+IDI_PROCEDURE           ICON    DISCARDABLE     "Procedure.ico"
+IDI_FILE_PJ             ICON    DISCARDABLE     "file_pj.ico"
+IDI_FILE_BAS            ICON    DISCARDABLE     "file_bas.ico"
+IDI_FILE_SBP            ICON    DISCARDABLE     "file_sbp.ico"
+IDI_MENU                ICON    DISCARDABLE     "menu.ico"
+IDI_FILE_ICON           ICON    DISCARDABLE     "file_icon.ico"
+IDI_FILE_BMP            ICON    DISCARDABLE     "file_bmp.ico"
+IDI_FILE_CURSOR         ICON    DISCARDABLE     "ico00001.ico"
+IDI_MEMBER_PRIVATE_FUNCTION ICON    DISCARDABLE     "member_private_function.ico"
+IDI_MEMBER_PUBLIC_FUNCTION ICON    DISCARDABLE     "member_public_function.ico"
+IDI_MEMBER_PRIVATE_VARIABLE ICON    DISCARDABLE     "member_private_variable.ico"
+IDI_MEMBER_PUBLIC_VARIABLE ICON    DISCARDABLE     "member_public_variable.ico"
+IDI_PAIRSTATEMENT       ICON    DISCARDABLE     "pair_statement.ico"
+IDI_VOID                ICON    DISCARDABLE     "ico00002.ico"
+IDI_PROGRAM_FOLDER      ICON    DISCARDABLE     "program_folder.ico"
+IDI_HTML_PARAMETER      ICON    DISCARDABLE     "html_parameter.ico"
+IDI_HTML_GENERAL_PARAMETER ICON    DISCARDABLE     "html_general_parameter.ico"
+IDI_ZOOMOUT             ICON    DISCARDABLE     "zoomout.ico"
+IDI_ZOOMIN              ICON    DISCARDABLE     "zoomin.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Cursor
+//
+
+IDC_CURSOR_PEN          CURSOR  DISCARDABLE     "cursor_pen.cur"
+IDC_CURSOR_FILL         CURSOR  DISCARDABLE     "cursor_fill.cur"
+IDC_CURSOR_ARROW_TO_RIGHT CURSOR  DISCARDABLE     "cursor_arrow_to_right.cur"
+#endif    // 日本語 resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif    // not APSTUDIO_INVOKED
+
Index: tag/abdev(2007.06.20)/res_TheText/resource.h
===================================================================
--- tag/abdev(2007.06.20)/res_TheText/resource.h	(revision 178)
+++ tag/abdev(2007.06.20)/res_TheText/resource.h	(revision 178)
@@ -0,0 +1,614 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by res.rc
+//
+#define IDCANCEL5                       13
+#define IDR_MAINMENU                    101
+#define IDR_ACCELERATOR1                105
+#define IDR_STANDARDTOOLBAR             106
+#define IDD_ABOUT                       108
+#define IDR_BASICTOOLBAR                111
+#define IDI_MAIN                        114
+#define IDI_BASICPROGRAM                118
+#define IDD_FIND                        119
+#define IDR_EDITMENU                    122
+#define IDD_MAKELINENUM                 124
+#define IDD_FINDALL                     126
+#define IDR_REBARMENU                   127
+#define IDD_SETWHOLE                    128
+#define IDD_OPTION_WHOLE                128
+#define IDD_PERMUTATION                 129
+#define IDD_NEWFILE                     130
+#define IDI_TEXTDOCUMENT                131
+#define IDD_SETEDITOR                   132
+#define IDD_OPTION_EDITOR               132
+#define IDD_SETTOOLBAR                  133
+#define IDD_OPTION_TOOLBAR              133
+#define IDD_NEWPROJECT_PAGE1            136
+#define IDB_BASE_NORMAL                 138
+#define IDB_BASE_PROMPT                 139
+#define IDD_NEWPROJECT_PAGE3            140
+#define IDD_PROJECT_VIEW                145
+#define IDR_PROJECTVIEW_FILETREEMENU    146
+#define IDR_PROJECTVIEW_FILETREEROOTMENU 147
+#define IDI_FOLDER_CLOSE                148
+#define IDI_FOLDER_OPEN                 149
+#define IDD_PROJECT_FILEPROPERTY        150
+#define IDI_WINDOW                      151
+#define IDR_PROJECTVIEW_MATERIALTREEMENU 153
+#define IDR_PROJECTVIEW_WINDOWTREEROOTMENU 157
+#define IDD_RAD_CTRLBUTTONS             158
+#define IDD_PROJECT_NEWWINDOW           161
+#define IDR_RADCONTEXTMENU              164
+#define IDD_RAD_PROP_WINDOW             166
+#define IDD_RAD_PROP_BUTTON             167
+#define IDD_RAD_PROP_WINDOW_RENAME      170
+#define IDD_RAD_EVENTCODE               171
+#define IDD_RAD_PROP_ITEM_RENAMEID      172
+#define IDD_RAD_PROP_WINDOW_EXSTYLE     174
+#define IDD_RAD_PROP_ITEM_EXSTYLE       176
+#define IDD_RAD_PROP_EDIT               177
+#define IDD_RAD_PROP_STATIC             178
+#define IDD_RAD_PROP_CHECKBOX           180
+#define IDD_RAD_PROP_RADIOBUTTON        182
+#define IDB_RADIOBUTTON                 183
+#define IDD_RAD_PROP_SCROLLBAR          184
+#define IDB_TITLE_BUTTON_CLOSE          189
+#define IDD_RAD_PROP_ITEM_RENAMECAPTION 190
+#define IDD_RAD_PROP_LISTBOX            192
+#define IDD_RAD_PROP_LISTVIEW           194
+#define IDD_RAD_PROP_TREEVIEW           198
+#define IDD_RAD_PROP_IMAGEBOX           201
+#define IDR_PROJECTVIEW_PROCEDURETREEMENU 202
+#define IDI_PROCEDURE                   203
+#define IDD_RAD_PROP_COMBOBOX           204
+#define IDD_RAD_PROP_GROUPBOX           208
+#define IDD_RAD_PROP_UPDOWN             211
+#define IDD_RAD_PROP_PROGRESSBAR        212
+#define IDD_RAD_PROP_TRACKBAR           214
+#define IDD_PROJECT_MENUEDIT            216
+#define IDD_PROJECT_NEWMENU             217
+#define IDD_INPUTID                     217
+#define IDD_PROJECT_OPTION              218
+#define IDD_PJ_OPTION2                  218
+#define IDD_NEWPROJECT_PAGE             219
+#define IDD_NEWPROJECT_PAGE2            219
+#define IDD_PROJECT_MENURENAME          220
+#define IDR_CONTROL                     221
+#define IDD_RAD_CHOOSECHILD             223
+#define IDD_RAD_PROP_CHILD              224
+#define IDD_SETRAD                      225
+#define IDD_OPTION_RAD                  225
+#define IDI_FILE_PJ                     226
+#define IDD_SETFILELINK                 227
+#define IDD_OPTION_FILELINK             227
+#define IDI_FILE_BAS                    229
+#define IDI_FILE_SBP                    230
+#define IDI_MENU                        231
+#define IDI_FILE_ICON                   233
+#define IDI_FILE_BMP                    234
+#define IDI_FILE_CURSOR                 236
+#define IDB_TITLE                       238
+#define IDD_RAD_SUPPORT                 239
+#define IDD_PJ_OPTION1                  241
+#define IDB_PARAMHINT_QUESTION          243
+#define IDB_PARAMHINT_QUESTION2         244
+#define IDD_ICONEDIT_TOOL               246
+#define IDD_ICONEDIT_COLOR              247
+#define IDD_ICONEDIT_BUTTONS            248
+#define IDR_ICONTOOLBAR                 257
+#define IDD_ICONEDIT_ICONTYPE           259
+#define IDC_CURSOR_PEN                  260
+#define IDC_CURSOR_FILL                 261
+#define IDI_MEMBER_PRIVATE_FUNCTION     262
+#define IDI_MEMBER_PUBLIC_FUNCTION      263
+#define IDI_MEMBER_PRIVATE_VARIABLE     264
+#define IDI_MEMBER_PUBLIC_VARIABLE      265
+#define IDB_BASE_DOSPROMPT              266
+#define IDB_BASE_NON                    267
+#define IDB_BASE_DIRECTX                268
+#define IDI_PAIRSTATEMENT               269
+#define IDC_CURSOR_ARROW_TO_RIGHT       272
+#define IDD_OPTION_COLOR                273
+#define IDD_CODE_SAVE                   274
+#define IDI_ICON1                       275
+#define IDI_VOID                        275
+#define IDI_PROGRAM_FOLDER              276
+#define IDR_STANDARDTOOLBAR_DISABLED    283
+#define IDD_PJ_OPTION3                  284
+#define IDD_EXTENSION_LINK              285
+#define IDD_STRING_COUNT                286
+#define IDR_TABMENU                     287
+#define IDD_EXTENSION_ADD               288
+#define IDD_OPTION_WEB                  291
+#define IDD_OPTION_WEB_DOMAIN_ADD       292
+#define IDI_HTML_PARAMETER              293
+#define IDI_HTML_GENERAL_PARAMETER      294
+#define IDD_PREVIEW                     296
+#define IDI_ZOOMOUT                     297
+#define IDI_ZOOMIN                      298
+#define IDD_OPTION_THEME_SAVE           299
+#define IDD_PASSWORD                    300
+#define IDD_PROFESSIONAL_START          301
+#define IDB_THETEXT_PRO_IMAGE           302
+#define IDD_RESERVE                     303
+#define IDC_FINDSTR                     1001
+#define IDC_FINDINWINDOW                1002
+#define IDC_FINDALL                     1003
+#define IDC_ISBIGSMALL                  1004
+#define IDC_SHOWITEM                    1018
+#define IDC_FINDLIST                    1020
+#define IDC_EDITLINE                    1022
+#define IDC_NEWLINE                     1023
+#define IDC_RESETTOOLBAR                1027
+#define IDC_PERMUTATIONSTR              1034
+#define IDC_PERMUTATIONNEXT             1036
+#define IDC_PERMUTATIONALL              1037
+#define IDC_FIND                        1038
+#define IDC_FILETYPELIST                1039
+#define IDC_SETFONT                     1041
+#define IDC_TABSIZE                     1042
+#define IDC_PARAMHINT                   1043
+#define IDC_ISAUTOINDENT                1044
+#define IDC_PROJECTNAME                 1053
+#define IDC_DIRPATH                     1054
+#define IDC_EXE_PROMPTBASE              1055
+#define IDC_EXE_WINDOWBASE              1056
+#define IDC_EXE_NOBASE                  1057
+#define IDC_IMAGE_WINDOW                1058
+#define IDC_IMAGE_PROMPT                1059
+#define IDC_HELPTEXT_OFBASE             1060
+#define IDC_BUTTON1                     1061
+#define IDC_PATHBROWSE                  1061
+#define IDC_RENAMEWINDOW                1061
+#define IDC_HINTFONT                    1061
+#define IDC_LINKFILE                    1061
+#define IDC_TEST                        1061
+#define IDC_ADD_ICONTYPE                1061
+#define IDC_SAMPLE                      1061
+#define IDC_DIR                         1061
+#define IDC_ADD_BUTTON                  1061
+#define IDC_ADD                         1061
+#define IDC_GOPRO                       1061
+#define IDC_PAGESET                     1061
+#define IDD_PJ_OPTION4                  1061
+#define IDC_PROJECTINFO                 1062
+#define IDC_DELETE_ICONTYPE             1062
+#define IDC_DELETE_BUTTON               1062
+#define IDC_DELETE                      1062
+#define IDC_EDIT                        1063
+#define IDC_TAB_PROJECTINFO             1066
+#define IDC_SHOWHELLOWORLD              1068
+#define IDC_USING_FILE                  1069
+#define IDC_DEFINED_FILE                1070
+#define IDC_UPDATE_TIME                 1071
+#define IDC_FILETYPE                    1072
+#define IDC_TOOL_MOUSE                  1075
+#define IDC_TOOL_STATIC                 1076
+#define IDC_TOOL_BUTTON                 1077
+#define IDC_TOOL_EDIT                   1078
+#define IDC_TOOL_CHECKBOX               1079
+#define IDC_WINDOWNAME                  1080
+#define IDC_TOOL_RADIOBUTTON            1080
+#define IDC_WINDOWHANDLE                1081
+#define IDC_TOOL_GROUPBOX               1081
+#define IDC_WINDOWPROC                  1082
+#define IDC_TOOL_HSCROLLBAR             1082
+#define IDC_AUTOSET                     1083
+#define IDC_TOOL_VSCROLLBAR             1083
+#define IDC_TOOL_COMBOBOX               1084
+#define IDC_TOOL_LISTBOX                1085
+#define IDC_TOOL_UPDOWN                 1086
+#define IDC_TOOL_LISTVIEW               1087
+#define IDC_TOOL_TREEVIEW               1088
+#define IDC_CAPTION                     1090
+#define IDC_TOOL_IMAGEBOX               1091
+#define IDC_BGCOLOR                     1091
+#define IDC_TOOL_PROGRESSBAR            1092
+#define IDC_TOOL_TRACKBAR               1093
+#define IDC_IDNAME                      1095
+#define IDC_WINDOWSTYLE                 1097
+#define IDC_STYLE_HSCROLLBAR            1098
+#define IDC_STYLE_VSCROLLBAR            1099
+#define IDC_STYLE_CLIPSIBLINGS          1100
+#define IDC_STYLE_CLIPCHILDREN          1101
+#define IDC_STYLE_SYSMENU               1102
+#define IDC_STYLE_CAPTION               1104
+#define IDC_STYLE_MINIMIZE              1105
+#define IDC_STYLE_MAXIMIZE              1106
+#define IDC_STYLE_VISIBLE               1107
+#define IDC_STYLE_MAXIMIZEBOX           1108
+#define IDC_STYLE_MINIMIZEBOX           1109
+#define IDC_BORDERSTYLE                 1110
+#define IDC_STYLE_DISABLED              1111
+#define IDC_EXSTYLE                     1113
+#define IDC_PROCEDURENAME               1116
+#define IDC_EVENTLIST                   1117
+#define IDC_STYLE_GROUP                 1118
+#define IDC_STYLE_TABSTOP               1119
+#define IDC_BS_DEFPUSHBUTTON            1120
+#define IDC_BS_OWNERDRAW                1121
+#define IDC_BS_ICON                     1122
+#define IDC_BS_BITMAP                   1123
+#define IDC_BS_MULTILINE                1124
+#define IDC_BS_NOTIFY                   1125
+#define IDC_BS_HPOS                     1126
+#define IDC_BS_VPOS                     1127
+#define IDC_RENAMEID                    1128
+#define IDC_RENAMECAPTION               1129
+#define IDC_EXSTYLE_NOPARENTNOTIFY      1129
+#define IDC_EXSTYLE_TOPMOST             1130
+#define IDC_EXSTYLE_ACCEPTFILES         1131
+#define IDC_EXSTYLE_TRANSPARENT         1133
+#define IDC_EXSTYLE_TOOLWINDOW          1134
+#define IDC_EXSTYLE_DLGMODALFRAME       1135
+#define IDC_EXSTYLE_CLIENTEDGE          1136
+#define IDC_EXSTYLE_STATICEDGE          1137
+#define IDC_EXSTYLE_CONTEXTHELP         1138
+#define IDC_EXSTYLE_CONTROLPARENT       1139
+#define IDC_ES_MULTILINE                1161
+#define IDC_ES_NUMBER                   1162
+#define IDC_STYLE_HSCROLL               1163
+#define IDC_ES_AUTOHSCROLL              1164
+#define IDC_STYLE_VSCROLL               1165
+#define IDC_ES_AUTOVSCROLL              1166
+#define IDC_ES_PASSWORD                 1167
+#define IDC_ES_NOHIDESEL                1168
+#define IDC_ES_OEMCONVERT               1169
+#define IDC_ES_WANTRETURN               1170
+#define IDC_ES_UPPERCASE                1171
+#define IDC_ES_LOWERCASE                1172
+#define IDC_ES_READONLY                 1173
+#define IDC_ES_TEXTPOS                  1174
+#define IDC_LBS_SELECT                  1175
+#define IDC_LBS_OWNERDRAW               1176
+#define IDC_LVS_SORT                    1177
+#define IDC_SS_NOPREFIX                 1178
+#define IDC_SS_LEFTNOWORDWRAP           1179
+#define IDC_SS_NOTIFY                   1180
+#define IDC_SS_TEXTPOS                  1182
+#define IDC_BS_AUTO                     1184
+#define IDC_BS_3STATE                   1185
+#define IDC_BS_LEFTTEXT                 1187
+#define IDC_BS_PUSHLIKE                 1188
+#define IDC_SBS_POSITION                1207
+#define IDC_LBS_HASSTRINGS              1221
+#define IDC_LBS_SORT                    1223
+#define IDC_LBS_NOTIFY                  1224
+#define IDC_LBS_MULTICOLUMN             1225
+#define IDC_LBS_DISABLENOSCROLL         1226
+#define IDC_LBS_NOREDRAW                1227
+#define IDC_LBS_USETABSTOPS             1228
+#define IDC_LBS_WANTKEYBOARDINPUT       1229
+#define IDC_LVS_VIEW                    1240
+#define IDC_LVS_POSITION                1241
+#define IDC_LVS_SHOWSELALWAYS           1243
+#define IDC_LVS_SINGLESEL               1244
+#define IDC_LVS_AUTOARRANGE             1245
+#define IDC_LVS_NOLABELWRAP             1246
+#define IDC_LVS_EDITLABELS              1247
+#define IDC_LVS_NOSCROLL                1248
+#define IDC_LVS_NOCOLUMNHEADER          1249
+#define IDC_LVS_NOSORTHEADER            1250
+#define IDC_LVS_OWNERDRAWFIXED          1251
+#define IDC_LVS_SHAREIMAGELISTS         1252
+#define IDC_TVS_HASBUTTONS              1264
+#define IDC_TVS_HASLINES                1266
+#define IDC_TVS_LINESATROOT             1267
+#define IDC_TVS_EDITLABELS              1268
+#define IDC_TVS_DISABLEDRAGDROP         1269
+#define IDC_TVS_SHOWSELALWAYS           1270
+#define IDC_TVS_NOSCROLL                1271
+#define IDC_TVS_NOTOOLTIPS              1272
+#define IDC_TVS_CHECKBOXES              1273
+#define IDC_TVS_FULLROWSELECT           1274
+#define IDC_TVS_TRACKSELECT             1275
+#define IDC_TVS_SINGLEEXPAND            1276
+#define IDC_IMAGE_FILE                  1278
+#define IDC_IMAGE_TYPE                  1281
+#define IDC_SS_CENTERIMAGE              1283
+#define IDC_SS_RIGHTJUST                1284
+#define IDC_CBS_TYPE                    1288
+#define IDC_CBS_HASSTRINGS              1289
+#define IDC_CBS_SORT                    1290
+#define IDC_CBS_NOINTEGRALHEIGHT        1292
+#define IDC_CBS_OEMCONVERT              1293
+#define IDC_CBS_AUTOHSCROLL             1294
+#define IDC_CBS_DISABLENOSCROLL         1295
+#define IDC_CBS_UPPERCASE               1296
+#define IDC_CBS_LOWERCASE               1297
+#define IDC_CBS_OWNERDRAW               1301
+#define IDC_BS_POSITION                 1307
+#define IDC_UDS_AUTOBUDDY               1314
+#define IDC_UDS_SETBUDDYINT             1315
+#define IDC_UDS_NOTHOUSANDS             1316
+#define IDC_UDS_WRAP                    1317
+#define IDC_UDS_ARROWKEYS               1318
+#define IDC_UDS_SITUATION               1319
+#define IDC_UDS_ATTACH                  1320
+#define IDC_PROGRESS3                   1327
+#define IDC_PBS_SMOOTH                  1328
+#define IDC_PBS_VERTICAL                1329
+#define IDC_SLIDER2                     1331
+#define IDC_TBS_SITUATION               1332
+#define IDC_TBS_POINT                   1333
+#define IDC_TBS_NOTICKS                 1334
+#define IDC_TBS_AUTOTICKS               1335
+#define IDC_TBS_ENABLESELRANGE          1336
+#define IDC_SLIDER3                     1337
+#define IDC_HANDLE                      1339
+#define IDC_PATH                        1340
+#define IDC_CHANGEPATH                  1341
+#define IDC_IMAGE_SITUATION             1342
+#define IDC_WINDOWMENU                  1343
+#define IDC_ICONRES                     1344
+#define IDC_UP                          1347
+#define IDC_DOWN                        1348
+#define IDC_CHECKED                     1349
+#define IDC_DISABLED                    1350
+#define IDC_INSERTMENUITEM              1352
+#define IDC_DELETEMENUITEM              1353
+#define IDC_POPUP                       1356
+#define IDC_SEPARATOR                   1357
+#define IDC_DEFWINDOW                   1358
+#define IDC_API_MMSYS                   1362
+#define IDC_DEFAULT                     1363
+#define IDC_API_MMSYS2                  1363
+#define IDC_MMSYS                       1364
+#define IDC_MENU                        1365
+#define IDC_API_COMMCTRL                1368
+#define IDC_RENAME                      1369
+#define IDC_IDSTATIC                    1370
+#define IDC_CAPTIONSTATIC               1371
+#define IDC_STATUSBAR                   1373
+#define IDC_STATIC_HINTFONT             1374
+#define IDC_CHECK3                      1377
+#define IDC_SBP                         1377
+#define IDC_WINDOWLIST                  1380
+#define IDC_STATIC_HANDLE               1383
+#define IDC_SAVECHECK                   1384
+#define IDC_SUPPORT_COMMENT             1386
+#define IDC_LINEADJUST                  1387
+#define IDC_BAS                         1391
+#define IDC_ABP                         1392
+#define IDC_PJ                          1393
+#define IDC_MODALDLG                    1394
+#define IDC_MODELESSDLG                 1395
+#define IDC_DLL                         1397
+#define IDC_EXE_DOSPROMPTBASE           1399
+#define IDC_API_RICHEDIT                1401
+#define IDC_FILE                        1402
+#define IDC_RESOURCE                    1403
+#define IDC_RESCOMBO                    1404
+#define IDC_STATIC_ICON                 1405
+#define IDC_API_WINSOCK                 1406
+#define IDC_XPOS                        1408
+#define IDC_YPOS                        1409
+#define IDC_WIDTH                       1410
+#define IDC_HEIGHT                      1411
+#define IDC_SPIN1                       1414
+#define IDC_SPIN2                       1415
+#define IDC_EDIT_RELEASE                1415
+#define IDC_SPIN3                       1416
+#define IDC_EDIT_DEBUG                  1416
+#define IDC_ADDTOPROJECT                1416
+#define IDC_SPIN4                       1417
+#define IDC_FILENAME                    1417
+#define IDC_STATIC_FILENAME             1418
+#define IDC_CLIP                        1419
+#define IDC_ICONTYPECOMBO               1420
+#define IDC_STATIC_COLOR                1422
+#define IDC_NOWCOLOR                    1423
+#define IDC_TYPELIST                    1425
+#define IDC_COMPLEMENT                  1427
+#define IDC_STATIC_SETFONT              1428
+#define IDC_STATIC_TABSIZE              1429
+#define IDC_EXE_DIRECTX                 1432
+#define IDC_IMAGE_DOSPROMPT             1433
+#define IDC_IMAGE_NON                   1434
+#define IDC_IMAGE_DIRECTX               1435
+#define IDC_PAIRSTATEMENT               1435
+#define IDC_BACKNUM                     1436
+#define IDC_STATIC_PAIRSTATEMENT        1439
+#define IDC_LINENUMBER                  1440
+#define IDC_CARETLINE_BACKGROUND        1441
+#define IDC_STATIC_VERSION              1442
+#define IDC_STRICT                      1443
+#define IDC_COMBO1                      1444
+#define IDC_TARGET                      1445
+#define IDC_THEME                       1446
+#define IDC_COLOR_BUTTON                1448
+#define IDC_STATIC_PARTS                1449
+#define IDC_LIST_CHARCODE               1451
+#define IDC_LIST_LFCODE                 1452
+#define IDC_STATIC_NAME                 1453
+#define IDC_CMD_LINE                    1454
+#define IDC_EXE_PATH                    1455
+#define IDC_STATIC_DEBUG                1456
+#define IDC_MAX_ONELINE_TEXT_LENGTH     1457
+#define IDC_MAX_CONV_ONELINE_TEXT_LENGTH 1458
+#define IDC_SCOUNT_BYTE                 1463
+#define IDC_SCOUNT_OMIT_SPACE           1464
+#define IDC_SCOUNT_WITH_SPACE           1465
+#define IDC_SCOUNT_LINENUM              1466
+#define IDC_RULER                       1467
+#define IDC_EXTENSION_LIST              1468
+#define IDC_EXTENSION                   1469
+#define IDC_NOTE                        1470
+#define IDC_SEARCH_ON                   1472
+#define IDC_SEARCH_OFF                  1473
+#define IDC_EDIT_BUTTON                 1473
+#define IDC_SAVE_TAB_TO_HEAD            1474
+#define IDC_DOMAIN_LIST                 1478
+#define IDC_CTRLKEY_HYPERLINK           1479
+#define IDC_NAME                        1480
+#define IDC_DOMAIN                      1481
+#define IDC_REGEXP                      1482
+#define IDC_FONT                        1484
+#define IDC_PRINT                       1487
+#define IDC_PREV                        1488
+#define IDC_NEXT                        1489
+#define IDC_SHOWPAGENUM                 1490
+#define IDC_PAGESTR                     1491
+#define IDC_STATIC_TABCOLOR             1492
+#define IDC_STATIC_TABCOLOR2            1493
+#define IDC_SAVE_FINDSTR                1494
+#define IDC_SAVE_WEBFINDSTR             1495
+#define IDC_ZOOMIN                      1496
+#define IDC_ZOOMOUT                     1497
+#define IDC_ZOOMRATIO                   1498
+#define IDC_SAVE                        1499
+#define IDC_OVERWRITE                   1501
+#define IDC_PASSWORD                    1502
+#define IDC_UNICODE                     1503
+#define IDC_PASTEINDENT                 1504
+#define IDC_RC_MANIFEST                 1505
+#define IDC_STATIC_PATH                 1506
+#define IDM_STEP_IN                     1507
+#define IDM_STEP_OUT                    1508
+#define IDM_STEP_CURSOR                 1509
+#define IDM_DEBUG_PAUSE                 1510
+#define IDM_DEBUG_STOP                  1511
+#define IDM_RELEASERUN                  1512
+#define IDM_STEP_OVER                   1513
+#define IDM_BREAKPOINT                  1514
+#define IDC_ISWORDUNIT                  1515
+#define IDM_EXIT                        40001
+#define IDM_NEW                         40002
+#define IDM_OPEN                        40003
+#define IDM_CLOSE                       40004
+#define IDM_SAVE                        40008
+#define IDM_NEWSAVE                     40009
+#define IDM_UNDO                        40010
+#define IDM_CUT                         40011
+#define IDM_COPY                        40012
+#define IDM_PASTE                       40013
+#define IDM_DELETE                      40014
+#define IDM_ABOUT                       40015
+#define IDM_WINDOWCHARGE                40017
+#define IDM_ALLSAVE                     40020
+#define IDM_ALLSELECT                   40021
+#define IDM_FIND                        40024
+#define IDM_REDO                        40034
+#define IDM_TOPIC                       40037
+#define ID_MENUITEM40038                40038
+#define IDM_DOCSELECTBAND               40039
+#define IDM_STANDARDBAND                40040
+#define IDM_BASICBAND                   40041
+#define IDM_SET                         40042
+#define IDM_PERMUTATION                 40044
+#define IDM_DSHOMEPAGE                  40047
+#define IDM_ACTBDL                      40048
+#define IDM_PROJECT_OPEN                40051
+#define IDM_PROJECT_CLOSE               40052
+#define IDM_PROJECT_SAVE                40053
+#define IDM_PROJECTVIEW                 40054
+#define IDM_FILETREE_PROPERTY           40057
+#define IDM_FILETREE_OPEN               40058
+#define IDM_FILETREE_INSERT             40059
+#define IDM_FILETREE_DELETE             40060
+#define IDM_WINDOWTREE_OPEN             40062
+#define IDM_MATERIALTREE_OPEN           40062
+#define IDM_WINDOWTREE_DELETE           40063
+#define IDM_MATERIALTREE_DELETE         40063
+#define IDM_WINDOWTREE_PROPERTY         40064
+#define IDM_WINDOWTREE_INSERT           40065
+#define IDM_MATERIALTREE_INSERT         40065
+#define IDM_MATERIALTREE_INSERTWINDOW   40065
+#define IDM_RAD_ITEM_DELETE             40067
+#define IDM_RAD_WINDOW_EVENTCODE        40069
+#define IDM_ACCEL_UNDO                  -25466
+#define IDM_ACCEL_REDO                  -25465
+#define IDM_PROCEDURETREE_SHOW          40072
+#define IDM_RAD_WINDOW_MENUEVENTCODE    40074
+#define IDM_MENUTREE_RENAMEID           40075
+#define IDM_PROJECT_OPTION              40076
+#define IDM_TOPMOST                     40077
+#define ID_BUTTON40079                  40079
+#define ID_BUTTON40080                  40080
+#define ID_BUTTON40081                  40081
+#define ID_BUTTON40082                  40082
+#define ID_BUTTON40083                  40083
+#define ID_BUTTON40084                  40084
+#define ID_BUTTON40085                  40085
+#define ID_BUTTON40086                  40086
+#define ID_BUTTON40087                  40087
+#define ID_BUTTON40088                  40088
+#define ID_BUTTON40089                  40089
+#define ID_BUTTON40090                  40090
+#define ID_BUTTON40091                  40091
+#define ID_BUTTON40092                  40092
+#define ID_BUTTON40093                  40093
+#define ID_BUTTON40094                  40094
+#define ID_BUTTON40095                  40095
+#define ID_BUTTON40097                  40097
+#define IDM_DEBUG                       40101
+#define IDM_RELEASECOMPILE              40106
+#define IDM_DEBUGCOMPILE                40108
+#define IDM_MATERIALTREE_INSERTICON     40109
+#define IDM_MATERIALTREE_INSERTMENU     40110
+#define IDM_MATERIALTREE_ICON_SETMAIN   40113
+#define IDM_MATERIALTREE_INSERTBITMAP   40115
+#define IDM_MATERIALTREE_INSERTCURSOR   40116
+#define IDM_NOGRIPPER                   40117
+#define IDC_TOOL_SELECT                 40119
+#define IDC_TOOL_PEN                    40120
+#define IDC_TOOL_LINE                   40121
+#define IDC_TOOL_RECTANGLE              40123
+#define IDC_TOOL_ELLIPSE                40124
+#define IDC_TOOL_FILL                   40126
+#define IDC_TOOL_FILLRECT               40127
+#define IDC_TOOL_FILLRECT2              40128
+#define IDM_SELECTCOMPILERBAND          40133
+#define IDM_RESET_REBAR                 40134
+#define IDM_COMMU_PM                    40136
+#define ID_COMMU_FORUM1                 40138
+#define ID_COMMU_FORUM2                 40139
+#define ID_COMMU_FORUM4                 40140
+#define ID_COMMU_FORUM3                 40141
+#define ID_COMMU_FORUM5                 40142
+#define IDM_COMMUNITY                   40143
+#define IDM_CODE_SAVE                   40144
+#define IDM_COMMU_SEARCH                40148
+#define IDM_WEB_SEARCH                  40149
+#define IDM_BANDMENU_WEB_SEARCH         40150
+#define IDM_RIGHT_TURN                  40151
+#define IDM_STRING_COUNT                40153
+#define IDM_SEL_STRING_COUNT            40154
+#define IDM_DELETE_FILE                 40156
+#define IDM_PATH_COPY                   40157
+#define IDM_ALLCLOSE_OMIT_MYSELF        40158
+#define IDM_FOLDER_OPEN                 40159
+#define IDM_RED                         40160
+#define IDM_GREEN                       40161
+#define IDM_BLUE                        40162
+#define IDM_YELLOW                      40163
+#define IDM_USER_COLOR                  40164
+#define IDM_GRAY                        40165
+#define IDM_WHITE                       40166
+#define IDM_PRINTOUT                    40167
+#define IDM_CONV_ALPHA_SMALL            40168
+#define IDM_CONV_ALPHA_BIG              40169
+#define IDM_CONV_HELF                   40170
+#define IDM_CONV_HALF                   40170
+#define IDM_CONV_MULTI                  40171
+#define IDM_CONV_KATAKANA               40172
+#define IDM_CONV_HIRAGANA               40173
+#define IDM_CONV_SPACE                  40174
+#define IDM_CONV_TAB                    40175
+#define IDM_PAGESET                     40176
+#define IDM_PREVIEW                     40177
+#define ID_MENUITEM40180                40180
+#define IDM_CONV_QUOTE                  40182
+#define IDM_CONV_HASRETURN              40183
+
+// Next default values for new objects
+// 
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE        304
+#define _APS_NEXT_COMMAND_VALUE         40184
+#define _APS_NEXT_CONTROL_VALUE         1516
+#define _APS_NEXT_SYMED_VALUE           101
+#endif
+#endif
