Results 1 to 15 of 15

Thread: VB6, APIs, and OS's

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    VB6, APIs, and OS's

    Can APIs be added to VB6's API Viewer?

    How is it that I can have API's in my VB6 projects but are not listed in the API Viewer?

    If the API is on the system then wouldn't it stand to reason that VB6 would pick up on these and put them in it's viewer? How is it I have so many APIs on my XP but no reference to them in the viewer.

    How do I find what APIs I have on my XP OS?

    Are APIs downward compatible? For example, can an API from W8 run on XP?


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: VB6, APIs, and OS's

    The API Viewer just loads a file. It will show you what ever is int he file

  3. #3
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: VB6, APIs, and OS's

    if you want a listing of all APIs in Windows... get the Win32API Bible by Dan Appleman... or any Win32API book by Dan... that stuff is golden. A lot of it is now out of print, but you can still find copies floating around here and there if you look.


    Here's the book I was thinking of - http://www.amazon.com/Applemans-Visu.../dp/0672315904
    A couple lifetimes ago, we had a couple copies of that book hanging around...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: VB6, APIs, and OS's

    Of course those books are far out of date while still being good for ca. 1998 API calls. Every new version of Windows has added API libraries and functions and removed a few.

    For example, the spreadsheet Microsoft released for Vista lists 7,124 new API calls, the biggest change since NT 4.0 and until Windows 8.


    Declare statements are not magic incantations, but a sort of "binding" that lets you call a function in some library from your VB program. The library must be present on the system, compatible with the version of Windows, and export the particular function.


    The online MSDN documentation for API calls normally lists the minimum OS version supporting a given function. Of course over time old OSs are dropped, as XP soon will too.

    This means the documentation might say something requires a minimum of XP today, though it actually exists and works as far back as Win95.

    That's why you want to keep old versions of the MSDN Library and Windows SDK around for reference.

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6, APIs, and OS's

    The only book I ever had is Programming Windows 95 by Charles Petzold which taught me a lot back then but it sure doesn't have many of the API's I'm using now. The only reason I know to use a certain APIs is someone here told me or it was in their source code I downloaded.

    I suppose the one techgnome linked to is better than the one I have even if it doesn't have the newer APIs it surely has many not listed in the book I have.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  6. #6
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: VB6, APIs, and OS's

    This thread has a link in it to a api text file compressed in rar format that is quite a bit larger than the one from VB, I haven't looked at it beyond the size but may be worth a look
    http://www.vbforums.com/showthread.p...r-Visual-Basic

  7. #7
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,418

    Re: VB6, APIs, and OS's

    Still my favourite book: http://vb.mvps.org/hardweb/mckinney.htm
    Or directly to the table of contents: http://vb.mvps.org/hardcore/toclist.html
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  8. #8
    Frenzied Member HanneSThEGreaT's Avatar
    Join Date
    Nov 2003
    Location
    Vereeniging, South Africa
    Posts
    1,492

    Re: VB6, APIs, and OS's

    I know I'm a bit late to the party, as always, but the API Viewer makes use of TextFiles. These are named WIN32API.TXT and MAPI32.TXT that are present inside the C:\Program Files\Microsoft Visual Studio\COMMON\Tools\Winapi directory. Obviously if you have converted it to a database file it would be WIN32API.MDB.

    Nothing prevents you from adding items to those lists.

    I should also mention that these text files ( specifically ) are in a certain format. This is to split the Types, from the Declarations and Constants.

    APIs are not downward compatible
    VB.NET MVP 2008 - Present

  9. #9
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,418

    Re: VB6, APIs, and OS's

    Quoting from Bruce's Book:
    WIN.TLB isn’t as comprehensive as WIN32API.TXT. It contains over 700 function entries focused specifically on those functions Visual Basic programmers are most likely to need—as chosen and implemented by yours truly. In contrast, WIN32API.TXT was implemented by a program that converted C include files to Declare statements in a somewhat mechanical and sometimes inaccurate way. So whom do you trust? Me? Or a machine? Unfortunately, WIN32API.TXT has a well-earned reputation for being full of errors.

    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  10. #10
    Frenzied Member HanneSThEGreaT's Avatar
    Join Date
    Nov 2003
    Location
    Vereeniging, South Africa
    Posts
    1,492

    Re: VB6, APIs, and OS's

    Quote Originally Posted by Zvoni View Post
    Quoting from Bruce's Book:
    Nice!

    I suppose I cannot recall any mistakes in that file
    VB.NET MVP 2008 - Present

  11. #11
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    4,418

    Re: VB6, APIs, and OS's

    Quote Originally Posted by HanneSThEGreaT View Post
    *snipp* These are named WIN32API.TXT and MAPI32.TXT that are present *snipp*
    I remember finding the ODBC32.TXT on the Internet. Following Bruce McKinney's examples i even managed to write a TLB for the ODBC-API's :-)
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  12. #12

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6, APIs, and OS's

    Quote Originally Posted by HanneSThEGreaT View Post
    Nice!

    I suppose I cannot recall any mistakes in that file
    I have found discrepancies, like where a Integer should have been a Long, and a few others


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  13. #13
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: VB6, APIs, and OS's

    That sounds like an old 16 bit APIs (integer) got included with newer 32 bit APIs (long) - I've seen old lists like that which combine the two. It really depends on the actual API (.DLL file) being used.

  14. #14

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: VB6, APIs, and OS's

    I don't remember which API is question but I copied it out of the API Viewer. put it in my code and got a run-time error. After examining the API I simply changed the Integer to Long and the app ran correctly.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  15. #15
    gibra
    Guest

    Re: VB6, APIs, and OS's

    My favourites:

    the API Viewer 2004
    http://www.activevb.de/rubriken/apiv...viewereng.html



    The API Guide with 900+ samples
    http://allapi.mentalis.org/agnet/apiguide.shtml



    Last edited by gibra; Nov 8th, 2013 at 02:37 PM.

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