D6 COM Events With Transposed Parameters

2006-02-19 10:59:36 PM
I have generated a TLB file from a type library of a supplied
COM server with events, and found that the event parameters appeared to be transposed on a two parameter event handler.
On inspecting the TLB file I found that the InvokeEvent code had the following ...
case DispID of
1: if Assigned(FOnSPMEventDeviceConnected) then
FOnSPMEventDeviceConnected(Self, Params[0] {Integer});
2: if Assigned(FOnSPMEventDeviceDisconnected) then
FOnSPMEventDeviceDisconnected(Self, Params[0] {Integer});
3: if Assigned(FOnSPMEventButton) then
FOnSPMEventButton(Self, Params[1] {spmControlDeviceEvent},
Params[0] {Integer});
end; {case DispID}
... note the "case of 3" line. On transposing the parameters everything worked OK.
I also noted that the corresponding line in a D5 generated TLB is ...
3: if Assigned(FOnSPMEventButton) then
FOnSPMEventButton(Self, Params[0] {Integer}, Params[1]{spmControlDeviceEvent});
Is this a known bug in Delphi 6 Personal or may something else be going on.
The Delphi 6 TLB was generated as a component COM library.
Alan Lloyd