Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ VBscript ➜ Calling .Net COM objects from VBScript

Calling .Net COM objects from VBScript

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Majamer   (1 post)  Bio
Date Sun 22 Mar 2009 09:24 AM (UTC)
Message
Hello,

I have a .Net class that I developed with C# and exposed to COM. One of the exposed properties is a two-dimensional array Measurements[,]. I can read this array with VB6:

Dim arMeasurements()

res = oCard.ReadMeasurements(arM, iFieldCount, iRowCount)

The oCard.Measurements property gets populated with a two dimensional array containing the records

ReDim arMeasurements(iRowCount, iFieldCount)
arMeasurements(iRows, iFields) = oCard.Measurements

I've tried to do the same with a VBScript:

res = oCard.ReadMeasurements(iFieldCount, iRowCount)
ReDim arMeasurements(iRowCount, iFieldCount)
arMeasurements(iRowCount, iFieldCount) = oCard.Measurements

For r = LBound(oCard.Measurements, 1) To UBound(oCard.Measurements, 1)
For f = LBound(oCard.Measurements, 2) To UBound(oCard.Measurements, 2)
s = s vbTab & arMeasurements(r, f)
Next
s = s + vbCrLf
Next
MsgBox s
but never worked. The script initalizes the object and forces it to read the measurements, and the proof that the data gets received is that the LBound and UBound of the array is correct, but s is empty. Any idea what I'm doing wrong?
Thanks,

Martha


Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


9,174 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.