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



Ikke schrieb:
Danny Strümpel <dannys9@invalid> wrote in
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).

But as I already replied to Old Fan, I do not include Windows in the
uses list. As soon as I do, I get all sorts of other errors, but without
it, I still get the hint.

To get rid of this one hint, you need to include Windows - if you don't like to disable the warnings. This means, you need to resolve all other errors and warnings afterwards.

OR...

You implement your own DeleteFile(), indepenent of the Windows unit.

------- 8< -------

interface

function DeleteFile(FileName: PChar): LongBool; stdcall;

implementation

function DeleteFile; external 'kernel32.dll' name 'DeleteFileA';

------- 8< -------

You need to typecast string variables holding the file name to PChar when calling DeleteFile() (that's what SysUtils.DeleteFile() does).

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

I know I can just ignore the message, but I'd still like to get rid of
it.

At work, we have a sort of unwritten rule:
1. if you find an error in the source code, fix it before checking the
source in. 2. if you get a hint, treat it like an error :)

Basically a good idea, that's how I do it ;-) When I'm compiling, I don't want to see any messages...

--
Support wildlife -- vote for an orgy.

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



Relevant Pages

  • Re: My Dumb Question of the Month
    ... There are all sorts of ways to do it. ... Calling a professional is the easiest way to do it as they know what they're doing and they do it. ... But the bottom line is go to Borders, anyway, and spend hours there looking at books, magazines, newspapers, etc ... ... whether they are related to website creation or not. ...
    (alt.marketing.online.ebay)
  • Re: return values of os.system() on win32
    ... According to the docs, assuming that *in general* would be an error, but it's likely that for the sorts of cases you are talking about, it's true. ... Ultimately, since the return code is generally under the control of the application you're calling, it's absolutely possible that there are many programs which do not work as you assume above, and probably a large number which don't ever explicitly set the return value at all... ...
    (comp.lang.python)
  • [PATCH 1/3] tty: Sort out the USB sysrq changes that wrecked performance
    ... We can't go around calling all sorts of magic per character functions at ... Please read the FAQ at http://www.tux.org/lkml/ ...
    (Linux-Kernel)
  • Re: The Piece You Wish You Could Play
    ... me calling me all sorts of names. ... Now, you just can't get away with that, Michael. ... If you are referring to me, post the one email that I sent you this week. ...
    (rec.music.classical.guitar)
  • DeleteFile fails unexpectedly
    ... We make sure that the file exists by calling FindFirstFile(), ... * The deletion happens on a secondary thread. ... Also is it possible that DeleteFile could return successfully but the ...
    (microsoft.public.win32.programmer.kernel)