Unable to "Make" ActveX controls
I'm migrating old VB 6.0 apps to Windows 11 which contain a few ActiveX controls that need to be registered. I did a "make" first to be sure they're healthy but get "Permission denied". This is a personal, non-corporate computer over which I should have administrative control, but I've gotten rusty and am unaware what to do to clear permission. Anyone have suggestions?
Re: Unable to "Make" ActveX controls
You need an elevated command prompt for proper registration of ActiveX components.
Re: Unable to "Make" ActveX controls
Thank you for replying but I am only at this point trying to File > Make to recreate the finished .OCX, and that is halted with "Permission denied". Isn't there some permission setting I need to change?
1 Attachment(s)
Re: Unable to "Make" ActveX controls
You need to run the VB6.EXE as an administrator, and then say "Yes" when you run it and it asks if you want to allow it to make changes to your system.
When you compile an ActiveX (DLL or OCX), it attempts to register it after it's compiled. However, without the VB6.EXE being run as an administrator, it won't have permission to make changes to this part of the registry.
And it doesn't matter if your user is an administrator. You still have to specifically run the VB6.EXE as an administrator.
Attachment 191542
Re: Unable to "Make" ActveX controls
Elroy, Thanks greatly for taking the time with so thorough a reply !!
Re: Unable to "Make" ActveX controls
And just to follow up a bit more, personally I do not run my VB6.EXE as an administrator. Most standard EXE VB6 projects work (and compile) just fine in the VB6 IDE without the VB6.EXE being run as an administrator. In a few cases it's still necessary, but, in those cases, I create a shortcut to the VB6.EXE (with my specific VBP file specified on the command line) ... and then I can set that shortcut to run as an administrator (in that specific case).
Done that way, I have piecemeal control of when I'm running the VB6 IDE as an administrator, and, in most cases, I'm not.
As a tip, in those shortcuts (LNK files), you have to point directly at the VB6.EXE (with a VBP specified on the command line of the shortcut). You can't just have a shortcut to the VBP, or the "run as administrator" checkbox will be grayed off.
------------------
And done this way, I get the added benefit of being able to compile my ActiveX (OCX & DLL) projects without them getting registered (and cluttering up my registry). I still get that permission denied error, but the actual OCX (or DLL) still compiles just fine. It's just not registered, which I never want it to be anyway. Regarding DLLs, I've got code that loads them and uses them without registration. Regarding OCX files, I always create manifest information for them, and run them in a SxS mode. Done that way, no registration is require of either of them. And that allows me to keep even very complex projects "portable" (i.e., no installation needed).
Re: Unable to "Make" ActveX controls
Elroy, thanks for the extra consulting. Hope others will dig deep enough in this thread to discover it. Perhaps just post it in new "how to" thread.