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

Question about Implements

Hi everyone,
I'm trying to implement the ISupportInitialize interface, in the object
browser there implemented like the followinfg:
Public Overridable Sub BeginInit()
Public Overridable Sub EndInit()

I get the following build errors for both functions.
'MyDialog' Must implement 'OVerridable Sub BeginInit()' for interface
'System.ComponentModel.IsupportInitialize'.

Here is the class that implements the interface. Why does it give me these
error since I have implemented those subs in my class. Thanks for any help.
Public Class MyDialog
Implements ISupportInitialize

Public Sub BeginInit()
End Sub

Public Sub EndInit()
Dim ret As DialogResult = Mfd.ShowDialog()
End Sub

Public Sub New()
ofd = New OpenFileDialog()
End Sub 'New
End Class

Nov 21 '05 #1
3 1531
Michael wrote:
Here is the class that implements the interface. Why does it give me
these error since I have implemented those subs in my class.


You have created functions with names that match those in the interface, but
you haven't told VB that they actually implement the functions in the
interface.

Try this:

\\\
Public Sub BeginInit() Implements ISupportInitialize.BeginInit
[...]
End Sub

Public Sub EndInit() Implements ISupportInitialize.EndInit
[...]
End Sub
///

This tells VB that the functions provide the implementation for the
BeginInit and EndInit members of the interface.

Hope that helps,

--

(O) e n o n e
Nov 21 '05 #2
Michael,

In your MyDialog class you need to implement the methods with the Implements
clause as ISupportInitialize.methodname, indicating that you are fulfilling
the contract with the interface

ex
Public Sub BeginInit() Implements ISupportInitialize.BeginInit

End Sub

Similarly for the EndInit method.

HTH

HTH
Nov 21 '05 #3
THanks so much for the reply you all.
Michael

"Oenone" wrote:
Michael wrote:
Here is the class that implements the interface. Why does it give me
these error since I have implemented those subs in my class.


You have created functions with names that match those in the interface, but
you haven't told VB that they actually implement the functions in the
interface.

Try this:

\\\
Public Sub BeginInit() Implements ISupportInitialize.BeginInit
[...]
End Sub

Public Sub EndInit() Implements ISupportInitialize.EndInit
[...]
End Sub
///

This tells VB that the functions provide the implementation for the
BeginInit and EndInit members of the interface.

Hope that helps,

--

(O) e n o n e

Nov 21 '05 #4

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

Similar topics

11
by: Michael Rodriguez | last post by:
Suppose I have a dataset, dsMain, that is already filled with data. What then, is the affect of this: DataSet ds1 = dsMain; Does this cause ds1 to simply become a pointer to dsMain? If so,...
5
by: Kartic | last post by:
Is there any way I can store +, -, *, / in some kind of variable/object Something like this dim xTransaction as object = "+" Then Instead of writing 100 + 50, I write 100 xTransaction 50....
0
by: Paul Cleghorn | last post by:
Hi I am relatively new to net remoting and have been following Ingo Ramer's NetRemoting book for Vb.net. Here is an example of what I am trying to do. Main interface object ...
5
by: Colin McGuire | last post by:
Hi all, when I write the class below Private Class employee End Class and then add the line "Implements IVF" which is an interface I have written, the IDE modifies my code to display
3
by: Debbie Carter | last post by:
Can XML files be easily encrypted?
3
by: steve | last post by:
i'd like to inherit from a class while changing the access-level of an interface within the derived class. the below won't work...how do i properly do this...i don't want to expose the "add" method...
6
by: GarrettD78 | last post by:
Accidently posted this to the wrong group so I am reposting. This is probably a newbie question but I am a little confused about how to go next with my code. I think I want to use a factory pattern...
7
by: jason | last post by:
In the microsoft starter kit Time Tracker application, the data access layer code consist of three cs files. DataAccessHelper.cs DataAcess.cs SQLDataAccessLayer.cs DataAcccessHelper appears...
3
by: =?Utf-8?B?VGVycnk=?= | last post by:
I have made up a contrived example show the problem I am having. I have some ReadOnly interfaces: Public Interface IROPerson ReadOnly Property FirstName() As String ReadOnly Property LastName()...
3
by: Scott Stark | last post by:
Hello, I'm trying to get a better handle on OOP programming principles in VB.NET. Forgive me if this question is sort of basic, but here's what I want to do. I have a collection of Employee...
0
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...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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.