Calling a C function in a DLL with enum parameters from Delphi
- by dommer
I have a third-party (Win32) DLL, written in C, that exposes the following interface:
DLL_EXPORT typedef enum
{
DEVICE_PCI = 1,
DEVICE_USB = 2
} DeviceType;
DLL_EXPORT int DeviceStatus(DeviceType kind);
I wish to call it from Delphi.
How do I get access to the DeviceType constants in my Delphi code? Or, if I should just use the values 1 and 2 directly, what Delphi type should I use for the "DeviceType kind" parameters? Integer? Word?