Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

findfirst, findnext 1

Status
Not open for further replies.

Nosferatu

Programmer
Jun 9, 2000
412
RO
Folks...

I think I am missing something on the above calls for a win2000 environment...
I try to use the functions to scan a directory (of course) but the second call to findnext crashes in NTDLL. The find is initialized with a call to findfirst and the parameter passing looks OK to me:

Code:
int	ret;
struct _finddata_t fdata;

ret = _findfirst("*.*",&fdata);
while (ret != -1)
{	
	ret = _findnext(ret,&fdata); 
// crashes on the second call. NOP on fdata!
...
}

What am I missing?????

Thanks. [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
You overwrite the handle received from _findfirst().

This handle should be reused during calls to _findnext() (And _findclose())
/JOlesen
 
Yep... Thanks a bunch! [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top