Results 1 to 10 of 10

Thread: API's?!!!!!!!!!!

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227

    API's?!!!!!!!!!!

    hi,

    I want to learn about how to use win API's, never used them before , where to start ? ( cant buy books, its pretty hard finding them where i am )

    and when are they useful? i mean i thought that you can do everything using the framework classes that you can do using those api's , but its seems theres alot that the framework cant do and api's have to be used directly

    i know its hard to answer this stupid question, but it would be nice if anyone could show me the path of understanding and using win api's

    sorry for the newbie type of question again, thanks

  2. #2
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    Http://www.allapi.net

    This is one of the best api reference sites that I could find. It also has a useful program (Api Guide) that has a lot of examples on how to use api's.
    If wishes were fishes we'd all cast nets.

  3. #3
    Lively Member
    Join Date
    Oct 2003
    Posts
    88
    Yeah there are huge piles of function that currently the Framework simply doesn't have implemented. For example a huge amount of common task system-level stuff like manipuating OS file security or modifying user accounts. Another example is if you want anything beyond the most basic printing (e.g. printing in multiple columns or mixed format). I believe that over time the Framework will be expanded to catch at least some of the more common functions.

    The generic term for calling a function that lives in a DLL (e.g. the Win32 API) is "Platform Invoke". Check out your help on that:
    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconplatforminvokeexamples.htm
    ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconacloserlookatplatforminvoke.htm

    Very good docs on the Win32 API can be found as Graff says above, although you should be aware that most of their examples are in VB6. Better than nothing though!

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    so can we say every single action thats performed in windows is through an API call, i mean whatever we see we can do by finding the right api ( or are there some api's that can not be referenced to? ) ?!

    and do all framework classes use api's? i mean are the api's the base for all functionality of the framework?

  5. #5
    Fanatic Member Graff's Avatar
    Join Date
    Jan 2002
    Location
    Calgary
    Posts
    668
    I beleive microsoft prevents you from doing "EVERYTHING" but the APIs give you control of the good majority.

    They should be funcational for all framework languages, just the syntax needs to be adjusted. For example just about all the apis listed in the guide need to be adjusted slightly, instead of long you need to use Int32... not always, sometimes it will work as long but I found it's safer to just stick with Int32 for consistancy.
    If wishes were fishes we'd all cast nets.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    so the question is that all vb does is make it easier to use these api's, and nothing else, is that true?!

  7. #7
    Lively Member
    Join Date
    Oct 2003
    Posts
    88
    Well yes and no - the .NET Framework makes many tasks much simpler than doing the same thing via API calls, but on the other hand there are a whole bunch of things built into the Framework that are new and would be impractical to write from scratch.

    DataSets are a very good example that I can think of. I do certain things with DataSets that I doubt were intended originally, but I can't imagine a way of getting them done using another programming technique that would be ANYWHERE NEAR as easy. Maybe it's a bad programming technique, but how else could you get the effect of unbounded, jagged, queryable arrays with pretty flexible triggers, without installing SQL Server or some crap? I'm sure there are other ways to get the same effect but I'm not skilled enough to even imagine them, let alone write them. But DataSet offers a very solid and extremely functional "black box" that my applications can use on any platform that has .NET Framework installed.

    PS: Yes much of what the Framework does "under the hood" is done through the Win32 API.
    Last edited by Crunch; Oct 26th, 2003 at 10:20 PM.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    and whats the best way to find the api we want, i mean we know for example what we want to do , now how can we search to api's and see which one can help us?!

  9. #9
    Lively Member
    Join Date
    Oct 2003
    Posts
    88
    Go check out the link Graff showed above (2nd post). API-Guide is a freeware product that you can download from there that is basically a bunch of code samples that are searchable. All of them have VB6 examples, some of them have VB.NET samples.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    thanks, all go check them out

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