any idea

Hi evryone
I using MVC++ and built my project using Win32 app.
My program do not have any interfaces. it reads files and it put the output in another file. ( I do not mind put interface only to enter the path)

the thing is I made my program read the input file from specific directory and put the output in the specify directory.[red] the probelm now is that I would like the user to inter the dirctory of the input file and the output file[/red] is this possible if yes, please tell me how to do it, I do not have any idea.

[code]
"C:\Wadi\In\Log_01.csv" my in file directory
"C:\Wadi\Out\Daily_Summary_%d.csv" my out file directory
[/code]

now I would like to enable the user to enter his path for the input file and the output file.



Comments

  • : Hi evryone
    : I using MVC++ and built my project using Win32 app.
    : My program do not have any interfaces. it reads files and it put the output in another file. ( I do not mind put interface only to enter the path)
    :
    : the thing is I made my program read the input file from specific directory and put the output in the specify directory.[red] the probelm now is that I would like the user to inter the dirctory of the input file and the output file[/red] is this possible if yes, please tell me how to do it, I do not have any idea.
    :
    : [code]
    : "C:\Wadi\In\Log_01.csv" my in file directory
    : "C:\Wadi\Out\Daily_Summary_%d.csv" my out file directory
    : [/code]
    :
    : now I would like to enable the user to enter his path for the input file and the output file.
    :
    :
    Why not?
    [code]
    cin >> inPath;
    cin >> outPath;
    [/code]
  • thank you for your reply.
    my program will be run every day after ( make a window xp task scheduler to run the .exe part) so I need the user just to spacify the path once then the system will work every day.

    : : Hi evryone
    : : I using MVC++ and built my project using Win32 app.
    : : My program do not have any interfaces. it reads files and it put the output in another file. ( I do not mind put interface only to enter the path)
    : :
    : : the thing is I made my program read the input file from specific directory and put the output in the specify directory.[red] the probelm now is that I would like the user to inter the dirctory of the input file and the output file[/red] is this possible if yes, please tell me how to do it, I do not have any idea.
    : :
    : : [code]
    : : "C:\Wadi\In\Log_01.csv" my in file directory
    : : "C:\Wadi\Out\Daily_Summary_%d.csv" my out file directory
    : : [/code]
    : :
    : : now I would like to enable the user to enter his path for the input file and the output file.
    : :
    : :
    : Why not?
    : [code]
    : cin >> inPath;
    : cin >> outPath;
    : [/code]
    :

  • Use another file to store the paths in.

    [code]
    int main(int argc, char* argv[])
    {
    if(argc == 1)
    {
    load paths from file
    if(no path in file)
    {
    bleh, error
    }
    }
    else if(argc == 3)
    {
    save input path to file
    save output path to file
    }
    else
    {
    bleh, error
    }

    /* rest of the program here */

    return 0;
    }
    [/code]
  • I know it is an easy thing to ask the user to enter the whole path and the file name. but thats mean every time window xp scheduler task run the project.exe the user have to enter the path and I do not want something like this.

    I would like the user to enter the path only one time when they first day run the project then the computer will remeber this path and work every day without asking for the path again.my project is going to put in a computer and make window xp task scheduler run it once a day, it will read different input file every day( day1.txt,.....) according to the day of the current date. but all the file ( day1.txt.....) are kept the same path ( which the user have to give his path to the project when He run it for the first time, then it will be left to work according to the schedular and the path he told it previously. so it will run every day by itself .










    : Use another file to store the paths in.
    :
    : [code]
    : int main(int argc, char* argv[])
    : {
    : if(argc == 1)
    : {
    : load paths from file
    : if(no path in file)
    : {
    : bleh, error
    : }
    : }
    : else if(argc == 3)
    : {
    : save input path to file
    : save output path to file
    : }
    : else
    : {
    : bleh, error
    : }
    :
    : /* rest of the program here */
    :
    : return 0;
    : }
    : [/code]
    :

  • [b][red]This message was edited by Donotalo at 2006-1-27 8:24:44[/red][/b][hr]
    : I know it is an easy thing to ask the user to enter the whole path and the file name. but thats mean every time window xp scheduler task run the project.exe the user have to enter the path and I do not want something like this.
    :
    : I would like the user to enter the path only one time when they first day run the project then the computer will remeber this path and work every day without asking for the path again.my project is going to put in a computer and make window xp task scheduler run it once a day, it will read different input file every day( day1.txt,.....) according to the day of the current date. but all the file ( day1.txt.....) are kept the same path ( which the user have to give his path to the project when He run it for the first time, then it will be left to work according to the schedular and the path he told it previously. so it will run every day by itself .
    :
    :
    [purple]
    keep an indicator in a file that helps to remember ur program whether the user has entered a path yet. for example, u can simply keep a boolean value in a file with false value initially. when ur program starts, it will look for this bool whether it is false or not. if it is false, then ask the user for the path and make this value true and save to the file.
    [/purple]
    [hr][purple]~Donotalo()[/purple]



  • you are asolutly right and I will apply it to my code, one final thing is it possible to let the user input his path in an interface rather than the prompt window, because I used
    [code]
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
    [/code]
    to stop the prompt window.
    because if I used
    [code]
    int main()
    [/code]
    it will keep the prompt window appear with every run.

    and my project built in win32 app non mfc. MVC++6

    thank you

    : [b][red]This message was edited by Donotalo at 2006-1-27 8:24:44[/red][/b][hr]
    : : I know it is an easy thing to ask the user to enter the whole path and the file name. but thats mean every time window xp scheduler task run the project.exe the user have to enter the path and I do not want something like this.
    : :
    : : I would like the user to enter the path only one time when they first day run the project then the computer will remeber this path and work every day without asking for the path again.my project is going to put in a computer and make window xp task scheduler run it once a day, it will read different input file every day( day1.txt,.....) according to the day of the current date. but all the file ( day1.txt.....) are kept the same path ( which the user have to give his path to the project when He run it for the first time, then it will be left to work according to the schedular and the path he told it previously. so it will run every day by itself .
    : :
    : :
    : [purple]
    : keep an indicator in a file that helps to remember ur program whether the user has entered a path yet. for example, u can simply keep a boolean value in a file with false value initially. when ur program starts, it will look for this bool whether it is false or not. if it is false, then ask the user for the path and make this value true and save to the file.
    : [/purple]
    : [hr][purple]~Donotalo()[/purple]
    :
    :
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories