Re: How to export a UDT from a Class
- From: "Ken Halter" <Ken_Halter@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 2 Jun 2005 12:36:16 -0700
"Tony Proctor" <tony_proctor@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:%23PxI5V5ZFHA.2288@xxxxxxxxxxxxxxxxxxxxxxx
>I have a problem with exporting a UDT from a Public class and have it being
> modifiable. It may be related to something I thought was a bug a couple of
> years ago
> (http://groups.google.ie/group/microsoft.public.vb.bugs/msg/4f99d5da34f04162
> ?hl=en)
>
> Note that isn't the usual problem of not being able to export UDTs unless
> the Type is Public and in a Public class. Everyone knows that one. No, in
Even stranger... lose the With/End With and it doesn't work at all... but
create a class property for each member of the UDT and it works always.
'==========
Option Explicit
Dim o As Class1
Private Sub Command1_Click()
Debug.Print o.Var.s
End Sub
Private Sub Form_Load()
Set o = New Class1
o.Var.s = "Hello"
Debug.Print o.Var.s
End Sub
'==========
Separate property for each member of UDT works....
'===========Form
Option Explicit
Dim o As Class1
Private Sub Command1_Click()
Debug.Print o.VarS
End Sub
Private Sub Form_Load()
Set o = New Class1
o.VarS = "Hello"
Debug.Print o.VarS
End Sub
'===========Class
Option Explicit
Public Type t
s As String
End Type
Private tVar As t
Public Property Get VarS() As String
VarS = tVar.s
End Property
Public Property Let VarS(Arg As String)
tVar.s = Arg
End Property
'===========
What a pain... eh? <g>
--
Ken Halter - MS-MVP-VB - http://www.vbsight.com
DLL Hell problems? Try ComGuard - http://www.vbsight.com/ComGuard.htm
Please keep all discussions in the groups..
.
- Follow-Ups:
- Re: How to export a UDT from a Class
- From: Tony Proctor
- Re: How to export a UDT from a Class
- References:
- How to export a UDT from a Class
- From: Tony Proctor
- How to export a UDT from a Class
- Prev by Date: How to export a UDT from a Class
- Next by Date: Re: How to export a UDT from a Class
- Previous by thread: How to export a UDT from a Class
- Next by thread: Re: How to export a UDT from a Class
- Index(es):
Relevant Pages
|