|
@@ -290,6 +290,9 @@ unit comobj;
|
|
|
|
|
|
function StringToLPOLESTR(const Source: string): POLEStr;
|
|
function StringToLPOLESTR(const Source: string): POLEStr;
|
|
|
|
|
|
|
|
+ procedure InterfaceConnect(const Source: IUnknown; const IID: TIID; const Sink: IUnknown; var Connection: DWORD);
|
|
|
|
+ procedure InterfaceDisconnect(const Source: IUnknown; const IID: TIID; var Connection: DWORD);
|
|
|
|
+
|
|
procedure DispatchInvoke(const Dispatch: IDispatch; CallDesc: PCallDesc;
|
|
procedure DispatchInvoke(const Dispatch: IDispatch; CallDesc: PCallDesc;
|
|
DispIDs: PDispIDList; Params: Pointer; Result: PVariant);
|
|
DispIDs: PDispIDList; Params: Pointer; Result: PVariant);
|
|
procedure DispatchInvokeError(Status: HRESULT; const ExceptInfo: TExcepInfo);
|
|
procedure DispatchInvokeError(Status: HRESULT; const ExceptInfo: TExcepInfo);
|
|
@@ -586,6 +589,35 @@ implementation
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
+ procedure InterfaceConnect(const Source: IUnknown; const IID: TIID; const Sink: IUnknown; var Connection: DWORD);
|
|
|
|
+ var
|
|
|
|
+ CPC: IConnectionPointContainer;
|
|
|
|
+ CP: IConnectionPoint;
|
|
|
|
+ i: hresult;
|
|
|
|
+ begin
|
|
|
|
+ Connection := 0;
|
|
|
|
+ if Succeeded(Source.QueryInterface(IConnectionPointContainer, CPC)) then
|
|
|
|
+ if Succeeded(CPC.FindConnectionPoint(IID, CP)) then
|
|
|
|
+ i:=CP.Advise(Sink, Connection);
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ procedure InterfaceDisconnect(const Source: IUnknown; const IID: TIID; var Connection: DWORD);
|
|
|
|
+ var
|
|
|
|
+ CPC: IConnectionPointContainer;
|
|
|
|
+ CP: IConnectionPoint;
|
|
|
|
+ i: hresult;
|
|
|
|
+ begin
|
|
|
|
+ if Connection <> 0 then
|
|
|
|
+ if Succeeded(Source.QueryInterface(IConnectionPointContainer, CPC)) then
|
|
|
|
+ if Succeeded(CPC.FindConnectionPoint(IID, CP)) then
|
|
|
|
+ begin
|
|
|
|
+ i:=CP.Unadvise(Connection);
|
|
|
|
+ if Succeeded(i) then Connection := 0;
|
|
|
|
+ end;
|
|
|
|
+ end;
|
|
|
|
+
|
|
|
|
+
|
|
procedure SafeCallErrorHandler(err : HResult;addr : pointer);
|
|
procedure SafeCallErrorHandler(err : HResult;addr : pointer);
|
|
{$ifndef wince}
|
|
{$ifndef wince}
|
|
var
|
|
var
|