Click to See Complete Forum and Search --> : Return User Type from a property
JackDaniels256
March 21st, 2001, 03:15 PM
Does anybody know how to return a User Type from a property such as:
Public Property Get MyType() as [User Type in question]
MyType = [user type]
End Property
VB is giving an error for that!
The user Type is declared in a standard module and used in a class module.
Thanks in advance!
epelyavski
March 21st, 2001, 11:27 PM
Include you type in class module. Be aware that this is only possible with ActiveX DLL project type.
option Explicit
public Type MyType
x as Long
y as Long
End Type
private t as MyType
public property get GetMyType() as MyType
GetMyType = t
End property
Next question!
JackDaniels256
March 22nd, 2001, 08:22 AM
-Be aware that this is only possible with ActiveX DLL project type.
That's what I needed to know, thanks!
Cimperiali
April 11th, 2001, 07:53 AM
It should be possible also in activex exe project. The limitation is: a public creatable class (look for innstancing property of the class).
Once you have defined your user defined type in a class, you zhould be able to pass it to functions or subs in forms, bas, dll,..., module, provided that you declared instances of it with the
(private/public) myHereType as myclass.myType formula
Best regards,
Cesare Imperiali
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.