afindia

afindia

  • NA
  • 1
  • 0

Problem Calling .Net Component from an ASP Page

Oct 8 2003 4:39 PM
Hi All, I am calling a .Net Component from an ASP page. In my component I have methods that take string as an argument, they work fine. But this one, which accepts an array of Strings is throwing a Type msimatch error to the VBScript Runtime. The following is the code for the method: public string generateProductID([MarshalAs(UnmanagedType.SafeArray, SafeArraySubType = VarEnum.VT_BSTR)]String[] myArray) { string resultString=""; if(myArray!=null) resultString ="myArray is not null"; else resultString ="myArray is null"; return resultString; } '*****************Here's how, I am calling the component. '*****************ASP CODE******************** On Error Resume Next Set myObject = Server.CreateObject("System.Custom.ProductNamingComponent") Set myDict = CreateObject("Scripting.Dictionary") myDict.CompareMode = 1 For Each sItem1 In g_aPrChar sItemID1 = sReplaceSpaces(sItem1) myDict.Add sItemID1, g_oDict(sItemID1) Next resultString= myObject.generateProductID(myDict.Items) If Err <> 0 Then Response.Write Err.Number & " -- " & Err.Description End If Thanks in advance for anyone's help. AFI