Prevent phantom apps using the DataReport

VB 6.0's new DataReport designer provides a great way to display
simple datasets. When you use this new tool, however, you may have
found phantom instances of your application cropping up on machines
using the final compiled version. This behavior occurs if you print
the DataReport via code, but don't unload it when you're through with it.

For instance, suppose we added a button to a form with the following code:

Private Sub Command1_Click()
DataReport1.PrintReport
End Sub

and then compiled the project. When you launch the new application,
click the button, and close the application, a phantom instance of
the application shows up in the Windows Task Manager. This phantom
instance results because Visual Basic instantiates the DataReport
object but never unloads it when it's through printing.

To fix this glitch, simply unload the DataReport in the form's
Unload() event, like so

Private Sub Form_Unload(Cancel As Integer)
Unload DataReport1
End Sub


You might also like...

Comments

James Crowley James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audience ...

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Memory is like an orgasm. It's a lot better if you don't have to fake it.” - Seymour Cray