Ciao a tutti,
Ho una DLL scritta in C.
La documentazione mi fornisce queste info :
Parameterscodice:Function ND2_ERR ND2GetHostIP ( const char* hostname, unsigned long* ip )
hostname Pointer to a C-string containing the IP address or the host name of the ND 287
ip [return value] Pointer to a variable to which the IP address of the ND 287 is saved
Il mio programma in VB6 è in questo modo :
Private Declare Function ND2GetHostIP Lib "ND2_DLL.dll" (ByVal hostname As String, ByRef ip As Byte) As ND2_ERR
Private Sub bttRead_Click()
Dim res As ND2_ERR
Dim ip As Byte
Dim host As String
host = "192.168.000.002"
res = ND2GetHostIP(host, ip)
txtRiga.Text = ip
End Sub
hostname non è un problema perchè è string, ND2_ERR neanche perchè è un typedef convertito in enum.
Lo stronzo è ip, il quale vuole un unsigned long e non so come crearlo in vb6 dato che il tipo di dato non esiste.
Se io lo creo come long mi da come errore di Convenzione, se provo a non dichiarare il tipo di dati mi solleva eccezzione.
Non so che tipo di dati usare.