Solved

Which unit to include in ordrer to use WIN32_FIND_DATA statement

Posted on 2004-09-29
4
842 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
  • 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 50 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now