Announcement

Collapse
No announcement yet.

Interfacing to DLLs

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

  • Interfacing to DLLs

    I have a number of questions on interfacing to a DLL and have not been able to find the answers elsewhere.

    1. Does the DLL.STRING declaration pass pass a string or a pointer to a string to the DLL? If it passes a pointer to the string and the DLL modifies it, how is the string space malloc'd? (The easiest way is to init the string in the efs with at elast as many spaces as the DLL needs - is this okay?)

    2. Is DLL.INT 32 bits?

    3. If I want to pass a pointer to a float to a dll, do I declare a DLL.FLOATARRAY and pass only the single var?

    4. When a pointer is passed to a DLL, is it a far pointer?

    5. Does the javascript engine automatically cast the types for a DLL call? For example, if I pass a variable containing an integer as a parameter declared as DLL.FLOAT, will the integer be automatically cast to a float?


    A few non-dll questions:

    1. My DLL assumes all price data is in integer format for speed reasons. Thus, I don't wnat to pass, say, close() to my DLL - I need to integer-ize it first. For example, e-mini prices multiplied by 100 will eliminate the decimal point and I can now pass the data via DLL.INT. For any given symbol, how can I automatically determine the multiplication constant?

    2. The plot functions reference bars by bar number. If I wnat ot plot a line from some date and time to another, is there a means to convert that to the appropriate bar numbers or do I need to manually calculate that?


    Thanks in advance.

  • #2
    Hello NEXSOFTWARE1,

    Your questions were beyond my level of expertise. I forwarded them on to one of our senior developers (Dion) and he provided the following information. Hope this helps.

    DLL questions:
    1. pointer to a string. The memory is alloc'd using 'new char[length + 1]'.
    2. 32 bits.
    3. I believe so, we have not tried though.
    4. I believe so. I don't think we've used near pointers since 16 bit programs ?
    5. casting is done automatically according to regular javascript rules, so for your cases, it should be okay.



    non-DLL questions:
    1. no current way of determining that.
    2. you'll have to do this manually.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment

    Working...
    X