You are currently offline, waiting for your internet to reconnect

FIX: You receive an "OLE error code 0x80020006: Unknown name" error message when you call a method of the second server from an instance of the first server in a COM+ package

This article has been archived. It is offered "as is" and will no longer be updated.
SYMPTOMS
A Component Object Model (COM) multithreaded DLL (MTDLL) is built by using Microsoft Visual FoxPro (VFP) version 8.0 (8.0.0.2521). The DLL contains two OLEPUBLIC server definitions. The DLL is added to a COM+ package. When you call a method of the second server from an instance of the first server, you receive the following error message:
"OLE error code 0x80020006: Unknown name."
This error might not occur on a computer that is running Microsoft Windows XP Service Pack 2 (SP2) or Windows Server 2003.
RESOLUTION
To resolve this problem, install Visual FoxPro 8.0 Service Pack 1.For more information, click the following article number to view the article in the Microsoft Knowledge Base:
829988 How to obtain the latest Visual FoxPro 8.0 service pack
WORKAROUND
To work around this problem, create separate COM servers, and use COM+ packages for each server.
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.This problem was corrected in Microsoft Visual FoxPro 8.0 Service Pack 1.
MORE INFORMATION

Steps to reproduce the behavior

  1. Start Visual FoxPro 8.0, paste the following code in a .prg file, and then run the program to create the COM server.
    CLEAR CLEAR ALL DELETE FILE errortest1.pjxDELETE FILE errortest1.exeDELETE FILE errortest1.dllCREATE PROJECT errortest1 nowaTEXT TO lcText NOSHOWDEFINE CLASS ComServer1 AS Session OLEPUBLIC	PROCEDURE ReturnHello1() AS String	RETURN "Hello1"ENDDEFINEDEFINE CLASS ComServer2 AS Session OLEPUBLIC	PROCEDURE ReturnHello2() AS String		RETURN "Hello2"	PROCEDURE ReturnHello3() AS String		RETURN "Hello3"ENDDEFINEENDTEXT DELETE FILE testxx.prg=STRTOFILE(lcText,'testxx.prg',0)_vfp.ActiveProject.files.add('testxx.prg')_vfp.ActiveProject.Build('errortest1',1)_vfp.ActiveProject.Build('errortest1',5)_vfp.ActiveProject.close
  2. In Control Panel, double-click Administrative Tools, and then double-click Component Services MMC.
  3. Right-click COM+ Application, point to New, and then click Application.
  4. In the COM+ Application Install Wizard, click Next, click Create an empty application, click Server Application, and then type a name for the application.
  5. Click Next to accept all other default settings, and then click Finish.
  6. In the Component Services MMC panel, right-click the component that you just created, point to New, and then click Component.
  7. In the COM+ Component Install Wizard, click Next, click Install new component(s), and then double-click ErrorTest1.Dll.
  8. Click Next to accept the default settings, and then click Finish.
  9. In Visual FoxPro, run the following code in the Command window.
    o1 = CreateObject("ErrorTest1.ComServer1")o2 = CreateObject("ErrorTest1.ComServer2")cval=o2.ReturnHello2() && Error: "OLE error code 0x80020006: Unknown name"o1=Null=o2.ReturnHello2() && No error 
Properties

Article ID: 822335 - Last Review: 12/08/2015 03:00:51 - Revision: 1.3

  • Microsoft Visual FoxPro 8.0 Professional Edition
  • kbnosurvey kbarchive kbqfe KB822335
Feedback