now with all the post i am getting i will print this page soon ther is a loth of valuable information to keep

nice Arjay this code looks a loth like wat i was trying to do in the ferry beginning
bevore you post it i wrote a new ini.h file that works.


You can also simplify the code by using the CString class (just #include <atlstr.h>).
yes its simple indeed, i can read you code and execute it in my head, i cant say that from my ini.h file
so i am going to play with your code so i learn more about it becorse i think this will be usse full to me for even more things then ini files


my new ini.h file

Code:
char* ini_read_char(LPCWSTR _ini_File_Name, LPCWSTR _ini_Section_Name, LPCWSTR _ini_Key_Name, LPCWSTR _ini_Default )
{ 
	wchar_t ini_index[6];
	GetPrivateProfileStringW(_ini_Section_Name, _ini_Key_Name, _ini_Default ,ini_index,6,_ini_File_Name);
    
	wchar_t* vIn   = ini_index;
        char *   vOut  = new char[wcslen(vIn)+1];
        wcstombs_s(NULL,vOut,wcslen(vIn)+1,vIn,wcslen(vIn)+1);

	return vOut;
}