Solved

regsvr32 needs any dlls?

Posted on 1998-07-28
15
409 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 39

Expert Comment

by:abel
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
username1,
As an alternative try using Regocx32

0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:username1
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Adjusted points to 70
0
 

Author Comment

by:username1
Comment Utility
See you next time Abel :-)
0
 
LVL 39

Expert Comment

by:abel
Comment Utility
Thanks for the extra points :)
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now