FoxPro Programming
OLE error code 0x80020009: Exception occurred.
Gravatar is a globally recognized avatar based on your email address. OLE error code 0x80020009: Exception occurred.
  Simon White
  All
  Sep 18, 2020 @ 12:52pm

Hi

I have created 6 COM objects and 5 work perfectly but the 6th one gives the error 0x80020009. If I do lo=CreateObject("dCFusionCmd") from VFP's command windows the object is created and all the methods work correctly. If I try lo=CreateObject("dCFusionCmd.dCFusionCmd") then I get the error. I am running VFP9 on Windows 2019 Server. I have compared the registry entries with my other COM objects and everything appears to be correct They all have the same entries in the registry.

I have unregistered the COM object and re-registered it using C:\Windows\Syswow64\Regsvr32.exe and it always reports success. I have removed all code from the Init method but it makes no difference.

Does anyone have any other suggestions as to what might be wrong?

Thanks, Simon

Gravatar is a globally recognized avatar based on your email address. re: OLE error code 0x80020009: Exception occurred.
  Simon White
  Simon White
  Sep 18, 2020 @ 01:36pm

Hi

I am not sure I understand what the issue was but I found a small prg file included the project of the COM object that failed but was not present in the other projects. Once I removed it everything worked just fine. I am not really sure why the inclusion of an unused prg file affected the COM object but at least I have found the cause of the error.

Simon

Gravatar is a globally recognized avatar based on your email address. re: OLE error code 0x80020009: Exception occurred.
  Rick Strahl
  Simon White
  Sep 18, 2020 @ 01:54pm

If you're invoking a COM object locally that points at your current project (ie. the source files are all there) then it's better to use CREATEOBEJCTEX() instead to make sure the component loads correctly as a true COM object rather than loading from some components from memory or source.

Or better yet, make sure when you test the COM object create a new folder and test program in a separate instance of VFP.

This has bitten me many times before, so I can relate to this 😄

+++ Rick ---

© 1996-2020