API declarations in standard modules can be Public or Private API declarations in class modules must be Private

■ It will be referred to as GetUserName in your program. This is the variable name assigned by you.

■ The function being used is found in advapi32.dll.

■ The alias, GetUserNameA, is what the function is referred to in the DLL. This name is case sensitive and cannot be changed; it is specific to the DLL. There are often two versions of each API function. One version uses the ANSI character set and has aliases that end with A. The other version uses the Unicode character set and has aliases that end with W. When specifying the alias, you are telling VBA which version of the function to use.

■ There are two parameters, lpBuffer and nSize. These are two arguments that the DLL function accepts.

0 0

Post a comment