RE: getOpenFileName Bug???

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

It really has nothing to do with the number of files.  It's the number 
of characters contained in all of those file names that's the problem.

I'm working on a dynamic solution based on this info from the SDK:
"The buffer pointed to by the lpstrFile member of the OPENFILENAME 
structure is too small for the file name specified by the user. The 
first two bytes of the lpstrFile buffer contain an integer value 
specifying the size, in TCHARs, required to receive the full name."

However, this only seems to be true to a certain extent on my XP system 
so I need to to more testing at home.  One *possible* reason for this is 
that the OPENFILENAME structure has 3 extra members in XP:

#if (_WIN32_WINNT >= 0x0500)
  void *        pvReserved;
  DWORD         dwReserved;
  DWORD         FlagsEx;
#endif // (_WIN32_WINNT >= 0x0500)

It would be easy to modify the lib (this structure in particular) using 
GetVersionEx to take advantage of new/extra features.  The question is, 
if I can make this work, will Derek add it or will I be wasting my time?

-- Brian


10963508 wrote:
> Best solutin would be to display how many files maximum can user select
> (text somewhere on top of dialog), and if user did select too many files
> warn him that he has selected too many files and has to select again - 
> don't
> close dialog yet.
> 
> Or that each app would be able to define maximum number of files??
> 
> 
> ----- Original Message -----
> From: "Kat" <gertie at PELL.NET>
> To: "EUforum" <EUforum at topica.com>
> Sent: Tuesday, August 27, 2002 11:47 PM
> Subject: Re: getOpenFileName Bug???
> 
> 
> > On 28 Aug 2002, at 7:00, Derek Parnell wrote:
> >
> > >
> > > Brian is correct. The original routine only catered for a single
> path/file
> > > name to be returned. When it was updated to support multiple files
> names,
> > > the buffer size was not changed. I'll increase it 8000 bytes. This
> should do for
> > > nearly all cases.
> >
> >
> > I have a folder with 12,379 files in it. Any chance you can accomodate
> that?
> >
> > Kat
> >
> >

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

Search



Quick Links

User menu

Not signed in.

Misc Menu