VB Component Registration for Distribution

From Free Knowledge Base- The DUCK Project: information for everyone
Revision as of 00:45, 30 November 2011 by Admin (Talk | contribs)

Jump to: navigation, search

For example, you put your VB executable on a system and attempted to execute. An error message stated...

 Component 'mscomctl.ocx' or one of its dependencies not correctly registered: a file is missing or invalid.

You could obtain a copy of mscomctl.ocx and just drop it in the same folder as your executable. However, this is not the correct way of doing things in Microsoft Windows.

Windows 2000 / XP

Place mscomctl.ocx in c:\windows\system32 then register the component with the following command:

 regsvr32 \windows\system32\MSCOMCTL.OCX

Which creates an entry in the windows registry and makes the component available to all Windows applications which may require it under Windows XP.

Windows Vista / 7

All Visual Basic 6.0 runtime components are supported under Windows 7.

When trying to register a component such as MSCOCMCTL.OCX in Windows 7 you get an error such as DLLRegisterserver error code 0x08002801c

Use the following work around: (you will need administrator privilege account)

1. Place mscomctl.ocx in c:\windows\system

2. Create a batch file on the windows desktop called runme.bat and put the following command in the batch file:

 REGSVR32 MSCOMCTL.OCX

3. Copy runme.bat into the c:\windows\system directory (you will be nagged to do as administrator)

4. Right click on the runme.bat and choose "Run as administrator"

Your com object will be successfully registered.

Reference source: Can't figure out how to register MSCOMCTL.OCX in Windows 7