Results 1 to 2 of 2

Thread: Class Modules

  1. #1

    Thread Starter
    Fanatic Member petrus's Avatar
    Join Date
    May 2002
    Location
    pBytes[sizeof(pBytes)/2]
    Posts
    553

    Class Modules

    This code is in a class module:

    VB Code:
    1. Private Type hej
    2.     x As Long
    3.     y As Long
    4. End Type
    5.  
    6. Public Sub showHej(hej2 As hej)
    7. msgbox hej2.x & ":" & hej2.y
    8.  
    9. End Sub
    This will result in this error:

    Compile error:
    Private enum and user defined types cannot be used as parameters or return types for public procedures, public data members, or fields of public user defined types.

    How to make it work???
    ICQ: 128716725

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Simple, just make it a Public Type.

    VB Code:
    1. [b]Public[/b] Type hej
    2.     x As Long
    3.     y As Long
    4. End Type

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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