Ok.
I have a VB6 compiled DLL that i have imported to a webservice(C# ASMX).
In VB6 i have this following types:
Public Type typeAccountInfo
singular As String
code As String
description As String
End Type
Public Type timeSheetRowPost
lock As Boolean
code As String
from As Long
to As Long
fakt As Boolean
ik As String
ek As String
ak As String
accounts() As typeAccountInfo
End Type
Public Type timeSheetDayPosts
date As String
scheduleFrom As Long
scheduleTo As Long
break As Long
dagPost() As timeSheetRowPost
End Type
Public Type timeSheet
period As String
dayCount As Long
days() As timeSheetDayPosts
End Type
TimeSheet > timeSheetDayPosts > timeSheetRowPosts > typeAccountInfo
I have a VB6 function that gets all the data i need.
When i implement this in my webservice asmx, i do it in the following way:
public List<returnType> myFunction(input parameters){
List<timeSheet> VB6Array = new List<timeSheet>();
VB6Array = new List<timeSheet>((timeSheet[])VBWrapper.myVB6Func(input params));
// at this point VB6Array holds all the data i need. And all i need (want) at this point is to be able to cast this VB6(system.array) to a List<> object that i can return as my returntype.
// Pseudo : List<ReturnType> myNewReturnType = new List<ReturnType>((ReturnType[])VB6Array);
// However all my tries has been without success....and what i get is You must implement a default accessor on System.Array because it inherits from ICollection.
return myNewReturnType;
}
Any tips and/or pointers on how to cast or convert a VB6 type (system.array) to a List<> will be highly appreciated.
Thanks in advance.
You may have to manually loop through the list and copy the data to a new
at least if you want a quick fix.