Which Files do You Need to Install to Use BiAutoprint.ocx in a VB.NET Application?
There are some misunderstandings about the files of the BiAutoprint control. Which files should you install in your install project? We can differentiate two cases:
1. Statically
In this case you use the BiAutoprint.ocx statically in your VB.NET application. This means you drag and drop the registered BiAutoprint control to a form in your project. When you compile the application the development environment automatically creates the following files:
AxInterop.BIAUTOPRINTLib.dll
Interop.BIAUTOPRINTLib.dll
These files are required to run your application. They should be placed at the same location as your application. Of course the BiAutoprint.dll and BiAutoprint.ocx are also required. The BiAutoprint.ocx must be registered before running the application, and because the BiAutoprint.ocx calls functions from BiAutoprint.dll the ocx should be able to reach the dll, so the dll must be in the same directory as the ocx (or it can be in the path variable). The simplest solution is putting all dlls and ocxs in the same directory as your application.
2. Dynamically
In this case you use the BiAutoPrint control dynamically and you don’t drag and drop the control to a form in your project. If you compile your project only the Interop.BIAUTOPRINTLib.dll will be automatically generated by the development environment. In this case besides the Interop.BIAUTOPRINTLib.dll, BiAutoprint.dll and BiAutoprint.ocx you also need the BiAutoprint.lic file. The BiAutoprint.lic must also be placed at the same directory as the BiAutoprint.ocx.
The following VB.NET code snippet shows you how to use the BiAutoprint control dynamically.
' declaration
Private BiAutoPrint As BIAUTOPRINTLib.BiAutoPrint
' Initialize BiAutoPrint control
BiAutoPrint = New BIAUTOPRINTLib.BiAutoPrint()
' Calling a method from the ocx
BiAutoPrint.BIAPInitialize()
()