?
Solved

Create IE ActiveX Control with Windows Control Library project

Posted on 2007-03-19
12
Medium Priority
?
304 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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

Industry Leaders: 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!

Question has a verified solution.

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
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 …

777 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