Solved

Bizarre Error

Posted on 2002-04-25
6
151 Views
Last Modified: 2010-04-04
Hi All when I try to compile my code
I get this Error : Incompatible Type 'Integer' and 'TSearchRec' but it points me to the Function FindClose(SearchRec); SearchRec is a TSearchRec type variable so it must be ok but when I write 'FindClose('
it writes me that the functions want a HFindFile : Integer
I know that FindClose normally takes a TsearchRec as parameter so why it wants an integer now? lol
Thx for your help
0
Comment
Question by:mabell
6 Comments
 
LVL 6

Accepted Solution

by:
zebada earned 75 total points
ID: 6969976
You must include SysUtils in your unit's uses clause.
Otherwise Delphi will try to use the Windows SDK version of FindClose which takes an unsigned long integer as an argument.
0
 

Author Comment

by:mabell
ID: 6969981
Yes I know .. it's included too thats why I dont Understand lol
0
 

Author Comment

by:mabell
ID: 6969997
Mmmmmmm its ok now hahahaha Guess what I have done?
I just move the SysUtil from the beginning of the Uses clause to the end and now it works lol
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 12

Assisted Solution

by:Lee_Nover
Lee_Nover earned 75 total points
ID: 6970041
mhm
or use SysUtils.FindClose
a similar thing is in D6 with AllocateWnd and the deprecated directive
it's moved from Forms unit to Classes
so you do the same here .. simply use Classes.AllocateWnd :)
0
 
LVL 33

Expert Comment

by:Slick812
ID: 6970397
A Note, the compiler searches the units in the uses clause, starting with the last one and moves forward to the first one.
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9004150
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split points between zebada and Lee_Nover

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

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…
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

776 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