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
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
> 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 |
+-----------------------------------------------------+