Click here to Skip to main content
Sign Up to vote bad
good
See more: ActiveX
I'm trying to run activex control for a simple hello world message box. First i created the class library and i have now the dll , then i created the HTML page and called 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 in my machine i used to register the dll using regasm /codebase "dll path" and it worked fine.
 
The problem when i tried to run in another machine, i followed the coming steps : 1) I created setup project and added the dll file.
2) I created .inf file and tried two contents which are :
 
[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
 
---OR---
 
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
 
[Setup Hooks]
install=install
 
[install]
run=msiexec.exe /package """%EXTRACT_DIR%\DemoActiveXSetup.msi""" /qn
 
3) I created .CAB file which contains the .inf and setup.exe files 4) Changed the object in HTML page to be :
 
<OBJECT id="DemoActiveX" classid="clsid:400DCE17-4B26-4E59-9A88-AF39E2BE4A55" 
codebase="ActiveXCAB.CAB" ></OBJECT> 

when i tried to open the page on the other machine a request windows opened which request to open CAB ,when i press yes nothing happened !!!!! why it doesn't open the setup.exe or msi file ?? BTW when i installed manually the setup file the activeX worked !
Posted 26 Dec '12 - 4:35
Edited 26 Dec '12 - 4:38

Comments
aspnet_regiis -i - 26 Dec '12 - 12:18
it depends on activex settings in browser http://www.ehow.com/how_6202033_enable-activex-internet-explorer-8.html
Sergey Alexandrovich Kryukov - 26 Dec '12 - 18:21
Why?! —SA

2 solutions

I solved the problem Smile | :)
The problem was :
 
1) I used to put msi file only or setup.exe in CAB file but i must put both msi and setup.exe and refer to setup.exe in inf file
2) inf file format was wrong , the correc one is :
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
 
[Add.Code]
setup.exe=setup.exe
 
[setup.exe]
file-win32-x86=thiscab
clsid={415D09B9-3C9F-43F4-BB5C-C056263EF270}
FileVersion=1,0,0,0
 
[Setup Hooks]
RunSetup=RunSetup
 
[RunSetup]
run="%EXTRACT_DIR%\setup.exe"
Good Luck Smile | :)
  Permalink  
Why using ActiveX at all? For a Web application, this is pure evil. ActiveX is proprietary and aging technology which will never be available on all client systems. Moreover, using ActiveX is considered unsafe, for good reasons, so really knowledgeable users will deny using your application as soon as they know it requires support of ActiveX in browser. By these reasons, this practice cannot be considered legitimate. My advice is: get rid of it as soon as possible. Stay out of trouble.
 
—SA
  Permalink  
Comments
Zoltán Zörgő - 26 Dec '12 - 18:27
Agree. 5!
Sergey Alexandrovich Kryukov - 26 Dec '12 - 18:28
Thank you, Zoltán. —SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 508
1 Arun Vasu 275
2 Mahesh Bailwal 259
3 Maciej Los 238
4 Rohan Leuva 176
0 Sergey Alexandrovich Kryukov 9,660
1 OriginalGriff 7,329
2 CPallini 3,968
3 Rohan Leuva 3,339
4 Maciej Los 2,851


Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 30 Dec 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid