I newly installed VB6 and Visual Studio 2012 Premium. OS - Windows 7. I want to add Listview control to my form. For this when i add reference to MS Windows common controls, VB crashes and closes. This is the error msg i am getting "Unhandled exception at 0x00409719 in VB6.EXE: 0xC0000005: Access violation writing location 0x75BDA632." I have MSCOMCTL.OCX under C:\Windows\System32 folder. Please help.

Recommended Answers

All 12 Replies

How are you adding the reference? If you use the choose item dialog directly from the toolbox and choose Windows Common Controls 6.0(SP6) I think that should work.


I am doing the same thing. After selecting Windows Common Controls 6.0(SP6) and click Apply, VB6 freezes with Debug and close program option. If i click debug, error of "An unhandled win32 exception occurred in VB6.EXE[4420]" in Visual Studio Just-In-Time Debugger window.

try running vb6 in xp mode. It might not be compatible with win 7.

No xp installed. Only win 7

xp mode is an app for win 7 for running older apps. You can download it for free from Microsoft. It basically acts like an XP shell that you run these older apps in.

I dont have access to download this (req admin access) in my org. Could you pls suggest some other solutions?

The Access violation is probably due to you running VB6 as a standard user. Try running it as an Administrator. VB6 is an old program designed when nearly everyone ran with full privileges.

I get the same thing on my XP machine running under a normal account. VBA under Excel 2007 does the same irritating thing as well, except that it does not crash; it refuses to let me add controls.

Perhaps the reason you need VB6 can be accomplished another way. Why do you need VB6?

Tried running VB6 as administrator. Freezes when i add reference to common ctrls6(SP6)

Copy your ocx over to the SySWOW64 folder. It handles ALL win 32 dll and ocx files. It will NOT run from your system32 folder. Also, register it via your command prompt.

The error means, Error accessing the OLE (Object Linking and Embedding) registry. You need to copy the MSCOMCTL.OCX file to c:\windows\sysWOW64 not c:\windows\system32.

Run the command with elevated privileges, to do this, follow the steps below:
-Click on start and in the start search bar type CMD, right click on the command prompt icon in the programs area and then click on run as administrator.
-At the command prompt type regsvr32 wmnetmgr.dll and then press enter.

Note: Make sure you are running the computer as administrator.
Make sure you have logged in as administrator of the computer. To verify your account type on your computer, follow these steps:
-Click Start.
- Click Control Panel, and then click User Accounts.

  • If you are not part of a network domain, follow these steps:
    -From the User Accounts window, click User Accounts.
    ii. Look at your user account icon, your account type is displayed under your user name.

-If you are part of a network domain, follow these steps:
- From the User Accounts window, click User Accounts.
- Select your account from the list, and then click Properties.
-In Group membership, make sure that you belong to the Administrators group.

In cmd, type regsvr32 c:\windows\sysWOW64\MSCOMCTL.OCX


There is no folder "c:\windows\sysWOW64". Mine is a 32 bit OS

Oops, assumption was my downfall here...

Do the same then when the ocx is copied to your system 32 folder. Use cmd to register it properly. Also make sure you run cmd as admin...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.