VM140 and C#

Hi

I have the VM140 USB interface card. Now I’m trying to write software in c#. I have readed the manual and a lot of forum topics here but i have a problem.

When I do this, just for testing:

 [DllImport("K8061.dll")]
        private static extern int OpenDevice(int CardAddress);

private void Form1_Load(object sender, EventArgs e)
        {
            if (OpenDevice(0) > 1)
            {
                MessageBox.Show("succes");
            }
            else
            {
                MessageBox.Show("error");
            }

        }

The program compiles, but when it is running I get a did not found exception.

What is wrong?

  • Do I use the wrong DLL?
  • Bad code?
  • Some detail i don’t see?

I have found a c# project on this forum but for a board that uses K8055D.dll… But when i change the dll file the did not found exception returns…

Can somebody help mee please?

With C# it’s a bit tricky where you put your dll. Try moving it to C:\Windows\System32 folder. An other alternative is to put it somewhere in the Release or Debug folders of your Visual Studio project.

The following dlls are needed:
K8061.dll
mpusbapi.dll

Your code looks perfect :slight_smile:

Hellow!

Have you fix the problem?? I´m through the same problem you have related.
Thanks.

If you download this project, can you compile and run it?
box.net/shared/cstqy0ulq4
This should work if you put the K8061.DLL to the System32 folder.

What is the operating system you are using?
What version of the K8061.DLL are you using? (2.0.0.0 ?)
Have you installed the driver from the Vistapack download package?