Prepare my ActiveX for Use in an Object Tag


In this Post I try te prepare my Activex from Previous Post for Use in an Object Tag

I have to change the Object Creation Method in HTML, because "ActivexObject(...)" provides no Way to install ActiveX. But this was a Requirement in my Case. ActivexObject(...) uses the ProgID of ActiveX. The ProgID is not Unique, so <object> uses the CLASSID to instantiate an ActiveX.

  • Decorate Class with a GUID: [Guid("23BEDEB8-6A05-4F26-A12A-F0AAD3F09DA4")]
  • Decorate Class with the COM Visible Attribute [ComVisible(true)]
  • Add a Deployment Project to build a CAB File
  • Sign the CAB File:
  • Open CMD Shell
  • Change to C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\x64>
  • makecert.exe -sv "MyActivexCert.pvk" -n "CN=Willi Neuner," "MyActivexCert.cer" -r
  • .PVK and .cer Files are located in current Folder
  • c:pvk2pfx -pvk myactivexcert.pvk -spc myactivexcert.cer
  • In the Wizard use the Passwords used above and name the file appropriately
  • D:\Projects\regexreplace\testobject\testobject\bin\Release>c:signtool sign /f my
    activexcert.pfx /p <password>
    Done Adding Additional Store
    Successfully signed: testactivexobject.CAB
  • Call HTML via Browser
  • View in C:\Users\willin\AppData\Local\Microsoft\Windows\Temporary Internet Files for Errors
  • Activex Registration of .NET COM Objects does NOT work with regsvr32. I can create a .REG File with regasm and try to register this Entries in the .INF file contained in the CAB
  • I Stop here and search for a better solution
  • Reasons for stopping now: User has to be Admin for Registration. My selfsigned Certificate has no trusted Publisher, so the Installer has to change Activex Internet Settings in IE to allow installation of Activex from untrusted Publisher. Every IE Version is a little different in handling this.


Related Links at this Point

© Willi Neuner 2019 Impressum