Simplicity is the most important thing.
It used to be possible to do something like this with the old EasyLanguage DLL kit, I believe.
I can get the following to compile in TS but not in MC.
Any suggestions?
Also note that variable type declarations appear to be rejected by MC.
Code: Select all
{
external: "mydll.dll", int, "arrayExampleAddOne", (double*) {Values}, long {startAddress}, long {arraySize} ;
external: "mydll.dll", int, "arrayExampleAddOne", double* {Values}, long {startAddress}, long {arraySize} ;
}
definedllfunc: "mydll.dll", int, "arrayExampleAddOne", multiple;
Input: notUsed(0);
{
Var: long dwStartAddr(0), long dwArraySize(0), i(0), int Result(0);
}
Var: dwStartAddr(0), dwArraySize(0), Count(0), Result(0);
Array: double inOutArray[5](0.0);
Once Begin
For Count = 0 to dwArraySize Begin
inOutArray[Count] = Count;
End;
End;
dwStartAddr = ArrayStartAddr(inOutArray);
dwArraySize = ArraySize(inOutArray);
Result = arrayExampleAddOne((double)&inOutArray[0], (long) dwStartAddr, (long) dwArraySize );
Plot1(inOutArray[0], "TestArray0");
Plot2(inOutArray[1], "TestArray1");
Plot3(inOutArray[2], "TestArray2");
Plot4(inOutArray[3], "TestArray3");