|
-
Sep 15th, 2000, 01:32 PM
#1
Thread Starter
Lively Member
I was just wondering... how the hell do some of these people come up with those weird api functions.. and what is an api function? post some common and rare apis here!!
-
Sep 15th, 2000, 01:51 PM
#2
Monday Morning Lunatic
An API function is one that comes as part of an Application Programming Interface, supplied with the product. In most cases (for VB anyway) this is the Win32 API. The functions are stored inside a DLL, and VB loads them at runtime.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 15th, 2000, 03:06 PM
#3
Thread Starter
Lively Member
and where can we find all these functions listed?
-
Sep 15th, 2000, 03:09 PM
#4
Monday Morning Lunatic
VB comes with a viewer which contains all the VB definitions. For documentation, check out MSDN on http://msdn.microsoft.com/library
Look under "Platform SDK" for the details, organised by category.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 16th, 2000, 12:45 AM
#5
Monday Morning Lunatic
Yeah, including the dreaded "As Any". I usually use the viewer definitions, then if it doesn't work, go to the header files and write my own.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Sep 16th, 2000, 02:11 AM
#6
Here is a way to determine if an API Function is available.
Code:
Private Declare Function LoadLibrary Lib "kernel32" _
Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Private Declare Function GetProcAddress Lib "kernel32" _
(ByVal hModule As Long, ByVal lpProcName As String) As Long
Private Declare Function FreeLibrary Lib "kernel32" _
(ByVal hLibModule As Long) As Long
Code:
Public Function APIFunctionPresent(ByVal FunctionName _
As String, ByVal DllName As String) As Boolean
Dim bAvail as boolean
bAvail = APIFunctionPresent("GetDiskFreeSpaceExA", "kernel32")
Dim lHandle As Long
Dim lAddr As Long
lHandle = LoadLibrary(DllName)
If lHandle <> 0 Then
lAddr = GetProcAddress(lHandle, FunctionName)
FreeLibrary lHandle
End If
APIFunctionPresent = (lAddr <> 0)
End Function
-
Sep 16th, 2000, 12:05 PM
#7
Frenzied Member
What's wrong with the as Any Keyword, It's really useful I thought.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|