Hi Dojo,
I've been trying to call SLProtocol.SetRow, from class that implements SimpleMessageExecutor, to update existing row and was getting the following exception:
Exception: System.InvalidOperationException: This type has a ComVisible(false) parent in its hierarchy, therefore QueryInterface calls for IDispatch or class interfaces are disallowed.
at System.Runtime.InteropServices.Marshal.GetNativeVariantForObject(Object obj, IntPtr pDstNativeVariant)
at Skyline.DataMiner.Scripting.ConcreteSLProtocol.SetRow(Int32 iPID, String key, Object row)
at QAction_9000000.InterApp.Executors.RowRequestExecutor.TryExecute(Object dataSource, Object dataDestination, Message& response)
When I tried to call SLProtocol.AddRow it was working fine which got me wondering why. After digging for a bit I realised that AddRow and SetRow are implemented very differently in the ConcreteSLProtocol class.
AddRow simply calls NotifyProtocol while SetRow's implementation is this huge unsafe method.
After realising the difference I simply called NotifyProtocol myself for set row as well and that worked as expected.
I'm wondering why is this difference present between the two implementations and if it could be made more obvious that AddRow and SetRow are not similar methods, as one might expect based on the name?
Am I missing something important by not using the SetRow and instead calling NotifyProtocol manually?
I must point out that dealing with this has been quite frustrating and I would like to have learned something at least for my troubles.
Thank you,
Cheers
Hi Edib, can you provide an example of the SetRow call that results in this exception?

Hi Pedro,
Initially I was calling protocol.SetRow(TablePid, key, row); where TablePid is int, key is string and row is QActionTableRow.
In a moment of inspiration I tried calling row.ToObjectArray() and that fixes the issue.