Solved

Bizarre Error

Posted on 2002-04-25
6
155 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
[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
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 34

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month4 days, 21 hours left to enroll

636 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