Results 1 to 7 of 7

Thread: Interface Newbie

  1. #1

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Interface Newbie

    I have this interface:
    VB Code:
    1. Module Interface_Module
    2.     Public Interface ISleuthMobile
    3.         Function GetName() As String
    4.     End Interface
    5. End Module

    The module is in it's own project, named "SleuthInterface". Another project in this solution is called "Skids". In Skids, I added a reference to SleuthInterface, because I want Skids to implement SleuthInterface.

    In Skids, I import SleuthInterface with no problem:
    VB Code:
    1. Imports SleuthInterface
    2.  
    3. Public Class Skids
    4.     Inherits System.Windows.Forms.Form
    5.     Implements isleuthmobile
    6. ...

    My problem is, the class cannot see ISleuthMobile. If you saw the above code, there's a squiggly line under "isleuthmobile" (I usually write my code to not match the case, because of the visual feedback IntelliSense gives you).

    Looks like I'm missing something really basic, but heck if I can figure it out.

    Any help is much appreciated,
    Mike

  2. #2
    Addicted Member
    Join Date
    Aug 2003
    Posts
    153
    **Edit ** nm re-read the question.

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Why put the interface in a module? That adds the module name to the namespace. I'd suggest removing the Module:
    VB Code:
    1. Public Interface ISleuthMobile
    2.         Function GetName() As String
    3.     End Interface
    An interface is just like a class or module and doesn't need to be encapsulated in anything else. Otherwise you'd have to import SleuthInterface.Interface_Module to reach it but as stated there is no need for it to be in the module.

  4. #4

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    To be honest, I'm not really sure why I'm doing it this way. This is my first attempt at trying to make an extensible application.

    The way I understand it, my container application needs to see the interface, as does my (or someone else's) plugins. That way, I can iterate over some dlls in a "Plugins" directory, and load the plugins into my app.

    So I thought I needed to make the interface as a stand-alone thing - ready to be used by whoever makes a plugin.

    BTW - I really don't know what I'm doing

  5. #5

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    Originally posted by Carnifex
    **Edit ** nm re-read the question.
    I don't understand this post at all.

  6. #6
    PowerPoster
    Join Date
    Mar 2002
    Location
    UK
    Posts
    4,780
    nm = Never mind

    He answered the question, but probly realised it didnt help.

  7. #7

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    Making my module "Public" seems to have fixed that problem.

    Anybody around here ever make an extensible application? The idea is really cool, I'm slowly getting there, probably doing all sorts of stuff wrong

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width