views:

355

answers:

3

hi guys, simple question:How I control my activex is installed on the client?

A: 

The main way is to try creating an instance of it. If the creation fails, then the activex control is NOT installed or some other error happened.

Tommy Hui
+2  A: 

Guys i found it !

<script type="text/javascript">
    var p;
    try {
        p = new ActiveXObject('your activex control name');
    }
    catch (e) {
        alert("not installed");

    } </script>

its really simple isnt it? good programming :)

jadeWarlord
A: 

So what should I pass as 'your activex control name' for my custom ActiveX control? CLSID ?

Ma99uS
This should be a comment, not an answer.The "your activex control name" is the PROGID (i.e. Microsoft.XMLHTTP, etc). In a normal ATL project it's defined in the .rgs file for the control.
Taxilian