473,320 Members | 1,921 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,320 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
14 1232

"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,
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*********@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 #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 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 #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.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 #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.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 #10
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 #11
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 #12
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 #13
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 #14
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 #15

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

Similar topics

4
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...
2
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? ...
3
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...
2
by: Dave | last post by:
I'm trying to extend the System.IAsynchResult so I created a class as follows: public class MyAsynchResult : System.IAsyncResult { ..... } But get: ...
14
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...
7
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. ...
52
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...
4
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
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...
3
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...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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.