Index: trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp
===================================================================
--- trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp	(revision 773)
+++ trunk/ab5.0/abdev/BasicCompiler_Common/BasicCompiler.cpp	(revision 828)
@@ -253,5 +253,5 @@
 }
 
-BOOL GetFilePathDialog(HWND hwnd,char *filename,LPSTR Filter,LPSTR Title,BOOL bOpen){
+BOOL GetFilePathDialog(HWND hwnd,char *filename,LPCSTR Filter,LPCSTR Title,BOOL bOpen){
 	OPENFILENAME ofstr;
 	filename[0]=0;
@@ -325,5 +325,5 @@
 		//生成するファイルの相対パスを取得
 		char relationalPath[MAX_PATH];
-		lstrcpy( relationalPath, program.GetOutputFilePath().c_str() );
+		strcpy( relationalPath, program.GetOutputFilePath().c_str() );
 		GetRelationalPath( relationalPath, BasicCurDir );
 
@@ -375,6 +375,7 @@
 	SetWindowPos(hwnd,0,x,y,0,0,SWP_NOSIZE);
 }
-BOOL CALLBACK DlgCompile(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
+INT_PTR CALLBACK DlgCompile(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam){
 	extern HANDLE hDebugProcess;
+	extern DWORD processIdDebug;
 	char temporary[MAX_PATH];
 	RECT rect;
@@ -444,4 +445,5 @@
 							TerminateProcess(hDebugProcess,0);
 							hDebugProcess=0;
+							processIdDebug = 0;
 
 							//デバッグダイアログを終了
@@ -475,4 +477,5 @@
 						TerminateProcess(hDebugProcess,0);
 						hDebugProcess=0;
+						processIdDebug = 0;
 
 						//デバッグダイアログを終了
@@ -587,6 +590,6 @@
 
 	// グローバルローケルを日本語にする
-	std::locale::global(std::locale("japanese"));
-	_setmode(_fileno(stdout), _O_BINARY);
+	//std::locale::global(std::locale("japanese"));
+	//_setmode(_fileno(stdout), _O_BINARY);
 
 	//_Test();
@@ -642,9 +645,9 @@
 			if( program.IsDebugRun() || compiler.IsDebug() )
 			{
-				lstrcat(tempOutputFileName,"_debug.abobj");
+				strcat(tempOutputFileName,"_debug.abobj");
 			}
 			else
 			{
-				lstrcat(tempOutputFileName,".abobj");
+				strcat(tempOutputFileName,".abobj");
 			}
 		}
@@ -653,9 +656,9 @@
 			if( program.IsDebugRun() || compiler.IsDebug() )
 			{
-				lstrcat(tempOutputFileName,"_debug.exe");
+				strcat(tempOutputFileName,"_debug.exe");
 			}
 			else
 			{
-				lstrcat(tempOutputFileName,".exe");
+				strcat(tempOutputFileName,".exe");
 			}
 		}
@@ -719,14 +722,14 @@
 		}
 		if(temporary[i]){
-			lstrcpy(szDebugCmdLine,temporary+i+2);
+			strcpy(szDebugCmdLine,temporary+i+2);
 		}
 	}
 
 	_splitpath( program.GetSourceFilePath().c_str(), BasicCurDir,temporary,NULL,NULL);
-	lstrcat(BasicCurDir,temporary);
+	strcat(BasicCurDir,temporary);
 
 	if( program.IsClipCompileView() ){
 		//ProjectEditor埋め込み型インターフェイス
-		hMainDlg=CreateDialog(hInst,MAKEINTRESOURCE(IDD_CLIPMAIN),hOwnerEditor,(DLGPROC)DlgCompile);
+		hMainDlg=CreateDialog(hInst, MAKEINTRESOURCE(IDD_CLIPMAIN), hOwnerEditor, DlgCompile);
 		ShowWindow(hMainDlg,SW_SHOW);
 		SendMessage(hOwnerEditor,WM_SETCOMPILEVIEW,0,(LPARAM)hMainDlg);
@@ -759,6 +762,5 @@
 			trace("Complete ActiveBasic Compiler!");
 
-			ExitProcess( program.GetExitCode() );
-			return 0;
+			return program.GetExitCode();
 		}
 		else
@@ -770,10 +772,8 @@
 
 	//エラーリストをサブクラス化
-	OldErrorListProc=(WNDPROC)GetWindowLongPtr(GetDlgItem(hMainDlg,IDC_ERRORLIST),GWLP_WNDPROC);
-	SetWindowLongPtr(GetDlgItem(hMainDlg,IDC_ERRORLIST),GWLP_WNDPROC,(LONG_PTR)ErrorListProc);
+	OldErrorListProc = reinterpret_cast<WNDPROC>(SetWindowLongPtr(GetDlgItem(hMainDlg, IDC_ERRORLIST), GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(ErrorListProc)));
 
 	//デバッグリストをサブクラス化
-	OldDebugListProc=(WNDPROC)GetWindowLongPtr(GetDlgItem(hMainDlg,IDC_DEBUGLIST),GWLP_WNDPROC);
-	SetWindowLongPtr(GetDlgItem(hMainDlg,IDC_DEBUGLIST),GWLP_WNDPROC,(LONG_PTR)DebugListProc);
+	OldDebugListProc = reinterpret_cast<WNDPROC>(SetWindowLongPtr(GetDlgItem(hMainDlg, IDC_DEBUGLIST), GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(DebugListProc)));
 
 	if( program.IsKickedFromEditor() )
@@ -804,6 +804,4 @@
 	trace("Complete ActiveBasic Compiler!");
 
-	ExitProcess( program.GetExitCode() );
-
-	return 0;
-}
+	return program.GetExitCode();
+}
