79657241

Date: 2025-06-07 18:53:46
Score: 0.5
Natty:
Report link

I successfully configured and debugged the ActiveX component via w3wp.exe.

My VM environment contains:

Windows Server 2019

Visual Studio 2019

Visual Basic 6.0

IIS 10.0.17763.1

Setup steps:

  1. In regedit.exe find Clsid of my ActiveX component MyVbpProj.MyClass in HKEY_CLASSES_ROOT\MYVBPPROJ.MYCLASS\Clsid (e.g. {16731801-1C28-4A19-A127-123093BA1A1C})

  2. In regedit.exe add in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole:

    "LegacyAuthenticationLevel"=dword:00000001

    "LegacyImpersonationLevel"=dword:00000003

  3. Reboot VM

  4. Config IIS pool to Curent user. Go to IIS Manager > Application Pools

  5. Select MyIISAppPool pool in list, click Advanced Settings in contex menu

  6. In Advanced Settings window set Identity select Custom account and fill: user name, password and click OK button

  7. Restart IIS server (run in CMD: iisreset)

  8. Open project MyVbpProj.vbp with ActiveX component MyVbpProj.MyClass

  9. In top menu File, then Make MyVbpProj.dll... submenu item

  10. In top menu Project then MyVbpProj Properties... submenu item

  11. In MyVbpProj - Project Properties windows, on General tab set Project Type = ActiveX DLL and select checkboxs: Unattended Execution, Upgrade ActiveX Controls, Retained In Memory

  12. In MyVbpProj - Project Properties windows, on Debugging tab select radiobox Wait for components to be created, then select checkbox Use existing browser and click OK button

  13. Open some class and add breakpoint for debugging in which method

  14. Run debug in Visual Basic 6.0

  15. In dcomcnfg.exe app set pemision for DCOM with clsid {16731801-1C28-4A19-A127-123093BA1A1C} (for ActiveX component MyVbpProj.MyClass), and after every run debug in Visual Basic 6.0

  16. Go to Component Services > Computers > My Computer > DCOM config

  17. Select in right grid item with name {16731801-1C28-4A19-A127-123093BA1A1C} and click Properties in contex menu

  18. In {16731801-1C28-4A19-A127-123093BA1A1C} Properties windows, on Security tab for all groups: Launch and Activation Permissions, Access Permissions, Configuration Permissions select Customize radiobox and click Edit... button

  19. Everyone user and Allow all permissions for Everyone user

  20. In all permissions windows on Security tab, add Everyone user and select all permissions checkboxs Allow for Everyone user and click OK button

  21. In my case, HKEY_CLASSES_ROOT\AppID\{16731801-1C28-4A19-A127-123093BA1A1C} contains:

    "AppID"="{16731801-1C28-4A19-A127-123093BA1A1C}"

    "RunAs"="Interactive User"

    "LaunchPermission"=hex:01,00,some values,14,00

    "AccessPermission"=hex:01,00,some values,14,00

  22. Call in browser go to ASP page with Server.CreateObject("MyVbpProj.MyClass") and then go to the page with the method you are debugging

P.S. In case of an error occurring with the name of other ActiveX components from vbp projects. Load their vbp projects, go top menu File, then Make MyOtherLibs.dll... submenu item. Then restart VM and repeat the steps starting from the step of run debugging and other steps. Use debug with multy existing projects (In top menu File then Add Projects... submenu item)

P.S. In case of freezing or IIS error on Component Services > Computers > My Computer click Properties in context menu, on COM Security tab for all groups click Edit Limits... and Edit Default... and add Everyone user, then select all permissions checkboxs Allow for Everyone user and click OK button

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Міша Джага