Re: GetSaveFileName Question



TC <getmyemails2@xxxxxxxxx> schrieb im Beitrag
<u7L959ImIHA.1280@xxxxxxxxxxxxxxxxxxxx>...
I am using the GetSaveFileName API and I wanted to know if there is a way
to
have the 'File Name' textbox show up empty?
For example, in most Windows apps or Office apps for that matter, when
one
does a 'Save As', the cursor is placed in the 'File Name' textbox but the

textbox is empty vs. having all of the placeholder character spaces that
the
GetSaveFileName defaults to because of the lpstrFile value inside the
OPENFILENAME structure.
Any advice?

When you have to provide an >empty< buffer to a non-VB function which
(unlike VB) uses NULL terminated strings before passing the buffer to the
function you should initialize it to NULL bytes instead of spaces. I.e.
instead of
MyBuffer$ = Space$(260)
use
MyBuffer$ = String$(260, vbNullChar)

This prevents errors on the function's side and makes much more sense
within the context of the function.

--
----------------------------------------------------------------------
THORSTEN ALBERS Universität Freiburg
albers@
uni-freiburg.de
----------------------------------------------------------------------

.