0

Hi I have created an ActiveX control in C#.net and using it in a html page.

HTML Code is :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
<OBJECT id="DemoActiveX" classid="clsid:14CBF038-4D43-457e-A5D2-CBED641218C5" codebase="DemoCSharpActiveXNew.cab">
</OBJECT>
<script type="text/javascript">
            var obj = document.DemoActiveX;
            alert(obj.AddToIEList());

</script>
</body>
</html>

When I run this html page from file system (e:\testpage.html) it installs the dll packaged in "DemoCSharpActiveXNew.cab" and calls the

obj.AddToIEList(); 

method , but when I run it from Visual Studio it installs the dll (packaged in "DemoCSharpActiveXNew.cab") but throws a java script error saying that:

Object doesn't support property or method

Why is this happening ? Any idea ?

Update: Now I updated the .inf file as per link given by @wakqasahmed, it goes like this:

When I run the web page with in local host it installs the activex control but same error

Object doesn't support property or method 

is coming even after activex has been installed.

John Saunders
  • 160,644
  • 26
  • 247
  • 397
shrekDeep
  • 2,260
  • 7
  • 27
  • 39

1 Answers1

0

It seems like your inf file is not correct.

opening file from file system is different from opening it through localhost

for reference please check this link: ActiveX not working on client machine

Community
  • 1
  • 1
wakqasahmed
  • 2,059
  • 1
  • 18
  • 23
  • I am using this setting as per the reference given by you, but unfortunately it is not working. I am sure I am missing something here but just can't figure it out
    [version]
     signature="$CHICAGO$"
     AdvancedINF=2.0
    
     [Add.Code]
     setup.exe=setup.exe
    
     [setup.exe]
     file-win32-x86=thiscab
     clsid={14CBF038-4D43-457e-A5D2-CBED641218C5}
     FileVersion=1,0,0,0
    
     [Setup Hooks]
     RunSetup=RunSetup
    
     [RunSetup]
    run=msiexec.exe /package """%EXTRACT_DIR%\DemoCSharpActiveXSetup.msi""" /qn
    
     I included .msi instead of setup.exe becoz it was giving some different issue.
    – shrekDeep Jun 14 '13 at 12:11