-
Nov 7th, 2013, 02:47 PM
#1
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.
-
Nov 7th, 2013, 02:52 PM
#2
Re: VB6, APIs, and OS's
The API Viewer just loads a file. It will show you what ever is int he file
-
Nov 7th, 2013, 04:30 PM
#3
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
-
Nov 7th, 2013, 06:55 PM
#4
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.
-
Nov 7th, 2013, 08:53 PM
#5
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.
-
Nov 7th, 2013, 10:44 PM
#6
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
-
Nov 8th, 2013, 06:57 AM
#7
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
-
Nov 8th, 2013, 08:13 AM
#8
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
-
Nov 8th, 2013, 08:27 AM
#9
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
-
Nov 8th, 2013, 08:30 AM
#10
Re: VB6, APIs, and OS's
Originally Posted by Zvoni
Quoting from Bruce's Book:
Nice!
I suppose I cannot recall any mistakes in that file
VB.NET MVP 2008 - Present
-
Nov 8th, 2013, 08:35 AM
#11
Re: VB6, APIs, and OS's
Originally Posted by HanneSThEGreaT
*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
-
Nov 8th, 2013, 12:17 PM
#12
Re: VB6, APIs, and OS's
Originally Posted by HanneSThEGreaT
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.
-
Nov 8th, 2013, 01:28 PM
#13
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.
-
Nov 8th, 2013, 02:19 PM
#14
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.
-
Nov 8th, 2013, 02:33 PM
#15
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|