Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 426
  • Last Modified:

regsvr32 needs any dlls?

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
username1
Asked:
username1
  • 8
  • 6
1 Solution
 
abelCommented:
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
 
abelCommented:
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
 
username1Author Commented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
abelCommented:
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
 
username1Author Commented:
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
 
abelCommented:
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
 
AjoyCommented:
username1,
As an alternative try using Regocx32

0
 
username1Author Commented:
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
 
abelCommented:
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
 
abelCommented:
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
 
username1Author Commented:
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
 
abelCommented:
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
 
username1Author Commented:
Adjusted points to 70
0
 
username1Author Commented:
See you next time Abel :-)
0
 
abelCommented:
Thanks for the extra points :)
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 8
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now