Announcement

Collapse
No announcement yet.

eSignal 10 DLL info

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

  • eSignal 10 DLL info

    Dear eSignal folks,

    I saw some information a while back (many months) about changes to eSig 10 with regards to DLL handling? Can someone point me to that documentation???

    TIA!!

    B
    Brad Matheny
    eSignal Solution Provider since 2000

  • #2
    found it...

    DLL Object
    Previous Top Next


    DLL Object

    The eSignal EFS DLL Object allows you to interact with DLL files from within your EFS scripts.

    DLL Methods

    addFunction()
    add an exported function

    call()
    call an exported function



    DLL.addFunction( refName, returnType, functionDefType, functionName [, parameters...] )

    refName
    text string to identify the function in EFS

    returnType
    the type of value that the DLL function returns. must be one of the following:

    DLL.DOUBLE
    DLL.INT
    DLL.SHORT
    DLL.FLOAT
    DLL.STRING

    functionDefType
    the calling convention of the exported DLL function. must be one of the following:

    DLL.CDECL
    DLL.STDCALL


    functionName
    the name of the DLL function being called

    parameters
    the input parameters required by the exported DLL function, if any. the following parameter types are supported:

    DLL.BYTE
    DLL.STRING
    DLL.SHORT
    DLL.INT
    DLL.FLOAT
    DLL.DOUBLE
    DLL.FLOATARRAY
    DLL.DOUBLEARRAY




    Notes:
    eSignal provides Support only for EFS connections made to C++ and Visual Basic 6 dll files. Programming issues within the C++ or VB6 code of the custom dll files is not supported by eSignal. Other programming languages may be used to create dll files and connect them to the dll object, but is not supported by eSignal staff.

    The intended usage of this object is for sending data out to a dll function for processing, which returns results back to the EFS environment for use within the EFS code or plotting on an Advanced Chart. Any routine outside of this is not supported by eSignal staff.

    functionName is the name of the C/C++ function being called. Your compiler may mangle the function name. You will need to reference the MAP file generated by the linker to determine the actual name. In some cases the compiler prepends the function name with an underscore "_". In other cases the compiler mangles the function name.

    DLLs can just be plain C DLLs. They do NOT need to be registered (that is only for ActiveX/COM DLLs). No dependencies on MFC, .NET, etc.. are necessary. If someone surrounds C++ code with an extern "C" like below, no mangling of the names occurs, so the .map or .def file is unnecessary.


    extern "C" __declspec(dllexport) int

    giveMe50() {
    return 50;
    }

    To simplify the DLL load, place the DLL into \Program Files\eSignal. Then when loading the DLL, just use DLL Name w/o a path.
    var d = new DLL("FileName.dll")

    It will look into the 'current' (ie Program Files\eSignal) first.



    Usage

    var d = new DLL( "c:/testdll/myTest.DLL");

    function preMain() {

    d.addFunction("MyCallName", DLL.DOUBLE, DLL.CDECL, "Testing123", DLL.INT, DLL.STRING, DLL.FLOAT, DLL.DOUBLE, DLL.BYTE);
    }


    DLL.call( refname [, parameters] )

    refName
    text string used to identify the function

    parameters
    actual values to pass to the DLL



    Usage

    var d = new DLL( "c:/testdll/myTest.DLL" );

    function preMain() {

    d.addFunction( "MyCallName", DLL.DOUBLE, DLL.CDECL, "Testing123", DLL.INT, DLL.STRING, DLL.FLOAT, DLL.DOUBLE, DLL.BYTE );

    //in the above example:
    // "MyCallName" is the internal name we have assigned to the DLL function we are calling
    // DLL.DOUBLE is the type of value it returns (e.g., a double-precision number)
    // DLL.CDECL is the calling convention used by our DLL
    // "Testing123" is the actual function name of the exported DLL function.
    // DLL.INT signifies that the first input parameter is an integer
    // DLL.STRING signifies that the second input parameter is a string
    // DLL.FLOAT signifies that the third input parameter is a float
    // DLL.DOUBLE signifies that the fourth input parameter is a double
    // DLL.BYTE signifies that the fifth input parameter is a byte

    }

    function main() {
    var retVal;

    retVal = d.call( "MyCallName", 123, "hello world", 456.23, 544.0014053, 255 );

    }
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      Doji3333,

      I'm having problem receiving return strings from the DLL, because C++ returns the pointer of the string. How can efs retrieve that point and the string? Do you have an simple example?

      BTW, I'm using version 8.

      Thank you in advance.

      W
      Last edited by whammer; 02-13-2008, 01:27 PM.

      Comment


      • #4
        This is a question for others as well.

        How can a dll function obtain a string when the C++ implementation of the function returns a pointer to the string. I know the spec says it can. I tried a simple C++ program and I was able to received int/float, but not string.

        Love to hear from someone who is successful in getting string returns.

        W

        Comment


        • #5
          whammer, Sorry I did not reply earlier. I'm dealing with a family medical emergency over here.

          I'm sure this is possible and will try to ask one of my other programmers about this. I know we are returning STRINGS with my MENT Trader Services application into EFS. I believe it has to do with your constructing the properly containers for the variables in the DLL.
          Brad Matheny
          eSignal Solution Provider since 2000

          Comment


          • #6
            Thanks for the reply, Doji.

            Family comes first, of course. Let me know when your programmer has the answer. Thank you in advance.

            W

            Comment


            • #7
              I'd be interested too Doji in what you discover. Looking forward to your reply.

              Mike

              Comment

              Working...
              X