[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Simple API Question

Posted on 2003-11-20
5
Medium Priority
?
194 Views
Last Modified: 2010-05-01
I am using an API for some mail server software.  I dont have much experience of VB APIs and the documentation with the API is poor.  I have managed to get some stuff working but I dont understand it.

The API is Decalred as follows:

Public Declare Function AddDomain Lib "api" (ByVal Name As String, ByRef Buffer As Any, ByVal Size As Long) As Long

I understand that the Function returns a Long with 0 indicating sucess and any other number indicating an error message.  I understand that Name is the domain name to add.  What I dont understand is what the Buffer is and what the keyword Any means.  The code below does work I just dont understand the buffer stuff.  Any explanations please?

    Dim abBuffer(1 To 1024) As Byte
   
    MsgBox (AddDomain("psllllllsssasdasdsadsoo.homeip.net", abBuffer(1), 1024))
0
Comment
Question by:daveamour
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 4

Accepted Solution

by:
Steve Sirica earned 200 total points
ID: 9789051
Sometimes API functions have types/structures associated with them.  They would look something like this:
type xxx
    zzz as string
    qqq as string
end type

Any might be one of these...Do you see anything like that in the documentation?
0
 
LVL 19

Author Comment

by:daveamour
ID: 9789093
I dont see anything like that for this particular function (AddDomain).  I do understand what you mean though.  Am I right in thinking the buffer can be used to pass data in and to receive data back?  That makes sense to me, I guess I was just confused since this seems redundant with the AddDomain function which seems to only return a Long to indicate success or failure.

Does this sound right?

Dave
0
 
LVL 4

Expert Comment

by:Steve Sirica
ID: 9789153
Hard to answer without knowing the API, but I have seen functions that return data in one of the parms.

So I guess my asnswer is Yes...it sounds on track.
0
 
LVL 19

Author Comment

by:daveamour
ID: 9789180
AhhI think you are right.  I think before you call the AddDomain function you can optionally populate the buffer with data representing various parameters and settings for the domain name.

Got there in the end!

Thanks

Dave
0
 
LVL 4

Expert Comment

by:Steve Sirica
ID: 9789195
You're welcome.

Steve
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question