Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Will an ActiveX control serve this purpose?

Reply
Thread Tools

Will an ActiveX control serve this purpose?

 
 
Shawn
Guest
Posts: n/a
 
      06-22-2005
Hi.
I've never created an ActiveX control before, so I know little about what it
is capable of and what its limitations are. My problem is this: I have to
create a way to send multiple documents from the web server to a printer on
the user's network. The way it works today the user has to manually
download each document and send it to his printer, but now they want me to
create an automated process.
Will I be able to download documents to the user's temp catalogue with an
ActiveX control? If I can do that I can just send them to his default
printer using ShellExecute.

Need to know if this is possible before I start researching
If anyone can provide me with a good tutorial that would be great!

Thanks,
Shawn


 
Reply With Quote
 
 
 
 
bradley
Guest
Posts: n/a
 
      06-22-2005
An ActiveX control is basically a COM compenent, typically with GUI
elements, that can be hosted by a container, such as a Windows Form or web
page, and scripted. It is similar in concept to a Java applet, except that
there are no restrictions about accessing the client's resources and file
system. It is a full blown Win32 executable, but with the extention OCX. The
clients browser security settings will need to be configured to allow this.
I think that by default IT will allow, but displays a confirmation dialog
before downloading the control.

Below are some MSDN articles..

HOW TO: Host ActiveX Controls in a Web Form
http://support.microsoft.com/default...b;en-us;317392

PRB: Cannot Develop DHTML Applications, ActiveX Documents, and IIS
Applications in Visual Basic .NET
http://support.microsoft.com/default...b;en-us;311300

Visual Basic 6.0 is the best (most user friendly) tool for building ActiveX
controls. The client will need to have the VB6 runtime installed on their
PC, but Windows 2000/XP comes bundled with this.
http://msdn.microsoft.com/library/de...components.asp

However, if it were me, I would first try to implement a solution that
involved building WSH scripts dynamically on the server and then have the
client click on an execute them. A few lines of VB Script is much more
simple to program and maintain than delving into ActiveX control building,
especially if you havn't built one before.

http://msdn.microsoft.com/scripting

You didn't say what type of documents you are wanting to print, so I'm
assuming MS Word or Adobe PDF. You can find example script on the web for
automating MS Word and perhaps Adobe using WSH.

http://www.vandyke.com/support/crt/s...n_word_vbs.txt

Just like ActiveX controls, the client's browser security settings will
probably need modfying to execute .vbs or .js scripts from the web.

If you get this working, then reply back to the group with details.


"Shawn" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi.
> I've never created an ActiveX control before, so I know little about what

it
> is capable of and what its limitations are. My problem is this: I have to
> create a way to send multiple documents from the web server to a printer

on
> the user's network. The way it works today the user has to manually
> download each document and send it to his printer, but now they want me to
> create an automated process.
> Will I be able to download documents to the user's temp catalogue with an
> ActiveX control? If I can do that I can just send them to his default
> printer using ShellExecute.
>
> Need to know if this is possible before I start researching
> If anyone can provide me with a good tutorial that would be great!
>
> Thanks,
> Shawn
>
>



 
Reply With Quote
 
 
 
 
Shawn
Guest
Posts: n/a
 
      06-24-2005
Hi.
Just letting you know that I solved my problem with the use of a WSH.
Thanks for pointing me in the right direction bradley!

Option Explicit
'*
Const cVBS = "savefile.vbs"
Const cOUT = "C:\temp\"
Const cURL = "http://www.google.no/intl/no_no/images/"
Const cPAG = "logo.gif"
'*

Fetch cURL & cPAG,cOUT & cPAG
Print cOUT & cPAG

Function Fetch(xURL,xOUT)
On Error Resume Next
Err.Clear
Dim b
With CreateObject("Microsoft.XMLHTTP")
.Open "GET",xURL,False
.Send
b = .ResponseBody
If Err.Number <> 0 Or .Status <> 200 Then
MsgBox Err.Number & " " & .Status
Fetch = False
Exit Function
End If
End With
With CreateObject("ADODB.Stream")
.Type = 1
.Open
.Write b
.SaveToFile xOUT,2
End With
Fetch = Err.Number = 0
End Function


Function Print(xURL)
Dim objShell
set objShell = CreateObject("Shell.Application")
objShell.ShellExecute xURL, "", "", "print", 1
set objShell = nothing
End Function


"bradley" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> An ActiveX control is basically a COM compenent, typically with GUI
> elements, that can be hosted by a container, such as a Windows Form or web
> page, and scripted. It is similar in concept to a Java applet, except that
> there are no restrictions about accessing the client's resources and file
> system. It is a full blown Win32 executable, but with the extention OCX.

The
> clients browser security settings will need to be configured to allow

this.
> I think that by default IT will allow, but displays a confirmation dialog
> before downloading the control.
>
> Below are some MSDN articles..
>
> HOW TO: Host ActiveX Controls in a Web Form
> http://support.microsoft.com/default...b;en-us;317392
>
> PRB: Cannot Develop DHTML Applications, ActiveX Documents, and IIS
> Applications in Visual Basic .NET
> http://support.microsoft.com/default...b;en-us;311300
>
> Visual Basic 6.0 is the best (most user friendly) tool for building

ActiveX
> controls. The client will need to have the VB6 runtime installed on their
> PC, but Windows 2000/XP comes bundled with this.
>

http://msdn.microsoft.com/library/de...components.asp
>
> However, if it were me, I would first try to implement a solution that
> involved building WSH scripts dynamically on the server and then have the
> client click on an execute them. A few lines of VB Script is much more
> simple to program and maintain than delving into ActiveX control building,
> especially if you havn't built one before.
>
> http://msdn.microsoft.com/scripting
>
> You didn't say what type of documents you are wanting to print, so I'm
> assuming MS Word or Adobe PDF. You can find example script on the web for
> automating MS Word and perhaps Adobe using WSH.
>
> http://www.vandyke.com/support/crt/s...n_word_vbs.txt
>
> Just like ActiveX controls, the client's browser security settings will
> probably need modfying to execute .vbs or .js scripts from the web.
>
> If you get this working, then reply back to the group with details.
>
>
> "Shawn" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > Hi.
> > I've never created an ActiveX control before, so I know little about

what
> it
> > is capable of and what its limitations are. My problem is this: I have

to
> > create a way to send multiple documents from the web server to a printer

> on
> > the user's network. The way it works today the user has to manually
> > download each document and send it to his printer, but now they want me

to
> > create an automated process.
> > Will I be able to download documents to the user's temp catalogue with

an
> > ActiveX control? If I can do that I can just send them to his default
> > printer using ShellExecute.
> >
> > Need to know if this is possible before I start researching
> > If anyone can provide me with a good tutorial that would be great!
> >
> > Thanks,
> > Shawn
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ActiveX control in python vs ActiveX control in vb 6 (piece of code) vml Python 0 08-22-2007 09:57 AM
Dynamic DB lookup/eval to serve a user control bound to a repeater ASP .Net 7 01-05-2007 05:40 AM
Cannot get my computer to serve a shared folder =?Utf-8?B?U3ViWE8=?= Wireless Networking 0 08-30-2005 02:10 AM
ActiveX apologetic Larry Seltzer... "Sun paid for malicious ActiveX code, and Firefox is bad, bad bad baad. please use ActiveX, it's secure and nice!" (ok, the last part is irony on my part) fernando.cassia@gmail.com Java 0 04-16-2005 10:05 PM
Serve ASP.NET control through custom RequestHandler Ricky K. Rasmussen ASP .Net 3 06-07-2004 01:59 PM



Advertisments