Results 1 to 10 of 10

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

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2020
    Posts
    5

    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: 12217
Size:  40.0 KB - Components dialog showing the entry for MSCOMCTL.OCX 2.2
    Name:  Components List 4.png
Views: 12519
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
    Junior Member
    Join Date
    May 2020
    Posts
    18

    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
    Junior Member
    Join Date
    May 2020
    Posts
    18

    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
    5

    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
    5

    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.

  6. #6
    New Member
    Join Date
    Feb 2021
    Posts
    1

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

    Hello,
    I have a VB6.0 project , and when i try to open it , get the error message mscomctl.ocx could not be loaded
    (Windows 10 1809 , problem append after Windows update , Office 365 ... )
    after many investigation search .... C:\Windows\SysWOW64>regsvr32 MSCOMCTL.OCX , nothing works :-(
    i was in such situation
    - Create a new Project / insert MSCOMCTL.OCX => OK
    - Open my project => Error Message mscomctl.ocx could not be loaded
    --
    this is the solution , i have found :
    Edit File *.vbp in text editor , the difference was
    Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX
    Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.2#0; MSCOMCTL.OCX
    => this is the first time i manually Edit the vbp file , but this solve my problem
    I hop it can be helpful ....

  7. #7

    Thread Starter
    New Member
    Join Date
    Nov 2020
    Posts
    5

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

    Quote Originally Posted by Xav73 View Post
    Hello,
    I have a VB6.0 project , and when i try to open it , get the error message mscomctl.ocx could not be loaded
    (Windows 10 1809 , problem append after Windows update , Office 365 ... )
    after many investigation search .... C:\Windows\SysWOW64>regsvr32 MSCOMCTL.OCX , nothing works :-(
    i was in such situation
    - Create a new Project / insert MSCOMCTL.OCX => OK
    - Open my project => Error Message mscomctl.ocx could not be loaded
    --
    this is the solution , i have found :
    Edit File *.vbp in text editor , the difference was
    Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0; MSCOMCTL.OCX
    Object={831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.2#0; MSCOMCTL.OCX
    => this is the first time i manually Edit the vbp file , but this solve my problem
    I hop it can be helpful ....
    Hi Xav73 - yes, I did try that first after looking online, but what happened was I'd uninstalled the application that had put on the version 2.2 MSCOMCTL.OCX file and I was left with just the version 2.0 one.

    So when I edited the vbp file, it would keep failing (I did get an error about VB6 being unable to access the Registry, but that was because I hadn't enabled the "Run as Administrator" option in my shortcuts to the IDE).

    The method I mentioned was the one that worked for me in the end though, but I'd recommend people try your suggestion first to see if it works.

  8. #8
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    5,854

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

    I stumbled into the same yesterday when I had to use a new company laptop.
    I installed SP6, but the version of MSCOMCTL was 2.0

    So based on post #5 by RichardWatt I downloaded and installed the Microsoft Visual Basic 6.0 Service Pack 6 Security Rollup Update
    This fixed everything, making sure the version was 2.2

  9. #9
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

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

    These "rollups" have been problematic for a very long time. Just be sure that you have these instructions in case things blow up in your face:

    Removal information

    You cannot remove this security update through the Add or Remove Programs item or the Programs and Features item in Control Panel. To remove this security update, save the .msi file to a known location, and then run the following command at a command prompt:

    msiexec /x [knownlocation]\[PatchName].msi

  10. #10
    Lively Member
    Join Date
    Mar 2024
    Posts
    123

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

    Quote Originally Posted by Arnoutdv View Post
    I stumbled into the same yesterday when I had to use a new company laptop.
    I installed SP6, but the version of MSCOMCTL was 2.0

    So based on post #5 by RichardWatt I downloaded and installed the Microsoft Visual Basic 6.0 Service Pack 6 Security Rollup Update
    This fixed everything, making sure the version was 2.2
    Thanks that fixed the issue I was having too, and it was easy!

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