?
Solved

Which unit to include in ordrer to use WIN32_FIND_DATA statement

Posted on 2004-09-29
4
Medium Priority
?
860 Views
Last Modified: 2010-04-16
I'm trying to compile (Delphi 2) following code:

program Test;
{$APPTYPE CONSOLE}

uses
  SysUtils;

var FileData: WIN32_FIND_DATA;
    hSearch: THandle;

begin
 hSearch:=FindFirstFile(PChar('D:\1\*.*'),FileData);
 repeat Writeln (FileData.cFileName);
 until not FindNextFile(hSearch,FileData);
 FindClose(hSearch);
 ReadLn;
end.

Currently I have stuck on: Undeclared identifier 'WIN32_FIND_DATA'.

I'm a Delphi beginner. Please don't laugh.
0
Comment
Question by:For-Soft
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 7

Expert Comment

by:LRHGuy
ID: 12182178
Did you try WinTypes or WinProcs?

It's been a while since I've used D2.
0
 
LVL 10

Author Comment

by:For-Soft
ID: 12182279
I just did.
WinTypes and WinProcs units gave nothing.
0
 
LVL 7

Accepted Solution

by:
LRHGuy earned 200 total points
ID: 12182646
I found my old Delphi2 and Win32_Find_Data is not in there anywhere.

You might replace it with TWin32FindData found in the Windows unit. It's exactly what you need!

0
 
LVL 10

Author Comment

by:For-Soft
ID: 12182705
TWin32FindData works fine.
Thanks.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month15 days, left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question