how and where do I declare user data type to be able to pass an array of
this user data type as a parameter for the class method? Now I get an error
that I shoul declare it in a public object module, but all the objects
modules in a project seem to be private.
thanks, vlad.
Ishan Bhalla - 29 Sep 2004 00:55 GMT
the user data types should be declared as public in the class that u wish to
share!!
Regards,
Ishan
> how and where do I declare user data type to be able to pass an array of
> this user data type as a parameter for the class method? Now I get an error
> that I shoul declare it in a public object module, but all the objects
> modules in a project seem to be private.
>
> thanks, vlad.
vlad - 29 Sep 2004 10:33 GMT
This only works if the class module is public, i.e. in ActiveX DLL or
ActiveX EXE. If the class module is a part of a common project then it is
not allowed..
The dessision I've found is to declare User defined type as a class itself.
I.e. I use a class with a public properties instead of the User defined
type. Of course an array should be declared as
private a() as new MyClass
for example.
thanks anyway,
vlad.
news:79BA8860-35FB-4DFB-9FA2-74ACF2DC6681@microsoft.com...
> the user data types should be declared as public in the class that u wish to
> share!!
[quoted text clipped - 8 lines]
> >
> > thanks, vlad.
Ken Halter - 29 Sep 2004 15:27 GMT
> The dessision I've found is to declare User defined type as a class itself.
You'll find that you've added a lot of (optional) functionality to your
app by replacing that tired old UDT with a class module <g> Range
checking, default settings, etc, etc are now easy to implement.

Signature
Ken Halter - MS-MVP-VB - http://www.vbsight.com
Please keep all discussions in the groups..
Ishan Bhalla - 29 Sep 2004 00:59 GMT
Just to add to the previous note:
Option Explicit
Public myInstance As myDataType
Public Type myDataType
CPU As Variant
Memory As Long
VideoColors As Integer
Cost As Currency
PurchaseDate As Variant
End Type
Regards
ishan
> how and where do I declare user data type to be able to pass an array of
> this user data type as a parameter for the class method? Now I get an error
> that I shoul declare it in a public object module, but all the objects
> modules in a project seem to be private.
>
> thanks, vlad.