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

Interface problem

Hi

I have implemented an interface as below. I am getting a "Class
'HelloWordPlugin' must implement 'Sub PerformAction()' for interface
'IPlugin'." error. What is the problem and how can I fix it?

Thanks

Regards
Public Interface IPlugin
Sub PerformAction()
End Interface

Public Class HelloWordPlugin
Implements IPlugin

Public Sub PerformAction()
Console.WriteLine("Hello, World!")
End Sub
End Class
Nov 21 '05 #1
3 973

"John" <Jo**@nospam.infovis.co.uk> wrote in message
news:e9**************@TK2MSFTNGP10.phx.gbl...
: Hi
:
: I have implemented an interface as below. I am getting a
: "Class 'HelloWordPlugin' must implement 'Sub PerformAction()'
: for interface 'IPlugin'." error. What is the problem and how
: can I fix it?
:
: Thanks
:
: Regards
:
:
: Public Interface IPlugin
: Sub PerformAction()
: End Interface
:
: Public Class HelloWordPlugin
: Implements IPlugin
:
: Public Sub PerformAction()
: Console.WriteLine("Hello, World!")
: End Sub
: End Class

'-----------------------------------------------------------------------
Public Interface IPlugin
Sub PerformAction()
End Interface

Public Class HelloWordPlugin
Implements IPlugin

Public Sub PerformAction() Implements IPlugin.PerformAction
Console.WriteLine("Hello, World!")
End Sub
End Class
'-----------------------------------------------------------------------
Nov 21 '05 #2
"John" <Jo**@nospam.infovis.co.uk> schrieb
Hi

I have implemented an interface as below. I am getting a "Class
'HelloWordPlugin' must implement 'Sub PerformAction()' for interface
'IPlugin'." error. What is the problem and how can I fix it?

Thanks

Regards
Public Interface IPlugin
Sub PerformAction()
End Interface

Public Class HelloWordPlugin
Implements IPlugin

Public Sub PerformAction()
Console.WriteLine("Hello, World!")
End Sub
End Class


http://msdn.microsoft.com/library/en...Interfaces.asp

Same available via <F1>
Armin
Nov 21 '05 #3
"John" <Jo**@nospam.infovis.co.uk> schrieb:
I have implemented an interface as below. I am getting a "Class
'HelloWordPlugin' must implement 'Sub PerformAction()' for interface
'IPlugin'." error. What is the problem and how can I fix it?
VB.NET doesn't determine which method in a class implementing an interface
implements a certain method of the interface by comparing the methods'
names. Instead, you will have to declaratively specify which method of the
interface the method implements.
Public Interface IPlugin
Sub PerformAction()
End Interface

Public Class HelloWordPlugin
Implements IPlugin

Public Sub PerformAction()
Console.WriteLine("Hello, World!")
End Sub
End Class


\\\
Public Class HelloWorldPlugin
Implements IPlugin

Public Sub PerformAction() Implements IPlugin.PerformAction
...
End Sub
End Class
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #4

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

Similar topics

3
by: Davide M3xican Coppola | last post by:
Hi, I would realize an interface (interface) for a pair of concrete classes (concrete & concrete2), but I have a problem because I have to access to a third class (element) and if I try to declare...
3
by: Pol Bawin | last post by:
A class has a private field of type IWizard (An interface) and a public property to access it. When I try to serialize the Geometry class in XML, i have an error but it works in Binary Can...
7
by: Stephan Rose | last post by:
Ok here is my scenario I have an interface called IScalar which describes a one dimensional number that has a certain unit of measurement. This interface is used to create multiple structures,...
20
by: Ole Hanson | last post by:
I am accessing my database through an interface, to allow future substitution of the physical datastore - hence I would like to declare in my Interface that my DAL-objects implementing the...
15
by: jon | last post by:
How can I call a base interface method? class ThirdPartyClass :IDisposable { //I can not modify this class void IDisposable.Dispose() { Console.WriteLine( "ThirdPartyClass Dispose" ); } } ...
5
by: LS | last post by:
Can a WebMethod return an Interface type? Can we pass an interface parameter ? Example : public interface IEntity { long Id { get; set; } string Name { get; set; } }
12
by: masoud bayan | last post by:
I've come across something in Interface implementation that I am not sure is correct behavior in VB.NET (and maybe C#) or not? Consider following example: Public Interface IShape
2
by: stefan.moser | last post by:
Hi All, I'm having a problem implementing the Separated Interface pattern from Martin Fowler's book Patterns of Enterprise Application Architecture. I'm using C# in Visual Studio 2005. The...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
7
by: WTH | last post by:
I am now aware (I am primarily a C++ developer) that in C# if you reference the same interface from the same file in two different projects the types are actually incompatible. I found this out...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.