Link to home
Start Free TrialLog in
Avatar of Peter Chan
Peter ChanFlag for Hong Kong

asked on

Problem to "overrides" function

Hi,
how to correct the line like
    Public Overrides Function LoadReportData(GenText As Boolean) As Integer
...

Open in new window


due to this error?

Error	8	function 'LoadReportData' cannot be declared 'Overrides' because it does not override a function in a base class.

Open in new window

Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

try remove the Overrides and it should be fine?

Public Function LoadReportData(GenText As Boolean) As Integer
Avatar of Peter Chan

ASKER

I did what you suggested, but I still get

Error	19	'Public Function LoadReportData(GenText As Boolean) As Integer' cannot shadow a method declared 'MustOverride'.	

Open in new window

due to this
    Public Function LoadReportData(GenText As Boolean) As Integer
	...

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of ste5an
ste5an
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
why do I get this

cannot shadow a method declared 'MustOverride'

now? Thanks
Please post the code of your base class and your derived class.
Check signature of LoadReportData in base class, your override should match exactly in terms of parameters, your line is right, its just you have to make sure yours parameters are right