Fixing Dymo SDK problems with VB.net apps

I have a VB.net ClickOnce application that I developed years ago and when I went to update it, I ran into all kinds of problems with the Dymo SDK Framework.
Here are some of the things that I did to fix my errors.

Error number one was "Object reference not set to an instance of an object" every time I would bring up the print dialog box to choose the Dymo printer.
This would happen when I loaded this object in VB.net:
DYMO.Label.Framework.Framework.GetPrinters

What was happening is that I didn't include all the dll files in my application.
All the dll files you need are installed with the Dymo Label application in this framework folder:
C:\Program Files (x86)\DYMO\DYMO Label Software\Framework

These dll files are not included with the SDK download.  The SDK is just samples and documentation.  They are installed with the Dymo software.



Your also going to get an error if you don't set your target CPU to x86, so I set that Compile bit.



If you are using the latest Dymo dll files, make sure your users are installing that same version of the Dymo Label Software.  I'm using 8.7.3 with this article.
http://www.dymo.com/en-US/dymo-user-guides

Also, don't do like me and name your form Dymo.vb since that will cause problems when you want to call out an object and you have the Dymo DLL and your form sharing that name.

To add some code to your VB.net app to check for the correct version, here is what I use:


Dim DymoPath As String = "C:\Program Files (x86)\DYMO\DYMO Label Software\DLS.exe"

If System.IO.File.Exists(DymoPath) Then
  'Do nothing
Else
  MsgBox("You need the Dymo Drivers and software installed first")
  Exit Sub
End If

'Make sure the Dymo software is at least 8.7.3.46663

Dim DLLFileVersion As String
Dim DLLFileName As String = "C:\Program Files (x86)\DYMO\DYMO Label Software\Framework\DYMO.Common.dll"
DLLFileVersion = GetFileVersionInfo(DLLFileName).ToString()
If DLLFileVersion < "8.7.3" Then
  MsgBox("Your Dymo Software is at version " & DLLFileVersion & " and this app requires at least    version 8.7.3, please update your Dymo Software before using this app.")
End If


Comments

Popular Posts