Numeric Parameters

As with VBA, there are many types of numeric data you might come across when working with APIs. The following table outlines the numeric types defined in C/C++ along with their VBA equivalents. Also included are the data type prefixes often found in Windows API declarations on MSDN.

Size (bits)

Data Type

Prefix

Description

VBA Equivalent

8

char

ch

8-bit signed integer

Byte

8

byte, uchar

ch

8-bit unsigned integer

Byte

8

TCHAR

ch

8-bit or 16-bit signed (depending on whether you're using ANSI or Unicode)

Byte or Integer

Size (bits)

Data Type

Prefix

Description

VBA Equivalent

16

short

c

16-bit signed integer

Integer

16

unsigned short, WORD

w

16-bit unsigned integer

Integer

16

TCHAR

ch

8-bit or 16-bit signed (depending on whether you're using ANSI or Unicode)

Byte or Integer

32

int

n

32-bit signed integer

Long

32

long

l

32-bit signed integer

Long

32

unsigned int,UINT

n

32-bit unsigned integer

Long

32

unsigned long, DWORD

dw

32-bit unsigned integer (also referred to as a double-word)

Long

Let's take a closer look at these types of parameters.

0 0

Post a comment