Library tutorials & articles
API Programming Series #2
- Foreword
- Declaring API functions
- Problems when using API Text Viewer
- Here it comes...
- The Code
- Aliasing
- Arguments
- ByVal and ByRef
Declaring API functions
As discussed in Article #1, the API functions are declared in DLLs located in the Windows System directory. You can type in the declaration of an API just as you do with any other function exported from a DLL, but VB has provided an easier way to do it - it is called the API Text Viewer. This was available as a standalone application in VB5. In VB6 this can be run as a standalone app or as an addin.
To have some API declared in your project, just launch API Text Viewer, open Win32Api.txt (or .MDB if you have converted it into a database to speed it up), choose Declares, find the function, and click Add and then Copy.
Go to your project and paste it in. Do the same to have a predefined constant or type. This saves quite lot of typing. Also it eliminates the errors caused due to mistyping.
Related articles
Related discussion
-
Run-time error '91'
by converter2009 (1 replies)
-
VB6 Runtime error 381 subsript out of range Error
by Uncle (2 replies)
-
passing and reading parameters from using Shell
by jigartoliya (0 replies)
-
Convert C++ code to VB6
by mawcot (4 replies)
-
listbox scrollbar
by Dennijr (10 replies)
Related podcasts
-
Christian Beauclair
14 mai 2008 (�mission #0074) ::.Christian Beauclair: Stratégies de migration VB6 vers .NET Nous discutons avec Christian Beauclair des stratégies de migration VB6 vers .NET. Entre autres, nous discutons comment utiliser le "VB 6 Code Advisor" et le "Interop Forms Toolkit" pour ajouter la puiss...
The current release of the ApiViewer can now be found here:
http://www.activevb.de/rubriken/apiviewer/index-apiviewereng.html
or (German):
http://www.ApiViewer.de
charcoal
he's already posted part 4... i've just gotta get around to publishing 'em
i thought he was never gonna come back
This thread is for discussions of API Programming Series #2.