|
-
Dec 11th, 2000, 12:00 PM
#1
Thread Starter
Addicted Member
Okay I've checked 3 api sites and a book and they all say this works. Unfortunately I can't make a long value equal FindFirstFile or FindNextFile. Here's my code.
Can someone make this work correctly? Btw it only grabs the first 2 files in this code, i'll add my loop later
[code]
#include <iostream.h>
#include <windows.h>
void main()
{
WIN32_FIND_DATA data;
char search[] = "C:/windows/system/*.dll";
long hsearch;
hsearch = FindFirstFile("C:/windows/system/*.dll",&data);
cout<<data.cFileName<<endl;
FindNextFile(hsearch,&data);
cout<<path<<data.cFileName<<endl;
}
-
Dec 11th, 2000, 03:37 PM
#2
Frenzied Member
The FindFirstFile function returns a HANDLE not long. Use This:
Code:
WIN32_FIND_DATA data;
char search[] = "C:/windows/system/*.dll";
HANDLE hsearch;
hsearch = FindFirstFile ( "C:/windows/system/*.dll",&data);
cout<<data.cFileName<<endl;
FindNextFile(hsearch,&data);
cout<<data.cFileName<<endl;
-
Dec 11th, 2000, 06:35 PM
#3
Thread Starter
Addicted Member
*Sigh*
Thank you once again Vlatko. Is there a good resource for using the API in C++? I can use them fine in vb. Just its the C++ conversions that get me
-
Dec 11th, 2000, 08:04 PM
#4
Member
Download the platform SDK from microsoft.
that has documentation on almost all of the API's
-
Dec 12th, 2000, 10:49 AM
#5
Thread Starter
Addicted Member
Could you?
Could you give me the link? I have HORRIBLE luck navigating the msdn site for anything
-
Dec 12th, 2000, 11:53 AM
#6
Thread Starter
Addicted Member
I meant..
I meant what is the SDK you mean? I can't find one for C++ or API on msdn
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|