  MODULE Daniel
    USE IFWINTY
    USE IFCOM
    IMPLICIT NONE
  

    ! CLSIDs		
    TYPE (GUID), PARAMETER :: CLSID_AnalysisDb = &
      GUID(#B4B3E6EA, #D289, #46CA, &
        CHAR('86'X)//CHAR('60'X)//CHAR('04'X)//CHAR('A2'X)// &
        CHAR('EC'X)//CHAR('B8'X)//CHAR('31'X)//CHAR('4F'X))

    ! IIDs		
    TYPE (GUID), PARAMETER :: IID_IAnalysisDb = &
      GUID(#B33EA439, #EE51, #474F, &
        CHAR('83'X)//CHAR('DF'X)//CHAR('4A'X)//CHAR('9C'X)// &
        CHAR('BA'X)//CHAR('D9'X)//CHAR('D4'X)//CHAR('9F'X))
    TYPE (GUID), PARAMETER :: IID__AnalysisDb = &
      GUID(#F7B462F1, #2DEF, #3E4E, &
        CHAR('BD'X)//CHAR('BC'X)//CHAR('EA'X)//CHAR('1A'X)// &
        CHAR('47'X)//CHAR('C4'X)//CHAR('A0'X)//CHAR('4F'X))

    ! Interfaces
    INTERFACE
        INTEGER(4) FUNCTION $AnalysisDb_ArrayTest($OBJECT, arrayOfFloat, aNotherArrayOfFloat, pRetVal)
        INTEGER(INT_PTR_KIND()), INTENT(IN)	:: $OBJECT	 ! Object Pointer
        !DEC$ ATTRIBUTES VALUE	:: $OBJECT
        INTEGER(INT_PTR_KIND()), INTENT(IN)	:: arrayOfFloat	! (SafeArray)
        !DEC$ ATTRIBUTES VALUE	:: arrayOfFloat
        INTEGER(INT_PTR_KIND()), INTENT(IN)	:: aNotherArrayOfFloat	! (SafeArray)
        !DEC$ ATTRIBUTES VALUE	:: aNotherArrayOfFloat
        INTEGER(INT_PTR_KIND()), INTENT(OUT)	:: pRetVal	! BSTR
        !DEC$ ATTRIBUTES REFERENCE	:: pRetVal
      !DEC$ ATTRIBUTES STDCALL :: $AnalysisDb_ArrayTest
      END FUNCTION $AnalysisDb_ArrayTest
    END INTERFACE
    POINTER($AnalysisDb_ArrayTest_PTR, $AnalysisDb_ArrayTest)	! routine pointer
    INTERFACE
        INTEGER(4) FUNCTION IAnalysisDb_ArrayTest($OBJECT, arrayOfFloat, aNotherArrayOfFloat, pRetVal)
        INTEGER(INT_PTR_KIND()), INTENT(IN)	:: $OBJECT	 ! Object Pointer
        !DEC$ ATTRIBUTES VALUE	:: $OBJECT
        INTEGER(INT_PTR_KIND()), INTENT(IN)	:: arrayOfFloat	! (SafeArray)
        !DEC$ ATTRIBUTES VALUE	:: arrayOfFloat
        INTEGER(INT_PTR_KIND()), INTENT(IN)	:: aNotherArrayOfFloat	! (SafeArray)
        !DEC$ ATTRIBUTES VALUE	:: aNotherArrayOfFloat
        INTEGER(INT_PTR_KIND()), INTENT(OUT)	:: pRetVal	! BSTR
        !DEC$ ATTRIBUTES REFERENCE	:: pRetVal
      !DEC$ ATTRIBUTES STDCALL :: IAnalysisDb_ArrayTest
      END FUNCTION IAnalysisDb_ArrayTest
    END INTERFACE
    POINTER(IAnalysisDb_ArrayTest_PTR, IAnalysisDb_ArrayTest)	! routine pointer

    ! Module Procedures
    CONTAINS
        INTEGER(4) FUNCTION $$AnalysisDb_ArrayTest($OBJECT, arrayOfFloat, aNotherArrayOfFloat, pRetVal)
        !DEC$ ATTRIBUTES DLLEXPORT	:: $$AnalysisDb_ArrayTest
        IMPLICIT NONE
  
        INTEGER(INT_PTR_KIND()), INTENT(IN)	:: $OBJECT	 ! Object Pointer
        !DEC$ ATTRIBUTES VALUE	:: $OBJECT
        INTEGER(INT_PTR_KIND()), INTENT(IN)	:: arrayOfFloat	! (SafeArray)
        !DEC$ ATTRIBUTES REFERENCE	:: arrayOfFloat
        INTEGER(INT_PTR_KIND()), INTENT(IN)	:: aNotherArrayOfFloat	! (SafeArray)
        !DEC$ ATTRIBUTES REFERENCE	:: aNotherArrayOfFloat
        CHARACTER(LEN=*), INTENT(OUT)	:: pRetVal	! BSTR
        INTEGER(4) $RETURN
        INTEGER(INT_PTR_KIND()) $VTBL			! Interface Function Table
        POINTER($VPTR, $VTBL)
        INTEGER(INT_PTR_KIND()) $BSTR_pRetVal    ! BSTR
        INTEGER(4) $STATUS
        $BSTR_pRetVal = NULL
        $VPTR = $OBJECT					! Interface Function Table
        $VPTR = $VTBL + 14 * INT_PTR_KIND()	! Add routine table offset
        $AnalysisDb_ArrayTest_PTR = $VTBL
        $RETURN = $AnalysisDb_ArrayTest($OBJECT, arrayOfFloat, aNotherArrayOfFloat, $BSTR_pRetVal)
        $STATUS = ConvertBSTRToString($BSTR_pRetVal, pRetVal)
        CALL SysFreeString($BSTR_pRetVal)
        $$AnalysisDb_ArrayTest = $RETURN
      END FUNCTION $$AnalysisDb_ArrayTest
        INTEGER(4) FUNCTION $IAnalysisDb_ArrayTest($OBJECT, arrayOfFloat, aNotherArrayOfFloat, pRetVal)
        !DEC$ ATTRIBUTES DLLEXPORT	:: $IAnalysisDb_ArrayTest
        IMPLICIT NONE
  
        INTEGER(INT_PTR_KIND()), INTENT(IN)	:: $OBJECT	 ! Object Pointer
        !DEC$ ATTRIBUTES VALUE	:: $OBJECT
        INTEGER(INT_PTR_KIND()), INTENT(IN)	:: arrayOfFloat	! (SafeArray)
        !DEC$ ATTRIBUTES REFERENCE	:: arrayOfFloat
        INTEGER(INT_PTR_KIND()), INTENT(IN)	:: aNotherArrayOfFloat	! (SafeArray)
        !DEC$ ATTRIBUTES REFERENCE	:: aNotherArrayOfFloat
        CHARACTER(LEN=*), INTENT(OUT)	:: pRetVal	! BSTR
        INTEGER(4) $RETURN
        INTEGER(INT_PTR_KIND()) $VTBL			! Interface Function Table
        POINTER($VPTR, $VTBL)
        INTEGER(INT_PTR_KIND()) $BSTR_pRetVal    ! BSTR
        INTEGER(4) $STATUS
        $BSTR_pRetVal = NULL
        $VPTR = $OBJECT					! Interface Function Table
        $VPTR = $VTBL + 10 * INT_PTR_KIND()	! Add routine table offset
        IAnalysisDb_ArrayTest_PTR = $VTBL
        $RETURN = IAnalysisDb_ArrayTest($OBJECT, arrayOfFloat, aNotherArrayOfFloat, $BSTR_pRetVal)
        $STATUS = ConvertBSTRToString($BSTR_pRetVal, pRetVal)
        CALL SysFreeString($BSTR_pRetVal)
        $IAnalysisDb_ArrayTest = $RETURN
      END FUNCTION $IAnalysisDb_ArrayTest
  END MODULE
