473,405 Members | 2,349 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,405 software developers and data experts.

inheritance problem

guy
I have a problem with a class hierarchy.
The inheriting and inherited class are in different solutions.

In the base class, (which inherits from System.Windows.Forms.UserControl) i
have a method Test, see

below, and in the class which inherits from it i have a call to a method,
Testx, which in turn calls

Test.
The application builds with no errors or warnings.

In the try catch block i get the exception below:-
"Method not found: Void SSCTemplate.Component.Test()."

If i use 'go to definition' for Test it correctly finds the method, which is
also visible in the

object browser.
Note that when debugging the call to Testx errors immediately, without
stepping into Testx
However if i replace the call to Test with a call to for example Refresh()
the code behaves as

expected, stepping into Testx and then calling Refresh

Also if i change the call in Testx to
SSCTemplate.Component.Test()
the application does not build, Test() is not found and only the methods on
the UserControl are

visible.

Mybase.Test() fails in exactly the same way as Test()

This seems to boil down to a visibilty problem, in that if the method call
is not qualified the

compiler sees it, but if it is not qualified it does not, but at runtime it
is never seen.

This is running on a Citrix box using Windows server 2003, Visual Studio 2003
I have completely reinstalled the environment for a different Citrix user
on a different client pc

with the same results.

any ideas what is going on?

The inheriting class contains ...
inherits SSCTemplate.Component
...
Try
Testx()
Catch e As Exception
MsgBox(e.Message)
End Try
...

Private Sub Testx()

Me.Test()
End Sub
The inherited class contains...

public class SSCTemplate.Component
Inherits System.Windows.Forms.UserControl
....
more Properties and methods
....
Protected Sub Test()
MsgBox("hallo")
End Sub

thanks guy
Nov 21 '05 #1
3 1130
You seems to have reflection problem. Try to register a class library with
regasm or using an appropriate checkbox on solution property page.
I.e. regasm MyBaseClassLib.dll /codebase
HIH,
Boni

"guy" <gu*@discussions.microsoft.com> schrieb im Newsbeitrag
news:02**********************************@microsof t.com...
I have a problem with a class hierarchy.
The inheriting and inherited class are in different solutions.

In the base class, (which inherits from System.Windows.Forms.UserControl)
i
have a method Test, see

below, and in the class which inherits from it i have a call to a method,
Testx, which in turn calls

Test.
The application builds with no errors or warnings.

In the try catch block i get the exception below:-
"Method not found: Void SSCTemplate.Component.Test()."

If i use 'go to definition' for Test it correctly finds the method, which
is
also visible in the

object browser.
Note that when debugging the call to Testx errors immediately, without
stepping into Testx
However if i replace the call to Test with a call to for example Refresh()
the code behaves as

expected, stepping into Testx and then calling Refresh

Also if i change the call in Testx to
SSCTemplate.Component.Test()
the application does not build, Test() is not found and only the methods
on
the UserControl are

visible.

Mybase.Test() fails in exactly the same way as Test()

This seems to boil down to a visibilty problem, in that if the method call
is not qualified the

compiler sees it, but if it is not qualified it does not, but at runtime
it
is never seen.

This is running on a Citrix box using Windows server 2003, Visual Studio
2003
I have completely reinstalled the environment for a different Citrix user
on a different client pc

with the same results.

any ideas what is going on?

The inheriting class contains ...
inherits SSCTemplate.Component
...
Try
Testx()
Catch e As Exception
MsgBox(e.Message)
End Try
...

Private Sub Testx()

Me.Test()
End Sub
The inherited class contains...

public class SSCTemplate.Component
Inherits System.Windows.Forms.UserControl
...
more Properties and methods
...
Protected Sub Test()
MsgBox("hallo")
End Sub

thanks guy

Nov 21 '05 #2
"guy" <gu*@discussions.microsoft.com> wrote in message
news:02**********************************@microsof t.com...
In the try catch block i get the exception below:-
"Method not found: Void SSCTemplate.Component.Test()."


Is the "base class" assembly "registered" in the Global Assembly Cache?

If /not/, do you have the latest version of the "base class" assembly in
the /bin (or possibly, /debug/obj) directory of the "derived class"
project?

Do any of your References have the "Copy Local" property (Solution
Explorer, select reference, F4) set to True? This last one caused me
no end of hassle when I was getting started ...

HTH,
Phill W.

Nov 21 '05 #3
guy
Phil, yes this is the problem, a dll being refernced was not the most current
one, seems like the only way of ensuring this is to delete the dl and re copy
it in, as VS.NET doesnt reload dlls, it just uses whatever it has in the bin
directory - grrrrr

cheers

guy

"Phill. W" wrote:
"guy" <gu*@discussions.microsoft.com> wrote in message
news:02**********************************@microsof t.com...
In the try catch block i get the exception below:-
"Method not found: Void SSCTemplate.Component.Test()."


Is the "base class" assembly "registered" in the Global Assembly Cache?

If /not/, do you have the latest version of the "base class" assembly in
the /bin (or possibly, /debug/obj) directory of the "derived class"
project?

Do any of your References have the "Copy Local" property (Solution
Explorer, select reference, F4) set to True? This last one caused me
no end of hassle when I was getting started ...

HTH,
Phill W.

Nov 21 '05 #4

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

Similar topics

2
by: AIM | last post by:
Error in msvc in building inheritance.obj to build hello.pyd Hello, I am trying to build the boost 1.31.0 sample extension hello.cpp. I can not compile the file inheritance.cpp because the two...
3
by: Morten Aune Lyrstad | last post by:
Hi again! I'm having problems with inheritance. I have a base interface class called IObject. Next I have two other interfaces classes, IControl and ICommandMaster, which derives from IObject. ...
14
by: Steve Jorgensen | last post by:
Recently, I tried and did a poor job explaining an idea I've had for handling a particular case of implementation inheritance that would be easy and obvious in a fully OOP language, but is not at...
22
by: Matthew Louden | last post by:
I want to know why C# doesnt support multiple inheritance? But why we can inherit multiple interfaces instead? I know this is the rule, but I dont understand why. Can anyone give me some concrete...
8
by: Gaetan | last post by:
hi i have 2 classes A1 and A2 implementing a problem with 2 different ways i also have 2 other classes X1 and X2 implementing an other problem i need classes that provide A1+X1 methods,...
6
by: VR | last post by:
Hi, I read about Master Pages in ASP.Net 2.0 and after implementing some WinForms Visual Inheritance I tryed it with WebForms (let's say .aspx pages, my MasterPage does not have a form tag itself...
60
by: Shawnk | last post by:
Some Sr. colleges and I have had an on going discussion relative to when and if C# will ever support 'true' multiple inheritance. Relevant to this, I wanted to query the C# community (the...
5
by: colint | last post by:
Hi I'm fairly new to c++ and I have a question regarding inheritance. I'm trying to create a class based on 2 inherited classes, e.g. class A { ... } class B: public A
5
by: a | last post by:
Hi, I have an oop inheritance graph problem. What is the difference betweent the following 2 inheritance graph? How does the C++ solve the naming conflict problem for multiple inheritance...
3
by: Leo Seccia | last post by:
Hello everyone, I have a c# project with a sql server database. I have a number of lookup tables in my database which I successfully managed to import into my LINQ dataclasses. eg. Table:...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.