例如: Public Property Get Connection() As StringConnection = cnEnd PropertyPublic Property Let Connection(c As String)cn = c PropertyChanged "Connection"End Property
如: 建立一个Activex dll工程(test) 增加一个Class Module(comDemo)Public Function ab(a As Integer, b As Integer) As Integer ab = a + b End Function 生成 test.dllregsvr32 [your test.dll文件路径 ]test.dll新建一个工程以如下方式引用你的dll中的函数 如: sub main() Dim pa As New test.comDemo MsgBox pa.ad(1, 2) end subOK,如有不懂,请看看有关com方面的书或mail me
只不过是要定义成public。
Public Property Get Connection() As StringConnection = cnEnd PropertyPublic Property Let Connection(c As String)cn = c
PropertyChanged "Connection"End Property
最后工程中引用这个dll,定义这个类,就可以调用这些接口函数了
建立一个Activex dll工程(test)
增加一个Class Module(comDemo)Public Function ab(a As Integer, b As Integer) As Integer
ab = a + b
End Function
生成 test.dllregsvr32 [your test.dll文件路径 ]test.dll新建一个工程以如下方式引用你的dll中的函数
如:
sub main()
Dim pa As New test.comDemo
MsgBox pa.ad(1, 2)
end subOK,如有不懂,请看看有关com方面的书或mail me