标准模块: Type aa ss As String End Type类模块: Function test() As Variant Dim a As aa a.ss = Now test = a End Function
貌似可以传址再用CopyMemory?标准模块: Type aa s As String b as byte End Type 类模块: Function test(lng as long) As Variant Dim a As aa CopyMemory a,lng,len(a) debug.? a.s debug.? a.b End Function窗体: dim t as ss t.s="test" t.b=123dim c as new class1 c.test(varptr(t)) 这样?
Type aa
ss As String
End Type类模块:
Function test() As Variant
Dim a As aa
a.ss = Now
test = a
End Function
Type aa
s As String
b as byte
End Type 类模块:
Function test(lng as long) As Variant
Dim a As aa
CopyMemory a,lng,len(a)
debug.? a.s
debug.? a.b
End Function窗体:
dim t as ss
t.s="test"
t.b=123dim c as new class1
c.test(varptr(t))
这样?