Index: trunk/ab5.0/abdev/abdev/NonVolatile.cpp
===================================================================
--- trunk/ab5.0/abdev/abdev/NonVolatile.cpp	(revision 481)
+++ trunk/ab5.0/abdev/abdev/NonVolatile.cpp	(revision 717)
@@ -235,16 +235,11 @@
 	char temporary[MAX_PATH];
 
+	std::string userAppDir = ActiveBasic::IDE::Program::GetUserAppDir();
+
 
 	///////////////////////////////////
 	// 関連付け用の拡張子オブジェクト
 	///////////////////////////////////
-	sprintf(temporary,"%sUserSetting\\extlink.ini",pj_editor_Dir);
-	pobj_ExtLink->load(temporary);
-
-
-	//////////////////////////////////////
-	// Web検索用ドメイン管理オブジェクト
-	//////////////////////////////////////
-	pobj_DBDomain->load();
+	pobj_ExtLink->load( userAppDir + "\\extlink.ini" );
 
 
@@ -252,6 +247,5 @@
 	// 「最近使ったファイル」オブジェクト
 	///////////////////////////////////////
-	sprintf(temporary,"%sUserSetting\\history.ini",pj_editor_Dir);
-	pobj_History->load(temporary);
+	pobj_History->load( userAppDir + "\\history.ini" );
 
 
@@ -259,12 +253,10 @@
 	// 「最近使ったプロジェクト」オブジェクト
 	////////////////////////////////////////////
-	sprintf(temporary,"%sUserSetting\\pj_history.ini",pj_editor_Dir);
-	pobj_ProjectHistory->load(temporary);
+	pobj_ProjectHistory->load( userAppDir + "\\pj_history.ini" );
 
 
 
 	//開く
-	sprintf(temporary,"%sUserSetting\\editor.ini",pj_editor_Dir);
-	buffer=ReadBuffer_NonErrMsg(temporary);
+	buffer=ReadBuffer_NonErrMsg( userAppDir + "\\editor.ini" );
 	if(!buffer){
 
@@ -454,6 +446,5 @@
 	int i2,i3;
 
-	sprintf(temporary,"%sUserSetting\\findstr.ini",pj_editor_Dir);
-	buffer=ReadBuffer_NonErrMsg(temporary);
+	buffer=ReadBuffer_NonErrMsg( userAppDir + "\\findstr.ini" );
 	if(buffer){
 		i2=0;
@@ -476,6 +467,5 @@
 	// 置換文字列
 	/////////////////
-	sprintf(temporary,"%sUserSetting\\permustr.ini",pj_editor_Dir);
-	buffer=ReadBuffer_NonErrMsg(temporary);
+	buffer=ReadBuffer_NonErrMsg( userAppDir + "\\permustr.ini" );
 	if(buffer){
 		i2=0;
@@ -498,6 +488,5 @@
 	// Web検索文字列
 	/////////////////
-	sprintf(temporary,"%sUserSetting\\webstr.ini",pj_editor_Dir);
-	buffer=ReadBuffer_NonErrMsg(temporary);
+	buffer=ReadBuffer_NonErrMsg( userAppDir + "webstr.ini" );
 	if(buffer){
 		i2=0;
@@ -678,18 +667,8 @@
 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;
-		}
-	}
+	
+	// ユーザ情報保存用のディレクトリを作成
+	Jenga::Common::Directory dir( ActiveBasic::IDE::Program::GetUserAppDir(), true );
+
 
 	buffer=(char *)HeapAlloc(hHeap,0,65536);
@@ -827,7 +806,8 @@
 
 
+	std::string userAppDir = ActiveBasic::IDE::Program::GetUserAppDir();
+
 	//保存
-	sprintf(temporary,"%sUserSetting\\editor.ini",pj_editor_Dir);
-	WriteBuffer(temporary,buffer,lstrlen(buffer));
+	WriteBuffer( userAppDir + "\\editor.ini", buffer,lstrlen(buffer));
 
 
@@ -845,6 +825,5 @@
 
 	//保存
-	sprintf(temporary,"%sUserSetting\\findstr.ini",pj_editor_Dir);
-	WriteBuffer(temporary,buffer,lstrlen(buffer));
+	WriteBuffer( userAppDir + "\\findstr.ini", buffer,lstrlen(buffer));
 
 
@@ -862,6 +841,5 @@
 
 	//保存
-	sprintf(temporary,"%sUserSetting\\permustr.ini",pj_editor_Dir);
-	WriteBuffer(temporary,buffer,lstrlen(buffer));
+	WriteBuffer( userAppDir + "\\permustr.ini", buffer,lstrlen(buffer));
 
 
@@ -879,6 +857,5 @@
 
 	//保存
-	sprintf(temporary,"%sUserSetting\\webstr.ini",pj_editor_Dir);
-	WriteBuffer(temporary,buffer,lstrlen(buffer));
+	WriteBuffer( userAppDir + "\\webstr.ini", buffer,lstrlen(buffer));
 
 	HeapDefaultFree(buffer);
@@ -889,12 +866,5 @@
 	// 関連付け用の拡張子オブジェクト
 	///////////////////////////////////
-	sprintf(temporary,"%sUserSetting\\extlink.ini",pj_editor_Dir);
-	pobj_ExtLink->save(temporary);
-
-
-	//////////////////////////////////////
-	// Web検索用ドメイン管理オブジェクト
-	//////////////////////////////////////
-	pobj_DBDomain->save();
+	pobj_ExtLink->save( userAppDir + "\\extlink.ini" );
 
 
@@ -902,6 +872,5 @@
 	// 「最近使ったファイル」オブジェクト
 	///////////////////////////////////////
-	sprintf(temporary,"%sUserSetting\\history.ini",pj_editor_Dir);
-	pobj_History->save(temporary);
+	pobj_History->save( userAppDir + "\\history.ini" );
 
 	
@@ -909,5 +878,4 @@
 	// 「最近使ったファイル」オブジェクト
 	///////////////////////////////////////
-	sprintf(temporary,"%sUserSetting\\pj_history.ini",pj_editor_Dir);
-	pobj_ProjectHistory->save(temporary);
-}
+	pobj_ProjectHistory->save( userAppDir + "\\pj_history.ini" );
+}
