I've noticed there's a problem with GetVar function when using MS SDK with C#. If string returned is larger than 29277 characters, next call to RunCode function will result in following error (at least for codes where variable assignment is done, e.g. Let>, Length>):
Code: Select all
System.Runtime.InteropServices.COMException: 'The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))'
Code: Select all
System.Runtime.InteropServices.COMException: 'Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))'
I tried to implement solution in my program, by splitting the string into smaller chunks based on 29277 char threshold, using MidStr before retrieving it through GetVar and it worked... sort of...
Now after getting the large string there's no issue with the RunCode function, at least haven't found one yet. However, GetVar throws this error when variable name is longer than 7 characters:
Code: Select all
System.Runtime.InteropServices.COMException: 'The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))'
This variable name size error happens after I run GetVar on a string larger than 14533 character. Everything appears to work fine if I set my string splitting function threshold to 14533. However, I am not sure if I won't be getting any related errors in the future. Would be best if someone from MJT would fix the issue in the SDK itself.