问题
I'm a web developer and my current task is to build an ActiveX component.
It's the first time I have to work with ActiveX and I managed to make an working example.
However I cannot make the ActiveX install from a browser. When installing it using visual studio 2008 and running the web page all works as expected, when I don't have it installed I would expect something similar to windows updates asking me if I allow the installation but this does not happen....
Here is how I'm placing it in the web page:
<object id="myActiveX" name="myActiveX" classid="clsid:A68B19C8-9DB4-49e4-912F-37FB44968528"
codebase="http://localhost/myWebSite/install.cab#version=1,0,0,0"></object>
The guid in the classId matches the guid I created for my class.
Can anyone point out what I'm missing?
Edit:
Forgot to mention this, I have a Setup Project for my ActiveX that generates an .msi and an Setup.exe
i have made a cab file with those using a .inf file as so:
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
[Setup Hooks]
hook1=hook1
[hook1]
run=msiexec.exe /i %EXTRACT_DIR%\Install.msi /qf
回答1:
You might want to check your IE security settings: By default, unsigned ActiveX controls are ignored.
Here's another possibility:
Did you mark your control as "Safe for scripting" and "safe for initialization"?
I'm not sure this is the issue you're running into since 1) your sample HTML code doesn't show that you're using the control in a script and 2) said HTML snippet doesn't show that you set control properties. However this is a usual trap so if I were you, I'd give a look.
IIRC this can be achieved either by implementing the IObjectSafety interface or using registry settings.
This and this are 2 pointers to get you started.
来源:https://stackoverflow.com/questions/370960/auto-install-activex