previously I said that I wanted to use COM to work with a software, without document.
the problem is that, after some function call, it must die, and cause luart to crash and disappear.
now using microsoft objview.exe, I find some IDL type information
// Generated .IDL file (by the OLE/COM Object Viewer)
[id(0x60010027), propget, helpstring("First item strictly to the right. Returns Nothing if there are no items to the right "), helpcontext(0x0000198)]
FIXPositionedItem* FIXPositionedItem([in] long X);
so it find something on chart, and return nothing if not found.
but, the problem is that, in luart sys.COM, if return nothing, then it crashed, and the process disappear.
according to the doc string, returning nothing is allowed, and there are many functions return nothing when none is found.
if use vbscript or office VBA to call such function, then it gets nothing, and does not crash.
test with excel, let's find some function that return Nothing,
Set Item = Selection.Find(2, LookIn:=xlValues)
Debug.Print Item Is Nothing
Debug.Print xlValues
this got:
True
-4163
using luart 1.7
r = app.selection
r:find(2, -4163)
>>> memory allocation error: block too big
Excel is better, though it returns error, but at least it does not crash.
and some other software just crash when returned value is Nothing
maybe there is something related to luart, so it crash if got nothing returned.