Black Ice Software
September Developer News
Volume 12, Issue 9 - September, 2007
The BLACK ICE NEWSLETTER is published by Black Ice Software, LLC. The contents of this newsletter in its entirety are Copyright © 2007 by Black Ice Software, LLC. 292 Route 101, Salzburg Square, Amherst, NH 03031, USA. Black Ice Software, LLC. does hereby give permission to reproduce material contained in this newsletter, provided credit is given to the source, and a copy of the publication that the material appears in is sent to Black Ice Software at the above address. Phone: (603) 673-1019 Fax: (603) 672-4112 sales@blackice.com www.blackice.com

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()

()