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



Danny Strümpel schrieb:
Ikke schrieb:
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?

SysUtils.DeleteFile() calls Windows.DeleteFile()

If I understood it correctly, this error should not show up, unless you are inheriting and expanding SysUtils.DeleteFile(). And this is impossible since DeleteFile() is a routine and not an object's method.

I understood it wrong, and this is half-way nonsense. ;-)

In your Delphi version SysUtils.DeleteFile() seems to be declared using the inline directive. This means that the call to Windows.DeleteFile() would directly replace your call to SysUtils.DeleteFile(). This can only work, if you also bind the Windows unit into the uses clause. If you don't, it will simply not be replaced.

Example:

uses
Windows, SysUtils;

begin
DeleteFile('blah');
end;

Without inlining, this calls SysUtils.DeleteFile() which calls Windows.DeleteFile().

With inlining, this directly calls Windows.DeleteFile().

If you don't include Windows, it simply uses the first way (which is the standard way of calling this function in at least Turbo Explorer).

So, you can ignore this message, your program will work.

--
Too clever is dumb.
-- Ogden Nash

....und wech
Danny <dannys9 (at) gmx (dot) de>
.



Relevant Pages

  • Re: DiskPart on Win2K SP4 Extending RAID 5 data volume
    ... system isn't expanding to fill the new size. ... MFT knows to use all of the new partition size. ... Windows NT4&2000 MCSE ... The hot fix would not install due to ...
    (microsoft.public.win2000.file_system)
  • Re: Cannot Run XPsp2 Setup CD to add windows components
    ... I'm sorry that does not apply here, Peter. ... Expanding a fresh copy of sysoc.inf file from the source should help. ... Expanding Sysoc.inf file from the Windows XP CD ... "Setup was unable to open information file hide-4. ...
    (microsoft.public.windowsxp.configuration_manage)
  • Re: Cannot run XP Setup CD to add components
    ... Expanding a fresh copy of sysoc.inf file from the source should help. ... Expanding Sysoc.inf file from the Windows XP CD ... "Setup was unable to open information file hide-4. ... The specific error code is 0x7b at line 2088999592." ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Computer Maintenance Post SP2
    ... >machine so I think it was auto deleted after expanding into Windows - ... The ServicePackFiles is needed: contains the service pack file versions ... The uninstall folder you can delete once you are satisfied you will not ... Windows - Download one, which is not I think going to be usable again so ...
    (microsoft.public.windowsxp.general)
  • Re: Using msconfig to restore rpcss.exe from disc
    ... Here's a link to try on expanding ... by entering D: <rtn> for your CD Cdrive ... Hmmm, you asked for Rpcss.exe, the Windows disks only has the rpcss.dll. ... the DLL cache folder. ...
    (microsoft.public.windowsxp.general)