When I try to instantiate a VFP COM (OlePublic
) DLL from my .NET web app running in IIS on Windows server 2016 I get:
Retrieving the COM class factory for component with CLSID {A55C4127-DDCB-4E5F-B69C-A7EAC83A83DC} failed due to the following error: 80004005 Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL)).
I was able to track it down (using Simon's comment) to it not being able to find vfp9r.dll
:
Those files got installed w/ my InstallShield package under C:\Program Files (x86)\Common Files\Microsoft Shared\VFP
:
Why isn't "it" searching that dir? I got one server it is finding them under program files and another that isn't. How does that magic work?
update
if I install VFP 9, it will search that dir & successfully load it. So what is the VFP 9 install doing to my machine to tell "it" to search that dir not just the current dir & \SysWow64
? 🤔
workaround
import these registry keys:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\VisualFoxProRuntimeMT.9\Shell\Open\Command]
@="C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\VFP\\vfp9t.dll"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\VisualFoxProRuntime.9\Shell\Open\Command]
@="C:\\Program Files (x86)\\Common Files\\Microsoft Shared\\VFP\\vfp9r.dll"
(save the above 'script' as a .reg
file and double click it to import it)
how I figured this out:
vfp9r.dll
or vfp9t.dll
vfp9t.dll
was smaller so that was helpful. I grabbed the first key and that worked. Then I searched for the same-ish path for the vfp9r.dll
export and grabbed that key.