Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 158
  • Last Modified:

Bizarre Error

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
mabell
Asked:
mabell
2 Solutions
 
zebadaCommented:
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
 
mabellAuthor Commented:
Yes I know .. it's included too thats why I dont Understand lol
0
 
mabellAuthor Commented:
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
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
Lee_NoverCommented:
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
 
Slick812Commented:
A Note, the compiler searches the units in the uses clause, starting with the last one and moves forward to the first one.
0
 
pnh73Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now