Click here to Skip to main content
15,900,110 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionWord cannot fire events Pin
Member 400654623-Jul-08 20:01
Member 400654623-Jul-08 20:01 
AnswerRe: Word cannot fire events Pin
~Khatri Mitesh~23-Jul-08 20:22
~Khatri Mitesh~23-Jul-08 20:22 
QuestionWhat exactly is an Interface? (yeah, i know i sound stupid) Pin
jacobjordan23-Jul-08 14:35
jacobjordan23-Jul-08 14:35 
AnswerRe: What exactly is an Interface? (yeah, i know i sound stupid) Pin
_Damian S_23-Jul-08 14:45
professional_Damian S_23-Jul-08 14:45 
AnswerRe: What exactly is an Interface? (yeah, i know i sound stupid) Pin
Gideon Engelberth23-Jul-08 15:30
Gideon Engelberth23-Jul-08 15:30 
GeneralRe: What exactly is an Interface? (yeah, i know i sound stupid) Pin
jacobjordan23-Jul-08 18:12
jacobjordan23-Jul-08 18:12 
GeneralRe: What exactly is an Interface? (yeah, i know i sound stupid) Pin
Jon_Boy24-Jul-08 1:40
Jon_Boy24-Jul-08 1:40 
AnswerRe: What exactly is an Interface? (yeah, i know i sound stupid) Pin
supercat924-Jul-08 6:00
supercat924-Jul-08 6:00 
Under .net, any class of object is only allowed to 'inherit' from one other class of object. There are sound reasons for this, since multiple inheritance causes considerable complications and confusion.

Nonetheless, there are many circumstances where something resembling multiple inheritance would be desirable. For example, a container control should be inherited from a basic control (obviously), but it should also support a standard method of enumerating its contents, which would suggest that it should be inherited from a 'things whose contents can be enumerated' class. It's not possible to have a container control (or anything else) inherit from more than one class, but it is possible to use interfaces to make it be a 'thing whose contents can be enumerated' in addition to being a control.

The primary differences between inheritance and interfaces are
  1. Classes can be inherited from at most one other class, but can have an unlimited number of interfaces

  2. A class that inherits another class will by default use the properties, methods, and fields of the base class; there are no "default" implementations for interfaces. If ten classes support an interface, the code for every property or method in the interface must be repeated in all ten classes even if it is identical in every case.

  3. While it is possible (and often useful) to declare an object variable or parameter as being of an interface type (e.g. "iDisposable") it is not possible to create a new variable of an interface type.
If rather than having "Control" be an inheritable class, .Net were to use an iControl interface, then every type of control would have to include code for dozens of methods and properties; it would be a total nightmare. Inheriting the "Control" class allows controls to use mostly default behaviors and simply implement the things that are unique to each type of control. Since a container control isn't inherited from a container class, it must explicitly implement code to handle enumeration (the iEnumerable interface) but that's far less of a hassle than would be implementing every control property on every control.
Questionwriting program code in excel visual basic Pin
Matthew Leggett23-Jul-08 14:28
Matthew Leggett23-Jul-08 14:28 
AnswerRe: writing program code in excel visual basic Pin
_Damian S_23-Jul-08 14:39
professional_Damian S_23-Jul-08 14:39 
GeneralRe: writing program code in excel visual basic Pin
Matthew Leggett24-Jul-08 14:47
Matthew Leggett24-Jul-08 14:47 
GeneralRe: writing program code in excel visual basic Pin
ChandraRam25-Jul-08 1:58
ChandraRam25-Jul-08 1:58 
GeneralRe: writing program code in excel visual basic Pin
Matthew Leggett25-Jul-08 2:43
Matthew Leggett25-Jul-08 2:43 
GeneralRe: writing program code in excel visual basic Pin
ChandraRam25-Jul-08 2:50
ChandraRam25-Jul-08 2:50 
GeneralRe: writing program code in excel visual basic Pin
Matthew Leggett25-Jul-08 3:10
Matthew Leggett25-Jul-08 3:10 
GeneralRe: writing program code in excel visual basic Pin
ChandraRam25-Jul-08 3:23
ChandraRam25-Jul-08 3:23 
GeneralRe: writing program code in excel visual basic Pin
Matthew Leggett25-Jul-08 3:33
Matthew Leggett25-Jul-08 3:33 
QuestionConnection String Typed Dataset 2005 Pin
dotnetme223-Jul-08 11:07
dotnetme223-Jul-08 11:07 
AnswerRe: Connection String Typed Dataset 2005 Pin
_Damian S_23-Jul-08 14:42
professional_Damian S_23-Jul-08 14:42 
GeneralRe: Connection String Typed Dataset 2005 Pin
Jon_Boy24-Jul-08 1:52
Jon_Boy24-Jul-08 1:52 
QuestionDistribute com-wrapped dll Pin
nlarson1123-Jul-08 8:29
nlarson1123-Jul-08 8:29 
AnswerRe: Distribute com-wrapped dll Pin
jzonthemtn23-Jul-08 9:02
jzonthemtn23-Jul-08 9:02 
GeneralRe: Distribute com-wrapped dll Pin
nlarson1123-Jul-08 9:07
nlarson1123-Jul-08 9:07 
GeneralRe: Distribute com-wrapped dll Pin
nlarson1123-Jul-08 9:13
nlarson1123-Jul-08 9:13 
GeneralRe: Distribute com-wrapped dll Pin
jzonthemtn23-Jul-08 12:44
jzonthemtn23-Jul-08 12:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.