473,834 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I implement an interface with VB.Net?

Jim
I am using VB.Net 2.0 and I am completely new to the concept of implementing
interfaces. Can anyone explain "implementi ng interfaces" to me and perhaps
give me an example of implementing an interface that would help me implement
the IIneternetSecur ityManager interface mentioned under "Creating a
Customized URL Security Manager" on
http://msdn.microsoft.com/library/de...#SecurityZones
and mentioned under "Download Control" on
http://msdn.microsoft.com/library/de...nload_Control?

This would help me a great understand implementing interfaces and I could
then implement a few more for my company's internal webbrowser.

Thanks for your help!
Dec 20 '05 #1
14 1765

"Jim" <re***@groups.p lease> wrote in message
news:qf******** ***********@big news5.bellsouth .net...
I am using VB.Net 2.0 and I am completely new to the concept of
implementing interfaces. Can anyone explain "implementi ng interfaces" to
me and perhaps give me an example of implementing an interface that would
help me implement the IIneternetSecur ityManager interface mentioned under
"Creating a Customized URL Security Manager" on
http://msdn.microsoft.com/library/de...#SecurityZones
and mentioned under "Download Control" on
http://msdn.microsoft.com/library/de...nload_Control?

This would help me a great understand implementing interfaces and I could
then implement a few more for my company's internal webbrowser.

Thanks for your help!

Why cross-post to a bunch of non appropriate NG's, please restrict your
postings to the vb NG only.

Willy.
Dec 20 '05 #2
Jim
Thank you for that most informative and helpful response.
"Willy Denoyette [MVP]" <wi************ *@telenet.be> wrote in message
news:eM******** *****@TK2MSFTNG P10.phx.gbl...

"Jim" <re***@groups.p lease> wrote in message
news:qf******** ***********@big news5.bellsouth .net...
I am using VB.Net 2.0 and I am completely new to the concept of
implementin g interfaces. Can anyone explain "implementi ng interfaces" to
me and perhaps give me an example of implementing an interface that would
help me implement the IIneternetSecur ityManager interface mentioned under
"Creating a Customized URL Security Manager" on
http://msdn.microsoft.com/library/de...#SecurityZones
and mentioned under "Download Control" on
http://msdn.microsoft.com/library/de...nload_Control?

This would help me a great understand implementing interfaces and I could
then implement a few more for my company's internal webbrowser.

Thanks for your help!

Why cross-post to a bunch of non appropriate NG's, please restrict your
postings to the vb NG only.

Willy.

Dec 20 '05 #3
Jim:

In .NET we don't have multiple inheritance but by using interfaces, you can
get to the same place by and large. If I have an interface, then the
compiler knows that each fo the methods and properties must exist in the
class - it can count on them being there. So in it's simplest form,
implementing an interface is simply adding a property and method to your
class for each one in the interface. That way you can do this....

IList myObject = new ObjectThatImple mentsIList();
myObject.Item(0 ) ; //b/c IList has Item

Now, by doing this, you can take an IList object as a paramater and then
pass in anything that implements IList b/c it effectively "is" an IList
object.

Does this help?

"Jim" <re***@groups.p lease> wrote in message
news:qf******** ***********@big news5.bellsouth .net...
I am using VB.Net 2.0 and I am completely new to the concept of
implementing interfaces. Can anyone explain "implementi ng interfaces" to
me and perhaps give me an example of implementing an interface that would
help me implement the IIneternetSecur ityManager interface mentioned under
"Creating a Customized URL Security Manager" on
http://msdn.microsoft.com/library/de...#SecurityZones
and mentioned under "Download Control" on
http://msdn.microsoft.com/library/de...nload_Control?

This would help me a great understand implementing interfaces and I could
then implement a few more for my company's internal webbrowser.

Thanks for your help!

Dec 20 '05 #4
Jim - if you would, shoot me an email to WilliamRyan at gmail dotcom - I
answered your question briefly below, but I have some material that you will
probably find helpful - it's too much to simply post but if you'll shoot me
a private email, I'll do what I can to help.
"Jim" <re***@groups.p lease> wrote in message
news:NA******** ***********@big news5.bellsouth .net...
Thank you for that most informative and helpful response.
"Willy Denoyette [MVP]" <wi************ *@telenet.be> wrote in message
news:eM******** *****@TK2MSFTNG P10.phx.gbl...

"Jim" <re***@groups.p lease> wrote in message
news:qf******** ***********@big news5.bellsouth .net...
I am using VB.Net 2.0 and I am completely new to the concept of
implementi ng interfaces. Can anyone explain "implementi ng interfaces" to
me and perhaps give me an example of implementing an interface that would
help me implement the IIneternetSecur ityManager interface mentioned under
"Creating a Customized URL Security Manager" on
http://msdn.microsoft.com/library/de...#SecurityZones
and mentioned under "Download Control" on
http://msdn.microsoft.com/library/de...nload_Control?

This would help me a great understand implementing interfaces and I
could then implement a few more for my company's internal webbrowser.

Thanks for your help!

Why cross-post to a bunch of non appropriate NG's, please restrict your
postings to the vb NG only.

Willy.


Dec 20 '05 #5
Jim,
Thank you for that most informative and helpful response.

I am glad that the help from Willy did help you, I was ready to make a reply
however now I see that it is not needed anymore.

Because of your answer I assume that the most of us think about it this way.

Cor
Dec 20 '05 #6
Jim
On it's way...

Thanks!

"W.G. Ryan - MVP" <Wi*********@no spam.gmail.com> wrote in message
news:eB******** ******@TK2MSFTN GP10.phx.gbl...
Jim - if you would, shoot me an email to WilliamRyan at gmail dotcom - I
answered your question briefly below, but I have some material that you
will probably find helpful - it's too much to simply post but if you'll
shoot me a private email, I'll do what I can to help.
"Jim" <re***@groups.p lease> wrote in message
news:NA******** ***********@big news5.bellsouth .net...
Thank you for that most informative and helpful response.
"Willy Denoyette [MVP]" <wi************ *@telenet.be> wrote in message
news:eM******** *****@TK2MSFTNG P10.phx.gbl...

"Jim" <re***@groups.p lease> wrote in message
news:qf******** ***********@big news5.bellsouth .net...
I am using VB.Net 2.0 and I am completely new to the concept of
implementin g interfaces. Can anyone explain "implementi ng interfaces"
to me and perhaps give me an example of implementing an interface that
would help me implement the IIneternetSecur ityManager interface
mentioned under "Creating a Customized URL Security Manager" on
http://msdn.microsoft.com/library/de...#SecurityZones
and mentioned under "Download Control" on
http://msdn.microsoft.com/library/de...nload_Control?

This would help me a great understand implementing interfaces and I
could then implement a few more for my company's internal webbrowser.

Thanks for your help!

Why cross-post to a bunch of non appropriate NG's, please restrict your
postings to the vb NG only.

Willy.



Dec 20 '05 #7
Jim
That does help.

But how do I know what the object's interface looks like and how to
replicate it in VB.Net?

For example, the IInternetSecuri tyManager::Proc essUrlAction Method located
at
http://msdn.microsoft.com/library/de...#SecurityZones.
How would this interface be implemented?
"W.G. Ryan - MVP" <Wi*********@no spam.gmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Jim:

In .NET we don't have multiple inheritance but by using interfaces, you
can get to the same place by and large. If I have an interface, then the
compiler knows that each fo the methods and properties must exist in the
class - it can count on them being there. So in it's simplest form,
implementing an interface is simply adding a property and method to your
class for each one in the interface. That way you can do this....

IList myObject = new ObjectThatImple mentsIList();
myObject.Item(0 ) ; //b/c IList has Item

Now, by doing this, you can take an IList object as a paramater and then
pass in anything that implements IList b/c it effectively "is" an IList
object.

Does this help?

"Jim" <re***@groups.p lease> wrote in message
news:qf******** ***********@big news5.bellsouth .net...
I am using VB.Net 2.0 and I am completely new to the concept of
implementin g interfaces. Can anyone explain "implementi ng interfaces" to
me and perhaps give me an example of implementing an interface that would
help me implement the IIneternetSecur ityManager interface mentioned under
"Creating a Customized URL Security Manager" on
http://msdn.microsoft.com/library/de...#SecurityZones
and mentioned under "Download Control" on
http://msdn.microsoft.com/library/de...nload_Control?

This would help me a great understand implementing interfaces and I could
then implement a few more for my company's internal webbrowser.

Thanks for your help!


Dec 20 '05 #8
RCS
Yikes.

It might be helpful if you stuck to one question at a time and sent it to
one newsgroup. Crossposting is bad.

Interfaces require a bit of explanation. If you are not familiar, just ask.

HOW to implement them in VB (sorry to the other newsgroups), you do
something like this:

Public Class MyClass
Implements System.IFormatt able

End Class

in C#, it's something like this:

public class MyClass : System.IFormatt able
{
}

You will then obviously need to implement the members that the interface
describes.. hope that helps

"Jim" <re***@groups.p lease> wrote in message
news:qf******** ***********@big news5.bellsouth .net...
I am using VB.Net 2.0 and I am completely new to the concept of
implementing interfaces. Can anyone explain "implementi ng interfaces" to
me and perhaps give me an example of implementing an interface that would
help me implement the IIneternetSecur ityManager interface mentioned under
"Creating a Customized URL Security Manager" on
http://msdn.microsoft.com/library/de...#SecurityZones
and mentioned under "Download Control" on
http://msdn.microsoft.com/library/de...nload_Control?

This would help me a great understand implementing interfaces and I could
then implement a few more for my company's internal webbrowser.

Thanks for your help!

Dec 20 '05 #9
RCS
If I didn't know any better, these look like C++ API's and I couldn't find a
..NET implementation of them.. so I would guess (based on a cursory glance)
that there isn't an easy way to use this functionality in VB without
wrapping it first..

"Jim" <re***@groups.p lease> wrote in message
news:j4******** **********@bign ews5.bellsouth. net...
That does help.

But how do I know what the object's interface looks like and how to
replicate it in VB.Net?

For example, the IInternetSecuri tyManager::Proc essUrlAction Method located
at
http://msdn.microsoft.com/library/de...#SecurityZones.
How would this interface be implemented?
"W.G. Ryan - MVP" <Wi*********@no spam.gmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Jim:

In .NET we don't have multiple inheritance but by using interfaces, you
can get to the same place by and large. If I have an interface, then the
compiler knows that each fo the methods and properties must exist in the
class - it can count on them being there. So in it's simplest form,
implementing an interface is simply adding a property and method to your
class for each one in the interface. That way you can do this....

IList myObject = new ObjectThatImple mentsIList();
myObject.Item(0 ) ; //b/c IList has Item

Now, by doing this, you can take an IList object as a paramater and then
pass in anything that implements IList b/c it effectively "is" an IList
object.

Does this help?

"Jim" <re***@groups.p lease> wrote in message
news:qf******** ***********@big news5.bellsouth .net...
I am using VB.Net 2.0 and I am completely new to the concept of
implementi ng interfaces. Can anyone explain "implementi ng interfaces" to
me and perhaps give me an example of implementing an interface that would
help me implement the IIneternetSecur ityManager interface mentioned under
"Creating a Customized URL Security Manager" on
http://msdn.microsoft.com/library/de...#SecurityZones
and mentioned under "Download Control" on
http://msdn.microsoft.com/library/de...nload_Control?

This would help me a great understand implementing interfaces and I
could then implement a few more for my company's internal webbrowser.

Thanks for your help!



Dec 20 '05 #10

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

Similar topics

4
17202
by: Peter | last post by:
I want to copy a parent class instance's all datas to a child's. It's actually a C++'s copy constructor. But why the following code does not work - there is a compile error! How it should look like? (The background is I don't know (I don't care indeed) all members in DataGrid, so I don't want to copy all members in DataGrid one by one.) public class GridEx : DataGrid { public GridEx()
2
2580
by: Derrick | last post by:
Is there an implement interface wizard is C#/Visual Studio? And, I have an interface, with many implentations, want to provide a Web Service implementation. What would be the standard practice? Implement the interface in the main asmx class? Or just have all interface methods available, but without explicitly implementing it? Thanks in advance! Derrick
3
2727
by: Brett Hall | last post by:
I have a VB.NET interface that my managed C++ code is to implement. I seem to be stuck implementing an event defined in that interface. Does anyone have a simple code snippet that will show me the basics of what I need to implement? I've seen all the MSDN articles on implementing events in managed C++ and I've gotten events to work without issue when implementing all the constructs
16
1407
by: Jim | last post by:
I am using VB.Net 2.0 and I am completely new to the concept of implementing interfaces. Can anyone explain "implementing interfaces" to me and perhaps give me an example of implementing an interface that would help me implement the IIneternetSecurityManager interface mentioned under "Creating a Customized URL Security Manager" on http://msdn.microsoft.com/library/default.asp?url=/workshop/security/szone/overview/overview.asp#SecurityZones...
7
15719
by: moondaddy | last post by:
If I'm in a class that inherits an interface, is there a shortcut key that will write the implementation of the interface into the class? I remember seeing something like this in vb.net. Thanks. -- moondaddy@nospam.nospam
52
20923
by: Ben Voigt [C++ MVP] | last post by:
I get C:\Programming\LTM\devtools\UselessJunkForDissassembly\Class1.cs(360,27): error CS0535: 'UselessJunkForDissassembly.InvocableInternals' does not implement interface member 'UselessJunkForDissassembly.IInvocableInternals.OperationValidate(string)' C:\Programming\LTM\devtools\UselessJunkForDissassembly\Class1.cs(360,27): error CS0535: 'UselessJunkForDissassembly.InvocableInternals' does not implement interface member...
4
4244
by: =?Utf-8?B?QmFqaS4=?= | last post by:
Hi, Can somebody suggest me, how can I implement a vc++ interface in C#.net. This interface has method CallMe( ) which is used as a CallBack from my main application. Thanks, Baji.
5
2416
by: Tony Johansson | last post by:
Hello! Assume you have the following interface and classes shown below. It is said that a class must implement all the methods in the interface it inherits. Below we have class MyDerivedClass that inherits IMyInterface but MyDerivedClass doesn't implement method DoSomething() it inherits it from the base class MyBaseClass. So the statement that a class must implement all method in an interface that
3
15756
by: =?Utf-8?B?Sm9uIEU=?= | last post by:
I have an interface class with maybe eight functions, defined in one workspace and am defining a class in a second workspace that derives from this interface. Unfortunately only 7 of the 8 functions in my derived class compile whilst just one of them refuses to be recognised, leading to an error message "...does not implement interface member...". Try as I might, I can't fix the error. I have cut and paste names so can rule out simple...
0
9797
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9644
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10509
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10547
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10219
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9331
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7757
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5793
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.