• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 872
  • Last Modified:

api declaration with vb.net

Hello experts, i havent done a lot with api calls so i am not sure what is going on.  I need to make some api calls to external dlls, below i found an example of one of the calls.  Could someone explain what is going on or maybe direct me to a website that contains information on api calls with vb.net?

For example how would i use this function?
Declare Function ADAMTCP_ReadReg Lib "ADAMTCP.dll" (ByVal IPAddress As String, ByVal wIDAddress As Short, ByVal wStartAddress As Short, ByVal wCount As Short, ByRef wData As Short) As Integer
     
0
tentavarious
Asked:
tentavarious
  • 2
  • 2
2 Solutions
 
Bob LearnedCommented:
What information do you need (I don't quite understand what you are asking)?

Do you want to know to call the ADAMTCP_ReadReg function?  Or, do you want to know what this API is?

Calling an API function is as easy as calling an internal function:

ADAMTCP_ReadReg(ipAddress, wIDAddress, wStartAddress, wCount, wData)

Bob
0
 
tentavariousAuthor Commented:
I guess i am not really sure what API functions are?  Where is the actually function located?  The above function is just an example.  For the example above:  is the actual function located within the ADAMTP.dll file?   I tried adding the ADAMTP.dll file as a reference so that i could see all functions and methods, but I cant.  I just need some clarification, because I have never dealt with calling API functions.  I will check out the link from the first post to see if that helps me out.
0
 
Bob LearnedCommented:
Start with definition:

http://www.webopedia.com/TERM/A/API.html

Abbreviation of "Application Program Interface".  

A set of routines, protocols, and tools for building software applications. A good API makes it easier to develop a program by providing all the building blocks. A programmer puts the blocks together.

Most operating environments, such as Micro$oft-Windows, provide an API so that programmers can write applications consistent with the operating environment. Although APIs are designed for programmers, they are ultimately good for users because they guarantee that all programs using a common API will have similar interfaces. This makes it easier for users to learn new programs.

Where did the ADAMTP.dll library come from?  DLL library must export functions in order for the caller to call these functions.  You could use something like Dependency Walker (http://www.dependencywalker.com/) to look at the exported functions for the DLL, but that doesn't necessarily help you in making calls correctly.  The "perfect" source is from the library's creator.


Bob
0
 
tentavariousAuthor Commented:
Thanks, got what i needed from this post.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now