Announcement

Collapse
No announcement yet.

DLL.VOID gives syntax error

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

  • DLL.VOID gives syntax error

    I'm using the DLL addFunction call and use DLL.VOID as one of the parameter types.
    PHP Code:
    myDll.addFunction("Func1"DLL.INTDLL.CDECL"Func1"DLL.VOID); 
    When I do a syntax check I get an error that says:

    DLL.addFunction: invalid DLL parameter type #5 (void)

    Is DLL.VOID not supported? It is listed in the documentation.

    Steve

  • #2
    HI Steve,
    I don't know anything about DLL.VOID but I got an error message something like that and it was because I did not have the right number of parameters.

    Also check the parameter types.

    Tom

    Comment


    • #3
      Hello Steve,

      Can you post a copy of the dll or an example dll I can use to test this?
      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


      • #4
        Jason,

        Attached is the DLL file I'm using.

        The function in the dll is defined as:
        extern "C" int Func1(void* pvTest)

        Here is the efs I was testing with.
        PHP Code:
        // test using DLL with DLL.VOID as a parameter type
        // If I do a syntax check I get an error on line 5 that says
        // DLL.adFunction: Invalid DLL parameter type # 5 (void)
        var myDll = new DLL("C:\\Program Files\\eSignal\\Formulas\\DLL\\DLLTest.dll");
        myDll.addFunction("Func1"DLL.INTDLL.CDECL"Func1"DLL.VOID);

        function 
        preMain()
        {
            
        setPriceStudy(true);
            
        setStudyTitle("DLL test");
            
        debugClear();
        }
        function 
        main()
        {
            return;

        Basically the efs is failing a syntax check at the DLL.VOID parameter. If I use any of the other DLL.xxx types it doesn't give syntax errors with the same DLL code.

        Let me know if you need other info.

        Steve
        Attached Files

        Comment


        • #5
          Hello Steve,

          Thank you for posting the code and dll example. I do see the syntax error. I'm still investigating the issue and should have more information on this later this week.

          In the mean time, is the Func1 function supposed to return anything? As an experiment, I tried the following, which seemed to work. No errors at least.

          PHP Code:
          var myDll = new DLL("C:\\Program Files\\eSignal\\Formulas\\DLL\\DLLTest.dll");
          //myDll.addFunction("Func1", DLL.INT, DLL.CDECL, "Func1", DLL.VOID);
          myDll.addFunction("Func1"DLL.INTDLL.CDECL"Func1");

          function 
          preMain()
          {
              
          setPriceStudy(true);
              
          setStudyTitle("DLL test");
              
          debugClear();
          }
          function 
          main()
          {
              var 
          retVal myDll.call("Func1");
              
          //debugPrintln(typeof(retVal));
              
          return retVal;


          Also, have you created any other dll functions where you did not receive an error when passing DLL.VOID?
          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


          • #6
            Jason,

            Func1 is just a test function. It returns 0 and doesn't check for valid parameters, so your example code should work, even without the DLL.VOID parameter.

            This is the first time I've tried using DLL.VOID. I've written other DLLs that took INT parameters and I can get them to work fine. It's just the DLL.VOID type that's giving me problems.

            Thanks for looking at this.

            Steve

            Comment


            • #7
              Hello Steve,

              As it turns out there was a specific override added to the base code that disallows DLL.VOID as a parameter type. The docs just haven't been updated to reflect this. I will update them shortly.

              If you know of a specific scenario where your dll code requires the DLL.VOID parameter type to be passed, please send the details and any code examples to [email protected] and our development team will review it.
              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


              • #8
                Jason,

                Thanks for checking on this.

                Steve

                Comment


                • #9
                  Steve, you're most welcome. Thank you for giving some of your time and assistance to other members here in the forums. Your contributions to this community are appreciated.
                  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