Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Print preview Run-time error -2147417848 (80010108) - Urgent

Posted on 2004-08-24
6
Medium Priority
?
580 Views
Last Modified: 2013-12-25
I have designed a program in Visual Basic 6.
Incorporated in the program is a 3rd party print preview control called "Swiftprint".
In certain instances, upon clicking the print preview button, the following error is encountered:

Run-time error '-2147417848 (80010108)':
Automation error
The object invoked has disconnected from its clients.

The error occurs infrequently and has occurred on both Win 98 and XP operating systems.
There is no apparent pattern which leads up to the error, i.e. from the user's point of view, it occurs randomly when attempting to activate a print preview.

In laymans terms, I suspect that the program loses connection with the control for some reason and cannot feed it commands.
I need to find the reason it loses connection or find a way of reestablishing the connection when it gets lost.

Unfortunately the author of the Swiftprint preview control has abandoned development on the control and his help file makes not reference to such an error.
In hindsight, I should have found an alternative print preview control, however I have designed a number of reports to generate via the SwiftPrint control and am reluctant to reproduce all that coding for another control.

I have read up on early vs. late binding sometimes being the cause of this form of problem, however, the control is an OCX that is dropped directly onto the form - it cannot be referenced to and manipulated as one would a reference to, say, Excel.  Accordingly I cannot institute late binding to try and solve the problem.  Maybe someone more advanced can offer further advice in trying to institute this solution?

Is there perhaps a way to refresh an OCX control to reestablish contact with it in some manner?

If no-one can offer any help in solving the problem with the current control - what practical recommendations are there for an alternate, time tested, stable,  print preview control for Visual Basic 6?

This program is ready for commercial beta release barring this one error, which has been plaguing me for about 2 years now, any urgent assistance would be most appreciated.
0
Comment
Question by:RussellKnight
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 53

Expert Comment

by:Dhaest
ID: 11880102
What kind of data do you want to preview ? Word, excell, ...

Q193379 HOWTO: Print Preview in Visual Basic Applications
http://support.microsoft.com/support/kb/articles/Q193/3/79.ASP


Print preview ocx
http://www.freevbcode.com/ShowCode.Asp?ID=730 
0
 

Author Comment

by:RussellKnight
ID: 11880312
Thank you for your prompt reply Dhaest.
Sorry, the data does not get exported to Excel or Word etc. as not all of my potential users will have these applications installed.
The data is basically generated by the program and then displayed, much the same as the print preview feature built into any application.
Thank you for the reference to Q193379 - I have already reviewed this previously - it is very primitive and would result in the overall quality of the program being reduced (No zooming, no second pages etc.)
Thank you for the references to another print preview OCX - I have also found many of these on the net - this was the manner which I came across Swiftprint.    
Since the error is very infrequent, I am keen to try and find a work around with my current OCX, rather than redesign 20 odd detailed reports from scratch for a new print preview OCX.
The question stands - if anyone can shed light on how the run time error can be avoided or worked around?
0
 

Author Comment

by:RussellKnight
ID: 12938262
I have managed to find a work around to this problem.
The Swiftprint OCX is flawed in that when a form which had the OCX compenent loaded is closed, it severs all the connections to the OCX for every form that is open.
Forms that are still open are no longer connected and report an error when an action involving the OCX is called.
To solve the problem I have gotten each form to hide rather than close, so that the connection is not severed.
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12942325
PAQed with points refunded (500)

modulo
Community Support Moderator
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question