Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6866885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:14:25+00:00 2026-05-27T03:14:25+00:00

I need to call a function that takes an array of drive letters as

  • 0

I need to call a function that takes an array of drive letters as one of its arguments. The sample I received from the dev team that created the object uses VBScript and looks like this:

Array("C:","D:")

This doesn’t work in VB.NET so I tried the following code. Note: The drives are passed to me in a comma separated string:

Dim drives As String = "C,D"
Dim volumeList As String() = drives.Split(","c)
For i As Integer = 0 To volumeList.Length - 1
    volumeList(i) &= ":"
Next

Then I try to pass volumeList to the function in question and I get an invalid argument exception. Is there some other way I could try to create/pass this array so that it acts like the VBScript example? I told the developer what I’m doing and he said “hhmm… should work.” So I’d like to figure it out without having to force this guy to help me.

EDIT: The com server expects an array of type variant (VB6). That is the problem. Sadly EVERYTHING I try in VB.NET fails.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:14:26+00:00Added an answer on May 27, 2026 at 3:14 am

    VB6 variant datatype is equivalent to object in VB.Net.

    Dim drives As String = "C,D"
    Dim volumeList As String() = drives.Split(","c)
    ' Create an object array the same length as volumeList
    Dim objectArray(volumeList.Length - 1) As Object
    ' Add the strings to the object array
    For i As Integer = 0 To volumeList.Length - 1
        objectArray(i) = volumeList(i) & ":"
    Next
    
    ' Now pass the object array to your function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to call the co-class function by reading its address from vtable of
I need to call a library function that sometimes won't terminate within a given
I have a function that i need to call on iframe mousemove(). But i
I need a function that I can call when somthing is done, for example
In my C# code, I need to call a function from a C++ Dll
I need to call a const function from a non-const object. See example struct
I'm trying to call an external Delphi function from C# which takes a Delphi
I have a javascript function (class) that takes a function reference as one paremter.
I have a function that takes a parameter(key) to retrieve it's value from a
I have a multidimensional array. I need a function that checks if a specified

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.