G
Guest
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
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