VB6(visual basic 6.0)程序求注释m7,谢谢 10
PublicFunctionDDECallback(ByValuTypeAsLong,ByValuFmtAsLong,ByValhConvAsLong,ByValhszS...
Public Function DDECallback(ByVal uType As Long, ByVal uFmt As Long, ByVal hConv As Long, ByVal hszString1 As Long, _
ByVal hszString2 As Long, ByVal hData As Long, ByVal dwData1 As Long, ByVal dwData2 As Long) As Long
On Error Resume Next
Dim lSize As Long
Dim sValue As String
Dim sTopic As String
Dim sItem As String
Dim sSymbol As String
Dim sFieldType As String
Dim nPeriod As Integer
Dim Ret As Long
Debug.Print "In client callback. uType: " & uType
Select Case uType
' This is th eevent you'll receive when a server sends you a advise.
Case XTYP_ADVDATA
Debug.Print "XTYP_ADVDATA"
lSize = DdeGetData(hData, vbNullString, 0, 0)
If (lSize > 0) Then
sValue = Space(lSize)
DdeGetData hData, sValue, lSize + 1, 0
End If
lSize = DdeQueryString(g_lInstID, hszString1, vbNullString, 0, CP_WINANSI)
If (lSize > 0) Then
sTopic = Space(lSize)
DdeQueryString g_lInstID, hszString1, sTopic, lSize + 1, CP_WINANSI
End If
lSize = DdeQueryString(g_lInstID, hszString2, vbNullString, 0, CP_WINANSI)
If (lSize > 0) Then
sItem = Space(lSize)
DdeQueryString g_lInstID, hszString2, sItem, lSize + 1, CP_WINANSI
nPeriod = InStr(sItem, ",")
If (nPeriod > 0) Then
sSymbol = Left(sItem, nPeriod - 1)
sFieldType = Mid(sItem, nPeriod + 1, Len(sItem))
End If
End If
DataRecieved sTopic, sSymbol, sFieldType, sValue
Case XTYP_ADVSTART
Debug.Print "XTYP_ADVSTART"
Case XTYP_ADVSTOP
Debug.Print "XTYP_ADVSTOP"
Case XTYP_CONNECT
Debug.Print "XTYP_CONNECT"
Case XTYP_CONNECT_CONFIRM
Debug.Print "XTYP_CONNECT_CONFIRM"
Case XTYP_DISCONNECT
Debug.Print "XTYP_DISCONNECT"
g_hDDEConv = 0
Case XTYP_ERROR
Debug.Print "XTYP_ERROR"
Case XTYP_EXECUTE
Debug.Print "XTYP_EXECUTE"
Case XTYP_MASK
Debug.Print "XTYP_MASK"
Case XTYP_MONITOR
Debug.Print "XTYP_MONITOR"
Case XTYP_POKE
Debug.Print "XTYP_POKE"
Case XTYP_REGISTER
Debug.Print "XTYP_REGISTER"
Case XTYP_REQUEST
Debug.Print "XTYP_REQUEST"
Case XTYP_SHIFT
Debug.Print "XTYP_SHIFT"
Case XTYP_UNREGISTER
Debug.Print "XTYP_UNREGISTER"
Case XTYP_WILDCONNECT
Debug.Print "XTYP_WILDCONNECT"
Case XTYP_XACT_COMPLETE
Debug.Print "XTYP_XACT_COMPLETE"
End Select
DDECallback = 0
End Function 展开
ByVal hszString2 As Long, ByVal hData As Long, ByVal dwData1 As Long, ByVal dwData2 As Long) As Long
On Error Resume Next
Dim lSize As Long
Dim sValue As String
Dim sTopic As String
Dim sItem As String
Dim sSymbol As String
Dim sFieldType As String
Dim nPeriod As Integer
Dim Ret As Long
Debug.Print "In client callback. uType: " & uType
Select Case uType
' This is th eevent you'll receive when a server sends you a advise.
Case XTYP_ADVDATA
Debug.Print "XTYP_ADVDATA"
lSize = DdeGetData(hData, vbNullString, 0, 0)
If (lSize > 0) Then
sValue = Space(lSize)
DdeGetData hData, sValue, lSize + 1, 0
End If
lSize = DdeQueryString(g_lInstID, hszString1, vbNullString, 0, CP_WINANSI)
If (lSize > 0) Then
sTopic = Space(lSize)
DdeQueryString g_lInstID, hszString1, sTopic, lSize + 1, CP_WINANSI
End If
lSize = DdeQueryString(g_lInstID, hszString2, vbNullString, 0, CP_WINANSI)
If (lSize > 0) Then
sItem = Space(lSize)
DdeQueryString g_lInstID, hszString2, sItem, lSize + 1, CP_WINANSI
nPeriod = InStr(sItem, ",")
If (nPeriod > 0) Then
sSymbol = Left(sItem, nPeriod - 1)
sFieldType = Mid(sItem, nPeriod + 1, Len(sItem))
End If
End If
DataRecieved sTopic, sSymbol, sFieldType, sValue
Case XTYP_ADVSTART
Debug.Print "XTYP_ADVSTART"
Case XTYP_ADVSTOP
Debug.Print "XTYP_ADVSTOP"
Case XTYP_CONNECT
Debug.Print "XTYP_CONNECT"
Case XTYP_CONNECT_CONFIRM
Debug.Print "XTYP_CONNECT_CONFIRM"
Case XTYP_DISCONNECT
Debug.Print "XTYP_DISCONNECT"
g_hDDEConv = 0
Case XTYP_ERROR
Debug.Print "XTYP_ERROR"
Case XTYP_EXECUTE
Debug.Print "XTYP_EXECUTE"
Case XTYP_MASK
Debug.Print "XTYP_MASK"
Case XTYP_MONITOR
Debug.Print "XTYP_MONITOR"
Case XTYP_POKE
Debug.Print "XTYP_POKE"
Case XTYP_REGISTER
Debug.Print "XTYP_REGISTER"
Case XTYP_REQUEST
Debug.Print "XTYP_REQUEST"
Case XTYP_SHIFT
Debug.Print "XTYP_SHIFT"
Case XTYP_UNREGISTER
Debug.Print "XTYP_UNREGISTER"
Case XTYP_WILDCONNECT
Debug.Print "XTYP_WILDCONNECT"
Case XTYP_XACT_COMPLETE
Debug.Print "XTYP_XACT_COMPLETE"
End Select
DDECallback = 0
End Function 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询