找回密码
 加入
搜索
查看: 1866|回复: 0

[系统综合] vba的addressof不知道au3如何對應

[复制链接]
发表于 2011-9-1 09:33:11 | 显示全部楼层 |阅读模式
excel 的 vba 改寫為au3
遇到 addressof  不知道au3如何對應
請高手幫幫忙.出手相助.幫忙改寫以下程序
非常感激



Option Explicit

Declare Function SKQuoteLib_Initialize Lib "SKQuoteLib.dll" (ByVal strID As String, ByVal strPass As String) As Long
Declare Function SKQuoteLib_EnterMonitor Lib "SKQuoteLib.dll" () As Long
Declare Function SKQuoteLib_AttachConnectionCallBack Lib "SKQuoteLib.dll" (ByVal Func As Long) As Long
Declare Function SKQuoteLib_AttachQuoteCallBack Lib "SKQuoteLib.dll" (ByVal Func As Long) As Long
Declare Function SKQuoteLib_GetStockByIndex Lib "SKQuoteLib.dll" (ByVal Market As Integer, ByVal Index As Integer, ByRef Stock As TStock) As Long

Type TStock
    Stockidx As Integer
    Decimal As Integer
    TypeNo As Integer
    MarketNo As Byte
    StockNo As String * 20
    StockName As String * 10
    Open As Long
    High As Long
    Low As Long
    Close As Long
    TickQty As Long
    Ref As Long
    Bid As Long
    Bc As Long
    Ask As Long
    Ac As Long
    TBc As Long
    TAc As Long
    FutureOI As Long
    TQty As Long
    YQty As Long
    Up As Long
    Down As Long
End Type



Public Function Login(ByVal AcNo As String, ByVal Pwd As String) As Integer

    Dim Status As Long
    Status = Status + SKQuoteLib_Initialize(AcNo, Pwd)
    Status = Status + SKQuoteLib_AttachConnectionCallBack(AddressOf OnConnectionBack)
    Status = Status + SKQuoteLib_AttachQuoteCallBack(AddressOf OnQuoteCallBack)
    'Status = Status + SKQuoteLib_AttachTicksCallBack(AddressOf OnTicks)
    'Status = Status + SKQuoteLib_AttachBest5CallBack(AddressOf OnBest5)
   
    If Status = 0 Then
        Status = SKQuoteLib_EnterMonitor()
        Login = 0
    Else
        Login = -1
    End If
   
End Function

Sub OnConnectionBack(ByVal Kind As Long, ByVal Code As Long)
    If Code = 0 Then
        MsgBox "登入成功!!"
    Else
        MsgBox "中斷!!"
    End If
End Sub

Sub OnQuoteCallBack(ByVal Market As Integer, ByVal Index As Integer)
    On Error Resume Next
    Dim Status As Long, Stock As TStock, ComId As String, Dot As Integer
    Status = SKQuoteLib_GetStockByIndex(Market, Index, Stock)
End Sub
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-15 07:14 , Processed in 0.072392 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表