473,396 Members | 2,020 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

vb array to legacy C appl

gg
I have trouble marshalling array
I have a VB COM class TestArrClass

Imports System.Runtime.Remoting

Imports System.Runtime.InteropServices

<ComClass(TestArrClass.ClassId, TestArrClass.InterfaceId,
TestArrClass.EventsId)> _
Public Class TestArrClass
Public Function atestIntStrArr(ByVal aiLen As Integer, _
<MarshalAs(UnmanagedType.LPArray, ArraySubType:=UnmanagedType.LPStr,
_
SizeParamIndex:=1)> ByRef astr As String(), _
<MarshalAs(UnmanagedType.LPArray, SizeParamIndex:=1)> ByRef aiPosn()
_
As Integer) _
As Integer

Dim IntArr() As Integer = {0, 1, 2, 3, 4, 5}
Dim iarr() As Integer
Dim lstrArr() As String = {"X", "Y", "A", "c", "d", "F"}
iarr = lstrArr.Clone()
If aiLen >= 6 Then
aiLen = 6
astr = lstrArr.Clone()
Return aiLen
ElseIf aiLen > 0 Then
ReDim Preserve lstrArr(aiLen)
astr = lstrArr.Clone()
Return aiLen
Else
aiLen = 0
End If

Return aiLen
End Function

When I call from vbscript
set TestArrClass = createObject("TestArrClass.TestArrClass")
iLen = TestArrClass.atestIntStrArr (aiLen, str_results , iarr)
' gives "Microsoft VBScript runtime error: Variable uses an Automation
type not supported in vbscript: 'atestIntStrArr'"

what did I do wrong?

Should I have a differnt call prototype for VBSCRIPT versus C style
application?


Nov 21 '05 #1
0 836

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Pola | last post by:
Please Help I am using VC++ in win 2000 In my appl (Win32 project) I want to control the close operation of the apl (for example if somebody will try to close appl from the "Windows Task Manager")...
2
by: rajkumar | last post by:
hey all While maintaining some legacy code I came across such a class class Point { double coordinate; }; This class doesn't have any virtual functions and is aligned by
6
by: Alpha | last post by:
Hi, I'm fixing a bug in an application and need to step thru the appl to find where it's occuring. The main project includs 33 other projects each having a .resx file in it. When I step through it...
1
by: Gregory Hassett | last post by:
Hello, I am calling into a legacy COM server from VB.NET. The method that I am calling expects an array. Here is the example syntax provided by the author of this COM automation object -- this...
1
by: tin | last post by:
hi, i need to cache data in memory for a web appl, which takes up to 1 GB ram. and i don't want it to load everytime the appl restart (changing other code files/replacing other dll etc). and i...
9
by: Rainman | last post by:
In my HTML, I have several of the following: <input type='checkbox' name='right' id='right' value='0' /> All are the same except the value is set differently for each one. The reason for the ...
12
by: joshuapking | last post by:
I'm having a very difficult time coming across an appropriate solution for this seemingly simple problem. I've written a managed wrapper class for some legacy C++ routines. One routine generates...
272
by: Peter Olcott | last post by:
http://groups.google.com/group/comp.lang.c++/msg/a9092f0f6c9bf13a I think that the operator() member function does not work correctly, does anyone else know how to make a template for making two...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.