Delphi Conversion of "C" enum



I am interfacing to a USB commercial hardware device which is accessed
by a COM interface.

The SDK method declaration is ...

HRESULT ISpeechMikeControl.SetLED(
[in] LONG lDeviceID,
[in] LONG lIndex,
[in] enum spmLEDColor LEDColor,
[in] enum spmLEDState LEDState);

.... and ...

enum spmLEDState
{
spmLEDOff,
spmLEDBlinkSlow,
spmLEDBlinkFast,
spmLEDOn,
spmAllLEDsOff
};
.... similar for spmLED Color.

The Delphi generated type library declares ...

procedure SetLED(lDeviceID, lIndex: Integer; LEDColor: spmLEDColor;
LEDState: spmLEDState); safecall;

....and ...

spmLEDColor = TOleEnum;
spmLEDState = TOleEnum;

However I find that unless I declare the spmLEDState parameter as a
byte, the method call will not work.

I have tried declaring the parameter as TOleEnum (from OLECtrls.pas),
byte, word and integer. Only a declaration as a byte appears to work.

Any comments, explanations or suggestions please. I am using D3.

Alan Lloyd

.