Name Last modified Size Description
Parent Directory -
CHANGELOG.html 18-Feb-2005 19:21 2.3K
DEPENDENCIES.html 18-Feb-2005 19:21 1.2K
DOCUMENTATION.html 24-Jan-2005 00:00 132
LICENSE.txt 02-Dec-2004 00:00 11K
README.html 02-Dec-2004 00:00 18K
builds/ 27-Aug-2008 02:06 -
Visual Basic Libraries for Novell® Services allows a VB user to use NetWare® APIs in a VB program. The libraries are in the form of a text file and a set of helper routines in a .BAS file. The text file (netware.txt) contains declarations for most of the NetWare APIs.
The libraries do not support the 16-bit library.
All of the constants, types, and routine declares are in the netware.txt file to make it easier to include them in a project. This one file replaces all of the other files that used to be shipped with the Visual Basic Libraries. A sample project, NDSLoginSample, is also included to demonstrate some of the routines that are available.
While no Visual Basic specific documentation exists, you can find documentation for each API listed in the netware.txt file by
The netware.txt file can be used through the API Viewer or added as a module directly into a Visual Basic project.
The most important step in calling NetWare APIs from VB is passing parameters correctly. The parameters can be categorized into three groups:
Integer, Long, and Byte are primitive types. These parameters can be passed by value or by reference. You don't have to be concerned about the way this type of parameter is passed since they are automatically taken care of.
String are declared in one of two ways:
In this case, create a variable of String type, initialize it and pass it to the API. If it is an Out variable, the API will modify it. Initialization of String types is very important.
If it is an Out variable, allocate space for containing the result. Suppose there exists a maximum length of 50, you could declare that space as
Dim x As String * 50
In this case, create a Byte array of required length (50 for the above example). At the time of calling the API, pass the first element of the byte array.
You can call StrToBytes to copy a string to a byte array or call BytesToStr to copy a byte array to a string. These two routines are both defined in the netware.txt file.
User-defined types can be passed only ByRef. A field of user-defined type can contain primitive types, string types, user-defined types, or a pointer to any of the above.
VB does not support pointers. However a variable of type Long can be used for containing the address of a variable.
To retrieve the address of any variable, you can call the routines provided in the netware.txt file. To get the address of a variable, call the corresponding routines and pass the variable as the first and second parameters. The routines return the address of the variable.
The following table contains information about the routine to call for each variable:
Integer |
aInteger |
Long |
aLong |
Byte |
aByte |
The following code is an example of how these routines can be called to initialize a member of a structure that is a pointer to an Integer..
Type twoInt
pointerToInt As Long
Int As Integer
End Type
Dim x As Integer
Dim y As twoInt
x = 5
y.pointerToInt = aInteger(x,x)
Some of the APIs take a pointer to a pointer of a structure. For example, AllocBuf takes a pointer to a pointer of the buf_t structure (the buf variable in NWDSAllocBuf). In this case, declare a variable of type Long.
Most of the NetWare APIs have types that are unsigned, such as an unsigned long and an unsigned int.
Because Visual Basic does not support unsigned long or unsigned int types, we have included some helper routines in a module called ConvertTypes.bas that can be used to promote or demote the type to the desired result.
For example, the following code defines the NWFSE_FILE_SYSTEM_INFO structure as it is declared in a C header file of the NetWare API:
typedef struct
{
SERVER_AND_VCONSOLE_INFO serverTimeAndVConsoleInfo;
nuint16 reserved;
FSE_FILE_SYSTEM_INFO fileSystemInfo;
} NWFSE_FILE_SYSTEM_INFO;
In Visual Basic, the same structure is declared as follows:
Type NWFSE_FILE_SYSTEM_INFO
serverTimeAndVConsoleInfo As SERVER_AND_VCONSOLE_INFO
reserved As Integer
fileSystemInfo As FSE_FILE_SYSTEM_INFO
End Type
Notice that reserved in the C declaration is of type nuint16 and in Visual Basic, it is a signed integer. Both are two bytes. However, because Visual Basic doesn't have unsigned integers or long types, it is signed instead of unsigned. For this reason, we have provided the following helper routines in the converttypes.bas file:
The preceeding routines help you to get the desired results back from structures and routines that have types of unsigned long and unsigned integer.
The NWCCGetConnInfo function was earlier declared as follows:
Declare Function NWCCGetConnInfo Lib "clxwin32" (ByVal connHandle As Long, ByVal infoType As Long, ByVal len1 As Long, buffer As Byte) As Long
Here, the last parameter (buffer) is a generic pointer. If used as is, it does not work. If the type for buffer is converted to Any, attempting to get a string causes Visual Basic to crash. However, other types work.
For strings, the last parameter should be declared as "ByVal buffer As String," so we've added the following two declarations:
Declare Function NWCCGetConnInfoString Lib "clxwin32" Alias "NWCCGetConnInfo" (ByVal connHandle As Long, ByVal infoType As Long, ByVal len1 As Long, ByVal buffer As String) As Long [for String values]
Declare Function NWCCGetConnInfo Lib "clxwin32" (ByVal connHandle As Long, ByVal infoType As Long, ByVal len1 As Long, buffer As Any) As Long [for non-String values]
These declarations are similar to the NWDSGetContext and NWDSSetContext functions. To see how to pass strings to these routines, see the additional routines listed in the converttypes.bas file.
Visual Basic Libraries for Novell Services is unsupported.
Novell, Inc. makes no representations or warranties with respect to the contents or use of this documentation, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. Further, Novell, Inc. reserves the right to revise this publication and to make changes to its content, at any time, without obligation to notify any person or entity of such revisions or changes.
Further, Novell, Inc. makes no representations or warranties with respect to any software, and specifically disclaims any express or implied warranties of merchantability or fitness for any particular purpose. Further, Novell, Inc. reserves the right to make changes to any and all parts of Novell software, at any time, without any obligation to notify any person or entity of such changes.
You may not use, export, or re-export this product in violation of any applicable laws or regulations including, without limitation, U.S. export regulations or the laws of the country in which you reside.
All files provided in this release are subject to the Novell Developer License Agreement , which can be found in the license.txt file provided in this download.
Copyright © 1999-2004 Novell, Inc. All rights reserved. No part of this publication may be reproduced, photocopied, stored on a retrieval system, or transmitted without the express written consent of the publisher.
Novell and NetWare are registered trademarks of Novell, Inc. in the United States and other countries.
All third-party products are the property of their respective owners.