|
-
Jan 11th, 2004, 06:40 PM
#1
Thread Starter
Frenzied Member
Interface Newbie
I have this interface:
VB Code:
Module Interface_Module
Public Interface ISleuthMobile
Function GetName() As String
End Interface
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:
Imports SleuthInterface
Public Class Skids
Inherits System.Windows.Forms.Form
Implements isleuthmobile
...
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
-
Jan 11th, 2004, 07:23 PM
#2
Addicted Member
**Edit ** nm re-read the question.
-
Jan 11th, 2004, 08:32 PM
#3
Why put the interface in a module? That adds the module name to the namespace. I'd suggest removing the Module:
VB Code:
Public Interface ISleuthMobile
Function GetName() As String
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.
-
Jan 12th, 2004, 10:02 AM
#4
Thread Starter
Frenzied Member
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
-
Jan 12th, 2004, 10:08 AM
#5
Thread Starter
Frenzied Member
Originally posted by Carnifex
**Edit ** nm re-read the question.
I don't understand this post at all.
-
Jan 12th, 2004, 10:25 AM
#6
nm = Never mind
He answered the question, but probly realised it didnt help.
-
Jan 12th, 2004, 10:39 AM
#7
Thread Starter
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|