Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Active X Controls programming on the WEB

Posted on 2003-04-04
8
Medium Priority
?
3,377 Views
Last Modified: 2013-11-25
Can someone, in there own words not from the glossary or from Microsoft, define and explain for me how Active X Controls plays a part of programming for WEB applications in conjunction with VB. There are so many definitions that it becomes confusing!
0
Comment
Question by:GlobalFax
[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
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 17

Expert Comment

by:inthedark
ID: 8274369
You should only use ActiveX if you only want Microsoft Windows Clients.  You should only use a combination of HTML and Javascript if you also wish MAC/Unix/Linux/MainFrame clients to visit your site.

VBScript and ActiveX are ideal for use in an intranet environment where you can control which OS your clients are using.

VB provides a system for use this non-microsft clients.  The system is called web-classes.  However, IMHO, there best way for creating VB for a web application is you use an ActiveX DLL.

So in your ASP page you need a simple bit of code that starts the DLL.  


---------Sample ASP page
<%
Option Explicit

'Const CurrentDLL = "MyDLL100.MyClass" ' previous version
Const CurrentDLL = "MyDLL101.MyClass" ' enhanced version

Dim MyDLL
Dim Ok

ok=False
On Error Resume Next
Do
    Set MyDLL = Server.CreateObject(CurrentDLL)
    If Err.Number<> 0 Then Exit Do
   
    OK = MyDLL.GetPageOK(Server, Application, Session, Request, Response)
    Exit Do
Loop

If Not OK Then
    Response.Redirect "http://yourserver.com/sitefault.htm"
End If

Set MyDLL = Nothing

%>

----End of Sample

So now all you need is some VB DLL code to create the HTML that you wish to display.

If you wish I can post a simple sample.

Hope this helps:~)


0
 
LVL 17

Expert Comment

by:inthedark
ID: 8274530
Here is a site which I created using an ActiveX DLL.

http://www.outdoorgear.co.uk

Here is the sub that the ASP page activates:

Public Function A_ProcessRequestASPOK(pServer As ASPTypeLibrary.Server, _
  pApplication As ASPTypeLibrary.Application, _
  pSession As ASPTypeLibrary.Session, pRequest As ASPTypeLibrary.Request, _
  pResponse As ASPTypeLibrary.Response)

A_ProcessRequestASPOK = False

On Error Goto ErrorTrap

' Set a project reference to ASP.DLL to gain access to
' the IIS objects passed as parameters from the ASP page.

Set Server = pServer
Set Application = pApplication
Set Session = pSession
Set Request = pRequest
Set Response = pResponse


A_ProcessRequestVB

A_ProcessRequestASPOK = True

Exit Function

ErrorTrap:

SaveErrorDetails Err

End Function

The sub A_ProcessRequestVB decides what the operator wants to do then calls an appropriate sub to create the html.

But in simple terms each sub does things like this:

HTMLData = "<HTML><BODY>Hello world</BODY></HTML>"

Response.Write HTMLData
0
 
LVL 4

Expert Comment

by:iozturk
ID: 8274631
Mostly there is something you should do that you cannot with javascript (such as file operations on client, dialing from users computers to somewhere, to securify a db connection from client and your db ...) you create an activex control when it first invokes it installs itself to clint then continue running when invoked.
0
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
LVL 19

Accepted Solution

by:
RanjeetRain earned 2000 total points
ID: 8274917
Hi,

If you are still looking for the answer here is my bit.

An ActiveX control can be used as a component in a web page. Such a component is embedded in a web page with the <OBJECT> tag of HTML. You need to specify the ProgID in the page to instantiate a control. The ProgID or CLSID of a control may be retrieved manually from the system registry. However, to make things simple you may use any of the available tools. One such tool commonly used in early days was Microsoft ActiveX Control Pad. When a web page containing an <OBJECT> tag loads it downloads the control from the location specified in CodeBase parameter, if not already done.

Having said that, I must maintain, using ActiveX to build web pages is no longer in fashion. Yes there was a time (when this technology was new) when some people did use it, but now? No one uses it any more.

So, what do you do with this technology?

As Microsoft would have liked us to believe (atleast till there was no .Net technology), there is nothing better than ActiveX. They did not only push ActiveX control but also ActiveX document technology as a web development technology. But unfortunately, barring ActiveX Dll and ASP, all ohter MS technologies failed.

So, why would you like to use ActiveX control in a web page now that you have something like .Net at your disposal, which gives you more power and flexibility in doing the same more elegantly?

The answer is: only if you want to learn OR only if you can not leave your good old plain vanilla VB. OR you do not want or your organization does not want to invest in .Net.

As pointed out earlier, it is only advisable to use ActiveX in an intranet environment, where you have direct control over the client machines. Consider putting online a website website based on ActiveX controls. You lose on a large chunk of visitors, plus the ones who do have IE even they might have security restrictions which may force your control to close shop.

Verdict: Do not think of using ActiveX unless you have gone too far OR unless you know the pitfalls. It may seem an easy solution to begin with but will cost you dear in a long run.
0
 
LVL 1

Author Comment

by:GlobalFax
ID: 8274929
Thanks, just what I was lookig for!
0
 
LVL 1

Author Comment

by:GlobalFax
ID: 8275289
Answer Accepted
0
 
LVL 19

Expert Comment

by:RanjeetRain
ID: 8278515
Glad I could get you the info you wanted.

Thanks!
0
 
LVL 7

Expert Comment

by:rolftollerud
ID: 9472020
I came across the question while searching EE and cannot resist the temptation to respond albeit the issue is PAQ and closed.

"using ActiveX to build web pages is no longer in fashion"

That is true, but could very well change in the future.

"So, why would you like to use ActiveX control in a web page now that you have something like .Net at your disposal, which gives you more power and flexibility in doing the same more elegantly?"

Because it will take at least 4-5 years more until we can assume that .NET framework is installed on 95% of all users. And VB6 code is much faster.

Client Side ActiveX Control did not catch on for different reasons that no longer apply.
1) Navigator choosed not to support ActiveX, now more than 95% use IE.
2) A VB6 control (50-60k) was a huge download because of all the supporting files that was needed; now all this files can be assumed to exist on the user machine.
3) Before many people used modems, now almost everybody have broadband.

"It may seem an easy solution to begin with”

To get a control properly digitally signed by an official Provider like Verysign or Thawte and get the internet deployment package correctly is not easy - on the contrary "only for experts."

But you only have problem the first time, after that it really solves a lot of problem, especially in Intranet environments.
The control only needs to be downloaded the first time you visit the page, after that you never notice it.





0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
Suggested Courses

715 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