I tried to wrap up the Win32 COM connection point interface, and I have the following code.
My question is: in order for Island COM memory management to kick in, do I HAVE TO DO the deference
var lCP: IConnectionPoint := lpCP^;
var lCPC: IConnectionPointContainer := lpCPC^;
Or it is totally unnecessary, while I can use the interface pointer (lpCP^, and lcCPC^) directly?
method InterfaceConnect(const aSource: IUnknown; const aIID_ConnectionPoint: ^GUID; const aSink: IUnknown; aConnection: ^DWORD); begin var lpCPC: ^IConnectionPointContainer; var lpCP: ^IConnectionPoint; var IID_ConnectionPointContainer: GUID; IID_ConnectionPointContainer := guidOf(IConnectionPointContainer); aConnection^ := 0; if Succeeded(aSource.QueryInterface(@IID_ConnectionPointContainer, (^^Void)(@lpCPC))) then begin var lCPC: IConnectionPointContainer := lpCPC^; // is this necessary for COM gc to kick in?? if Succeeded(lCPC.FindConnectionPoint(aIID_ConnectionPoint, (^IConnectionPoint)(@lpCP))) then begin var lCP: IConnectionPoint := lpCP^; // is this necessary for COM gc to kick in? lCP.Advise(aSink, aConnection); end; end; end;