-
I'm using VB6.
Can anyone please tell me how would it be possible for me to have a
CLASS METHOD that has a public USER-DEFINED DATATYPE as one of its
arguments.
Example:
'-----In a public module (.BAS)
Public Type POINTAPI
x As Long
y As Long
End Type
'-----In a class (.CLS)
Public Sub GetPoints(ByRef numOfPoints As Integer, _
ByRef floorPoints() As POINTAPI)
- The method declaration above will generate the following error :
"Only public user defined types defined in public object modules can
be used as parameters or return types for public procedures of class
modules or as fields of public iuser defined types"
- Is there a way to get around with such problem?
-
Hi,
The way I work around this one is to not use a normal module for the UDT but another class module of their own. Then setting the Instancing property to 2-PublicNotCreateable means that they are global to your code but cannot be seen when compiled. This probably isn't the correct way, but it works for me ;)
Hope this helps,
Shaun