|
我用VS 2008 寫了一小段程式想測試一下群益API,但沒有成功,請各位是前輩可指導一下.
create a class:
Imports System.Runtime.InteropServices
Public Class SKAPI
Declare Auto Function SKQuoteLib_Initialize Lib "SKQuoteLib.dll" (ByVal lpszLoginID As String, ByVal lpszPassword As String) As Integer
End Class
create form:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SKResult As Integer
SKResult = SKAPI.SKQuoteLib_Initialize(TextBox1.Text, TextBox2.Text)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
config.ini
[version]
id=2.08.28
[Servers]
0=order2.capital.com.tw
#1=order3.capital.com.tw
[debug]
enable=1
[order]
file=c:\order.log
[reply]
file=c:\reply.log
[quote]
file=c:\quote.log
執行後SKResult 回傳為153,回本按說明書上設定id=2.08.10,不過SKResult 回傳為-4(SK_ERROR_INITIALIZE_FAIL),不知各位是前輩可指導一下? |
|