Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / May 2004

Tip: Looking for answers? Try searching our database.

Passing Array from VBScript to C#

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alexander Stromer - 13 May 2004 11:21 GMT
Hi all !

I am trying to pass a 1-dim-array from VBScript to a C#-Class
(COM-Interop-Functionality is set to true).
The function responds and works correctly, but I have problems as soon as I
want to pass an array to it.

My Function-Decl looks as follows:
********FunctionDeclaration********
public bool ImportDataFile(string Filename, string Separator, ref object[]
ColumnDefiniton)
********END********

The following VBScript-Call doesn't work:
********VBScript********
Set xtest = CreateObject(<ClassName>)

MyVar2 = Array(10,20,30,40)
Result = xtest.ImportDataFile("c:\temp\test.txt","-", MyVar2)

Set xtest = nothing
********END********

but the following works:
********VBScript********
Set xtest = CreateObject(<ClassName>)

Result = xtest.ImportDataFile("c:\temp\test.txt","-", Array(10,20,30,40))

Set xtest = nothing
********END********

What is my fault at VBScript Nr1 ?

Thanks
Alexander
Alexander - 28 May 2004 10:01 GMT
Function-Decl has to be
public bool ImportDataFile(string Filename, string Separator, object
ColumnDefiniton)

> Hi all !
>
[quoted text clipped - 32 lines]
> Thanks
> Alexander

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.