Microsoft KB Archive/822335

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

Article ID: 822335

Article Last Modified on 4/18/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 8.0 Professional Edition

-



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:

&quot;OLE error code 0x80020006: Unknown name.&quot;

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 &quot;Applies to&quot; section. This problem was corrected in Microsoft Visual FoxPro 8.0 Service Pack 1.



Steps to reproduce the behavior
  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.pjx DELETE FILE errortest1.exe DELETE FILE errortest1.dll CREATE PROJECT errortest1 nowa TEXT TO lcText NOSHOW DEFINE CLASS ComServer1 AS Session OLEPUBLIC

PROCEDURE ReturnHello1 AS String RETURN &quot;Hello1&quot;

ENDDEFINE DEFINE CLASS ComServer2 AS Session OLEPUBLIC

PROCEDURE ReturnHello2 AS String RETURN &quot;Hello2&quot;

PROCEDURE ReturnHello3 AS String RETURN &quot;Hello3&quot;

ENDDEFINE

ENDTEXT

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  In Control Panel, double-click Administrative Tools, and then double-click Component Services MMC. Right-click COM+ Application, point to New, and then click Application. In the COM+ Application Install Wizard, click Next, click Create an empty application, click Server Application, and then type a name for the application. Click Next to accept all other default settings, and then click Finish. In the Component Services MMC panel, right-click the component that you just created, point to New, and then click Component.</li> In the COM+ Component Install Wizard, click Next, click Install new component(s), and then double-click ErrorTest1.Dll.</li> Click Next to accept the default settings, and then click Finish.</li>  In Visual FoxPro, run the following code in the Command window. o1 = CreateObject(&quot;ErrorTest1.ComServer1&quot;) o2 = CreateObject(&quot;ErrorTest1.ComServer2&quot;) cval=o2.ReturnHello2 && Error: &quot;OLE error code 0x80020006: Unknown name&quot; o1=Null =o2.ReturnHello2 && No error </li></ol>

Keywords: kbqfe KB822335

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.