std::auto_ptr<IOutputFile> out(output_factory(filename));
std::auto_ptr<IOutputFile> out(output_factory(output_name.c_str()));
void DoTransformFile(    const char* filename,    FilenameTransform fn_transform,    InputFactory input_factory,    OutputFactory output_factory){    static const int BUFFER_SIZE = 4096;    std::string output_name;    fn_transform(output_name, filename);    if (exists(output_name.c_str())) {        if (MessageBox(NULL, "File already exists, overwrite?", "WinTarBall", MB_YESNO | MB_ICONQUESTION) == IDNO) {            return;        }    }    std::auto_ptr<IInputFile> in(input_factory(filename));    if (!in.get()) {        MessageBox(NULL, "Can't open input file.", "WinTarBall", MB_OK | MB_ICONERROR);        return;    }    std::auto_ptr<IOutputFile> out(output_factory(filename));    if (!out.get()) {        MessageBox(NULL, "Can't open output file.", "WinTarBall", MB_OK | MB_ICONERROR);        return;    }    char buffer[BUFFER_SIZE];    bool done = false;    while (!done) {            int read = in->Read(buffer, BUFFER_SIZE);        int sent = out->Write(buffer, read);        if (sent != read) {            MessageBox(NULL, "Can't write to file.", "WinTarBall", MB_OK | MB_ICONERROR);            done = true;        } else {            done = (read != BUFFER_SIZE);        }    }}