|
-
Jul 15th, 2000, 09:56 PM
#1
Thread Starter
Fanatic Member
I have a class with a public GET and LET to set and retrieve the location of the object. I want to pass a type called LOCATION which has an X and a Y value.
But I always get "Only Public user types declared in public object modules can be used as parameters or return return types for public precedures or class modules... etc"
I've tried declaring the type in the class and/or a public module, I tried public and private but I can't get it to work!
I saw a question like this recently here re activeX controls but I'm not sure if this is related
HELP!
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
-
Jul 16th, 2000, 03:44 AM
#2
could you post a bit of code for us to have a butchers at?
-
Jul 16th, 2000, 04:19 AM
#3
Thread Starter
Fanatic Member
sure,
I looked through some of the old posts and found the idea of using "Friend" rather than "Public" which seems to work, which is odd, an in depth explanation would be great!!
Code:
' class props (now with friend, doesn't work with public)
Friend Property Get UnitPosition() As Location
UnitPosition = CurrentLoc
End Property
Friend Property Let UnitPosition(Loc As Location)
CurrentLoc = Loc
End Property
' Type
Public Type Location
X As Integer
Y As Integer
BaseWidth As Integer
End Type
Paul Dwyer 
Network Engineer
Aussie In Tokyo
Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)
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
|