Announcement

Collapse
No announcement yet.

DLL Object, Parameters ByRef ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • DLL Object, Parameters ByRef ?

    Is there a way to specify a parameter in the DLL is to be passed by reference rather than by value? This will enable me to write a DLL which returns more than one value.

    For example:

    DLL MyMath(ByVal P1 as Float, ByVal P2 as Float, ByRef P3 as Float) as Float

    Where P3 = P1*P2, MyMath = P1+P2

    Thanks,
    Doug

  • #2
    Hi Doug:

    As far as I know, at this time you can only return a single value. The way I have dealt with the issue is to have the DLL write the needed data to a file in the FormulaOutput directory and then have the script read in this data using the EFS File I/O functions. This works well for scripts that call the DLL infrequently but it would definitely not be efficient if the DLL is called on every tick (or possibly even every bar).

    Regards,

    Chris

    Comment

    Working...
    X