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

Gravatar is a globally recognized avatar based on your email address. re: OLE error code 0x80020009: Exception occurred.
  Michael B
  Simon White
  Jan 25, 2021 @ 09:28am

Simon - how exactly did you find this unused prg? OI have been chasing the dreaded OLE error in my project for years. When the error occurs, we refresh a few times and it goes away - most likely because another instance of the same com object resets itself.

Gravatar is a globally recognized avatar based on your email address. re: OLE error code 0x80020009: Exception occurred.
  Simon White
  Michael B
  Jan 25, 2021 @ 09:56am

I checked the Project Manager to compare which files were included in the COM objects that worked vs the one that did not. I found an extra prg file listed in the project that did not work. I checked the project to ensure it was not used and then deleted it from the project and re-compiled the COM object. After that everything worked correctly. In my case the prg file contained my utility functions I use for most of my desktop applications.

Simon

Gravatar is a globally recognized avatar based on your email address. re: OLE error code 0x80020009: Exception occurred.
  Christof Wollenhaupt
  Simon White
  Jun 1, 2021 @ 05:27am

Another reason for 0x80020009 error messages is when the VFP9R.DLL or VFP9T.DLL version does not match the VFP9RENU.DLL version. Basically, if you have the SP1 or SP2 runtime mixed with the original release of VFP 9.

This error can even be user specific, because there are VFP9Rxxx.DLLs for different languages (VFP9RDEU.DLL ist the German version, for instance). You can specify the language version with a command line switch. If you don't (the 99.999% case), then VFP uses the current UI language to load the appropriate DLL. If a particular user selected a different language, or more nasty, if the system language differs from the current UI language, then VFP might load a different resource DLL.

A possible cause is that the computer already had several of the original language files installed, but your setup only updated the VFP9RENU.DLL file, because that is all you thought you need.

Christof

Gravatar is a globally recognized avatar based on your email address. re: OLE error code 0x80020009: Exception occurred.
  Rick Strahl
  Christof Wollenhaupt
  Jun 1, 2021 @ 10:49am

Yeah I've seen that as well. I've done customer trouble shooting sessions where we were spinning our wheels for these random COM errors - those are fun to track down. Even if you know about the issue, it's still very likely you'll miss the symptoms and it'll likely be the last thing you think of to fix 😄

That's why I always recommend doing a full runtime install - especially for server installs - and either install the runtimes locally in the app folder (for non-component apps) or in the proper global location. No custom installs or if you do making sure to drop all the necessary files for a complete runtime install including those locales that you may not use.

+++ Rick ---

© 1996-2021