Visual Studio 8 (2005) and api examples in xp 64

Interested in integrating USB-UIRT support into an application? Look here!

Moderator: jrhees

Visual Studio 8 (2005) and api examples in xp 64

Postby specsix » Mon Dec 11, 2006 12:47 am

Attempting to get the manage api example to work. After eliminating compile errors from the api example, I did a test run. I am also using the beta x64 drivers.

Anyone else trying to do the same?

Here is the console output. Again this is not my code. This is the api managed api example output for TestApp.cs using UsbManagedWrapper.

UUIRTDRV Example Program...
===========================
An exception was thrown: System.TypeInitializationException: The type initialize
r for 'UsbUirt.Controller' threw an exception. ---> System.ApplicationException:
Unable to read UsbUirt driver version ---> System.BadImageFormatException: An a
ttempt was made to load a program with an incorrect format. (Exception from HRES
ULT: 0x8007000B)
at UsbUirt.Controller.UUIRTGetDrvInfo(UInt32& drvVersion)
at UsbUirt.Controller..cctor()
--- End of inner exception stack trace ---
at UsbUirt.Controller..cctor()
--- End of inner exception stack trace ---
at UsbUirt.Controller.get_DriverVersion()
at TestApp.Class1.RunTestApp() in J:\USB-UIRT_Dev\api_example_code(2)\UsbUirt
_rev1\UsbUirt\TestApp\TestApp.cs:line 39
at TestApp.Class1.Main(String[] args) in J:\USB-UIRT_Dev\api_example_code(2)\
UsbUirt_rev1\UsbUirt\TestApp\TestApp.cs:line 24
Press return to exit.

Any guidance would be appreciated.

Thanks
specsix
 
Posts: 1
Joined: Mon Dec 11, 2006 12:38 am

Postby jrhees » Wed Dec 20, 2006 5:37 am

Does the other example code work (the C example)?

-Jon
jrhees
Site Admin
 
Posts: 1652
Joined: Tue Jan 28, 2003 11:49 pm

Solved!

Postby JasonDentler » Fri Jun 19, 2009 2:34 pm

The issue is with a 64-bit application trying to load a 32-bit DLL (uuirtdrv.dll)

To correct the problem, change each project in your solution from AnyCPU to x86. To do this, go to Build --> Configuration Manager. In the platform column, choose (New). Choose x86 from the New Platform drop down. Uncheck Create New Solution Platforms. Click OK. Back on the configuration manager window, select the new x86 option for all of your projects.

Note: You will probably need to load the managed wrapper source code as a project, reference the project, and force it to compile as x86, instead of just referencing the already-compiled UsbUirtManagedWrapper.DLL
JasonDentler
 
Posts: 1
Joined: Fri Jun 19, 2009 2:25 pm

Postby jcbrooks75 » Thu Jan 14, 2010 3:06 am

I can confirm this works, Running Windows 7 64 bit and this solved the runtime exception in the managed wrapper.
jcbrooks75
 
Posts: 1
Joined: Thu Jan 14, 2010 2:51 am


Return to Developers

Who is online

Users browsing this forum: No registered users and 16 guests