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

  • Home
  • SEARCH
  • 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 3671688
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:31:03+00:00 2026-05-19T02:31:03+00:00

so far I made a component in C# .NET 4 and use System.EnterpriseServices to

  • 0

so far I made a component in C# .NET 4 and use System.EnterpriseServices to make it COM visible. I want to develop business methods in C#, but I still need to access them from classic ASP (vbscript).

So far so good, everything works fine (exept function overloading :)).
Now I made a test class to get more expirience with return code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.EnterpriseServices;
using System.Management;

namespace iController
{
  /// <summary>
  /// The tools class provides additional functions for general use in out of context to other classes of the iController.
  /// </summary>
  public class tools :ServicedComponent
  {

    #region publich methods

    public bool TestBoolean()
    {
      return true;
    }

    public string TestString()
    {
      return "this is a string";
    }

    public int TestInteger()
    {
      return 32;
    }

    public double TestDouble()
    {
      return 32.32;
    }

    public float TestFloat()
    {
      float ret = 2 ^ 16;
      return ret;
    }

    public string[] TestArray()
    {
      string[] ret = {"0","1"};
      return ret;
    }

    public int[][] TestJaggedArray()
    {
      int[][] jaggedArray = new int[3][];
      jaggedArray[0] = new int[] { 1, 3, 5, 7, 9 };
      jaggedArray[1] = new int[] { 0, 2, 4, 6 };
      jaggedArray[2] = new int[] { 11, 22 };
      return jaggedArray;
    }

    public Dictionary<string, string> TestDictionary()
    {
      Dictionary<string, string> ret = new Dictionary<string,string>();
      ret.Add("test1","val1");
      ret.Add("test2","val2");
      return ret;
    }

    #endregion

  }
}

Then I just made a simple vbscript file to run it with cscript.exe for testing porpuse.

Dim oTools : Set oTools = CreateObject("iController.tools")

WScript.StdOut.WriteLine TypeName(oTools.TestBoolean()) & " - " & oTools.TestBoolean()
WScript.StdOut.WriteLine TypeName(oTools.TestString()) & " - " & oTools.TestString()
WScript.StdOut.WriteLine TypeName(oTools.TestInteger()) & " - " & oTools.TestInteger()
WScript.StdOut.WriteLine TypeName(oTools.TestDouble()) & " - " & oTools.TestDouble()
WScript.StdOut.WriteLine TypeName(oTools.TestFloat()) & " - " & oTools.TestFloat()

test = oTools.TestArray()
WScript.StdOut.WriteLine TypeName(test)
WScript.StdOut.WriteLine UBound(test)

For i = 0 To UBound(test)
  WScript.StdOut.WriteLine test(i)
Next

For Each item IN test
  WScript.StdOut.WriteLine item
Next

test = oTools.TestJaggedArray()
WScript.StdOut.WriteLine TypeName(test)
For Each item IN test
  WScript.StdOut.WriteLine test & " - " & test.Item(item)
Next

test = oTools.TestDictionary()
WScript.StdOut.WriteLine TypeName(test)
For Each item IN test
  WScript.StdOut.WriteLine test & " - " & test.Item(item)
Next

What works fine:

string, int, foat, double

When it comes to array, jaggedarray or dictionaries I get a type mismatch.
VarType is 13 object for the dictionary e.g. but this dict seems to be different then the Scripting.Dictionary.

I checked codeproject.com and stackoverflow all day and didn’t find any hints exept some thread on stackoverflow where someone mentioned there is a need to created a IDispatch interface.

So anyone ever had the same issue and can help me or give me some hints I can go on with?

  • 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-19T02:31:04+00:00Added an answer on May 19, 2026 at 2:31 am
    1. Lesson: let .NET handle your MarshalAs 🙂

      public object[] Read()    {      var retVal = new object[] {1,2,3};      return retVal;    }
      

    This is a Array which I can access from vbscript. The clue is that is has to be object[].

    Now I go on work on a solution for jagged arrays and dictionaries…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've made .NET web service, so far my android application can communicate with my
I need to validate my textbox using JavaScript, so far i made this :
So far I've been setting up redirects for single pages on my ASP.NET site
I need a rich text editor component (like Scintilla ) for a project made
I've so far made a html and css file which have three images; title,
using chrome and ff so far have made a nasty glitch when using scrollTo
I am making an oscilloscope in android. So far I have made the base
Hey. I was going to make a current class for my menu component, that
Here's what I've made so far: // somewhere in the page code... <img alt=
Thanks for all your help so far I have made the following changes This

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.