ned help on converting C# to VB

T

TJS

I cannot seem to get this to convert to VB.
tried the converter at asp-alliance but it throws an error on line marked

any experts available ?

===== code ====

protected override AddInForm CreateAddInForm() {
String sDocumentName = base.Document.DocumentName;
String sDocumentPath = base.Document.DocumentPath;
ProjectItemStreamMode iMode = (ProjectItemStreamMode)0; //<==converter
chokes here
Stream sDocumentStream = base.Document.ProjectItem.GetStream(iMode);
return new MyFirstAddInForm(this, sDocumentPath, sDocumentName,
sDocumentStream);
}
 
A

Ashish M Bhonkiya

Hi,
i tried to convert your code using this utility and it converts properly.
just give a try at http://www.kamalpatel.net/ConvertCSharp2VB.aspx

Csharp Code.
==========
protected override AddInForm CreateAddInForm() {
String sDocumentName = base.Document.DocumentName;
String sDocumentPath = base.Document.DocumentPath;
ProjectItemStreamMode iMode = (ProjectItemStreamMode)0; //<==converter
chokes here
Stream sDocumentStream = base.Document.ProjectItem.GetStream(iMode);
return new MyFirstAddInForm(this, sDocumentPath, sDocumentName,
sDocumentStream);
}

Vb.Net Code.
==========
Protected Overrides Function CreateAddInForm() As AddInForm
Dim sDocumentName As String = MyBase.Document.DocumentName
Dim sDocumentPath As String = MyBase.Document.DocumentPath
Dim iMode As ProjectItemStreamMode = (ProjectItemStreamMode)0
'<==converter
chokes here
Dim sDocumentStream As Stream =
MyBase.Document.ProjectItem.GetStream(iMode)
Return New MyFirstAddInForm(this, sDocumentPath, sDocumentName,
sDocumentStream)
End Function

'----------------------------------------------------------------
' Converted from C# to VB .NET using CSharpToVBConverter(1.2).
' Developed by: Kamal Patel (http://www.KamalPatel.net)
'----------------------------------------------------------------

HTH
Regards
Ashish M Bhonkiya
 
T

TJS

thanks for responding


The converter you suggested does not return an error , but after conversion
the code will not compile . The problem is on the same line.

I suspect it is just ignoring the problem . I have found that the kamapatel
converter is less than reliable
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,255
Members
46,852
Latest member
CarlaDowle

Latest Threads

Top