比如在类模块中有以下代码,总是编译通不过啊!Public Type Node
    Count As Integer
    Name As String
End Type
Public Function s(t As Node)End Function难道类模块的函数就不能以结构体我参数吗?

解决方案 »

  1.   

    Public Type Node
        Count As Integer
        Name As String
    End Type
    Public Function s(t)
        dim a as node
        let a=t
        msgbox a.name
    End Function
      

  2.   

    当然可以以下是方法之一:写一个ODL,生成相应的TLB,在工程里引用就行了.推荐使用EditTLB,可以直接生成TLB文件
      

  3.   

    Modest(塞北雪貂
    的代码编译通不过啊!
      

  4.   

    Node在vb中已经作为treeview的节点对象,厂是另外定义一个新的名称。
      

  5.   

    模块中Public Type Node
        Count As Integer
        Name As String
    End TypePublic Sub s(t As Node)
        MsgBox t.Name
    End Sub
    窗体中Private Sub Command1_Click()Dim x As Node
    x.Count = 9
    x.Name = "aa"
    Call s(x)End Sub
      

  6.   

    Public Sub s(t As Node)
        MsgBox t.Name
    End Sub或Public Function s(t As Node)
        MsgBox t.Name
    End Function
    也可以传递啊...
      

  7.   

    模块中Public Type Node
        Count As Integer
        Name As String
    End Type
    类模块中
    Friend Function s(t As Node)
        
    End Function
      

  8.   

    参照
    http://book.hackbase.com/asppost10/web212464.htm
      

  9.   

    把结构定义成一个新的类模块
    'class  Node   
    public Count As Integer
    public Name As String
      

  10.   

    看你刚开始的工程是什么样的.
    如果是 .EXE 则不行.
    如果是.DLL .OCX 则可以.