FrontPanel 4.2.5 VB.NET

I’m currently having a problem with the latest FrontPanel’s API. Every time I try to initialize the frontpanel object I get a PINVOKE exception. This used to work for older version of the API. Did something change that causes it to error in .NET? I need 4.2.5 to work because we are upgrading to the XEM6310 boards. Has anyone had any luck with this?

[CODE]Imports com.opalkelly.frontpanel

Public Class Form1

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    Dim bob As New okCFrontPanel
    'bob = New okCFrontPanel
    MsgBox(bob.GetDeviceCount)
End Sub

End Class[/CODE]

Thanks

Are you using the C# wrapper to import this? If so, note this from the release notes:

[QUOTE]* Change C# API namespace to OpalKelly.FrontPanel to align with Microsoft standards.
[/QUOTE]

You are still using the old namespace (com.frontpanel.opalkelly). This namespace is compatible with Java naming conventions, but we decided to break this in this release to adhere to MS .NET standards.

I’ve tried it both ways:

[CODE]Imports OpalKelly.FrontPanel

Public Class Form1

Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
    Dim bob As New okCFrontPanel
    MsgBox(bob.GetDeviceCount)
End Sub

End Class[/CODE]

Is there a better way to use the driver in vb.net?

Sorry, we’re not familiar with VB.NET and don’t officially support it. I just recognized the possible discrepancy. Can you post the exception you’re getting? Maybe someone with more experience can respond.

For anyone else who was having this issue as well. I figured out what was the cause of the error.

It turns out that when VB.net target CPU is set to AnyCPU it defaults to 32-bit instead of 64-bit. To get the 64-bit driver/wrapper to work, the target CPU needs to be x64.

-Rob