Problemet uppstår när jag t.ex ska utnyttja FT2xx.dll:
Kod: Markera allt
[DllImport("FTD2XX.dll", EntryPoint = "FT_OpenEx")]public static extern uint FT_OpenEx(string ftDescr, uint ftHandle2, ref IntPtr ftHandle);
private static IntPtr m_USBhandler;
uint ft_status = FT_OpenEx(description, 2, ref m_USBhandler);1
An attempt was made to load a program with an incorrect format.
(Exception from HRESULT: 0x8007000B)
Kod: Markera allt
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
at test.DLLlek.FT_Close(IntPtr ftHandle)
at test.DLLlek.OpenByDescription(String description) in C:\Users\Marcus\Documents\Visual Studio 2008\Projects\test\test\DLLlek.cs:line 105
at test.DLLlek.Send(Byte[] DMXDATA, Int32 DeviceID) in C:\Users\Marcus\Documents\Visual Studio 2008\Projects\test\test\DLLlek.cs:line 58
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4918 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
test
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Marcus/Documents/Visual%20Studio%202008/Projects/test/test/bin/Release/test.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4918 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4918 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.4918 (NetFXspW7.050727-4900)
CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Ovanstående kod har fungerat hur bra som helst altså under tidigare OS, som WinXP. Hur ska jag göra detta Vista + Win7 kompatibelt?