Solved

Bizarre Error

Posted on 2002-04-25
6
153 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

756 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