Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common Controls 6 Error In Loading DLL 1

Status
Not open for further replies.

gmmastros

Programmer
Feb 15, 2005
14,909
US
I've been having a problem loading my VB6 project lately. I'm hoping someone recognizes the problem and can help me out.

When I attempt to load one of my projects, I get an error. It says, "Errors during load. Refer to 'C:\folder\frmWhatever.log' for details. When I look at the log file, it says...

[tt][blue]Line 35: Class MSComctlLib.StatusBar of control StatusBar1 was not a loaded control class.[/blue][/tt]

I know the status bar control is in Windows Common Controls 6.0, so I create a new VB project and attempt to add that component. I click Project -> Components, scroll down to Microsoft Windows Common Controls 6.0 (SP6). I select it, and click Apply. I then get an error message that say Error in loading DLL.

A search led me to this: thread222-1050587. When I run the code posted by HughLerwill, everything in the list returns Loaded ok/ Unloaded ok except GRID32.ocx, VBPrnDlg.dll, and MUST_FAIL.dll. Of signifigance though... MSCOMCTL.OCX appears to be ok. I then ran the compiled code from my application, and sure enough, there's the status bar functioning properly. So, it appears that the problem I am experiencing is with the VB IDE. So then I tried including other components. I could successfully use:

Microsoft Comm Control 6.0
Microsoft Common Dialog Control 6.0
Microsoft Rich Text Box Control 6.0
Microsoft Windows Common Controls 5.0
Microsoft Windows Common Controls-3 6.0

I'm stumped. I really don't know what else to do.

I'm running Visual Basic 6.0 (SP6). The about screen says version 9782 in the lower left corner of the window.
MSCOMCTL.OCX version 6.1.97.86
comcat.dll version 5.0.2600.1
mscomct2.ocx version 6.1.97.82

I'm running Windows XP service pack 2.

Other things I have tried:

I've run registry cleaners.
I've re-installed Visual Studio 6.0 (enterprise edition).
I've reinstalled Service Pack 6.
I've reinstalled windows common controls 6.0.

I don't know what else to try.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Although I don't think there is a problem with the Ocx if it works in a compiled version:

To start with, close all running programs. Under Start-Run copy these one at a time and execute:

regsvr32 /u MSCOMCTL.OCX
regsvr32 MSCOMCTL.OCX


When you start a new project and add the ocx, or open an existing project which uses it, a mscomctl.oca should be created in the system32. Not so when running the compiled version.

In Windows system32 look for the MSCOMCTL.oca Control Typelib cache, see if it is there (I'd delete it and let it be created again when you open the project).

Look in the registry under:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Visual Basic\6.0
for the CLSID for the MSComctl .oca.

Is it there?



______________________________________________
Also, for the future, download and install the DependencyWalker to check dependencies and versions:


(Do a right click in explorer on the ocx, dll, exe and select "View Dependencies". Check versions of dependencies-right click and properties. For Exe's use the profiling)
 
SBerthold,

Thank you. Your suggestions helped me resolve this problem. Apparently, there was another version of the ocx in another folder. I unregistered that version and registered the correct on (in the system32 folder). It was the tip about the registry that helped me track down the problem.

On a side note...

When I installed the dependency walker and ran it against the ocx, it's reporting a problem.

[tt]
dwmapi.dll [red]Error opening file. The system cannot find the specified file (2).[/red][/tt]

There are 2 other dll's shaded in red. SHLWAPI.DLL and MPR.DLL. In the bottom window, I see this...

[red][tt]Warning: At least one delay-load dependency module was not found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
[/tt][/red]

As of now, I can load my projects and get back to work. I guess I'm wondering if this is something I should worry about. [smile]

Thanks again for your help.


-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Great, and also thank you.

After I though about it again, I realized that the .Oca which I mentioned is anyways nothing of value relating to this.


The dwmapi.dll I think is for Vista.

The SHLWAPI.DLL and MPR.DLL are red probably because of a load-delay, probably here meaning the function is used and probably available when first called (dynamically)

Those last two "errors" are then nothing to worry about.

You can see more hwen you open your application exe with Dependency Walker and use F7 to start profiling, and then open up forms and functions which use the ocx/dll you want to inspect.

>I unregistered that version and registered the correct on (in the system32 folder).

What version was this and in what folder? It probably got installed by some older program.
 
>> It probably got installed by some older program.

You're right.

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top