Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

regsvr32 needs any dlls?

Posted on 1998-07-28
15
418 Views
Last Modified: 2010-05-18
I tried to do
regsvr32 xxxxx.ocx
and got error message: LoadLibary("xxxxx.ocx") failed.
However, I did the same thing with the same file in another PC with success.
Do you think to do that we need some dll files or what in a PC? what are the files?
0
Comment
Question by:username1
  • 8
  • 6
15 Comments
 
LVL 39

Expert Comment

by:abel
ID: 1466982
You probably need "xxxxx.ocx" on your machine, or you need to supply the correct path. Search "xxxxx.ocx" on your computer and if it's not in C:\Windows, C:\Windows\System (for NT: C:\WinNT or C:\WinNT\System32) you'll have to supply the full path.

Regards, Abel
0
 
LVL 39

Expert Comment

by:abel
ID: 1466983
BTW
RegSvr32.exe needs the libraries KERNEL32.DLL, USER32.DLL and OLE32.DLL. All of them should reside on your system. Without KERNEL32.DLL and USER32.DLL, your system won't even work.
0
 

Author Comment

by:username1
ID: 1466984
Hi  abel

thank you for your comments.
I did that from a floppy: both regsvr32.exe and xxxxx.ocx are in the floppy.
That worked in one PC but not in another.
I have just checked all the 3 dlls you mentioned are in Windoew\System of the PC that failed to register ocx.

Cheers.
0
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 39

Expert Comment

by:abel
ID: 1466985
Hi
I didn't know that it was possible to register an ocx/dll that's on a floppy...
I think you have two different situations here on the two machines:

M1   xxxxx.ocx is on the floppy AND in the system-dir
M2   xxxxx.ocx is ONLY on the floppy

Try it by copying xxxxx.ocx to the system-dir and call regsvr32.exe again. Even if your program needs to be run from the floppy, it will work.

Regards, Abel
0
 

Author Comment

by:username1
ID: 1466986
Hi Abel

i have just tried to copy xxxxx.ocx to Windows\System and run regesvr32.exe frome dos. This time I got
LoadLibary("xxxxx.ocx") failed
GetLastError return 0x00000485.

???????????
0
 
LVL 39

Expert Comment

by:abel
ID: 1466987
Hi,
Ok, sorry, I directed you in the wrong way (I thought it was the most obvious). Below I have a more possible explanation and solution for you. I hope it works out.

That is this error:
"One of the library files needed to run this application cannot be found.", or code: ERROR_DLL_NOT_FOUND (decimal: 1157, hex: 485).

This error doesn't mean that regsvr32 fails, but that your ocx needs additional libraries (it also says that the error is the error from LoadLibrary("xxxxx.ocx"), meaning that that's where it fails and where the error comes from). To know what libraries your ocx needs (and probably it needs them registered first) you'll have to use some tool like QuickView (a PowerToy utility from Microsoft, if you use NT it's built-in) to view the import table. Using QV it'll say that it hasn't got a viewer installed for OCX's, but if you let it view your file with one of the standard/default viewers, it's ok. You'll see lot's of boring technical stuff, but little downward you'll find the Import Table. That's where you should look for any dll's (it should AT LEAST list KERNEL32.DLL in the import table).
You can, of course, also use some other viewer which shows the import table for you.

Look up on your system every dll you find in the import table. If it's not there, you know where the error gets from. Find the dll, copy it to your HD, register it and run REGSVR32 again on the ocx.

Regards, Abel
0
 

Expert Comment

by:Ajoy
ID: 1466988
username1,
As an alternative try using Regocx32

0
 

Author Comment

by:username1
ID: 1466989
Hi Abel,

After reading your comments (difficult for me to understand :-)), I remember that when wrote the xxxxx.ocx I added a custom control which needs a dll file! And, it needs some dll files come whith VB..... Perhaps, regsvr32.exe can detect if the dll files (the ocx needed) existed or not in Windows\System?

I will copy the dll files to the PC and see what happens.

Cheers.
0
 
LVL 39

Expert Comment

by:abel
ID: 1466990
Username1,
If you've built your ocx with VB, why don't you make an install program with the VB Setup Wizard? That makes life a lot easier for these cases, because every program built with VB always needs some extra dll's (at least MSVBVM50.DLL for VB5). The wizard helps you with selecting the files needed and creates a setup application for you that you can easily distribute. It also registers the dll's or ocx's for you.

Regards, Abel
0
 
LVL 39

Expert Comment

by:abel
ID: 1466991
PS If you only have VB CCE (Control Creation Edition) you won't have the Setup Wizard. In that case you have to do it by hand.
0
 

Author Comment

by:username1
ID: 1466992
Hi Abel,

Yes, after copy MSVBVM50.DLL to the PC, xxxxx.ocx has been registed!!!!!!!!!!!!!!!!!

Is MSVBVM50.DLL = vb40032.dll in VB4 = vbrun300.dll in VB4?

Please put you answer here so that I can pass the points to you.
0
 
LVL 39

Accepted Solution

by:
abel earned 70 total points
ID: 1466993
Thanks for letting me answer this, and good that it works now.

Here's the answer, but for visitors, see the thread below as well.

Make sure you have all the needed dlls that are being used by the ocx on the target machine. Most VB-apps need MSVBVM50.DLL (VB5), VB40032 or VB40016 (VB4), VBRUN300 (VB3), VBRUN200 (VB2 or VBRUN100 (VB1) to run properly (most? no all!). Even when you build an ocx in VB you need it.
You can also use the App Wizard to do all the dirty work for you.

That's it by now,

Regards, Abel
0
 

Author Comment

by:username1
ID: 1466994
Adjusted points to 70
0
 

Author Comment

by:username1
ID: 1466995
See you next time Abel :-)
0
 
LVL 39

Expert Comment

by:abel
ID: 1466996
Thanks for the extra points :)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB6 - Convert HH:MM into Decimal 8 62
Visual Studio 2005 text editor 10 44
Set email body to html using vbscript 6 49
adding "ungroup sheets" to existing vbs code 5 30
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question