TEMP/TMP Folder access

closed account (GTXEhUp4)
I am doing an GUI for Tortoise SVN with C++ Builder and and i can't find any document to save my file .ini file to my temp->(C:\\User\\Username\\Appdata\\Local\\Temp) folder.

Here is my code;

1
2
3
4
5
6
7
8
9
void __fastcall TMainForm::FormCreate(TObject *Sender)
{
	TIniFile* ini = new TIniFile(ChangeFileExt(Application->ExeName,".ini"));

	MSaveLogs->Checked = ini->ReadBool("MainFormCheckedBoxLogs","MSaveLogs",false);
	MShutdown->Checked = ini->ReadBool("MainFormCheckedBoxLogs","MShutdown",false);

	delete ini;
}


1
2
3
4
5
6
7
8
9
void __fastcall TMainForm::FormClose(TObject *Sender, TCloseAction &Action)
{
	TIniFile* ini = new TIniFile(ChangeFileExt(Application->ExeName,".ini"));

	ini->WriteBool("MainFormCheckedBoxLogs","MSaveLogs",MSaveLogs->Checked);
	ini->WriteBool("MainFormCheckedBoxLogs","MShutdown",MShutdown->Checked);

	delete ini;
}

Last edited on
AFAIK, the class TIniFile deals with opening/reading/writing/closing the file. You don't need to explicitly save the ini file as that will be done automatically (here on delete).

http://www.functionx.com/bcb/howto/inifile.htm
Registered users can post here. Sign in or register to post.