Re: Strange hint: Inline function 'DeleteFile' has not been expanded??



Ikke wrote:
Hi everybody,

I'm trying to delete a file in a Delphi console application. Everything works fine and the project compiles, except for one hint which I do not understand:

[Pascal Hint] project.dpr(102): H2443 Inline function 'DeleteFile' has not been expanded because unit 'Windows' is not specified in USES list

If I try to add the Windows unit, I get all sorts of errors on other lines.

Can anybody explain to me what this means?

It means exactly what it says. The Windows unit has b=not been used, so the compiler cannot expand the inline function DeleteFile.

To resolve the warning, either disable inline warnings or add the Windows unit to your unit's "uses" clause.

Adding the Windows unit introduces lots of new identifiers into the current scope. The "all sorts of errors" you got probably had to do with identifiers that are in Windows that are also in other units. DeleteFile is in both Windows and SysUtils, for instance. TBitmap is in Windows and Graphics. You can resolve the issue by fully specifying which names you need, such as "Graphics.TBitmap". You can also adjust the order of the used units; units are searched for identifiers in reverse of the order tey appear in the "uses" clause. You probably added Windows to the end of your "uses" clause, so all of its identifiers suddenly took precedence over the other identifiers in your code.

--
Rob
.



Relevant Pages

  • Re: Windows 7 question: can one shuttle hard disks between two systems?
    ... hardware identifiers, since allthough the hardware might be identcal each ... I am using Windows XP in a somewhat special way: ... I *do* have two windows licenses (each system came with a license ...
    (microsoft.public.windowsxp.general)
  • Re: Unicode characters in identifiers
    ... But in Windows Forms Applications, ... like German Umlauts in ordinary identifiers ... Those are also valid according to the C++ standard, ... characters of identifiers in VS2005. ...
    (microsoft.public.dotnet.languages.vc)
  • Re: Unicode characters in identifiers
    ... But in Windows Forms Applications, Visual C++ 2005 also accepts extensions, like German Umlauts in ordinary identifiers ... I could find no reference for the valid characters of identifiers in VS2005. ... What source file encoding were you using? ...
    (microsoft.public.dotnet.languages.vc)
  • Re: windows new users?
    ... Can the microsoft windows experts(or best, ... I have encounter this problem on windows server 2003 sp2 too. ... Well-known security identifiers in Windows operating systems ... Membership is controlled by the operating system. ...
    (microsoft.public.windowsxp.setup_deployment)
  • Re: Execute Delete Where clause
    ... Microsoft MVP [Windows] ... "hughess7" wrote: ... | Can anyone please tell me the correct syntax for a where clause. ... | records deleting but now I want to add a where clause and I get error 424 ...
    (microsoft.public.access.modulesdaovba)