Vm110 and vb2010

Hi,
I have got a brandnew vm110 - really fine - demo with vb6 ok!

But now I want to use it with VB2010 - I put the dll to syswow64 (cause I ve win8.1 64bit) and followed the topic: thread for more info:
viewtopic.php?f=3&t=5363

But I cant connect to vm110 via vb 2010: here is the little programm

Public Class Formi
Dim n As Integer
Private Declare Function OpenDevice Lib “k8055d.dll” (ByVal CardAddress As Long) As Long

Private Sub Button2_Click(ByVal sender As System. )bjec, ByVal e As System.EventArgs) Handles Button2.Click
OpenDevice(0)
EndSub
End Class

… and the problem report:

r PlnvokeStackimbalance wurde erkannt. X
Ein Aufruf an die Pinvoke-Funktion vmtest!
WindowsApplicationi Formi ::OpenDevice” hat das Gleichgewicht des Stapels
gestõrt. Wahrscheinlich stimmt die verwaltete Plnvoke-Signatur nicht mit der
nicht verwalteten Zielsignatur überein. Uberprüfen Sie, ob die Aufrufkonvention
und die Parameter der Plnvoke-Signatur mit der nicht verwalteten Zielsignatur
übereinstimmen.

Try using Integer instead of Long for the argument and result types.

For those not fluent in German, the error message indicates that the function created a call stack imbalance and hints that the function signature declaration is incorrect.

Regards,
Jan

thx a lot - its ok!

and I have to use " integer" instead of “long” in the other declarations too!

greetings

PB

another question: it would have been easier to copy an image into the thread - but i couldn’t…

Nobody can upload images to this forum. You can use some free picture upload site and post the links.

Regards,
Jan

[quote]and I have to use " integer" instead of “long” in the other declarations too![/quote]Yes. Easiest is to use the Visual Basic 2008 example in the VB2010.

Here’s the link to download the latest K8055 software package with examples: velleman.eu/support/download … 055n&type=
Please download the package: “K8055N software pack”

In the examples subfolder there are example projects written in many programming languages.

Please read the “K8055N & VM110N Getting Started.pdf”.

In the Exampes subfolder there are example projects written in following languages:
• Microsoft Visual Basic 2008 Express Edition
• Microsoft Visual C++ 2008 Express Edition
• Microsoft Visual C# 2008 Express Edition
• Microsoft Visual Basic 6.0
• Microsoft Excel VBA
• Borland Delphi 5
• Borland C++Builder 6
• Bloodshed Dev-C++