Solved

VB6 HTML OCX - other than using Internet Explorer?

Posted on 2010-11-30
9
450 Views
Last Modified: 2012-05-10
I'm looking for a library that will render an HTML page and allow it to be printed.

Functionality to be like using IE via the VB6 Web browser control, but NOT using IE.

I'm having issues trying to properly trap errors generated from IE, so need something that is running in-process and without the IE overhead.

User display is not needed.


Does anyone know of such a control?



Thanks.
0
Comment
Question by:StuckInTheMud
  • 5
  • 4
9 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 34251148
what about the WinInet control?

What compatibility level of rendering do you need?

Does the user need to see the rendered page or do you just need to print the page?

What are you trying to do by printing the page? (problem context)
0
 

Author Comment

by:StuckInTheMud
ID: 34251187
I'm creating a simple report (just paragraphs & tables and bit of in-line styling) in HTML and then just printing it.

Base HTML comes from a pre-prepared template, it's warehouse picking notes which should give you a good idea about the simplicity of layout!

No requirement to see the page.

So I need something that is going to interpret the HTML and render it correctly on a printed page.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 34251424
Why don't you use the default browser to do the print?  I don't see any need to do any rendering in your VB6 application.

Your application could Shell() the necessary DOS command string to cause the HTML file to be printed.  There are two ways you might do this.

* use the default browser's file association (your command string will need to start with CMD.EXE
* find the path of the default browser in the registry and use that as the program you launch.
0
 

Author Comment

by:StuckInTheMud
ID: 34251665
Problem is trapping errors, e.g. if the print server isn't available and the print function hangs and eventually times out.

Running external processes (web browser control or shell) will just return "automation error" or similar, which is very difficult to sensibly trap and recover from, hence wanting to run it in-process.



Jim
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:StuckInTheMud
ID: 34251690
Additional info - I have been using the web browser control in the application for some while (year+) so looking to improve on what we have and give a better "user experience" when there are system problems.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 34251993
Here are some options to consider.
* use a more intelligent print server that queues print jobs
* look at the print server event log entries for problems, taking action as necessary.  You should probably institute a process that notes which documents were to be printed and then reprint any documents that weren't printed.  This creates a feedback mechanism for your application.
* Introduce an intermediate process that might be more resilient.  For instance, you might do your application printing to PDF documents in a server directory.  Then you would have a separate process that would physically print and then delete-after-print the PDF files.
0
 

Author Comment

by:StuckInTheMud
ID: 34253355
Thanks, but we have already been round the loop on other options.

To answer you suggestions.

(1) It does queue (Windows server), just occasionally occasionally the server is off-line which is what we are trying to trap.

(2) Not feasible, as the print is on demand from a real-time ordering system in a call centre.

(3) As 2, it's an on-demand system so printing to PDF and then queuing introduces an unacceptable time delay.


I guess from the replies that using an out-of-process browser is really the only way of printing an HTML document and a library to do the job doesn't exist.
0
 
LVL 45

Accepted Solution

by:
aikimark earned 125 total points
ID: 34253423
If you are trying to trap the print server not ready condition, you might try to write a 'header page' (only has to be a single line) with your VB6 code.
0
 

Author Closing Comment

by:StuckInTheMud
ID: 34368040
Not exactly what I was looking for, but suggestions have been useful
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

919 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now