Browse and copy image to a specific folder

Hi, i was wondering if anyone can help me with copying photo from one location to another, i was looking on yt and googling and there are many videos on this topic but they either copy specifilc file to specific location, or they allow user to choose both file and saved location which neither works for me.

I want to make a form with two buttons ("open" and "save"). When you click "open" it will open the browse window where you can browse to slect the photo you want to copy to another location, then when you click save it will copy that photo to predetermined location(so location will be fixed for example some folder on desktop). I repeat i dont want to have dialog to chose the folder where to save the image.
Regards.
Standard C++ doesn't have any dialogs to browse for a folder or file.
Of course there are frameworks that can do that but they all have a deep learning curve.
If you don't understand the background you won't be able to change the examples to suit your needs.

Your task sounds simple but requires several steps.
1. Create the form and a variable to store your target folder.
2. Create two buttons and add them to the form
3. Link the buttons with code that gets executed when a button is clicked.
4. When the open button is clicked create a OpenDialog and browse for the file.
5. Store the file name somewhere
6. When the save button is clicked copy the file to its target place

So it's up to you to decide if you want to spend the time to learn everything needed.
An alternative is to post in the job section and look for someone to write the program for you.
alternatively you can do it with OS commands and some C++ glue.
in windows, for example, you can do a dir/s filemask >textfile and parse the textfile, see if the file exists, and if it does where it is, and then move it or copy it.

visual studio's file dialog is pretty simple, I don't know that I would call using that tool 'deep'. In fact this would be a great first project in visual / windows gui programming. It will do most of the work for you.

Other GUI may be more or less complex for the job, but your terminology suggests windows...

I havent used the latest version, been doing commandline coding in unix ... but if you can still make a dialog based project, make one of those, drop a couple of buttons on it, add a file dialog widgit, configure them all to play together, see what you can make happen with it.




Topic archived. No new replies allowed.