By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,558 Members | 1,699 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,558 IT Pros & Developers. It's quick & easy.

Interface creation in VB.Net 2005

P: n/a
Is it me or has the way interfaces created changed in VB 2005?
I have to create a class file and then create the Interface within that, e.g.:
to create an Interface called IOrders, I create a class file called
Interfaces then within that file:
Public Class Interfaces
Interface IOrders
Property myOrderID() As Integer
End Interface
End Class

To reference this Interface in an Implements statement I have to use
Interfaces.IOrders. If I don't 'wrap' the interface in a class it can't be
seen by any Implements statement.
Am I don't something embarassingly wrong here, or have things changed with
2005?

Feb 15 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"John Mason" <Jo*******@discussions.microsoft.com> schrieb:
Is it me or has the way interfaces created changed in VB 2005?
I have to create a class file and then create the Interface within that,
e.g.:
to create an Interface called IOrders, I create a class file called
Interfaces then within that file:
Public Class Interfaces
Interface IOrders
Property myOrderID() As Integer
End Interface
End Class

To reference this Interface in an Implements statement I have to use
Interfaces.IOrders. If I don't 'wrap' the interface in a class it can't be
seen by any Implements statement.


Mhm... It should work without adding the interface to the class as a nested
type. I am curious if it only doesn't show up in IntelliSense or if the
compiler complains about the 'Implements...'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Feb 15 '06 #2

P: n/a
Many thanks for your reply Herfried, I think I have now resolved the problem.
Initially, when creating the class file which I wanted to use for my
Interface file I chose NOT to store the file in the App_Code folder. In that
resulting file, the Interface name would not show up in Intellisense.
Now, by allowing the file to be created in the App_Code folder, the
Interface IS available in Intellisense.
I'm afraid I'm a victim of trying to learn VB.Net 2005 at home, without the
crutch of my far more intelligent colleagues and the Help system showing me
everything except what I need to know!

"Herfried K. Wagner [MVP]" wrote:
"John Mason" <Jo*******@discussions.microsoft.com> schrieb:
Is it me or has the way interfaces created changed in VB 2005?
I have to create a class file and then create the Interface within that,
e.g.:
to create an Interface called IOrders, I create a class file called
Interfaces then within that file:
Public Class Interfaces
Interface IOrders
Property myOrderID() As Integer
End Interface
End Class

To reference this Interface in an Implements statement I have to use
Interfaces.IOrders. If I don't 'wrap' the interface in a class it can't be
seen by any Implements statement.


Mhm... It should work without adding the interface to the class as a nested
type. I am curious if it only doesn't show up in IntelliSense or if the
compiler complains about the 'Implements...'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Feb 16 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.