I'm trying to run the activex control to a simple mailbox greeting. First, I created a class library, and now I have a dll, then I created a HTML-page and call the ActiveX control:
<!DOCTYPE> <html> <head> <title>DemoActiveX</title> </head> <body> <OBJECT id="DemoActiveX" classid="clsid:400DCE17-4B26-4E59-9A88-AF39E2BE4A55"> </OBJECT> <script type="text/javascript"> try { var obj = document.DemoActiveX; if (obj) { alert(obj.SayHello()); } else { alert("Object is not created!"); } } catch (ex) { alert("Some error happens, error message is: " + ex.Description); } </script> </body> </html>
when I tried it on my machine, I used to log dll using regma / codebase "dll path", and it worked just fine.
The problem is, when I tried to run on a different machine, I performed the following steps: 1) I have created a setup project and add a file dll.
2) I created .inf file and tried two contents:
[version] signature="$CHICAGO$" AdvancedINF=2.0 [Add.Code] ActiveX.dll=ActiveX.dll [ActiveX.dll] file-win32-x86=thiscab clsid=400DCE17-4B26-4E59-9A88-AF39E2BE4A55 FileVersion=1,0,0,0
RegisterServer = yes
[version] signature="$CHICAGO$" AdvancedINF=2.0 [Setup Hooks] install=install [install] run=msiexec.exe /package """%EXTRACT_DIR%\DemoActiveXSetup.msi""" /qn
3) I have created a .CAB file containing the .inf files and setup.exe 4) Change the object in the HTML page:
<OBJECT id="DemoActiveX" classid="clsid:400DCE17-4B26-4E59-9A88-AF39E2BE4A55" codebase="ActiveXCAB.CAB" ></OBJECT> = "clsid: 400DCE17-4B26-4E59-9A88-AF39E2BE4A55" <OBJECT id="DemoActiveX" classid="clsid:400DCE17-4B26-4E59-9A88-AF39E2BE4A55" codebase="ActiveXCAB.CAB" ></OBJECT>
when I tried to open the page on another machine, the request windows opened, which request to open the CAB, when I click yes, nothing happened !!!!! why he does not open the file setup.exe or msi? BTW, when I set the manual installation file works with activeX!