Hi,
I have a form that encodes and decodes a file.
When the user selects the encode button, the user selects a file to open and that file is encoded and saved as a different file.
I now need the decode function to work. When the user selects the decode button, i want it to automatically start to decode the saved encoded file. so i would like to be able to hard code the file path of the saved file into this option. I'm struggling here because i'm not sure how to get the file path of a file.
Can anybody help?
My code is below:
CODE
if (OpenFileDialog->Execute())
input = OpenFileDialog->FileName.c_str();
if (SaveFileDialog->Execute())
output = SaveFileDialog->FileName.c_str();
std::ifstream infile(input.c_str(), std::ios::in | std::ios::binary);
if (output.find(".drc") == -1)
output = output + ".drc";
std::ofstream outfile(output.c_str(),std::ios::out | std::ios::binary);
I would like to be able to find the complete path of output in order to hard code it in the decoder method. Can anybody help?
Cheers