[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Create IE ActiveX Control with Windows Control Library project

Posted on 2007-03-19
12
Medium Priority
?
306 Views
Last Modified: 2008-02-01
I would like to create an Internet Explorer ActiveX control using a Windows Control Library project that will allow me to print without a dialog box. Can someone tell me if this is possible? I created a control with limited functionality but haven't gotten it to print yet. Thanks.
0
Comment
Question by:rbichon
[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
  • 7
  • 5
12 Comments
 
LVL 23

Expert Comment

by:Christopher Kile
ID: 18750270
This functionality undoubtedly exists because the Print icon on the standard IE toolbar does just that, prints without a dialogue.  Have you considered trying to simply hijack that functionality?
0
 
LVL 1

Author Comment

by:rbichon
ID: 18751305
The general concensous on the web is that there is no quick way to print without the dialog. Otherwise anyone would be able to simply print to any machine that you have setup on your computer.

I am not looking to simply print without a dialog box. I want to be able to configure which printer and orientation in the control.
0
 
LVL 23

Expert Comment

by:Christopher Kile
ID: 18751440
To do that, you have to have a guarantee as to how the client is configured, and I mean every POSSIBLE client.  Either that, or you can use the Print Dialog from the Common Controls library, and make sure that that gets installed as part of your ActiveX control plug-in.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:rbichon
ID: 18755421
Is there an example online that I can use? I created an activex control and got the print dialog to popup but it doesn't print when I click print. Does it have to be a signed control?

The only clients using this control will be behind my network so configuration won't be a problem. Thanks for your help so far.
0
 
LVL 23

Accepted Solution

by:
Christopher Kile earned 2000 total points
ID: 18755704
Were you able to select the printer you wanted to use?  Also, did anything appear in the print queues that did not later get printed?

Signing with a certain level would guarantee it, but lowering the security for objectsw loaded in the Intranet zone (or moving the residence of the control to a Trusted Site within your intranet) have worked just as well for me in the past (think of that as an anecdote, NOT as a guarantee :) ).  

Let me know as you progress (or if you cannot) and I'll advise where necessary.
0
 
LVL 1

Author Comment

by:rbichon
ID: 18757418
Okay. Now it tries to print but I get a .Net security error. It tells me that I can use the .Net Configuration Tool which I found under Administrative tools but don't know what to do next. Can you assist? Thanks.
0
 
LVL 1

Author Comment

by:rbichon
ID: 18757526
Nevermind. I got it figured out. I have it give Full Trust to my trusted internet sites. The question now is how do I get it to print the actual page. The page I am getting now is blank. I want it to print the full IE page. Any suggestions?
0
 
LVL 23

Expert Comment

by:Christopher Kile
ID: 18758243
You may want to create a test Windows application using the ActiveX control just to see if you can print a page from there.  That would isolate whether the control is having a problem, or the control works but it's not getting the data from IE.
0
 
LVL 1

Author Comment

by:rbichon
ID: 18758385
That is actually what I am doing but the page is blank. Is there a way to print the window?
0
 
LVL 1

Author Comment

by:rbichon
ID: 18759950
Okay, I got it to print the image I need (a barcode) and to the correct printer. Now I need to figure out how to pass the activex object a parameter. In PHP I would simply use a get variable in the URL. How would I send a parameter to this object?
0
 
LVL 1

Author Comment

by:rbichon
ID: 18763782
Got it all figured out now. First I added the site where the control exists to my Trusted Sites in Internet Explorer. Then using the .NET Configuration tool, I give Trusted Websites full control. And to pass a parameter to the ActiveX control, I set <PARAM NAME="RID" VALUE="10"> and in .NET I setup a property like this:

    Public myRID As String

    Public Property RID() As String
        Get
            Return myRID
        End Get
        Set(ByVal value As String)
            myRID = value
        End Set
    End Property
The variable "myRID" contains the value from the param with name "RID". Passing other parameters allows me to setup the printer I want to use with all of the settings and print immediately. Of course, you have to go through the Trust process otherwise the control will throw an error. Thanks for all of your help.
0
 
LVL 23

Expert Comment

by:Christopher Kile
ID: 18764153
yvw :)
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

649 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