我在一个EXE工程中写了一个类和一个标准模块我现在在类中写个函数,返回值是标准模块里面的公用结构体,但是一直无法编译,不知道什么错误?

解决方案 »

  1.   

    标准模块:
    Type aa
        ss As String
    End Type类模块:
    Function test() As Variant
        Dim a As aa
        a.ss = Now
        test = a
    End Function
      

  2.   

    貌似可以传址再用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))
    这样?