VB2010 code for K8055

Hi, i am a newby on thid subject. for a shool project i need to write a program in VB. i have VB2010 and i have writte the following code:

'Option Explicit On

Public Class Form1
Private Declare Function Opendevice Lib “K8055D.dll” (ByVal CardAddress As Long) As Long
Private Declare Sub CloseDevice Lib “k8055d.dll” ()
Private Declare Function ReadAnalogChannel Lib “k8055d.dll” (ByVal Channel As Long) As Long
Private Declare Sub ReadAllAnalog Lib “k8055d.dll” (ByVal Data1 As Long, ByVal Data2 As Long)
Private Declare Sub OutputAnalogChannel Lib “k8055d.dll” (ByVal Channel As Long, ByVal Data As Long)
Private Declare Sub OutputAllAnalog Lib “k8055d.dll” (ByVal Data1 As Long, ByVal Data2 As Long)
Private Declare Sub ClearAnalogChannel Lib “k8055d.dll” (ByVal Channel As Long)
Private Declare Sub SetAllAnalog Lib “k8055d.dll” ()
Private Declare Sub ClearAllAnalog Lib “k8055d.dll” ()
Private Declare Sub SetAnalogChannel Lib “k8055d.dll” (ByVal Channel As Long)
Private Declare Sub WriteAllDigital Lib “k8055d.dll” (ByVal Data As Long)
Private Declare Sub ClearDigitalChannel Lib “k8055d.dll” (ByVal Channel As Long)
Private Declare Sub ClearAllDigital Lib “k8055d.dll” ()
Private Declare Sub SetDigitalChannel Lib “k8055d.dll” (ByVal Channel As Long)
Private Declare Sub SetAllDigital Lib “k8055d.dll” ()
Private Declare Function ReadDigitalChannel Lib “k8055d.dll” (ByVal Channel As Long) As Boolean
Private Declare Function ReadAllDigital Lib “k8055d.dll” () As Long
Private Declare Function ReadCounter Lib “k8055d.dll” (ByVal CounterNr As Long) As Long
Private Declare Sub ResetCounter Lib “k8055d.dll” (ByVal CounterNr As Long)
Private Declare Sub SetCounterDebounceTime Lib “k8055d.dll” (ByVal CounterNr As Long, ByVal DebounceTime As Long)
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Connect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles connect.Click

    Label1.Text = "Card "
    Opendevice(0)


End Sub
Private Sub Form_Terminate()
    CloseDevice()
End Sub

End Class

as i run this i get the error

System.EntryPointNotFoundException was unhandled
Message=Kan ingangspunt met de naam Opendevice niet vinden in DLL K8055D.dll.
Source=k8055 test

i am stuck on this and do not know what to do.
My system runs on win7 on a 64bit laptop

can some help my,

thanks in advance

You have to compile (or whatever is done with vb code when you build it) it as a 32 bit application, then it will work.
In the Project settings look for something like ‘Target Platform’ and set it to ‘x86’ or ‘32bit’.
The DLL (k8055d.dll) is 32bit and you cant do calls from 64bit to 32bit.

OK, there IS a way to do that…
But unless you need 64bit features or run into trouble running in 32bit mode you wouldn’t want to go down that bumpy road, especially not with VB.
If i didn’t convince you to switch to 32bit you can read on here:
blog.mattmags.com/2007/06/30/acc … -bit-code/

Your DLL function declarations are for Visual basic 6.0.
These declarations can’t be used for VB2010.

Please download the latest software package for the K8055.
Here is the link to download page:
velleman.eu/distributor/supp … code=K8055
Download the: “Complete SDK Pack (Rev 4.0)”.

The package includes new K8055D.DLL and sample projects written in various programming languages.
VB2008 example is included. This example will convert to VB2010 when opened.

Pleas read the “README.TXT” and the “K8055 & VM110 Getting Started.pdf”.

Please see this thread how to fix the problem if you have 64-bit operating system:
viewtopic.php?f=3&t=6116&view=next