I am trying to program for the XEM5010 using Visual Studio Express 2010 using VB on Windows 7 64-bit. I used the libFrontPanel-csharp.dll as a reference and included libFrontPanel-pinv.dll in the project so that it would get copied to the destination folder. I also tried it with a C# program and got the same exception.
When I try to run the line:
xem = New okCFrontPanel
I got the following exception
System.TypeInitializationException was caught
Message=The type initializer for ‘com.opalkelly.frontpanel.libFrontPanelPINVOKE’ threw an exception.
Source=libFrontPanel-csharp
TypeName=com.opalkelly.frontpanel.libFrontPanelPINVOKE
StackTrace:
at com.opalkelly.frontpanel.libFrontPanelPINVOKE.new_okCFrontPanel()
at com.opalkelly.frontpanel.okCFrontPanel…ctor()
at VBDPD.MainForm.buttonInitialize_Click(Object sender, EventArgs e) in C:\Users\Glen\Documents\work\ETADevices\Software\VBDPD\VBDPD\MainForm.vb:line 237
InnerException: System.TypeInitializationException
Message=The type initializer for ‘SWIGExceptionHelper’ threw an exception.
Source=libFrontPanel-csharp
TypeName=SWIGExceptionHelper
StackTrace:
at com.opalkelly.frontpanel.libFrontPanelPINVOKE.SWIGExceptionHelper…ctor()
at com.opalkelly.frontpanel.libFrontPanelPINVOKE…cctor()
InnerException: System.BadImageFormatException
Message=An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Source=libFrontPanel-csharp
StackTrace:
at com.opalkelly.frontpanel.libFrontPanelPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_libFrontPanel(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate)
at com.opalkelly.frontpanel.libFrontPanelPINVOKE.SWIGExceptionHelper…cctor()
InnerException:
Any help would be appreciated
Glen