Delphi Conversion of "C" enum
- From: "alanglloyd@xxxxxxx" <alanglloyd@xxxxxxx>
- Date: 1 Nov 2005 22:40:23 -0800
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
.
- Follow-Ups:
- Re: Delphi Conversion of "C" enum
- From: Jamie
- Re: Delphi Conversion of "C" enum
- Prev by Date: Re: Another changing the cursor question.
- Next by Date: onCreate vs onShow
- Previous by thread: Another changing the cursor question.
- Next by thread: Re: Delphi Conversion of "C" enum
- Index(es):