installshieldcom-interopvisual-foxprowindows-server-2016visual-foxpro-9

how to package and deply a VFP OlePublic (COM Object)?


How do I deploy a VFP OlePublic dll to a Windows Server 2016 machine that is called via COM Interop from .NET hosted in an IIS website? What other bits do I need to deploy beside my VFP dll?

I would think I would use InstallShield Express Visual FoxPro Limited Edition (included w/ the install of VFP9), no?

Define Class miked As Session OLEPUBLIC
    
FUNCTION HelloWorld as String
    RETURN "Hello World"
ENDFUNC 

FUNCTION Echo(thingToEcho as String) as String
    RETURN thingToEcho
ENDFUNC 

Enddefine 

InstallShield MSI package

I included the following redistributable packages in my installer:

redistributables screenshot 1

redistributables screenshot 2

I'm able to manually register the dlls from an admin PowerShell prompt w/ regsv32 so that part seems ok.


I get the following when trying to instantiate an instance of this COM object.

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)).

On my additional test server, I installed VFP 9 w/ SP2 and my error went away but doesn't seem right. I probably shouldn't have to install the IDE to deploy the DLL.


Solution

  • On my additional test server, I installed VFP 9 w/ SP2 and my error went away but doesn't seem right. I probably shouldn't have to install the IDE to deploy the DLL.

    That was not correct. I reset my VM using a checkpoint, performed a fresh install of my app & it worked.

    Packaging up a VFP COM dll as described in my question works!


    Using Simon's comment & procman I was able to kinda solve my problem.

    E_FAIL is a super generic error (but it seems the entry COM .dll is indeed registered otherwise you'd get another error). You can try to run Process Monitor on the machine, filter by .exe, and check registry and possibly file accesses if there are some missing .DLL dependencies

    I found some not successes under my exe name trying to load vfp9r.dll:

    procmon screenshot of not suscesses

    proc man filters screenshot

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


    I copied the three DLLs:

    from C:\Program Files (x86)\Common Files\Microsoft Shared\VFP to my DLL install directory, restarted IIS & it worked 🎉. This off course is a workaround as it is finding those dll's on my other server but that's another question 😊.

    restart IIS: screenshot off iis restart