请问各位大哥,大姐们
我想在VB程序中调用这个函数,求这个函的返回的值,这个值是在函数中已经给好的。
我怎样在自定义的DLL函数中,直接让它返回一个值(字符串或数字)呀?我用的是VB写的程序,
我想在VB程序中调用这个函数,求这个函的返回的值,这个值是在函数中已经给好的。
我怎样在自定义的DLL函数中,直接让它返回一个值(字符串或数字)呀?我用的是VB写的程序,
调试欢乐多
Set clsaa = New Class1
MsgBox clsaa.aa
End Sub-----class1---
Option ExplicitPublic Function aa()
aa = "hello "
End Function
Set clsaa = New Class1
MsgBox clsaa.aa
End Sub-----class1---
Option ExplicitPublic Function aa()
aa = "hello "
End Function
Public Sub cha() Dim cn5 As New ADODB.Connection
cn5.ConnectionString = ""
cn5.Open
Dim rs5 As New ADODB.Recordset
Dim sql5 As String
rs5.CursorLocation = 3
sql5 = "select * from chi where cc='sycs'"
rs5.Open sql5, cn5, adOpenDynamic, adLockBatchOptimistic
dim zh_eng as string
If rs5.Fields(4) = 加密值 Then
zh_eng = "正版"
Else
zh_eng = "盗版"
End If
End Sub
我怎样把这个"zh_eng"的值传到我的VB程序里呀!!谢谢
Public Function cha() as string
...
If rs5.Fields(4) = 加密值 Then
cha = "正版"
Else
cha = "盗版"
End If
End Function2.模块中再定义变量
函数中:
public zh_eng as string调用时:
执行方法
cha
使用结果
msgbox class1.zh_eng
cha=zh_eng '正版、盗版
end property