|
-
March 21st, 2001, 04:15 PM
#1
Return User Type from a property
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!
-
March 22nd, 2001, 12:27 AM
#2
Re: Return User Type from a property
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!
-
March 22nd, 2001, 09:22 AM
#3
Re: Return User Type from a property
-Be aware that this is only possible with ActiveX DLL project type.
That's what I needed to know, thanks!
-
April 11th, 2001, 07:53 AM
#4
Re: Return User Type from a property
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.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
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
|