Call a function in ocx by using javascript

I have an ocx developed to retrieve hardware information. This ocx has a function (getInfo()) to return the obtained information in string.

I have a webpage (html) and I would like to call this getInfo() function by using javascript. However I failed and I receive a running error: Object doesn't support this property or method. It seems to me that I am not calling the function collectly. Would anyone help me please?
Function getInfo() in VB6
Public Function getInfo() As String
   Dim tmp As String, output As String  
   Call GetSystemInfo(SI)
   output = "Test Function"
   output = output & "SI.dwNumberOfProcessors: " & SI.dwNumberOfProcessors
   Select Case SI.dwProcessorType
      Case PROCESSOR_INTEL_386: tmp = "386"
      Case PROCESSOR_INTEL_486: tmp = "486"
      Case PROCESSOR_INTEL_PENTIUM: tmp = "Pentium"
      Case PROCESSOR_MIPS_R4000: tmp = "MIPS 4000"
      Case PROCESSOR_ALPHA_21064: tmp = "Alpha"
   End Select
   output = output & "SI.dwProcessorType & "" "" & tmp: " & SI.dwProcessorType & " " & tmp
   Select Case SI.wProcessorLevel
      Case PROCESSOR_LEVEL_80386: tmp = "Intel 80386"
      Case PROCESSOR_LEVEL_80486: tmp = "Intel 80486"
      Case PROCESSOR_LEVEL_PENTIUM: tmp = "Intel Pentium"
      Case PROCESSOR_LEVEL_PENTIUMII: tmp = "Intel Pentium Pro or Pentium II"
   End Select
   output = output & "SI.wProcessorLevel & "" "" & tmp: " & SI.wProcessorLevel & " " & tmp
   output = output & "SI.wProcessorRevision: " & SI.wProcessorRevision
   output = output & "GetCPUSpeed() & "" MHz"": " & GetCPUSpeed() & " MHz"
   getInfo = output
End Function
My html code
<script type="text/javascript" FOR="window">
function fn()
<body bgcolor=lightblue LANGUAGE = VBScript>
<!--	If any of the controls on this page require licensing, you must
	create a license package file. Run LPK_TOOL.EXE to create the
	required LPK file. LPK_TOOL.EXE can be found on the ActiveX SDK, If you have the Visual
	Basic 6.0 CD, it can also be found in the \Tools\LPK_TOOL directory.
	The following is an example of the Object tag:
<OBJECT CLASSID="clsid:5220cb21-c88d-11cf-b347-00aa00a28331">
CODEBASE="C:\Program Files\Microsoft Visual Studio\VB98\Package\myFirstOCX.ocx"
<INPUT TYPE=BUTTON VALUE=Textbox onclick="fn()" >
<INPUT TYPE=TEXT ID="ConnectionString" VALUE="" >

Open in new window

Who is Participating?
mishelperConnect With a Mentor Author Commented:
I found that the  function within activeX object cannot be called outside the ocx file. but they can be called by set/get property of the object.

hi ,

use a <% tag %> and call the function

b u d d h a
All Courses

From novice to tech pro — start learning today.