Javascript – Find the version of an ActiveX COM component

activexcomjavascript

I have a web application that uses an ActiveX COM component, for example:

<OBJECT id="SomeObject" style="VISIBILITY: hidden" etc...
    classid="clsid:0A6AD658-F144-4412-AB94-9C8F298973E1"></OBJECT>

I've produced the ActiveX control myself, and I want to be able to determine in JavaScript the version of the control that is installed and being used on the page.

I thought I could expose a method on the object than exposed the version number somehow, for example:

<script language="JavaScript>
    var version = SomeObject.GetVersion();
</script>

But that seemed really messy. I wondered if there was a built in COM / ActiveX mechanism for finding version numbers – whats the best way of doing this?

Best Answer

There is nothing in the ActiveX specs that has the construct of version, you can browse around and see that many ActiveX controls have Version property.
You can improve the code (a little) by providing a Version property instead of a method.

You can also provide a version in the codebase and know that you have at least the version ask for.