Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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 5:35am
Edited 26-Dec-12 5:38am
v2
Comments
aspnet_regiis -i at 26-Dec-12 12:18pm
   
it depends on activex settings in browser http://www.ehow.com/how_6202033_enable-activex-internet-explorer-8.html
Sergey Alexandrovich Kryukov at 26-Dec-12 18:21pm
   
Why?!
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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ő at 26-Dec-12 18:27pm
   
Agree. 5!
Sergey Alexandrovich Kryukov at 26-Dec-12 18:28pm
   
Thank you, Zoltán.
—SA
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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  

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

  Print Answers RSS
0 OriginalGriff 400
1 Jochen Arndt 200
2 Richard MacCutchan 135
3 DamithSL 95
4 Maciej Los 95
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100