Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

Passing an array from VBScript to COM enabled VB.NET Library...

$
0
0
Hi,

Getting this error below:

Error:0 'Invalid procedure call or argument: 'objFit.Simple''

VBScript Code:

Code:

dim objFit , alInputTemperatures
set objFit = CreateObject("VB_EPICS.CurveFunctions")
alInputTemperatures = Array(10,20,30,50)
msgbox(objFit.Simple(alInputTemperatures))


VB.NET Library Code:

Code:

Public Class CurveFunctions
    Public Function Simple(ByRef inp() As Single) As String
        Return "Hello There"
    End Function


I can call the function fine if I change its input parameter to say just a single and call it passing in just a single.

I've read that it could be that when VB Script is passing in the array, it is actually a variant and so doesn't match what the function is expecting, hence the error.

Here's a link to someone else who had the problem, but no solution:

http://www.visualbasicscript.com/m34060-print.aspx


All this is on Windows 7. VBScript is running via OPUS software made by Bruker. VB.NET library created in VS2010

Thanks

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>