Results 1 to 6 of 6

Thread: OS versions and API

  1. #1

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418

    OS versions and API

    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?

  2. #2
    jim mcnamara
    Guest
    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:

    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
    
    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

  3. #3

    Thread Starter
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    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?

  4. #4
    Megatron
    Guest
    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.

  5. #5

  6. #6
    Megatron
    Guest
    I'm not overley concerned with that poll. If his attempt was to target me, then it looks like it backfired. Thanks anyways.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width