I have connected VM8090 in PC
with “K8090 Demo.exe”, it’s OK
but with the programm sample01
code :
[code]Public Class MainForm
Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click
'Change this port to reflect your settings
K8090.Port = "COM12"
If (K8090.Connect()) Then
K8090.ToggleRelay(&HFF) ' Toggle all relays ON
K8090.Disconnect()
End If
End Sub
It seems the issue is that VS 2008 is building the project to compile on “Any CPU” and the DLL is intended for x86 systems only.
The project need to be compiled for x86 systems only. Do the following to resolve the issue:
In the Tools --> Options --> Projects and Solutions–>General Check “Show advanced build configurations”
Select Tools --> Settings --> Expert Settings to see the Build option
In the Build menu click Configuration Manager…
In the Active solution platform select New…
Select x86 from the first ComboBox
Click OK
Now you should be able to compile the project.
If you anyhow get the error message HRESULT: 0x8007007E, then the DLL must be copied to SysWOW64 folder.
In the initial configuration, there is no “build” option in the VB2008/2010 express menu, but that was indicated in a discussion on the MSDN forum:
You may want to mention you need to be Tools–>Settings–>Expert Settings to see the Build option. Also, many people may need to download and install the ACE driver for 32 bit ODBC support.
Thanks. This solved the “an attempt was made to load a program with an incorrect format” problem i have been trying to fix for the last two days. The K8055 now works. The fix was easier than i expected.