is there a good and free tool to convert vb to c#?

  • Thread starter Thread starter gs
  • Start date Start date
there is a little problem in marshal translation

From
Public Function RegExpGetStrings(ByRef StringIn As String, ByVal patrn
As String, _
<Out()> ByRef myMatchCnt As Integer, _
<Out()> <MarshalAs(UnmanagedType.LPArray,
ArraySubType:=UnmanagedType.LPStr, SizeParamIndex:=2)> ByRef stringOut As
String(), _
<Out()> <MarshalAs(UnmanagedType.LPArray, SizeParamIndex:=2)> ByRef
myMatchPos As Integer(), _
ByRef as_msg As String) As Integer
...
End Function


to:

public int RegExpGetStrings(ref string StringIn, string patrn, [Out()]
ref int myMatchCnt, [Out()]
[MarshalAs(UnmanagedType.LPArray, ArraySubType=UnmanagedType.LPStr,
SizeParamIndex=2)]
ref string[] stringOut, [Out()]
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex=2)]
ref int[] myMatchPos, ref string as_msg)
{
..........
}


And the C# complains on [Out()] with ref; It suggestes [ in() out()]] with
ref
 
nice to know but it tends to crash on my vb code - it has marshalas and a
few advanced technique
Alvin Bruney said:
You can also use this one:
http://www.kamalpatel.net/Default.htm

--

________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
-------------------------------------------------------

Mehfuz Hossain said:
you can also download a free copy of IDE for .net 2.0 called #develop
from www.icsharpcode.com which has a vb conversion tool. I use it for
vb to c# conversion .
 
Back
Top