Click here to Skip to main content
15,915,093 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Desprate need help with buttons and panels Pin
Dave Kreskowiak4-Jun-07 6:46
mveDave Kreskowiak4-Jun-07 6:46 
AnswerSTOP REPOSTING Pin
leckey4-Jun-07 8:33
leckey4-Jun-07 8:33 
AnswerRe: Desprate need help with buttons and panels Pin
The ANZAC4-Jun-07 12:19
The ANZAC4-Jun-07 12:19 
AnswerRe: Desprate need help with buttons and panels Pin
Christian Graus4-Jun-07 14:45
protectorChristian Graus4-Jun-07 14:45 
QuestionThe method or operation is not implemented. Pin
Blizzardice4-Jun-07 6:27
Blizzardice4-Jun-07 6:27 
AnswerRe: The method or operation is not implemented. Pin
Dave Kreskowiak4-Jun-07 8:16
mveDave Kreskowiak4-Jun-07 8:16 
GeneralRe: The method or operation is not implemented. Pin
Blizzardice4-Jun-07 9:21
Blizzardice4-Jun-07 9:21 
GeneralRe: The method or operation is not implemented. Pin
Dave Kreskowiak4-Jun-07 9:51
mveDave Kreskowiak4-Jun-07 9:51 
Blizzardice wrote:
i am curious thought why all the examples from ESRI (Which is where all this comes from always do the
dim P_Interface as Iinterface
p_Interface = new interface


Because an Interface is not a concrete object. It's more like a contract. An interface just defines what a class MUST implement.

Think of it this way. If you were writing a plugin for another application, how would that application know how to call the code in your plugin?? The only way is to make sure that the class you write implements an interface that the host application expects your class to use. Otherwise, the host app has no idea how to call your plugin code.

Now, since the host app also cannot know what your class is called at runtime, it just casts an instance of your class to the interface is expects. This allows the code to call your class because, without knowing what your class is called or what's in it, it knows that your class has to implements the things it DOES know about.

For example:
Public Class MyPlugIn
    Implements IAppPlugin
 
    Public Sub SomeMethod(blah, blah) Implements IAppPlugin.SomeMethod
        .
    End Sub
End Class

And in the application, it would do something like this (simplified!)
' An instance of the class has already been created somewhere
' else.  This is how the host app would use it.
Dim p As IAppPlugin = DirectCast(someInstance, IAppPlugin)
p.SomeMethod(argumentList)

The ESRI examples are overblown. They're doing extra steps that are just not necessary.


A guide to posting questions on CodeProject[^]

Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007


QuestionRe: The method or operation is not implemented. Pin
Blizzardice4-Jun-07 11:01
Blizzardice4-Jun-07 11:01 
AnswerRe: The method or operation is not implemented. Pin
Dave Kreskowiak4-Jun-07 13:49
mveDave Kreskowiak4-Jun-07 13:49 
QuestionHierarchical data Pin
advansis4-Jun-07 6:25
advansis4-Jun-07 6:25 
AnswerRe: Hierarchical data Pin
Dave Kreskowiak4-Jun-07 6:44
mveDave Kreskowiak4-Jun-07 6:44 
QuestionHow to unzip a pkzip file with sharpziplib? Pin
JSThomas4-Jun-07 6:24
JSThomas4-Jun-07 6:24 
QuestionEdit menu item Pin
jds12074-Jun-07 5:04
jds12074-Jun-07 5:04 
AnswerRe: Edit menu item Pin
jwlc764-Jun-07 5:40
jwlc764-Jun-07 5:40 
QuestionVB.Net Pin
SekharOne4-Jun-07 4:31
SekharOne4-Jun-07 4:31 
AnswerRe: VB.Net Pin
leckey4-Jun-07 5:27
leckey4-Jun-07 5:27 
QuestionError updating Dataset to Reflect into the Original Table Pin
Vimalsoft(Pty) Ltd4-Jun-07 4:13
professionalVimalsoft(Pty) Ltd4-Jun-07 4:13 
AnswerRe: Error updating Dataset to Reflect into the Original Table Pin
Dave Kreskowiak4-Jun-07 6:35
mveDave Kreskowiak4-Jun-07 6:35 
GeneralRe: Error updating Dataset to Reflect into the Original Table Pin
Vimalsoft(Pty) Ltd4-Jun-07 21:12
professionalVimalsoft(Pty) Ltd4-Jun-07 21:12 
GeneralRe: Error updating Dataset to Reflect into the Original Table Pin
Dave Kreskowiak6-Jun-07 16:30
mveDave Kreskowiak6-Jun-07 16:30 
QuestionProgress indicator Pin
DanB19834-Jun-07 3:56
DanB19834-Jun-07 3:56 
AnswerRe: Progress indicator Pin
Dave Kreskowiak4-Jun-07 6:38
mveDave Kreskowiak4-Jun-07 6:38 
AnswerRe: Progress indicator Pin
Thomas Stockwell4-Jun-07 8:22
professionalThomas Stockwell4-Jun-07 8:22 
QuestionVBA Excel Help Pin
Duane in Japan4-Jun-07 3:50
Duane in Japan4-Jun-07 3:50 

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.