
Dialog Boxes - Using Save As, Open, Print, etc.
Dear Prince:
> I am a beginning Visual Basic user...accually, just started
> yesterday...and am having trouble with dialog boxes. I put
> one out and followed the book's instructions to make an open,
> save, and print menu. I try to open any file, and it pops up
> with a box with the drive, directories, and files, but
> doesn't do anything. I try to save and I can see the files,
> but can't get anything to save to the hard disk. I try to
> print stuff in my program and it comes up with the number of
> copies and stuff, but then it doesn't print.
Actually, you are calling the "Windows Common Dialog" functions,
not just "dialog boxes" -- there are other kinds of user dialog
boxes. They are working just as they are supposed to work for the
file operations -- that is, they return a file name and path; they
do not, in themselves, open or save anything. The reason for that
is that it doesn't know what you want to do... you might be simply
wanting to open a file, but on the other hand, you might be wanting
to attach a number of different tables in a database that is
identified by the file and path name. You'll need to use the file
name and path that are returned to perform the operation you
desire.
> Is there something I'm doing wrong? If it's not supposed to
> work, then why do they have it in there??? If anyone has
> some insight on this subject, I'd REALLY appreciate it.
(1) No, not exactly -- more like "something you are not doing", see
above.
(2) Especially when one is just starting out, one needs to "take it
easy" and not assume that because something isn't working _just
as one expects it to work_ (which, as in this case, may not be
the way its intended to work), that "it doesn't work". By the
way, I believe that if you'll really _read_ the documentation
and help you'll find that it does explain this; further, VB
comes with a great many examples, at least some of which have
similar functions that _illustrate_ how to use the functions.
Sounds like you've jumped in "feet first" without doing all the
necessary homework.
(3) Available from "ftp.microsoft.com", from the VB forum on
CompuServe, and from Microsoft's Download Service BBS, there's
a VB Knowledge Base that contains _vast_ amounts of useful
information on subjects like this; there's also a file
available on the Net, the VB FAQ (can't give you the address;
don't have full Net access myself) that likely will cover this
and many other subjects of interest.
(4) I'd bet that _most_ good VB self-study books would have
addressed using the Windows Common Dialog control, at least to
the depth necessary to avoid this question. Any well-stocked
bookstore will have a variety of them, many of them quite good,
but some not so good as others. I can't offer any
recommendations, as the last VB self-study I used was for VB
1.0, and it turned out to be (IMHO) one of the "not so good"
ones (I won't mention it here, since it's out of date, and I've
used some excellent books by the same publisher since, in
other subject areas).
Larry Linson
A mere Commoner, but one who's spent a good deal of time with his
back to the wall doing computer application development...
---
t SLMR 2.1a t