Board index » cppbuilder » Path for Application in Vista

Path for Application in Vista


2007-06-20 03:09:42 PM
cppbuilder105
Hello,
I have run my application(installed with install shiel) in the AppData
directory of Vista, to do a try, but it stops when it tries to create a file
in this directory.
My question is in which directory my I put mine AppDatas because I must
create read and modify some .dbf files and other txt files.
I tried personnal folder of user and had the same problem.
Could show me the way please Because I would use the
GetSpecialFolderLocation function but I don't want to do mistake in the
choice of CLSID......,yes I have many lines to change in my application and
would it run on Vista and XP
I thank you by advance
Patrick
 
 

Re:Path for Application in Vista

"patrickartaud" < XXXX@XXXXX.COM >wrote in message
Quote
I have run my application(installed with install shiel) in the
AppData directory of Vista, to do a try, but it stops when
it tries to create a file in this directory.
Do not try to write any files in the CSIDL_APPDATA folder itself. You
need to create your own subfolder inside of it instead.
Gambit
 

Re:Path for Application in Vista

"patrickartaud" < XXXX@XXXXX.COM >wrote in message
Quote
Hello,
I have run my application(installed with install shiel) in the AppData
directory of Vista, to do a try, but it stops when it tries to create a
file in this directory.
Start here:
msdn2.microsoft.com/en-us/library/ms649274.aspx
Look at CSIDL_COMMON_APPDATA.
We create a new directory and give Read/Write permissions to the users.
This is where we store global datafiles, i.e. databases, config files, etc.
 

{smallsort}

Re:Path for Application in Vista

Thank you very much,but I have a problem with development.I use BCB6Pro on
Vista my applications folder is in C: ("C:\ProgsPerso") this application the
project and other files are in ("C:\ProgPerso\OptiEssai") subfolder.
My application creates folders in its own directory
"C:\ProgPerso\OpriEssai\subfolders" and stocks .dbf files but when my
application tries to open files created in its on directory I have "File
does not exist" error message. I look with explorer and the file is created
and contains good values.
I do'nt understand why
If you can say to me please it will be fine.
I thank you again
Patrick
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >a écrit dans le message de
Quote

"patrickartaud" < XXXX@XXXXX.COM >wrote in message
news:4678d2ca$ XXXX@XXXXX.COM ...

>I have run my application(installed with install shiel) in the
>AppData directory of Vista, to do a try, but it stops when
>it tries to create a file in this directory.

Do not try to write any files in the CSIDL_APPDATA folder itself. You
need to create your own subfolder inside of it instead.


Gambit


 

Re:Path for Application in Vista

Thank you very much, I go to try, but how to obtain permission with code?
If you can show me the way thank you again,I go to look at your link
Thank you again
Patrick
"Frank J" < XXXX@XXXXX.COM >a écrit dans le message de
Quote

"patrickartaud" < XXXX@XXXXX.COM >wrote in message
news:4678d2ca$ XXXX@XXXXX.COM ...
>Hello,
>I have run my application(installed with install shiel) in the AppData
>directory of Vista, to do a try, but it stops when it tries to create a
>file in this directory.

Start here:
msdn2.microsoft.com/en-us/library/ms649274.aspx

Look at CSIDL_COMMON_APPDATA.
We create a new directory and give Read/Write permissions to the users.
This is where we store global datafiles, i.e. databases, config files,
etc.
 

Re:Path for Application in Vista

"patrickartaud" < XXXX@XXXXX.COM >wrote in message
Quote
My application creates folders in its own directory
"C:\ProgPerso\OpriEssai\subfolders" and stocks .dbf files but
when my application tries to open files created in its on directory
I have "File does not exist" error message.
Please show your actual code.
Gambit
 

Re:Path for Application in Vista

Thank you for your answer,here is my code it run well with XP
////////////////////////////////////////////////////////////////////////////////////////
void StartVUS(){
// ici je demande le nom sct?
// InputDialog // InputQuery
/*
TOpenDialog *OpenDialog1;
OpenDialog1 =new TOpenDialog(NULL);
OpenDialog1->Filter="Opti Files(*.rxt)|*.RXT";
if(OpenDialog1->Execute()){
NomFichier=OpenDialog1->FileName;
TSearchRec sr;int iatt;
FindFirst(NomFichier,iatt,sr);
Fichier=sr.Name;
Fichier=Fichier.SubString(0,Fichier.Length()-4);
*/
NomChemin=ExtractFilePath(Application->ExeName);
RepList=new TRepList(NULL);
RepList->ShowModal();
if (RepList->ferme==true){}else
{
#ifdef multientreprise
NomFichier=NomChemin+"\\DirFile\\"+Fichier+".rxt";
#endif
//delete OpenDialog1;
StarUSA = new TStarUSA(NULL);
StarUSA->Show();
}
}
void __fastcall TStarUSA::InitBoiteListe(TObject *Sender)
{
Table1= new TTable(this);
Table1->Active=false;
Table1->DatabaseName=NomChemin+"DirBase\\";
Table1->TableType=ttDefault;
Table1->TableName=Fichier+"calcrats.db";
Table1->Active=true;
Table1->First();
NbreAns=0;
do{
ListBox1->Items->Add(Table1->FieldByName("Date")->AsString);
Update();
Table1->Next();NbreAns++;
}while(!Table1->Eof);
}
//////////////////////////////////////////////////////////////////////////////////////
It here it don't find the file
I thank you very much again
Patrick
"Remy Lebeau (TeamB)" < XXXX@XXXXX.COM >a écrit dans le message de
Quote

"patrickartaud" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...

>My application creates folders in its own directory
>"C:\ProgPerso\OpriEssai\subfolders" and stocks .dbf files but
>when my application tries to open files created in its on directory
>I have "File does not exist" error message.

Please show your actual code.


Gambit