473,396 Members | 1,914 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,396 software developers and data experts.

Cross-language inheritence question/problem

Hello again,

Given the following:

A C# written class in .NET 1.1 contained in Assembly A1.dll:

namespace Some.Namespace
{
public class MyBaseForm: System.Windows.Forms.Form
{
public AppointmentDialogBase(MyObject obj1, MyOtherObject obj2, bool
isTrue) : base()
{
// do some stuff
}
}
}

A VB winform, written in .NET 2.0 contained in Assembly B2.dll:

Public Class MySubForm
Inherits Some.Namespace.MyBaseForm

Public Sub New(ByVal obj1 As Some.Namespace.MyObject, _
ByVal obj2 As Some.Namespace.MyOtherObject, ByVal isTrue As
Boolean)

MyBase.New(obj1, obj2, isTrue)

Me.InitializeComponent()
End Sub
End Class

Now, everything compiles fine everywhere, we're all happy happy, and
even at runtime all is well. However, when I go to open MySubForm in
the VS 2005 form designer, I get the following error:

Constructor on type 'Some.Namespace.MyBaseForm' not found.

How is this possible? Everything compile's fine, Intellisense picks
everything up - why can't the form designer figure it out? Does it
have to do with the C# constructor syntax vs. the VB.NET 2.0
constructor syntax?

Any help/guidance would be greatly appreciated.

Thanks in advance.

- ryan.

May 2 '06 #1
3 1003
Crap - I proof-read it all and still screwed up the code - the
constructor in my example was wrong, but the problem's still the same:

namespace Some.Namespace
{
public class MyBaseForm: System.Windows.Forms.Form
{
public MyBaseForm(MyObject obj1, MyOtherObject obj2,
bool
isTrue) : base()
{
// do some stuff
}
}

}

A VB winform, written in .NET 2.0 contained in Assembly B2.dll:

Public Class MySubForm
Inherits Some.Namespace.MyBaseForm

Public Sub New(ByVal obj1 As Some.Namespace.MyObject, _
ByVal obj2 As Some.Namespace.MyOtherObject, ByVal isTrue As
Boolean)

MyBase.New(obj1, obj2, isTrue)

Me.InitializeComponent()
End Sub
End Class

May 2 '06 #2
On 2 May 2006 10:16:07 -0700, cranley wrote:
namespace Some.Namespace
{
public class MyBaseForm: System.Windows.Forms.Form
{
public AppointmentDialogBase(MyObject obj1, MyOtherObject obj2, bool
isTrue) : base()
{
// do some stuff
}
}
} [...] Now, everything compiles fine everywhere, we're all happy happy, and
even at runtime all is well. However, when I go to open MySubForm in
the VS 2005 form designer, I get the following error:

Constructor on type 'Some.Namespace.MyBaseForm' not found.


The Visual Studio designer needs a default constructor (that is, a
parameterless constructor) in order to be able to create your form. When
you think about it, it makes sense: how could the designer possibly know
what parameter it should give to your custom constructor? Add a constructor
without any parameters and it should work should fine.
May 3 '06 #3
Ha! Yea, that was it alright. Pretty obvious oversight on my part...
sometimes you just need that second set of eyes.

Thanks for your help Mehdi, muchly appreciated.

Cheers!

- ryan.

May 3 '06 #4

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

Similar topics

0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
12
by: * ProteanThread * | last post by:
but depends upon the clique: ...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
4
by: David Peach | last post by:
Hello, hope somebody here can help me... I have a query that lists defects recorded in a user defined date range. That query is then used as the source for a Cross Tab query that cross-tabs count...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.