procedure TAddinDesigner.InvokeEvent(DispID: TDispID; var Params: TVariantArray);
begin
case DispID of
-1: Exit; // DISPID_UNKNOWN
1: if Assigned(FOnConnection) then
FOnConnection(Self,
Params[0] {const IDispatch},
Params[1] {ext_ConnectMode},
Params[2] {const IDispatch},
{??PSafeArray}OleVariant((TVarData(Params[3]).VPointer)^) {var ??PSafeArray OleVariant}); <---这个位置出错 注意注释 很有意思
2: if Assigned(FOnDisconnection) then
FOnDisconnection(Self,
Params[0] {ext_DisconnectMode},
{??PSafeArray}OleVariant((TVarData(Params[1]).VPointer)^) {var ??PSafeArray OleVariant});
3: if Assigned(FOnAddInsUpdate) then
FOnAddInsUpdate(Self, {??PSafeArray}OleVariant((TVarData(Params[0]).VPointer)^) {var ??PSafeArray OleVariant});
4: if Assigned(FOnStartupComplete) then
FOnStartupComplete(Self, {??PSafeArray}OleVariant((TVarData(Params[0]).VPointer)^) {var ??PSafeArray OleVariant});
5: if Assigned(FOnBeginShutdown) then
FOnBeginShutdown(Self, {??PSafeArray}OleVariant((TVarData(Params[0]).VPointer)^) {var ??PSafeArray OleVariant});
end; {case DispID}
end;