RE: Dumb buffer question.

new topic     » topic index » view thread      » older message » newer message

> -----Original Message-----
> 
> If anyone has used DragQueryFile could you tell me if
> UINT cch set to 128 byte buffer will be enough to accept the
> directory and file names
> 
> 
> UINT DragQueryFile(
>     HDROP hDrop,
>     UINT iFile,
>     LPTSTR lpszFile,
>     UINT cch
> );
> 
> I thought this would be enough but was wondering....<
> Is there a way to dynamically increase/decrease the buffer?

Looks like you could first call it to get the number of files, then call to
get the size of the buffer required, then call to fill the buffer:

Return Value

When the function copies a filename to the buffer, the return value is a
count of the characters copied, not including the terminating null
character. 
If the index value is 0xFFFFFFFF, the return value is a count of the dropped
files. 
If the index value is between zero and the total number of dropped files and
the lpszFile buffer address is NULL, the return value is the required size,
in characters, of the buffer, not including the terminating null character.

Matt Lewis

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu