473,386 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

VB Class Conversion Assistance Needed...

VB
=====================

Public Interface IProcess
ReadOnly Property Title( ) As String
...
End Interface

Public Class ProcessBase Inherits System.Web.UI.UserControl Implements
IProcess

Sub New( )
MyBase.New( )
End Sub
...
End Class

C# Conversion
=====================
public interface IProcess
{
string Title
{ get; }
...
}

public class ProcessBase : System.Web.UI.UserControl, IProcess
{
ProcessBase( )
{
// System.Web.UI.UserControl does not contain a definition for 'New'
base.New( );
}

public virtual string Title
{
get { }
}
....
}

Question:
=====================
What is missing from this VB to C# conversion that will resolve compiler
errors?

For brevity I've only shown one data member "Title" of type string.
Clearly the VB 'New' keyword is not supported in C#. If I comment out
the entire C# ProcessBase( ) constructor and let C# create its own default
constructor the compiler still complains...

'MyNameSpace.ProcessBase.Title.get': 'not all code paths return a value

The C# was generated from converters [1],[2]. I hope somebody
may be able to explain how to resolve this issue. Thanks for comments...

--
<%= Clinton Gallagher

[1] http://developerfusion.com/utilities...btocsharp.aspx
[2] http://www.wimontheweb.com/ca_main.aspx

Nov 16 '05 #1
3 1226
First of all... "Public Class ProcessBase Inherits ..." is not VB.
"Public Class ProcessBase : Inherits ..."
or
"Public Class ProcessBase
Inherits ..."
is VB

Anyway - after correcting the inherits part, I get the following from
our Instant C# VB.NET to C# converter:

public interface IProcess
{
string Title {get;}
...
}

public class ProcessBase : System.Web.UI.UserControl, IProcess
{

public ProcessBase() : base()
{
}
...
}

Please download our Demo Edition converter - all the questions I've
answered over the last couple of weeks are easily obtained via the
free Demo Edition.

http://www.instantcsharp.com

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 16 '05 #2
I downloaded the demo. It seems to be smarter than the online converters
I've been trying to use. Thanks for nagging me ;-)

<%= Clinton Gallagher

"David Anton" <da**@tangiblesoftwaresolutions-dot-com.no-spam.invalid> wrote
in message news:41**********@Usenet.com...
First of all... "Public Class ProcessBase Inherits ..." is not VB.
"Public Class ProcessBase : Inherits ..."
or
"Public Class ProcessBase
Inherits ..."
is VB

Anyway - after correcting the inherits part, I get the following from
our Instant C# VB.NET to C# converter:

public interface IProcess
{
string Title {get;}
..
}

public class ProcessBase : System.Web.UI.UserControl, IProcess
{

public ProcessBase() : base()
{
}
..
}

Please download our Demo Edition converter - all the questions I've
answered over the last couple of weeks are easily obtained via the
free Demo Edition.

http://www.instantcsharp.com

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*

Nov 16 '05 #3
No problem - feel free to contact us (at
su*****@tangiblesoftwaresolutions.com) if you have any questions
about the conversion that Instant C# is producing.

The reason our quality is so good is that we take all the feedback we
get very seriously, even from users of our free Demo Edition.

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

106
by: A | last post by:
Hi, I have always been taught to use an inialization list for initialising data members of a class. I realize that initialsizing primitives and pointers use an inialization list is exactly the...
8
by: nl | last post by:
Hello, I've got a question... I'm currently coding a software rasterizer... I actually like to write my own matrix/vector classes, which I did, but those classes don't work on the D3DX library...
2
by: Maurice | last post by:
Folks once again I look forward to your invaluable assistance. When converting an Access 2002 mdb back to Access 1997 using the Access 2002 inbuilt tools I receive the following error message...
6
by: thomasp | last post by:
For those who gave advice on the shortfalls of my first attempt at writing a vb.net class, Thank You. I hope that I was able to apply some of your advice to this larger atempt. At first I didn' t...
36
by: Cap'n Ahab | last post by:
I have used VB3 - VB6, so learning all this OO stuff is reasonably new to me (although I looked at Java a few years ago). Anyway, I thought I would write a small class to begin with, with a...
7
by: Alden Pierre | last post by:
Hello, I'm trying to create my own user define container, but I'm having a little hard time figuring out why is my class considered undefined by my compiler. Here is the following code. //...
1
by: petschy | last post by:
hello, i've run into an error when qualifying a copy ctor 'explicit'. the strange thing is that i get a compiler error only if the class is a template and declare the variable as X<Zx = y....
21
by: phpCodeHead | last post by:
Code which should allow my constructor to accept arguments: <?php class Person { function __construct($name) { $this->name = $name; } function getName()
12
by: Angus | last post by:
I am writing a class as a wrapper around a std::map. The class is: template<class TKey, class TValue> class CGeneralMap : protected map<TKey, TValue> At the moment I have basic functions like...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.