Since these functions are encapsulated within external DLLs they are not available
in VB by default. Before invoking (i.e. using) them, we must declare them. Usually
this is done in the General | Declarations part of the module in which they
are to be used.
One important thing should be remembered while declaring API functions within
a form module. VB does not allow public Declare statements within form modules.
So the Declare statements should be explicitly specified as Private since all
object module members are considered Public by default. But this makes them
invisible outside the module in which they are defined. So the functions should
be declared in every module that needs to use them.
Declaring them in a separate .BAS module where they can be declared as Public
and are therefore accessible to all the modules eliminates this duplication.
This also permits easier maintenance.
Note: We will see how to declare and use API functions in the
second article of this series.
API Programming Series #1
- Foreword
- So what's API
- Where does the API reside?
- How can we access API functions from VB?
- Why use the API when I can achieve most of the thi
- What are the cons?
- Conclusion
How can we access API functions from VB?
You might also like...
.NET books
-
Programming with Microsoft Visual Basic 2008
Programming with Microsoft Visual Basic 2008, Fourth Edition by the best-selling author, Diane Zak, is designed for a first course in programming. Using the most recent version of the software, Visual Basic 2008, this book teaches individuals how to ...
.NET forum discussion
-
edmonton female escort services near me
by canadapleasure (0 replies)
-
Best security system for laptop
by maha.k47825 (0 replies)
-
Bagaimana memenangkan $ 1,54 miliar dalam Mega Jutaan
by gametogelan (0 replies)
-
input integer from text file and output text file
by shmilon (0 replies)
-
how can i in C++ send file to other PC over net ?
by greensqeq (7 replies)
.NET podcasts
-
Stack Overflow Podcast: Podcast #45 – Keeping it Sharp
Published 7 years ago, running time 0h54m
Our guest this week is Eric Lippert – language architect extraordinaire and famous for all his work at Microsoft in developing their languages Eric joined Microsoft right out of college and was originally working on VB It’s time for everyone’s favorite game: Name the Worst Feature of that Microso.
Comments