Re: GetSaveFileName Question
- From: "Thorsten Albers" <albersRE@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 07 Apr 2008 09:15:07 -0700
TC <getmyemails2@xxxxxxxxx> schrieb im Beitrag
<u7L959ImIHA.1280@xxxxxxxxxxxxxxxxxxxx>...
I am using the GetSaveFileName API and I wanted to know if there is a wayto
have the 'File Name' textbox show up empty?one
For example, in most Windows apps or Office apps for that matter, when
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 thatthe
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
----------------------------------------------------------------------
.
- References:
- GetSaveFileName Question
- From: TC
- GetSaveFileName Question
- Prev by Date: Re: GetSaveFileName Question
- Next by Date: Re: Find the login time of the current Windows user
- Previous by thread: Re: GetSaveFileName Question
- Index(es):