Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

FindFirstFile() Need Help!!!

0 views
Skip to first unread message

Erik Likeness

unread,
Sep 9, 1997, 3:00:00 AM9/9/97
to

Hello,

I wrote the following program and I always get an application error
when I run it. Can Someone please tell me what is wrong with this code?

#include <windows.h>

int main()
{
HANDLE find;
LPWIN32_FIND_DATA ffblk;
LPCTSTR search="*";

find=FindFirstFile(search,ffblk);

if (find!=INVALID_HANDLE_VALUE)
printf("Filename: %s\n",ffblk->cFileName);

return 0;

}


Thanks
ig...@engr109.tamu.edu


Chris Marriott

unread,
Sep 9, 1997, 3:00:00 AM9/9/97
to

In article <3415742A...@engr109.tamu.edu>, Erik Likeness
<ig...@engr109.tamu.edu> writes

Doesn't the declaration "LPWIN32_FIND_DATA" tell you something? Think
about what "LP" stands for...

Chris

----------------------------------------------------------------
Chris Marriott, Microsoft Certified Solution Developer.
SkyMap Software, U.K. e-mail: ch...@skymap.com
Visit our web site at http://www.skymap.com

Alfons Hoogervorst

unread,
Sep 10, 1997, 3:00:00 AM9/10/97
to

Lo Erik Likeness <ig...@engr109.tamu.edu>:

> I wrote the following program and I always get an application error
>when I run it. Can Someone please tell me what is wrong with this code?

Obviously my assumption in a previous reply was wrong...
FindFirstFile() wants the "address" of a WIN32_FIND_DATA struct:

HANDLE hFind;
WIN32_FIND_DATA ffblk;
find = FindFirstFile(TEXT("*.*"), &ffblk);

Bye.

---

>#include <windows.h>
>
>int main()
>{
>HANDLE find;
>LPWIN32_FIND_DATA ffblk;
>LPCTSTR search="*";
>
>find=FindFirstFile(search,ffblk);
>
>if (find!=INVALID_HANDLE_VALUE)
> printf("Filename: %s\n",ffblk->cFileName);
>
>return 0;
>
>}


+- Conceived Through Intercalation And Juxtaposition -+
| systems programmer / word player avant la lettre |
| proteus <hosted at> worldaccess nl |
+-----------------------------------------------------+

0 new messages