Results 1 to 5 of 5

Thread: [RESOLVED] MSCOMCTL.OCX not loading properly in VB6 on Windows 7

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2020
    Posts
    4

    Resolved [RESOLVED] MSCOMCTL.OCX not loading properly in VB6 on Windows 7

    Hi, new user with a question - this looked like the most appropriate board to post this on, so please bear with me if it should have been somewhere else (the VB6 & earlier board didn't feel like the most appropriate place for it based on the board description).

    I'm currently using a VMWare-hosted VM running Windows 7 Professional 64-bit with SP1 and VB6 SP6 and I recently uninstalled an application that uses the MSCOMCTL.OCX file which has pulled it out of the Windows Registry.

    The Windows Registry for the OCX control looks like this:

    Code:
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.0
        (Default)    REG_SZ    Microsoft Windows Common Controls 6.0 (SP6)
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.0\0
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.0\0\win32
        (Default)    REG_SZ    C:\Windows\SysWow64\MSCOMCTL.OCX
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.0\FLAGS
        (Default)    REG_SZ    2
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.0\HELPDIR
        (Default)    REG_SZ    C:\Windows\HELP
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.1
        (Default)    REG_SZ    Microsoft Windows Common Controls 6.0 (SP6)
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.1\0
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.1\0\win32
        (Default)    REG_SZ    C:\Windows\SysWOW64\mscomctl.OCX
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.1\FLAGS
        (Default)    REG_SZ    2
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.1\HELPDIR
        (Default)    REG_SZ    C:\Windows\HELP
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.2
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.2\0
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.2\0\win32
    I have a legacy application project in VB6 that uses the MSCOMCTL.OCX control and if I open this project up, it's looking for the 2.2 entry for MSCOMCTL.OCX: I've tried manually adding in the corresponding keys and values under the "HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.2" entry, and setting "HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.2\(Default)" to "Microsoft Windows Common Controls 6.0 (SP6)" displays the correct title in the Components dialog box

    If I then add the file location under "HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.2\0\win32\(Default)", when I try loading the project, the IDE goes into a "Not Responding" state after a few seconds and I don't appear to make any further progress.

    I have tried adding in the "HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.2\FLAGS\(Default)" key as "2" and the "HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.2\HELPDIR\(Default)" key as "C:\Windows\HELP", but these didn't work either.

    The way I get round this at the moment is to keep the VB6 IDE and project loaded and use Start | Shut down | Sleep at the end of the working day so that the current state is preserved.

    Now, it does appear in the Components dialog box as shown in the attached images below:

    Name:  Components List 1.png
Views: 192
Size:  40.0 KB - Components dialog showing the entry for MSCOMCTL.OCX 2.2
    Name:  Components List 4.png
Views: 190
Size:  45.7 KB - Components dialog showing the entry for MSCOMCTL.OCX 2.1

    Does anyone know how I can fix this? I do have a copy of the VB6 SP6 installer on the VM's drives so I could try running that again and see if it can overwrite the Registry settings.

  2. #2
    New Member
    Join Date
    May 2020
    Posts
    10

    Re: MSCOMCTL.OCX not loading properly in VB6 on Windows 7

    Hi,
    Just a few ideas,
    if you are running vmware maybe you are lucky and you got a restore point previos uninstalling
    if not, make a restore point with the VM prior to do more tests..
    Other option is to create a 2nd VM , same windows box/Version/languaje, install the aplication and try to copy Registry and files missing.
    hope you can fix it..

  3. #3
    New Member
    Join Date
    May 2020
    Posts
    10

    Re: MSCOMCTL.OCX not loading properly in VB6 on Windows 7

    sorry i duplicated the posting by mistake

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2020
    Posts
    4

    Re: MSCOMCTL.OCX not loading properly in VB6 on Windows 7

    After it giving it some more thought, I'm thinking of making sure I've got a recent Registry backup (a few minutes' work with the Registry Editor) before deleting the following keys/values:

    Code:
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.2
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.2\0
    HKEY_CLASSES_ROOT\TypeLib\{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}\2.2\0\win32
    After doing this, I'd restart the VB6 IDE and check the components dialog - the mscomctl.ocx file is definitely located in the C:\Windows\SysWOW64 folder.

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2020
    Posts
    4

    Re: MSCOMCTL.OCX not loading properly in VB6 on Windows 7

    Okay, so just a final update on this one as I've been able to fix it since my last post after doing some more research.

    After taking a backup of the VB6 project and closing down the IDE, I downloaded a copy of the NirSoft RegDllView freeware tool (their website is here) and ran that on the VM - this told me that the controls in the installed MSCOMCTL.OCX file were version 2.0 (the project is configured for version 2.2).

    I installed the Microsoft KB3096896 update and ran the RegDllView tool again and that told me the MSCOMCTL.OCX file's controls were now at version 2.2, which is what I wanted, but the project was still giving me System Registry access errors.

    I then extracted the files from this update's installer to a local folder, unregistered the existing MSCOMCTL.OCX file using regsvr32, and renamed the MSCOMCTL.OCX and MSCOMCTL.DEP files in the C:\Windows\SysWOW64 folder before copying the ones over from the KB folder.

    I then ran regsvr32 to register the new MSCOMCTL.OCX and ran RegDllView to check if the update had worked: the controls were now showing as version 2.2.

    I then launched the VB6 IDE as Administrator (turns out that I should have been doing this as well, so I've updated my shortcuts to set that option), and reopened the project successfully.

    So, if anyone else encounters this type of problem, I hope this thread can help them too.

    Many thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width