K8055D.dll v3.0.2 problem with VB2008 Express

Velleman K8055d.dll Compatibility Issues
I am running Windows XP Professional with SP3. The K8055d.dll version 2.0.0.2 cannot be added as a reference to a project in VB2008. The attempt produces the following result.

Microsoft Visual Basic 2008 Express Edition (Error dialog box)
“A reference to ‘C:\windows\system32\k8055d.dll’ could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component”

Next, using the K8055d.dll version 3.0.2 results in these errors. The dll file is located in the //Windows/System32/ directory. The dll file added without fault when adding it as a reference in the VB2008 IDE. These 3 errors occurred when trying to run the project.

These are all build error in VB

  1. “ResolveManifestFiles” task failed unexpectedly…
  2. "NativeAssemblies=@…
  3. “The ResolveManifestFiles” task could not be initialized with its input parameters.

For my next attempt, in VB2008, after adding the reference to the K8055d.dll v3.0.2 file in //windows/System32/ , I simply copied (overwrote) the v3.0.2 file with the K8055d.dll V2.0.0.1 file. To summarize, VB2008 accepts the v3.0.2 reference, and now it will find the v2.0.0.1 dll. Weird, but worth a try. The program ran without errors.

Yea, a working program that performs, but what a weird procedure for adding the K8055d.dll.

The online support documentation indicates that the V3.0.2 gives Vista support , so I guess I could understand a build/run problem using it with XP. However, I can’t understand why the v2.0.0.1 file will not add as a reference in XP. It’s almost like the XP system using VB2008 behaves as if it will accept the Velleman dll built for Vista support, but it will only perform with the older dll written for XP that it will not reference. Talk about confusing. Can you help me understand how I’m supposed to use the dll with VB2008 because what I’m doing is a serious Kludge?
Thanks,
Steve

I hope you’re not doing what I think you’re doing…

That’s because k8055d.dll is a Dynamic Link Library, not a .NET assembly or COM component.

It probably built correctly because it ignored your attempts at adding the DLL as if it was a .NET assembly file.

You’ll need to import the functions from the DLL by declaring their prototypes inside your .NET project

Snippet for the K8074:

Public Class K8074Native

    Declare Sub CloseDevice Lib "K8074.dll" (ByVal deviceId As Integer)

End Class

Thank you for the reply. I had the declares, but your clue as to the .NET assembly led me to find that I did not have to “add reference” to the dll but rather simply put in the declares then I added…

Imports System.Runtime.InteropServices

in the general declarations this allowed VB2008 access to the Platform Invocation Services in .NET Framework. The windows/system32 directory must be in the default search path for the VB app because it found the dll there from the name I gave in the function declarations.

Anyway, many thanks for helping me get from where I was to where I am.

Steve

Yep, you’ll need Interop since you’re calling unmanaged code

Just some extra information:

Dynamic-Link Library Search Order

  1. The directory from which the application loaded.
  2. The system directory
  3. The 16-bit system directory
  4. The Windows directory
  5. The current directory
  6. The directories that are listed in the PATH environment variable

msdn.microsoft.com/en-us/library/ms682586.aspx