Discussion:
API CDN XL i VB.NET
(Wiadomość utworzona zbyt dawno temu. Odpowiedź niemożliwa.)
Wojciech Kulesza
2005-08-20 16:22:10 UTC
Permalink
O rany, już nie mam koncepcji, pewnie robię jakiś debilny błąd. W każdym
razie próbuję się dostać do API CDN-a.
Deklaruję taką klasę:

Imports System.Runtime.InteropServices

Public Structure XLLoginInfo

Public Wersja As Long

Public ProgramID As String

Public Baza As String

Public OpeIdent As String

Public OpeHaslo As String

Public PlikLog As String

End Structure

Public Class Form1

Inherits System.Windows.Forms.Form

' 1. XLLogin

<DllImport("cdn_api.dll")> Private Shared Function XLLogin _

(ByVal LoginInfo As XLLoginInfo, ByVal Sesja As Long) As Long

End Function

<DllImport("cdn_api.dll")> Private Shared Function XLLogout _

(ByVal Sesja As Long) As Long

End Function

' <DllImport("cdn_api.dll", _

'EntryPoint:="XLSprawdzWersje", SetLastError:=True,
CharSet:=CharSet.Unicode, ExactSpelling:=True,
CallingConvention:=CallingConvention.StdCall)> _

'Public Shared Function XLSprawdzWersje _

' (ByVal NumWersji As Long) As Long

' End Function

Public Declare Function XLSprawdzWersje Lib "cdn_api.dll" _

Alias "XLSprawdzWersje" (ByVal NumWersji As Long) As Long





#Region " Windows Form Designer generated code "

'tutaj rozne takie

#End Region



Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

Dim logInfo As XLLoginInfo

Dim numW As Integer = 12

Dim sesja As Integer = 0

Dim zwrot As Integer

With logInfo

.Wersja = 12

.Baza = "CDNXL"

.OpeIdent = "sa"

.OpeHaslo = ""

.ProgramID = "dupa"

.PlikLog = "c:\log.log"

End With

Try

zwrot = XLSprawdzWersje(12)

' zwrot = XLLogin(logInfo, sesja)

Catch ex As Exception

MessageBox.Show(ex.Message)

End Try

End Sub

End Class



Oczywiście pojawia mi się błąd, niezależnie od tego, którą funkcję z API
zadeklaruję: Object reference not set to an instance of an object



Czy ma ktoś jakąś koncepcję życiową gdzie mam błąd? Ten kod już przeszedł
różne modyfikacje, cały czas mam to samo.



Wojtek
Johnny
2005-08-24 11:53:36 UTC
Permalink
Do współpracy z NET służy biblioteka cdn_api.net.
--
Johnny
Loading...