Name

Declare Statement

Syntax

Syntax for subroutines:

[accessmodifier] Declare [Ansi|Unicode|Auto] Sub name Lib "libname" _
    [Alias "aliasname"] [([arglist])]

Syntax for functions:

[accessmodifier] Declare [Ansi|Unicode|Auto] Function name _
   Lib "libname" [Alias "aliasname"] [([arglist])] [As type]
accessmodifier (optional; Keyword)

accessmodifier can be any one of the following: Public, Private, Protected, Friend, or Protected Friend. The following table describes the effects of the various access modifiers. Note that Direct Access refers to accessing the member without any qualification, as in:

classvariable = 100

and Class/Object Access refers to accessing the member through qualification, either with the class name or the name of an object of that class.

Direct Access scope

Class/Object Access scope

Private

Declaring class

Declaring class

Protected

All derived classes

Declaring class

Friend

Derived in-project classes

Declaring project

Protected Friend

All derived classes

Declaring project

Public

All derived classes

All projects

For more information, see Section 4.7 in Chapter 4.

Ansi (optional; Keyword)

Converts all strings to ANSI values.

Unicode (optional; Keyword)

Converts all strings to Unicode values.

Auto (optional; Keyword)

Converts the strings according to .NET rules based on the name of the method (or the alias name, if specified). If no modifier is specified, Auto is the default.

name (required; String literal)

Any valid procedure name. Note that DLL entry ...

Get VB.NET Language in a Nutshell, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.