-
Sep 3rd, 2012, 04:12 PM
#1
Thread Starter
Fanatic Member
not a member
I have been changing some namespace stuff, but I do not understand why I am getting this error. I can access the CoreClasses just fine, but API is an issue.
Code that gives me the error:
vb Code:
CoreClasses.API.adjustWindowSize(Me, frmStudy)
Error:
Error 8 'API' is not a member of 'CoreClasses'. C:\Users\Jeff\Documents\JeffWorkSpace2\StudyX.NET\frmAskQuestion.vb 132 9 study
Snippets from API:
vb Code:
Imports System.Runtime.InteropServices Imports System.Windows.Forms Namespace CoreClasses Implements IDisposable Public Class API Shared Sub adjustWindowSize(theForm As Form, formToCheck As Form) End Sub End Class End Namespace
I use VB .NET 2022. Currently developing StudyX educational software, PlazSales POS system and Yargis a space ship shooter game.
-
Sep 3rd, 2012, 04:29 PM
#2
Re: not a member
vb.net Code:
Imports System.Runtime.InteropServices
Imports System.Windows.Forms
Implements IDisposable 'this has to be outside the Namespace, did you not see the big blue wavy line?
Namespace CoreClasses
Public Class API
Shared Sub adjustWindowSize(theForm As Form, formToCheck As Form)
End Sub
End Class
End Namespace
-
Sep 3rd, 2012, 04:51 PM
#3
Thread Starter
Fanatic Member
Re: not a member
When I move it out (just below the imports) I get Blue Wavy lines, and this error:
Error 45 Statement is not valid in a namespace. C:\Users\Jeff\Documents\Visual Studio 2010\Projects\PlazCore\CoreClasses\CoreClasses\clsNet.vb 5 1 CoreClasses
Error 46 Interface 'System.IDisposable' is not implemented by this class. C:\Users\Jeff\Documents\Visual Studio 2010\Projects\PlazCore\CoreClasses\CoreClasses\clsNet.vb 652 41 CoreClasses
I use VB .NET 2022. Currently developing StudyX educational software, PlazSales POS system and Yargis a space ship shooter game.
-
Sep 3rd, 2012, 04:57 PM
#4
Re: not a member
Yup. Sorry. What I meant to say is you can't use Implements IDisposable in the namespace at all. You'll have to find an alternative or do without.
-
Sep 3rd, 2012, 09:34 PM
#5
Re: not a member
Namespaces do not implement interfaces. A namespace is nothing more than a way to group classes. It doesn't correspond to anything material like a class does.
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
|