FObjectSafetyFlags: dword;
add IObjectSafety to your class declaration and implement it as follows:
TfrmRPDEClient = class(TActiveForm, IRPDEClient, IObjectSafety)
...
...
protected
{ Protected declarations }
function GetInterfaceSafetyOptions(const IID: TIID; pdwSupportedOptions,
pdwEnabledOptions: PDWORD): HResult; stdcall;
function SetInterfaceSafetyOptions(const IID: TIID; dwOptionSetMask,
dwEnabledOptions: DWORD): HResult; stdcall;
end;
implmentation
function TfrmRPDEClient.GetInterfaceSafetyOptions(const IID: TIID;
pdwSupportedOptions, pdwEnabledOptions: PDWORD): HResult;
var
Unk: IUnknown;
begin
if (pdwSupportedOptions = nil) or (pdwEnabledOptions = nil) then
begin
Result := E_POINTER;
Exit;
end;
Result := QueryInterface(IID, Unk);
if Result = S_OK then
begin
pdwSupportedOptions^ := INTERFACESAFE_FOR_UNTRUSTED_CALLER or
INTERFACESAFE_FOR_UNTRUSTED_DATA;
pdwEnabledOptions^ := FObjectSafetyFlags and
(INTERFACESAFE_FOR_UNTRUSTED_CALLER or INTERFACESAFE_FOR_UNTRUSTED_DATA);
end
else
begin
pdwSupportedOptions^ := 0;
pdwEnabledOptions^ := 0;
end;
end;
function TfrmRPDEClient.SetInterfaceSafetyOptions(const IID: TIID;
dwOptionSetMask, dwEnabledOptions: DWORD): HResult;
var
Unk: IUnknown;
begin
Result := QueryInterface(IID, Unk);
if Result <> S_OK then Exit;
FObjectSafetyFlags := dwEnabledOptions and dwOptionSetMask;
end;