473,948 Members | 2,591 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
16 1418

"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" <re***@groups.p lease> wrote in message
news:qf******** ***********@big news5.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*********@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 #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 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 #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******** ******@TK2MSFTN GP10.phx.gbl...

"Jim" <re***@groups.p lease> wrote in message
news:qf******** ***********@big news5.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

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

Similar topics

4
17216
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
2584
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
2734
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
2
4338
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: C:\Inetpub\wwwroot\MyApp\MyAsynchResult.cs(8): 'MyAsynchResult' does not
14
1772
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
15733
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
20962
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
4248
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
2428
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
15761
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
9989
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
11587
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
11182
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
11355
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
10695
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
9898
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
4950
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
2
4543
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3548
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.