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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unable to register the DLL/OCX

Status
Not open for further replies.

montypython1

Technical User
Jan 12, 2005
187
US
Greetings,

Has anyone seen the following error message (and it only appears on one computer):

C:\Program Files\Common Files\Microsoft Shared\VFP\vfp9r.dll
Unable to register the DLL/OCX: RegSvr32 failed with exit code 0x5

Thanks in advance,
Dave Higgins
 
When does the error happen?

If it's on startup, then the app wasn't properly installed. Most likely culprit is not having sufficient rights. (ALWAYS Run As Administrator when installing.) Another option would be a system policy imposed by IT that limits what people can do on their PC.

If it happens at some other time, details would help.
 
I can only guess it's Vista or Higher, Registry Virtualisation and UAC in conjunction, maybe also 64bit OS. If the latter, you need to use regsvr32 from SysWOW64 instead of from system32.

Also it with UAC on it's insufficient to be logged in as admin and run regsvr32, the reason is processes you start as admin with UAC on still run with a low/normal privilege level, unless they have an embedded manifest to query for elevation. And regsvr32, though an admin tool, doe not have that!!!

What works best is to put whatever regsvr32 call into a cmd file and then right click on that file and choose the context menu option "Run as Admin", that is a way to elevate the cmd execution including the called regsvr.

Besides that, registration of COM server or OCX is part of an installation, that no matter how you execute it will always ask for elevation to admin rights anyway, Windows detects that from certain footprint of installers and also if update,install or setup is part of the exe name. You can always see what Windows detects as requiring elevation by a small shield icon added to the application icon. It that is not present, as with regsvr32, you need to specify from outside to run with elevated rights.

And if you run regsvr32 from within your application you will normally now fail since Vista, you need to move the registration to the setup.

Bye, Olaf.
 
Two questions, colleague Dave:

1. Since it's only 1 (one) machine that gives you this grief - what's the Access/User Rights level on this particular machine?

2. Do you really need to run setup for VFP9x.DLLs? AFAIK, you may just place them into the EXE's directory without registration, and it should suffice.

HTH.

Regards,

Ilya
 
Hi Dan, Olaf and Ilya,

Thank you so much for your input.

The IT person (at the company utilizing my program) has indicated that all of their computers are supposed to be setup the same (which apparently is not true).

Is it possible that someone manually deleted or corrupted the file in question? Per Ilya's suggestion, can I manually copy the file in question into the appropriate folder? Would the file be "vfp9r.dll" and would I place it in the folder "C:\Program Files\Common Files\Microsoft Shared\VFP"?

Thanks,
Dave
 
When an IT guys says machines are "supposed to be setup the same", it usually means "I don't allow messing with them" (which includes useful stuff like installing things).

If the problem is truly coming from vfp9r.dll, just plop the thing in the exe's directory on that one machine.

But I'll bet it's a dependency issue (C++ runtime, oleaut.dll, etc.)

Are you using an installer? And are you installing all the required files? See:


Dan
 
Actually C:\Program Files\Common Files\Microsoft Shared\VFP is the place of runtimes on a developer PC. It's not a good practive to install there for deployment at clients, as several foxpro apps using runtimes with different service pack levels would fail on that central runtime directory, as it can only contain one service pack level.

The best practive is really to put runtimes into the application directory.

My interpretation of your error rather was, it comes from vfp9r.dll and not is about vfp9r.dll. vfp9r.dll is a dll you don't nned to register at all, if putting it into the application directory.

Reading it suggests to register vfp9r.dll and mybe that's what you did, actually. In case you install vf9r.dll at some other place than the application directory, it's really needed for the sake of a vfp exe to find it, but as said that has the problem of the servce pack levels, it's not really a good idea.

If you do so, the wiki also says you need msvcr71.dll, and in more detail here:
I'd not register vfp9r.dll, but put it in your application directory, then that problem is removed anyway.

We don't have astorage space issue, so to avaoid DLL hell problems of one central DLL file, which can only be in the system with one version, it's a good practice in general, to not install dlls centrally anymore, but locally.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top