471,317 Members | 2,578 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,317 software developers and data experts.

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 "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/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
16 1283

"Jim" <re***@groups.please> wrote in message
news:qf*******************@bignews5.bellsouth.net. ..
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/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*************@TK2MSFTNGP10.phx.gbl...

"Jim" <re***@groups.please> wrote in message
news:qf*******************@bignews5.bellsouth.net. ..
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/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 ObjectThatImplementsIList();
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.please> wrote in message
news:qf*******************@bignews5.bellsouth.net. ..
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/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.please> wrote in message
news:NA*******************@bignews5.bellsouth.net. ..
Thank you for that most informative and helpful response.
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:eM*************@TK2MSFTNGP10.phx.gbl...

"Jim" <re***@groups.please> wrote in message
news:qf*******************@bignews5.bellsouth.net. ..
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/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" <re***@groups.please> wrote in message
news:qf*******************@bignews5.bellsouth.net. ..
I am using VB.Net 2.0


That's Q, being omnipoten, punishing you; as he knew you would cross-post on
usenet. Stop that and higher powers just may let you code in C#. =)

- Michael S

Dec 20 '05 #6
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 #7
Jim
On it's way...

Thanks!

"W.G. Ryan - MVP" <Wi*********@nospam.gmail.com> wrote in message
news:eB**************@TK2MSFTNGP10.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.please> wrote in message
news:NA*******************@bignews5.bellsouth.net. ..
Thank you for that most informative and helpful response.
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:eM*************@TK2MSFTNGP10.phx.gbl...

"Jim" <re***@groups.please> wrote in message
news:qf*******************@bignews5.bellsouth.net. ..
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/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 #8
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 IInternetSecurityManager::ProcessUrlAction Method located
at
http://msdn.microsoft.com/library/de...#SecurityZones.
How would this interface be implemented?
"W.G. Ryan - MVP" <Wi*********@nospam.gmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.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 ObjectThatImplementsIList();
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.please> wrote in message
news:qf*******************@bignews5.bellsouth.net. ..
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/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
Jim
I really just don't like C# syntax. Maybe it's all the years of being
spoiled by VB syntax....I don't know.

If I was going to learn a C? language, it'd be C++. More power than C#, and
the syntax is just as nasty.
"Michael S" <no@mail.com> wrote in message
news:uG**************@TK2MSFTNGP10.phx.gbl...

"Jim" <re***@groups.please> wrote in message
news:qf*******************@bignews5.bellsouth.net. ..
I am using VB.Net 2.0


That's Q, being omnipoten, punishing you; as he knew you would cross-post
on usenet. Stop that and higher powers just may let you code in C#. =)

- Michael S

Dec 20 '05 #10
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.IFormattable

End Class

in C#, it's something like this:

public class MyClass : System.IFormattable
{
}

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

"Jim" <re***@groups.please> wrote in message
news:qf*******************@bignews5.bellsouth.net. ..
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/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 #11
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.please> wrote in message
news:j4******************@bignews5.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 IInternetSecurityManager::ProcessUrlAction Method located
at
http://msdn.microsoft.com/library/de...#SecurityZones.
How would this interface be implemented?
"W.G. Ryan - MVP" <Wi*********@nospam.gmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.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 ObjectThatImplementsIList();
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.please> wrote in message
news:qf*******************@bignews5.bellsouth.net. ..
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/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 #12
Jim
Do you mean that you need to write a wrapper in C++ to expose this
functionality in VB.Net?
"RCS" <rs****@gmail.com> wrote in message
news:Ei*****************@newssvr33.news.prodigy.co m...
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.please> wrote in message
news:j4******************@bignews5.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 IInternetSecurityManager::ProcessUrlAction Method
located at
http://msdn.microsoft.com/library/de...#SecurityZones.
How would this interface be implemented?
"W.G. Ryan - MVP" <Wi*********@nospam.gmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.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 ObjectThatImplementsIList();
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.please> wrote in message
news:qf*******************@bignews5.bellsouth.net. ..
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/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 #13
Jim

"RCS" <rs****@gmail.com> wrote in message
news:Vb****************@newssvr33.news.prodigy.com ...
Yikes.

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


I only cross-posted because I knew that C/C++/C# programmers may hae the
information that I seek. Posting to the VB.Net ng could work, but since I
am talking about C++ APIs, I thought the groups selected were appropriate.

And, I have been taken to task for posting the same questions in separate
posts to separate groups because it evidentially eats up bandwidth for some
USENET users that pay for bandwidth usage.

In fact, based on those conversations, I thought that I was doing people a
favor by sending the question to several ngs at once rather than posting
separately to the ngs.

I don't know......I am just seeking knowledge wherever I can find it. Sorry
if I stepped on any toes in the process.

Dec 20 '05 #14
Cor - I think it's safe to answer if you want to give it a shot - I suspect
Jim's answer may have been polite sarcasm.
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uN**************@TK2MSFTNGP09.phx.gbl...
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 #15
Well it depejnds on the interface. If you're in the IDE, you can find out
the methods by hitting Tab after you use the Implements InterfaceName - this
will shell out all the methods for you. To implement the interface,create
your class and then use Implements and then the interface name, when you
hit tab, it will fill in the method stubs for you.
"Jim" <re***@groups.please> wrote in message
news:j4******************@bignews5.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 IInternetSecurityManager::ProcessUrlAction Method located
at
http://msdn.microsoft.com/library/de...#SecurityZones.
How would this interface be implemented?
"W.G. Ryan - MVP" <Wi*********@nospam.gmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.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 ObjectThatImplementsIList();
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.please> wrote in message
news:qf*******************@bignews5.bellsouth.net. ..
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/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 #16
Jim,

I think that we are talking about different interfaces.

As we are talking in VB.Net than an Interface describes a contract what a
class has to consist, which makes it possible to access that class using
that interface.

You have as well all kind of other Interfaces by instance a UI User
Interface what is totaly something different.

An Api Apllication Program Interface is an interface between your program
and the OS, however not seen as that when we talk about interfaces.

I first thought that you was asking for an Interface, now I understand that
you ask it for an API.

http://msdn.microsoft.com/library/de...indowsAPIs.asp

Probably it is better to start in one newsgroup (related to your expected
result) and give what you want it right name, if it is than wrong, people
will help you to a better newsgroup.

I hope this helps,

Cor

"Jim" <re***@groups.please> schreef in bericht
news:3s******************@bignews5.bellsouth.net.. .

"RCS" <rs****@gmail.com> wrote in message
news:Vb****************@newssvr33.news.prodigy.com ...
Yikes.

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


I only cross-posted because I knew that C/C++/C# programmers may hae the
information that I seek. Posting to the VB.Net ng could work, but since I
am talking about C++ APIs, I thought the groups selected were appropriate.

And, I have been taken to task for posting the same questions in separate
posts to separate groups because it evidentially eats up bandwidth for
some USENET users that pay for bandwidth usage.

In fact, based on those conversations, I thought that I was doing people a
favor by sending the question to several ngs at once rather than posting
separately to the ngs.

I don't know......I am just seeking knowledge wherever I can find it.
Sorry if I stepped on any toes in the process.

Dec 20 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Peter | last post: by
2 posts views Thread by Derrick | last post: by
2 posts views Thread by Dave | last post: by
7 posts views Thread by moondaddy | last post: by
52 posts views Thread by Ben Voigt [C++ MVP] | last post: by
4 posts views Thread by =?Utf-8?B?QmFqaS4=?= | last post: by
5 posts views Thread by Tony Johansson | last post: by
3 posts views Thread by =?Utf-8?B?Sm9uIEU=?= | last post: by
reply views Thread by rosydwin | last post: by

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.