Link to home
Create AccountLog in
ASP

ASP

--

Questions

--

Followers

Top Experts

Avatar of wahooo
wahooo

Run activex on client machine
Hi, totally newbie on activex controls, but I do know .asp.

I have an .asp application and I have made an activex-component that I want to access on the client machine. A also need to pass a variable to the client.

See this for info on the activex-component I have made..

https://www.experts-exchange.com/questions/21199583/Totally-Newbie-active-x-control.html

The page runs on a hosted server.

Sjur

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of justinbilligjustinbillig

Running an activex control on the clients machine is very difficult because of browser security. Default browser security doenst allow activex contorls becuase they could be potentionally harmful

but you, i you want to embadd the axtivex you need to use the html <object> tag.

Or if you want ot create it using javascript you would use new ActiveXObject( "name goes here" );

I do believe your looking to embadd the object

btw i know i spell horribly

Avatar of wahooowahooo

ASKER

ok, how do I for instance make a .dll file to put on the server that can do the same..

and is this better..`?

need code and help though..
for 500p..

sjur

here's what i do to embed ActiveX object in my asp page:

1.  use Visual Studio "Package and Deployment wizard" to create the .CAB package
2.  to place this object in the asp page, add something like this to your asp page:

<object ID="objTest" CLASSID="CLSID:xxxx-xxxxx-xxxxx-xxxxx" codebase="http://mySite/ActiveXObject/test.CAB#version=1,0,0,0" VIEWASTEXT>
</object>

The object ID is the name you can referred to in Javascript using getElementById(), and then you can call public functions in your activeX object like this:  objTest.MyFunction();
codebase tells the location in which the client machine can download the ActiveX object (.CAB).

-------

alternatively, you can try COM object.  With COM object you just need to compile it into .dll and register the dll to your server.  but if it is something that cannot be done using asp, the it is likely you won't be able to do it using COM dll either.  Only activeX object is like a real VB application.

To use activeX object, you need to make sure the client machine's security is setup to allow activeX object to run.  If you are using adodb connections in your activeX object to query the database, you might run into "msado" incompatibility issues which is a pain in the @$$ to fix, otherwise it shouldn't be too much trouble.


Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of wahooowahooo

ASKER

Ok, Kingsfan

I will try this later today, but what about passing a variable to the ActiveX-control?

Like for example:
Private Sub UserControl11_CallShell(PhNo As String)
   shell "c:\program files\x-pro\x-pro.exe " & "12345678"
End Sub

Is this possible to have on the .asp page and pass this to the activex-control?

the number will change for every time..

Sjur

ASKER CERTIFIED SOLUTION
Avatar of kingsfan76kingsfan76

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account
ASP

ASP

--

Questions

--

Followers

Top Experts

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.