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 / November 2007

Tip: Looking for answers? Try searching our database.

Returning a multidimensional array to VBScript

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marc Vangrieken - 16 Nov 2007 14:13 GMT
Hi,

I need to write a ComVisible object in C# and there are some methods
that must return a multidimensional array of strings. I created a .NET
assembly,  marked it COM visible, created a TLD via regasm and added
it to the GAC. I can now create instances and execute code, but I'm
not able to use the results that in the multidimensional array. I've
tries several version, but I can't get it to work.

Can someone help? I keep getting  Type mismatch errors. A lot of this
is written on the Internet, but nothing seems to work.

     //Version1
     public string[][] ClientManagementQuery(bool CW_OPERATIONAL)
       {
           ....
           return ConvertDataToArray(orderedView); //
ConvertDataToArray returns string[][]
       }

       //Version2
       public object[,] ClientManagementQuery(bool CW_OPERATIONAL)
       {
           ...
           return (object[,])ConvertDataToArray(orderedView);
       }

       //Version3
       public object ClientManagementQuery(bool CW_OPERATIONAL)
       {
           ...
           return (object)(object[,])ConvertDataToArray(orderedView);
       }

Here's the VBScript

Dim foo
Set foo = CreateObject("Genco2pi.Logic.Genco2piLogic")
dim results(1000,1000)
results = foo.ClientManagementQuery(true)
MsgBox results(1,1)

Thanks in advance,
Marc
Marc Vangrieken - 20 Nov 2007 08:47 GMT
> Hi,
>
[quoted text clipped - 40 lines]
> Thanks in advance,
> Marc

Ok, for some reason version 3 is working now. I think I was mixing
different versions of DLL's, only re-registering some of them.

Rate this thread:







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.