Search code examples
installshieldcom-interopvisual-foxprowindows-server-2016visual-foxpro-9

VFP dll not searching program files for vpf9r.dll


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:

failed to find vfp9r.dll screenshot from procmon

Those files got installed w/ my InstallShield package under C:\Program Files (x86)\Common Files\Microsoft Shared\VFP:

  • vfp9r.dll
  • VFP9RENU.dll
  • vfp9t.dll

screenshot of installshield package


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? 🤔

search common dir screenshot

load image screenshot


Solution

  • 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:

    • Hyper-V checkpoints so I could quickly go back and forth from a working to a non-working vm along w/ resetting after I did some test to find the minimal workaround
    • Search & export registry key w/ vfp9r.dll or vfp9t.dll
    • Compare exports via Notepad++ Compare Plus Plugin
    • The diff for 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.