Link to home
Start Free TrialLog in
Avatar of wahooo
wahooo

asked on

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
Avatar of justinbillig
justinbillig

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 wahooo

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.

Avatar of wahooo

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 kingsfan76
kingsfan76

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial