Solved

Create IE ActiveX Control with Windows Control Library project

Posted on 2007-03-19
12
297 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
  • 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
 
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 500 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

707 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

18 Experts available now in Live!

Get 1:1 Help Now