Click to See Complete Forum and Search --> : OS versions and API
Dillinger4
Jun 10th, 2001, 01:45 PM
Hey i was just wondering if there are any major changes to the API from OS to OS. With mircosoft spitting out a new OS every 10 seconds, windows 98, windows ME, windows XP ect.... do they add anymore functionality to the API or are the major changes just a revamped OS Interface?
jim mcnamara
Jun 10th, 2001, 03:20 PM
The Win 9X family (95, 98, me) and the NT family (3.x,4.x,2000 pro)
have different sets of api's, especially for security and for network activity -netapi32
The main stuff - shell32, user32, kernel32, & gdi32, are all pretty much the same. But not exactly. You should include something like this to test before you call and bomb:
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
Public Function IsAPIThere(ByVal strFunc as String, ByVal strDll as String) as Boolean
Dim lHandle As Long
Dim lAddr As Long
lAddr = False
lHandle = LoadLibrary(strDll)
If lHandle <> 0 Then
lAddr = GetProcAddress(lHandle, strFunc)
FreeLibrary lHandle
End If
IsAPIThere = (lAddr <> 0)
End Function
:D
Dillinger4
Jun 10th, 2001, 07:34 PM
Hummmmmm interesting. Thank you. So if, say i was using an API
call in a program i was developing i would want to use this function to see if the API is there?
Megatron
Jun 11th, 2001, 02:32 PM
I woudln't suggested you hard code that into your program, rather, you should test it on each OS (it shoulsn't be too hard).
Only test the API's you are skeptical about (e.g: security or net), because most of the others will probably work fine.
Dillinger4
Jun 11th, 2001, 02:38 PM
Ok thanks....... Dont worry i voted for you;)
Megatron
Jun 11th, 2001, 02:47 PM
I'm not overley concerned with that poll. If his attempt was to target me, then it looks like it backfired. Thanks anyways.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.