Discussion:
Getting a file name from a formview project
(too old to reply)
Z.K.
2006-07-15 07:15:02 UTC
Permalink
I have a FormView project and I was wondering if someone could tell me
how to get the name of the file name that is selected when trying to
open or save a file. I don't actually need to open or save a file, I
just need the file name. I tried using the serialize function, but that
did not seem to work for me. I can bring up the save or file dialog,
but I can't seem to actually select the file name that I want so that I
can assign it to a variable and display it in a messagebox. When I try
it using the ar variable, nothing happens. I know I could just use
CFile or CStdioFile to do it, but I wanted to use the open file icon
from the toolbar along with the serialize function.

Z.K.
Scott McPhillips [MVP]
2006-07-15 13:08:54 UTC
Permalink
Post by Z.K.
I have a FormView project and I was wondering if someone could tell me
how to get the name of the file name that is selected when trying to
open or save a file.
The file name selected for opening a file is passed to
CDocument::OnOpenDocument.

The file name to be saved is passed to CDocument::OnSaveDocument.

You can override these functions in your CDocument derived class.
--
Scott McPhillips [VC++ MVP]
Z.K.
2006-07-15 19:49:53 UTC
Permalink
Post by Scott McPhillips [MVP]
Post by Z.K.
I have a FormView project and I was wondering if someone could tell me
how to get the name of the file name that is selected when trying to
open or save a file.
The file name selected for opening a file is passed to
CDocument::OnOpenDocument.
The file name to be saved is passed to CDocument::OnSaveDocument.
You can override these functions in your CDocument derived class.
Thanks. For some reason I thought that I had tried that and it did not
seem to work, but it does now in my basic program. Oh well, thanks again.

Z.K.

Loading...