K8055 under Windows 7, only giving errors

I made a little simple test program, and it is returning this, no matter what command i throw at it… (Got a danish OS, translated to english with google translate)

System.BadImageFormatException: It was attempted to load a program with an incorrect format. (Exemption from HRESULT: 0x8007000B)
at K8055.Form1.api.OpenDevice(Int32 devNumber)
at K8055.Form1…ctor() i C:\Users\Parx\Documents\Visual Studio 2008\Projects\K8055\K8055\Form1.cs:line 21

Source: http://pastebin.com/m14050ce3

What am i doing wrong?

If you put the OpenDevice to a button function, does it work OK?

[code] private void button1_Click(object sender, EventArgs e)
{
int h;
h = api.OpenDevice(0);
label1.Text = h.ToString();

    }[/code]

The K8055D.dll have to be put to the Windows\System32 folder or to the \bin\Debug folder of the project.

I gave up on it, i have to spend over one hour, just to make it reconise the card, and after a restart or a disconnect of it, its then all over again with connecting and disconnecting until it works.

And finally when i got it working, that error still pops up.

Is the LED LD8 continuously lit when the card is not working?
If not, then you may check the driver state:

  • Download and run USBview.exe.
    Do you see this kind of data when you select the K8055 from the list:

    You can download the usbview.exe from: box.net/shared/mc3pt7bt1n

LED for D08 stays on, and the card pops up as Unknown device, got the dll that should support Vista, so should work on windows 7 too? Running Windows 7 x64

The K8055 in a HID (Human Interface Device) and it should be recognized by the operating system.
The LD8 should be off.

The card or the USB cable may be defective.

[quote=“VEL255”]The K8055 in a HID (Human Interface Device) and it should be recognized by the operating system.
The LD8 should be off.

The card or the USB cable may be defective.[/quote]
Works right away when i plug it into one of my windows 2003 machines

This was good comment.

  • The card is not defective.

[quote=“VEL255”]This was good comment.

  • The card is not defective.[/quote]
    Heh, yea i know. Thats why the topic isn’t “K8055 only giving errors” :wink:

But i can’t make it work under windows 7, been looking at the forum, found a few different answers on how others solved the problem. It just doesn’t work for me, plus the success rate of the card actually being found is under 1%

Under Windows 2003 - Everything working exactly as it should :smiley:

But the problem is, that the machine that should be running this, is a Windows 7 x64, and since the dll should be able to be used under Vista, it should under Windows 7 too? Or am i totally wrong there?

You are right: Both the K8055 hardware and the DLL should work under Windows 7 x64.
I have the Windows 7 x64 Ultimate RC for testing purposes and everything works OK with the K8055.

I have had difficulty running doconnel.force9.co.uk/csharp/k8055/ under ms windows 7 ultimate 64 bit. I get this error when I run it from visual studio 2008

“An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)”

I can take the same executable included with the download refrenced above and the .dll from Velleman to a 32 bit windows XP system. Runs fine. I can modify the source in Visual Studio 2005 on that XP machine and it runs.

Sure would like to code a bit in C# for the P8055. Any suggestions?

Thanks, - jeffa

A 64 bit process cannot load a 32 bit DLL.

Go into the Tools / Options, select ‘Show all Settings’ check box - then select the entry ‘Projects and Solutions’ and under ‘General’ you can activate ‘Show advanced build configuration’. click OK. Then you should see in the toolbar combobox for changing the build configuration and the target plattform.

Anything new on how to make windows 7 x64 find the card at all? When i connect mine, it loops the “usb connected” sound for a minute, then disables the card because of error. But the card is fine, because it works perfectly on my XP x86 machine…

And a short video of what is going on youtube.com/watch?v=maj5J3h3ZQ4

I haven’t made any progress on it. But thanks to your video I have a new desktop background! :slight_smile:

  • jeffa

There in the USBView report reads:
Device Bus Speed: Full
should be Low.

It seems the Windows 7 tries to communicate with wrong speed.

A USB host detects a device by the pullup resistors connected to the data lines.
D+ is pulled up by high-speed devices while D- is pulled up by low-speed devices.

It seems the data lines are crossed…!?

[quote=“VEL255”]There in the USBView report reads:
Device Bus Speed: Full
should be Low.

It seems the Windows 7 tries to communicate with wrong speed.

A USB host detects a device by the pullup resistors connected to the data lines.
D+ is pulled up by high-speed devices while D- is pulled up by low-speed devices.

It seems the data lines are crossed…!?[/quote]
huh, impossible :open_mouth:

i tried all usb ports on my computer, both the ones on the case, connected to the mainboard, thoose soldered to the mainboard in the back, even tried another usb 2.0 controller, tried different cables, in case the one i used was broken… struggled with this problem for quite some time, so tried alot of different things. I wonder if there are any way to force it to use low instead of full?

Another idea, are there made any changes to it over the time?

One of my friends experiments with it too, and his are working fine under windows 7 too, but i got mine way earlier than him.

Success! :smiley:

I tried Your Uninstaller (was a pain to get it working under windows 7 too) and it found something on the K8055, and i then tried to make it remove everything it could find about it, and then tried to reconnect. 30 secs after i reconnected it, the card was ready to operate. PERFECT! :smiley: :smiley: :smiley:

Indeed, strange why your Windows 7 detected wrong USB speed.
According to your tests it was not a hardware or cable problem.
Anyhow the Your Uninstaller solved the problem! :slight_smile:
It would be interesting to know what it really uninstalled…

yea, didn’t look in the log file… hmm not even sure if it makes one… but now i just got the next problem… :angry:

When i try to compile my program under windows 7, and trying to compile it into x86 it just tells me that the K8055D.dll can’t be opened, and then “Unspecified error” that is just so easy to see what is wrong then… heh

ack… getting tired of this constant stream of errors… it can now open the dll… and now just tells me that the module “OpenDevice(Int32 CardAddress)” is not found in it… tried the test program you linked to in another thread, same message…

DLL’en ‘k8055d.dll’ kunne ikke indlæses: Det angivne modul blev ikke fundet. (Undtagelse fra HRESULT: 0x8007007E)

DLL ‘k8055d.dll’ could not be loaded: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

apparently, that happens… sometimes… open and close visual c# a few times, and it then decides to work… or apparently not… i give up for now… simply too many errors for this to be any fun… everything worked fine under 2003 server, and windows xp… only thing i can get from windows 7 is a headacke