Hi Dojo,
I have a QAction which has 4 entry points, one of them is a button parameter with 2 discreet values (1-Connect; 2-Disconnect). When I click on the Connect button, an error unknown to me appeared in the log file:
Would anyone have more information on this?
GetNativeVariantForObject is a function that translates the managed (C#) objects to unmanaged (C++) objects. It's only capable of translating fundamental types like integers, strings, and arrays.
Presumably a part of the callstack is missing because the exception is thrown outside of the QAction, but I expect that your QAction is calling a Notify function with an object that can't be translated.
It's also possible that the helper functions contain an error and don't translate the request to a fundamental type first. Would you be able to isolate which protocol request is causing this issue?
Hi Benjamin, glad you managed to solve the issue. Knowing that the entry point was returning data also explains why the call stack didn’t seem to contain any QAction function references.
Thank you, Floris. I did not understand the call stack, it makes more sense now.
It turns out the methods which were the entry points were asynchronous, and the fact that the return type was “Task” instead of void was causing the issue.