Results 1 to 5 of 5

Thread: not a member

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2006
    Location
    Florida, USA
    Posts
    563

    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:
    1. 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:
    1. Imports System.Runtime.InteropServices
    2. Imports System.Windows.Forms
    3.  
    4. Namespace CoreClasses
    5.     Implements IDisposable
    6.  
    7.  
    8.     Public Class API
    9.  
    10. Shared Sub adjustWindowSize(theForm As Form, formToCheck As Form)
    11. End Sub
    12.  
    13.     End Class
    14. End Namespace
    I use VB .NET 2022. Currently developing StudyX educational software, PlazSales POS system and Yargis a space ship shooter game.

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: not a member

    vb.net Code:
    1. Imports System.Runtime.InteropServices
    2. Imports System.Windows.Forms
    3. Implements IDisposable 'this has to be outside the Namespace, did you not see the big blue wavy line?
    4.  
    5.  
    6. Namespace CoreClasses
    7.  
    8.     Public Class API
    9.  
    10. Shared Sub adjustWindowSize(theForm As Form, formToCheck As Form)
    11. End Sub
    12.  
    13.     End Class
    14. End Namespace

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2006
    Location
    Florida, USA
    Posts
    563

    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.

  4. #4
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    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.

  5. #5
    Angel of Code Niya's Avatar
    Join Date
    Nov 2011
    Posts
    8,601

    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.
    Treeview with NodeAdded/NodesRemoved events | BlinkLabel control | Calculate Permutations | Object Enums | ComboBox with centered items | .Net Internals article(not mine) | Wizard Control | Understanding Multi-Threading | Simple file compression | Demon Arena

    Copy/move files using Windows Shell | I'm not wanted

    C++ programmers will dismiss you as a cretinous simpleton for your inability to keep track of pointers chained 6 levels deep and Java programmers will pillory you for buying into the evils of Microsoft. Meanwhile C# programmers will get paid just a little bit more than you for writing exactly the same code and VB6 programmers will continue to whitter on about "footprints". - FunkyDexter

    There's just no reason to use garbage like InputBox. - jmcilhinney

    The threads I start are Niya and Olaf free zones. No arguing about the benefits of VB6 over .NET here please. Happiness must reign. - yereverluvinuncleber

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