Article View: borland.public.cppbuilder.nativeapi
Article #8674Re: GetDiskFreeSpaceEx()
From: Remy Lebeau (TeamB)
Date: Tue, 05 Oct 2004 22:30
Date: Tue, 05 Oct 2004 22:30
36 lines
2245 bytes
2245 bytes
"TerryC" <terryc.DONTSPAMME@sweetwaterhsa.DONTSPAMME.com> wrote in message
news:416309b0$1@newsgroups.borland.com...
> There is an ambiguity between __stdcall GetDiskFreeSpaceEx()
> and Sysutils::GetDiskFreeSpaceEx().
The VCL has a global function pointer named GetDiskFreeSpaceEx(), and the
Win32 API has a function named the same. In fact, the VCL's global pointer
is directly related to the API's function. The VCL dynamically loads the
API's function at runtime because it does not exist on all systems. If the
API function is not available on a machine, a stub function is used instead.
By using the VCL's global pointer in your code, you can safely call
GetDiskFreeSpaceEx() regardless of whether the API's function is actually
available or not.
> Since the Sysutils version is not documented
> I want to use the native Win32 API version.
You should use the VCL's global pointer instead. See above.
> How do I tell the compiler I want to use the __stdcall version?
> (Can't seem to get it to understand
> not_Sysutils::GetDiskFreeSpaceEx() ;-} )
Remove the namespace altogether, and leave just the colons. That means to
look in the global namespace:
// call the VCL's pointer
Sysutils::GetDiskFreeSpaceEx(...)
// call the API function directly
::GetDiskFreeSpaceEx(...)
Gambit
Technical Details
Message-ID:
<41632081$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!peernews-us.colt.net!colt.net!peernews3.colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<416309b0$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,2bd7eca6c872de70 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <416309b0$1@newsgroups.borland.com> Subject: Re: GetDiskFreeSpaceEx() Date: Tue, 5 Oct 2004 15:30:33 -0700 Lines: 38 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <41632081$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1097015425 68.69.17.41 (5 Oct 2004 15:30:25 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!peernews-us.colt.net!colt.net!peernews3.colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail