You are currently offline, waiting for your internet to reconnect

Return code 0x80004005 registering a .DLL COM server created with Microsoft Visual FoxPro

Source: Microsoft Support
RAPID PUBLISHING
RAPID PUBLISHING ARTICLES PROVIDE INFORMATION DIRECTLY FROM WITHIN THE MICROSOFT SUPPORT ORGANIZATION. THE INFORMATION CONTAINED HEREIN IS CREATED IN RESPONSE TO EMERGING OR UNIQUE TOPICS, OR IS INTENDED SUPPLEMENT OTHER KNOWLEDGE BASE INFORMATION.
Action
You have a COM server (.DLL) that was created using Microsoft Visual FoxPro (VFP). You attempt to manually register it using REGSVR32.EXE.
Result


You receive an error message similar to the following:

---------------------------
 RegSvr32
 ---------------------------
 DllRegisterServer in <PATH>\<VFPDLL>.dll failed.
 Return code was: 0x80004005
 ---------------------------
 OK  
 --------------------------- 
Cause
This typically happens when the Microsoft Visual FoxPro runtime files necessary to load the VFP-made .DLL cannot be located, as is often the case in an "XCOPY Deployment" scenario (no installation package is in use to install the .DLL).
Resolution


There are various solutions to this problem. To begin, it is necessary to understand the files which are necessary to run a VFP-made .EXE or .DLL:

If your .EXE or .DLL was created with Visual FoxPro 7, the minimum* required runtime files are...
  • VFP7R.DLL
  • VFP7T.DLL (If your .DLL is multi-threaded)
  • VFP7RENU.DLL (English language resource file. You may require a different one depending on your locale.)
  • MSVCR70.DLL


If your .EXE or .DLL was created with Visual FoxPro 8, the minimum* required runtime files are...
  • VFP8R.DLL
  • VFP8T.DLL (If your .DLL is multi-threaded)
  • VFP8RENU.DLL (English language resource file. You may require a different one depending on your locale.)
  • MSVCR71.DLL
  • GDIPLUS.DLL


If your .EXE or .DLL was created with Visual FoxPro 9, the minimum* required runtime files are...
  • VFP9R.DLL
  • VFP9T.DLL (If your .DLL is multi-threaded)
  • VFP9RENU.DLL (English language resource file. You may require a different one depending on your locale.)
  • MSVCR71.DLL
  • GDIPLUS.DLL


* While these are the minimum set of files necessary to run a VFP-mae .EXE or .DLL, other support files may be necessary. Check with the developer of the VFP-made product for more details.



Once you have the required runtime files you can resolve this registration issue by... 

1. Using an installation program, such as InstallShield Express which ships with Microsoft Visual FoxPro, to create an installation package (SETUP.EXE). This package can register the VFP-made .DLL for you automatically.

2. Copying the necessary VFP runtime files for the version of VFP used to create the COM .DLL to the standard VFP runtime folder and registering them. Typically the VFP runtime files (VFP*.dll) and GDIPLUS.dll are placed in the %CommonProgramFiles%\Microsoft Shared\VFP directory and the VFPnR.dll and VFPnT.DLL files are registered using REGSVR32.EXE (where the 'n' in the file names is the version of VFP: 7, 8, or 9). The MSVCR7n.DLL is copied to the %SystemRoot%\System32 directory (registration is not necessary as long as that folder is in the system PATH).

3. Copying the the necessary VFP runtime files for the version of VFP used to create the COM .DLL into the same directory as the COM .DLL. When you do this there in no need to register any of the runtime files because the VFP-made .DLL looks in it's current directory first for it's runtimes when it loads.
More Information


For more information about distributing VFP-made applications, please refer to the VFP9 SP2 help file available online here:
http://msdn.microsoft.com/en-us/library/we0w55zb(VS.80).aspx

You can also download the entire VFP9 SP2 help file here (.CHM):
http://www.microsoft.com/downloads/details.aspx?FamilyID=842ACEC8-F79C-41CD-AB1A-AE4F184387C2&displaylang=en
DISCLAIMER
MICROSOFT AND/OR ITS SUPPLIERS MAKE NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY, RELIABILITY OR ACCURACY OF THE INFORMATION CONTAINED IN THE DOCUMENTS AND RELATED GRAPHICS PUBLISHED ON THIS WEBSITE (THE “MATERIALS”) FOR ANY PURPOSE. THE MATERIALS MAY INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS AND MAY BE REVISED AT ANY TIME WITHOUT NOTICE.

TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, MICROSOFT AND/OR ITS SUPPLIERS DISCLAIM AND EXCLUDE ALL REPRESENTATIONS, WARRANTIES, AND CONDITIONS WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO REPRESENTATIONS, WARRANTIES, OR CONDITIONS OF TITLE, NON INFRINGEMENT, SATISFACTORY CONDITION OR QUALITY, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, WITH RESPECT TO THE MATERIALS.
Properties

Article ID: 956348 - Last Review: 07/30/2008 16:04:35 - Revision: 1.0

Microsoft Visual FoxPro 9.0 Professional Edition, Microsoft Visual FoxPro 8.0 Professional Edition, Microsoft Visual FoxPro 7.0 Professional Edition

  • kbnomt kbrapidpub KB956348
Feedback