VB6.0是不是不能转换object类型
我在MSDN上面找了 字符串和其他类型之间的转换 (Visual Basic)
里面最低版本都是 2005的!!!
我是不想背着.NET3.5的补丁,没办法才用VB6
不可能一个软件才2MB,
要下.NET 3.5的补丁得100MB!
真的很难抉择!
[解决办法]
Private Sub Command1_Click() Dim lObject As Long Dim sObject As String Dim bObject As Boolean Dim oObject As Object sObject = "abc123" lObject = 1243 bObject = False Set oObject = Me Call CObj(sObject) Call CObj(lObject) Call CObj(bObject) Call CObj(Me)End SubPrivate Sub CObj(ByVal obj As Variant) If VarType(obj) = vbObject Then MsgBox obj.Name Else MsgBox obj End IfEnd Sub